From c8d80d07aa255277ebb1617146be4fc171ade90a Mon Sep 17 00:00:00 2001 From: Ljzd-PRO Date: Mon, 13 Nov 2023 03:11:46 +0800 Subject: [PATCH 1/3] =?UTF-8?q?refactor:=20=E8=B7=9F=E8=BF=9BQQ=E9=A2=91?= =?UTF-8?q?=E9=81=93=E9=80=82=E9=85=8D=E5=99=A8=E7=9A=84=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #210 Closes #211 --- pyproject.toml | 4 ++-- src/nonebot_plugin_mystool/exchange.py | 2 +- src/nonebot_plugin_mystool/help.py | 2 +- src/nonebot_plugin_mystool/login.py | 4 ++-- src/nonebot_plugin_mystool/plan.py | 4 ++-- src/nonebot_plugin_mystool/user_check.py | 6 +++--- src/nonebot_plugin_mystool/utils.py | 7 ++++--- test-nonebot-project/pyproject.toml | 2 +- 8 files changed, 16 insertions(+), 15 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b1fd662c..d0e0137b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ readme = "README.md" homepage = "https://github.com/Ljzd-PRO/nonebot-plugin-mystool" repository = "https://github.com/Ljzd-PRO/nonebot-plugin-mystool" documentation = "https://github.com/Ljzd-PRO/nonebot-plugin-mystool/wiki" -keywords = ["bot", "qq", "qqbot", "onebotv11", "onebot", "nonebot2", "nonebot", "mihoyo", "mihoyobbs", "qqguild", "star-rail", "genshin-impact"] +keywords = ["bot", "qq", "qqbot", "onebotv11", "onebot", "nonebot2", "nonebot", "mihoyo", "mihoyobbs", "qq-guild", "star-rail", "genshin-impact"] classifiers = [ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", @@ -30,7 +30,7 @@ ntplib = "^0.4.0" Pillow = ">=9.5,<11.0" requests = "^2.31.0" nonebot_adapter_onebot = "^2.2.4" -nonebot-adapter-qqguild = ">=0.2.4,<0.5.0" +nonebot-adapter-qq = "^1.0.1" tenacity = "^8.2.3" qrcode = "^7.4.2" pydantic = "^1.10.0" diff --git a/src/nonebot_plugin_mystool/exchange.py b/src/nonebot_plugin_mystool/exchange.py index 00ef4718..6c762f86 100644 --- a/src/nonebot_plugin_mystool/exchange.py +++ b/src/nonebot_plugin_mystool/exchange.py @@ -16,7 +16,7 @@ from apscheduler.events import JobExecutionEvent, EVENT_JOB_EXECUTED from nonebot import on_command, get_driver from nonebot.adapters.onebot.v11 import MessageEvent as OneBotV11MessageEvent, MessageSegment as OneBotV11MessageSegment -from nonebot.adapters.qqguild import MessageEvent as QQGuildMessageEvent, MessageSegment as QQGuildMessageSegment +from nonebot.adapters.qq import MessageEvent as QQGuildMessageEvent, MessageSegment as QQGuildMessageSegment from nonebot.internal.params import ArgStr from nonebot.matcher import Matcher from nonebot.params import ArgPlainText, T_State, CommandArg, Command diff --git a/src/nonebot_plugin_mystool/help.py b/src/nonebot_plugin_mystool/help.py index d64db3b3..5de01645 100644 --- a/src/nonebot_plugin_mystool/help.py +++ b/src/nonebot_plugin_mystool/help.py @@ -5,7 +5,7 @@ from typing import Union from nonebot import on_command -from nonebot.adapters.qqguild.exception import ActionFailed as QQGuildActionFailed +from nonebot.adapters.qq.exception import ActionFailed as QQGuildActionFailed from nonebot.internal.params import ArgStr from nonebot.matcher import Matcher from nonebot.params import CommandArg diff --git a/src/nonebot_plugin_mystool/login.py b/src/nonebot_plugin_mystool/login.py index 2528d2c8..2f474581 100644 --- a/src/nonebot_plugin_mystool/login.py +++ b/src/nonebot_plugin_mystool/login.py @@ -5,8 +5,8 @@ from typing import Union from nonebot import on_command -from nonebot.adapters.qqguild import MessageSegment as QQGuildMessageSegment, DirectMessageCreateEvent -from nonebot.adapters.qqguild.exception import AuditException +from nonebot.adapters.qq import MessageSegment as QQGuildMessageSegment, DirectMessageCreateEvent +from nonebot.adapters.qq.exception import AuditException from nonebot.exception import ActionFailed from nonebot.internal.matcher import Matcher from nonebot.internal.params import ArgStr diff --git a/src/nonebot_plugin_mystool/plan.py b/src/nonebot_plugin_mystool/plan.py index 8f1d428c..a2611848 100644 --- a/src/nonebot_plugin_mystool/plan.py +++ b/src/nonebot_plugin_mystool/plan.py @@ -8,9 +8,9 @@ from nonebot import on_command, get_adapters from nonebot.adapters.onebot.v11 import MessageSegment as OneBotV11MessageSegment, Adapter as OneBotV11Adapter, \ MessageEvent as OneBotV11MessageEvent -from nonebot.adapters.qqguild import MessageSegment as QQGuildMessageSegment, Adapter as QQGuildAdapter, \ +from nonebot.adapters.qq import MessageSegment as QQGuildMessageSegment, Adapter as QQGuildAdapter, \ MessageEvent as QQGuildMessageEvent -from nonebot.adapters.qqguild.exception import AuditException +from nonebot.adapters.qq.exception import AuditException from nonebot.exception import ActionFailed from nonebot.internal.matcher import Matcher from nonebot_plugin_apscheduler import scheduler diff --git a/src/nonebot_plugin_mystool/user_check.py b/src/nonebot_plugin_mystool/user_check.py index a619e65c..498a39c7 100644 --- a/src/nonebot_plugin_mystool/user_check.py +++ b/src/nonebot_plugin_mystool/user_check.py @@ -7,8 +7,8 @@ from nonebot import get_driver, on_request, on_command, Bot from nonebot.adapters.onebot.v11 import FriendRequestEvent, GroupRequestEvent, RequestEvent, Bot as OneBotV11Bot -from nonebot.adapters.qqguild import Bot as QQGuildBot, DirectMessageCreateEvent, MessageCreateEvent -from nonebot.adapters.qqguild.exception import ActionFailed as QQGuildActionFailed, AuditException +from nonebot.adapters.qq import Bot as QQGuildBot, DirectMessageCreateEvent, MessageCreateEvent +from nonebot.adapters.qq.exception import ActionFailed as QQGuildActionFailed, AuditException from nonebot.internal.matcher import Matcher from nonebot.params import CommandArg, Command @@ -22,7 +22,7 @@ @_driver.on_bot_connect -def check_qqguild_config(bot: QQGuildBot): +def check_qq_config(bot: QQGuildBot): """ 检查QQGuild适配器是否开启了私信功能 Intents.direct_message diff --git a/src/nonebot_plugin_mystool/utils.py b/src/nonebot_plugin_mystool/utils.py index bdea4439..92b69999 100644 --- a/src/nonebot_plugin_mystool/utils.py +++ b/src/nonebot_plugin_mystool/utils.py @@ -23,10 +23,11 @@ from nonebot.adapters import Message from nonebot.adapters.onebot.v11 import MessageEvent as OneBotV11MessageEvent, PrivateMessageEvent, GroupMessageEvent, \ Adapter as OneBotV11Adapter, Bot as OneBotV11Bot, ActionFailed as OneBotV11ActionFailed -from nonebot.adapters.qqguild import DirectMessageCreateEvent, MessageCreateEvent, \ +from nonebot.adapters.qq import DirectMessageCreateEvent, MessageCreateEvent, \ Adapter as QQGuildAdapter, Bot as QQGuildBot, MessageSegment as QQGuildMessageSegment, Message as QQGuildMessage -from nonebot.adapters.qqguild.api import DMS -from nonebot.adapters.qqguild.exception import ActionFailed as QQGuildActionFailed, AuditException + +from nonebot.adapters.qq.exception import ActionFailed as QQGuildActionFailed, AuditException +from nonebot.adapters.qq.models import DMS from nonebot.exception import ActionFailed from nonebot.internal.matcher import Matcher from nonebot.log import logger diff --git a/test-nonebot-project/pyproject.toml b/test-nonebot-project/pyproject.toml index fe4bed79..cfbb7f5f 100644 --- a/test-nonebot-project/pyproject.toml +++ b/test-nonebot-project/pyproject.toml @@ -8,7 +8,7 @@ requires-python = ">=3.8, <4.0" [tool.nonebot] adapters = [ { name = "OneBotV11", module_name = "nonebot.adapters.onebot.v11" }, - { name = "QQGuild", module_name = "nonebot.adapters.qqguild" } + { name = "QQGuild", module_name = "nonebot.adapters.qq" } ] plugins = ["nonebot_plugin_mystool"] plugin_dirs = [] From f2471c7a0818bd80087ee0a161154cf0cb8f9b9f Mon Sep 17 00:00:00 2001 From: Ljzd-PRO Date: Mon, 13 Nov 2023 03:30:12 +0800 Subject: [PATCH 2/3] =?UTF-8?q?docs:=20=E5=A2=9E=E5=8A=A0=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [skip ci] --- README.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c1476b63..6bc84ff6 100644 --- a/README.md +++ b/README.md @@ -13,16 +13,25 @@ # mysTool - 米游社辅助工具插件 ## 📣 更新内容 +### 2023.11.13 - v1.4.0 +- 跟进QQ频道适配器的变更,已更换停止维护的 `nonebot-adapter-qqguild` 适配器为 `nonebot-adapter-qq` + +> **Warning** +> 对于之前使用QQ频道适配器的机器人项目,进行本次更新的同时,还需要修改之前的QQ频道适配器配置 \ +> 大致只需要修改**配置选项名**即可,可参考适配器的说明: +> https://github.com/nonebot/adapter-qq \ +> 例如:`QQGUILD_BOTS` -> `QQ_BOTS` + +> 在QQ频道适配器**变更之前安装的**用户仍可正常使用 \ +> 但现在 nonebot 各类文档指向的适配器都是新的 `nonebot-adapter-qq`,因此现在按照文档指引,如果安装本插件之前的版本,将无法正常支持QQ频道 + + ### 2023.11.3 - v1.3.5 - 修复兑换计划商品不存在导致插件启动失败的问题 #205 #206 - 支持自定义时区 #201 > [插件偏好设置 - timezone](https://github.com/Ljzd-PRO/nonebot-plugin-mystool/wiki/Configuration-Preference#enable_timezone) > 默认为上海时区 `Asia/Shanghai` -### 2023.9.23 - v1.3.4 -- 修复人机验证 gt 和 challenge 固定不变的问题 #196 by @Sakamakiiizayoi -- 修复插件数据文件中 `geetest_json` 被改变的问题 - ### 2023.8.30 - v1.3.1 - 登录功能增加黑名单/白名单功能 #178 > [插件偏好设置 - enable_blacklist](https://github.com/Ljzd-PRO/nonebot-plugin-mystool/wiki/Configuration-Preference#enable_blacklist) From 6971e5f5b9b6a5a414ce04dfce8eea1fc8db6718 Mon Sep 17 00:00:00 2001 From: Ljzd-PRO Date: Mon, 13 Nov 2023 03:31:08 +0800 Subject: [PATCH 3/3] =?UTF-8?q?build:=20=E8=B0=83=E6=95=B4=E8=87=B3=20v1.4?= =?UTF-8?q?.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [skip ci] --- pyproject.toml | 2 +- src/nonebot_plugin_mystool/plugin_data.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d0e0137b..8f9f1074 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "nonebot-plugin-mystool" -version = "v1.3.5" +version = "v1.4.0" description = "QQ聊天、频道机器人插件 | 米游社工具-每日米游币任务、游戏签到、商品兑换、免抓包登录、原神崩铁便笺提醒" license = "MIT" authors = [ diff --git a/src/nonebot_plugin_mystool/plugin_data.py b/src/nonebot_plugin_mystool/plugin_data.py index c070498d..badd912b 100644 --- a/src/nonebot_plugin_mystool/plugin_data.py +++ b/src/nonebot_plugin_mystool/plugin_data.py @@ -15,7 +15,7 @@ from . import user_data from .user_data import UserData, UserAccount -VERSION = "v1.3.4" +VERSION = "v1.4.0" """程序当前版本""" ROOT_PATH = Path(__name__).parent.absolute()