Skip to content

Commit

Permalink
👷 update docker files
Browse files Browse the repository at this point in the history
  • Loading branch information
j1g5awi committed Aug 8, 2024
1 parent 6236976 commit a616330
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
12 changes: 12 additions & 0 deletions docker/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
DRIVER=~fastapi+~httpx+~websockets

# ORM
ALEMBIC_STARTUP_CHECK

# All4One 的配置
OBIMPL_CONNECTIONS=[{"type":"websocket_rev","url":"ws://127.0.0.1:8080/onebot/v12/"}]
# 自定义加载的 Middleware,默认加载全部
Expand All @@ -20,6 +23,15 @@ TELEGRAM_BOTS=[]
TELEGRAM_PROXY
TELEGRAM_WEBHOOK_URL

# Discord
# https://github.com/nonebot/adapter-discord
DISCORD_BOTS=[]
DISCORD_COMPRESS=false
DISCORD_API_VERSION=10
DISCORD_API_TIMEOUT=30.0
DISCORD_HANDLE_SELF_MESSAGE=false
DISCORD_PROXY

# Sentry
SENTRY_ENVIRONMENT=prod
SENTRY_DSN
10 changes: 6 additions & 4 deletions docker/bot.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import nonebot
from nonebot.adapters.telegram import Adapter as TELEGRAMAdapter
from nonebot.adapters.onebot.v11 import Adapter as ONEBOT_V11Adapter
from nonebot.adapters.discord import Adapter as DiscordAdapter
from nonebot.adapters.telegram import Adapter as TelegramAdapter
from nonebot.adapters.onebot.v11 import Adapter as OneBotV11Adapter

nonebot.init()

driver = nonebot.get_driver()
driver.register_adapter(TELEGRAMAdapter)
driver.register_adapter(ONEBOT_V11Adapter)
driver.register_adapter(TelegramAdapter)
driver.register_adapter(OneBotV11Adapter)
driver.register_adapter(DiscordAdapter)

nonebot.load_plugin("nonebot_plugin_sentry")
nonebot.load_plugin("nonebot_plugin_all4one")
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,6 @@ executionEnvironments = [

[tool.pytest.ini_options]
asyncio_mode = "auto"

[tool.nonebot]
plugins = ["nonebot_plugin_all4one"]

0 comments on commit a616330

Please sign in to comment.