From a01dd0abdeb8ce71032466dce799a2bb56b09420 Mon Sep 17 00:00:00 2001 From: MxEmerson <2382413024@qq.com> Date: Tue, 17 Sep 2024 21:34:20 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=88=A0=E9=99=A4=E8=BF=87?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E9=85=8D=E7=BD=AE=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?adapters=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BREAKING CHANGE: 移除了`bot.py`,现在可以直接使用`nb run`运行 --- bot.py | 36 ------------------------------------ config.yml | 10 ---------- docker-compose.yml | 9 --------- pyproject.toml | 5 ++++- 4 files changed, 4 insertions(+), 56 deletions(-) delete mode 100644 bot.py delete mode 100644 config.yml diff --git a/bot.py b/bot.py deleted file mode 100644 index fb8730b1..00000000 --- a/bot.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -import nonebot -from nonebot.adapters.onebot.v11 import Adapter as ONEBOT_V11Adapter - -# Custom your logger -# -# from nonebot.log import logger, default_format -# logger.add("error.log", -# rotation="00:00", -# diagnose=False, -# level="ERROR", -# format=default_format) - -# You can pass some keyword args config to init function -nonebot.init() -app = nonebot.get_asgi() - -driver = nonebot.get_driver() -driver.register_adapter(ONEBOT_V11Adapter) - - -# Please DO NOT modify this file unless you know what you are doing! -# As an alternative, you should use command `nb` or modify `pyproject.toml` to load plugins -nonebot.load_from_toml("pyproject.toml") - -# Modify some config / config depends on loaded configs -# -# config = driver.config -# do something... - - -if __name__ == "__main__": - nonebot.logger.warning("Always use `nb run` to start the bot instead of manually running!") - nonebot.run(app="__mp_main__:app") diff --git a/config.yml b/config.yml deleted file mode 100644 index 700417e8..00000000 --- a/config.yml +++ /dev/null @@ -1,10 +0,0 @@ -account: - uin: 机器人QQ号 - password: "机器人密码" - -message: - post-format: array - -servers: - - ws-reverse: - universal: ws://127.0.0.1:8080/onebot/v11/ws \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index fa2223da..128165b0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -40,14 +40,5 @@ services: - /opt/dockerstore/mongo/data:/data/db - /opt/dockerstore/mongo/logs:/var/log/mongodb - qsign: - container_name: qsign - image: xzhouqd/qsign:8.9.63 - environment: - - PORT=8080 - - COUNT=3 - - ANDROID_ID=114514 - restart: always - networks: pallasbot: diff --git a/pyproject.toml b/pyproject.toml index 3af63507..e878589c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,12 +17,15 @@ jieba-fast = "^0.53" pypinyin = "^0.49.0" asyncer = "^0.0.2" nonebot-plugin-apscheduler = "^0.3.0" -nonebot-plugin-gocqhttp = "^0.6.4" +setuptools = "^74.1.2" [tool.poetry.dev-dependencies] nb-cli = "^1.2.0" [tool.nonebot] +adapters = [ + { name = "OneBot V11", module_name = "nonebot.adapters.onebot.v11" } +] plugins = ["nonebot_plugin_apscheduler"] plugin_dirs = ["src/plugins"]