diff --git a/.env.dev b/.env.dev index 127b48910..44f19fe28 100644 --- a/.env.dev +++ b/.env.dev @@ -1,5 +1,3 @@ - - SUPERUSERS=[""] COMMAND_START=[""] @@ -13,6 +11,16 @@ SESSION_EXPIRE_TIMEOUT=30 # 全局图片统一使用bytes发送,当真寻与协议端不在同一服务器上时为True IMAGE_TO_BYTES = False +# 回复消息时自称 +SELF_NICKNAME="小真寻" + +# 数据库配置 +# 示例: "postgres://user:password@127.0.0.1:5432/database" +DB_URL = "" + +# 系统代理 +# SYSTEM_PROXY = "http://127.0.0.1:7890" + PLATFORM_SUPERUSERS = ' { "qq": [""], @@ -22,6 +30,12 @@ PLATFORM_SUPERUSERS = ' DRIVER=~fastapi+~httpx+~websockets + +# LOG_LEVEL=DEBUG +# 服务器和端口 +HOST = 127.0.0.1 +PORT = 8080 + # kook adapter toekn # kaiheila_bots =[{"token": ""}] @@ -51,11 +65,4 @@ DRIVER=~fastapi+~httpx+~websockets # ' # application_commands的{"*": ["*"]}代表将全部应用命令注册为全局应用命令 -# {"admin": ["123", "456"]}则代表将admin命令注册为id是123、456服务器的局部命令,其余命令不注册 - -# LOG_LEVEL=DEBUG -# 服务器和端口 -HOST = 127.0.0.1 -PORT = 8080 - - \ No newline at end of file +# {"admin": ["123", "456"]}则代表将admin命令注册为id是123、456服务器的局部命令,其余命令不注册 \ No newline at end of file diff --git a/.github/workflows/bot_check.yml b/.github/workflows/bot_check.yml new file mode 100644 index 000000000..eba97e85a --- /dev/null +++ b/.github/workflows/bot_check.yml @@ -0,0 +1,43 @@ +name: 检查bot是否运行正常 + +on: + push: + branches: [ "dev", "main"] + pull_request: + branches: [ "dev", "main"] + +jobs: + bot-check: + runs-on: ubuntu-latest + name: bot check + steps: + - uses: actions/checkout@v4 + + - name: Setup Python + id: setup_python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Install Poetry + run: pip install poetry + + # Poetry cache depends on OS, Python version and Poetry version. + - name: Cache Poetry cache + uses: actions/cache@v3 + with: + path: ~/.cache/pypoetry + key: poetry-cache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }} + + - name: Install dependencies + run: | + mv scripts/bot_check.py bot_check.py + rm -rf poetry.lock + poetry source remove ali + poetry install --no-root + poetry run pip install pydantic==1.10 + + - name: Check bot run + id: bot_check_run + run: | + poetry run python3 bot_check.py \ No newline at end of file diff --git a/bot.py b/bot.py index b3009b5c7..915b77786 100644 --- a/bot.py +++ b/bot.py @@ -5,9 +5,10 @@ from nonebot.adapters.kaiheila import Adapter as KaiheilaAdapter from nonebot.adapters.onebot.v11 import Adapter as OneBotV11Adapter +nonebot.init() + from zhenxun.services.db_context import disconnect, init -nonebot.init() driver = nonebot.get_driver() driver.register_adapter(OneBotV11Adapter) driver.register_adapter(KaiheilaAdapter) @@ -18,7 +19,7 @@ driver.on_startup(init) driver.on_shutdown(disconnect) -nonebot.load_builtin_plugins("echo") # 内置插件 +# nonebot.load_builtin_plugins("echo") nonebot.load_plugins("zhenxun/builtin_plugins") nonebot.load_plugins("zhenxun/plugins") diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..f2bca1fe1 Binary files /dev/null and b/requirements.txt differ diff --git a/resources/font/HWXingKai.ttf b/resources/font/HWXingKai.ttf deleted file mode 100644 index 353ba6a9a..000000000 Binary files a/resources/font/HWXingKai.ttf and /dev/null differ diff --git a/resources/font/HWZhongSong.ttf b/resources/font/HWZhongSong.ttf deleted file mode 100644 index 0f167cbde..000000000 Binary files a/resources/font/HWZhongSong.ttf and /dev/null differ diff --git a/resources/font/sarasa-mono-sc-nerd-regular.ttf b/resources/font/sarasa-mono-sc-nerd-regular.ttf deleted file mode 100644 index 636c2f445..000000000 Binary files a/resources/font/sarasa-mono-sc-nerd-regular.ttf and /dev/null differ diff --git a/resources/font/wq.ttf b/resources/font/wq.ttf deleted file mode 100644 index f15cfefc1..000000000 Binary files a/resources/font/wq.ttf and /dev/null differ diff --git a/resources/font/yz.ttf b/resources/font/yz.ttf deleted file mode 100644 index d150b5378..000000000 Binary files a/resources/font/yz.ttf and /dev/null differ diff --git a/resources/font/yzz.ttc b/resources/font/yzz.ttc deleted file mode 100644 index d150b5378..000000000 Binary files a/resources/font/yzz.ttc and /dev/null differ diff --git a/resources/image/wordcloud/default.png b/resources/image/wordcloud/default.png index 7912ce8b0..49ba4f55c 100644 Binary files a/resources/image/wordcloud/default.png and b/resources/image/wordcloud/default.png differ diff --git a/resources/template/bar_chart/main.css b/resources/template/bar_chart/main.css new file mode 100644 index 000000000..8c1cc0396 --- /dev/null +++ b/resources/template/bar_chart/main.css @@ -0,0 +1,7 @@ + +body { + position: absolute; + left: -8px; + top: -8px; +} + diff --git a/resources/template/bar_chart/main.html b/resources/template/bar_chart/main.html new file mode 100644 index 000000000..8728b14b7 --- /dev/null +++ b/resources/template/bar_chart/main.html @@ -0,0 +1,50 @@ + + +
+ +