From a616330ef886666d244c244ec7232ea918f8e75f Mon Sep 17 00:00:00 2001 From: jigsaw Date: Fri, 9 Aug 2024 01:00:52 +0800 Subject: [PATCH] :construction_worker: update docker files --- docker/.env | 12 ++++++++++++ docker/bot.py | 10 ++++++---- pyproject.toml | 3 +++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/docker/.env b/docker/.env index 089e01c..081034e 100644 --- a/docker/.env +++ b/docker/.env @@ -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,默认加载全部 @@ -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 diff --git a/docker/bot.py b/docker/bot.py index f796ea2..5703da1 100644 --- a/docker/bot.py +++ b/docker/bot.py @@ -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") diff --git a/pyproject.toml b/pyproject.toml index 32de25e..4e5939b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -112,3 +112,6 @@ executionEnvironments = [ [tool.pytest.ini_options] asyncio_mode = "auto" + +[tool.nonebot] +plugins = ["nonebot_plugin_all4one"]