Skip to content

Commit

Permalink
refactor: 跟进QQ频道适配器的变更
Browse files Browse the repository at this point in the history
Closes #210
Closes #211
  • Loading branch information
Ljzd-PRO committed Nov 12, 2023
1 parent 61d148a commit c8d80d0
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 15 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/nonebot_plugin_mystool/exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/nonebot_plugin_mystool/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/nonebot_plugin_mystool/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/nonebot_plugin_mystool/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/nonebot_plugin_mystool/user_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -22,7 +22,7 @@


@_driver.on_bot_connect
def check_qqguild_config(bot: QQGuildBot):
def check_qq_config(bot: QQGuildBot):
"""
检查QQGuild适配器是否开启了私信功能 Intents.direct_message
Expand Down
7 changes: 4 additions & 3 deletions src/nonebot_plugin_mystool/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test-nonebot-project/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down

0 comments on commit c8d80d0

Please sign in to comment.