From d1c7036a13d5babfe26656fde126d755c6bb8f7c Mon Sep 17 00:00:00 2001 From: rf_tar_railt <3165388245@qq.com> Date: Thu, 13 Jun 2024 16:33:23 +0800 Subject: [PATCH] :bug: version 0.12.1 resolve #25 --- nonebot/adapters/satori/bot.py | 2 +- nonebot/adapters/satori/event.py | 52 ++++++++++++++++---------------- pyproject.toml | 2 +- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/nonebot/adapters/satori/bot.py b/nonebot/adapters/satori/bot.py index 73c8dbf..dee4d22 100644 --- a/nonebot/adapters/satori/bot.py +++ b/nonebot/adapters/satori/bot.py @@ -205,7 +205,7 @@ def _handle_response(self, response: Response, noreturn: Literal[True]) -> None: def _handle_response(self, response: Response, noreturn=False) -> Any: if 200 <= response.status_code < 300: - if not noreturn: + if noreturn: return return json.loads(response.content) if response.content else {} elif response.status_code == 400: diff --git a/nonebot/adapters/satori/event.py b/nonebot/adapters/satori/event.py index 9af14c7..be1a23b 100644 --- a/nonebot/adapters/satori/event.py +++ b/nonebot/adapters/satori/event.py @@ -99,7 +99,7 @@ def get_type(self) -> str: class FriendEvent(NoticeEvent): - user: User + user: User # type: ignore @override def get_user_id(self) -> str: @@ -116,7 +116,7 @@ class FriendRequestEvent(FriendEvent): class GuildEvent(NoticeEvent): - guild: Guild + guild: Guild # type: ignore @override def get_session_id(self) -> str: @@ -144,7 +144,7 @@ class GuildUpdatedEvent(GuildEvent): class GuildMemberEvent(GuildEvent): - user: User + user: User # type: ignore @override def get_user_id(self) -> str: @@ -169,18 +169,18 @@ class GuildMemberRemovedEvent(GuildMemberEvent): class GuildMemberRequestEvent(GuildMemberEvent): __type__ = EventType.GUILD_MEMBER_REQUEST - member: Member + member: Member # type: ignore @register_event_class class GuildMemberUpdatedEvent(GuildMemberEvent): __type__ = EventType.GUILD_MEMBER_UPDATED - member: Member + member: Member # type: ignore class GuildRoleEvent(GuildEvent): - role: Role + role: Role # type: ignore @override def get_session_id(self) -> str: @@ -203,7 +203,7 @@ class GuildRoleUpdatedEvent(GuildRoleEvent): class LoginEvent(NoticeEvent): - login: Login + login: Login # type: ignore @register_event_class @@ -222,9 +222,9 @@ class LoginUpdatedEvent(LoginEvent): class MessageEvent(Event): - channel: Channel - user: User - message: SatoriMessage + channel: Channel # type: ignore + user: User # type: ignore + message: SatoriMessage # type: ignore to_me: bool = False reply: Optional[RenderMessage] = None @@ -306,7 +306,7 @@ def get_user_id(self) -> str: class PublicMessageEvent(MessageEvent): - member: Member + member: Member # type: ignore @override def get_session_id(self) -> str: @@ -380,9 +380,9 @@ def get_event_description(self) -> str: class ReactionEvent(NoticeEvent): - channel: Channel - user: User - message: SatoriMessage + channel: Channel # type: ignore + user: User # type: ignore + message: SatoriMessage # type: ignore if TYPE_CHECKING: _message: Message @@ -445,7 +445,7 @@ def is_tome(self) -> bool: class InteractionButtonEvent(InteractionEvent): __type__ = EventType.INTERACTION_BUTTON - button: ButtonInteraction + button: ButtonInteraction # type: ignore @override def get_event_description(self) -> str: @@ -460,7 +460,7 @@ def convert(self): class PrivateInteractionButtonEvent(InteractionButtonEvent): - user: User + user: User # type: ignore @override def get_session_id(self) -> str: @@ -472,8 +472,8 @@ def get_user_id(self) -> str: class PublicInteractionButtonEvent(InteractionButtonEvent): - user: User - channel: Channel + user: User # type: ignore + channel: Channel # type: ignore @override def get_session_id(self) -> str: @@ -510,7 +510,7 @@ def convert(self): class InteractionCommandArgvEvent(InteractionCommandEvent): - argv: ArgvInteraction + argv: ArgvInteraction # type: ignore @override def get_event_description(self) -> str: @@ -534,7 +534,7 @@ def convert(self): class PrivateInteractionCommandArgvEvent(InteractionCommandArgvEvent): - user: User + user: User # type: ignore @override def get_session_id(self) -> str: @@ -546,8 +546,8 @@ def get_user_id(self) -> str: class PublicInteractionCommandArgvEvent(InteractionCommandArgvEvent): - user: User - channel: Channel + user: User # type: ignore + channel: Channel # type: ignore @override def get_session_id(self) -> str: @@ -562,7 +562,7 @@ def get_user_id(self) -> str: class InteractionCommandMessageEvent(InteractionCommandEvent): - message: SatoriMessage + message: SatoriMessage # type: ignore to_me: bool = False reply: Optional[RenderMessage] = None @@ -585,7 +585,7 @@ def convert(self): class PrivateInteractionCommandMessageEvent(InteractionCommandMessageEvent): - user: User + user: User # type: ignore @override def get_session_id(self) -> str: @@ -597,8 +597,8 @@ def get_user_id(self) -> str: class PublicInteractionCommandMessageEvent(InteractionCommandMessageEvent): - user: User - channel: Channel + user: User # type: ignore + channel: Channel # type: ignore @override def get_session_id(self) -> str: diff --git a/pyproject.toml b/pyproject.toml index dc55627..4540fa5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "nonebot-adapter-satori" -version = "0.12.0" +version = "0.12.1" description = "Satori Protocol Adapter for Nonebot2" authors = [ {name = "RF-Tar-Railt",email = "rf_tar_railt@qq.com"},