Skip to content

Commit

Permalink
🐛 version 0.12.1
Browse files Browse the repository at this point in the history
resolve #25
  • Loading branch information
RF-Tar-Railt committed Jun 13, 2024
1 parent 7a7ab98 commit d1c7036
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion nonebot/adapters/satori/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
52 changes: 26 additions & 26 deletions nonebot/adapters/satori/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -116,7 +116,7 @@ class FriendRequestEvent(FriendEvent):


class GuildEvent(NoticeEvent):
guild: Guild
guild: Guild # type: ignore

@override
def get_session_id(self) -> str:
Expand Down Expand Up @@ -144,7 +144,7 @@ class GuildUpdatedEvent(GuildEvent):


class GuildMemberEvent(GuildEvent):
user: User
user: User # type: ignore

@override
def get_user_id(self) -> str:
Expand All @@ -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:
Expand All @@ -203,7 +203,7 @@ class GuildRoleUpdatedEvent(GuildRoleEvent):


class LoginEvent(NoticeEvent):
login: Login
login: Login # type: ignore


@register_event_class
Expand All @@ -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

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -460,7 +460,7 @@ def convert(self):


class PrivateInteractionButtonEvent(InteractionButtonEvent):
user: User
user: User # type: ignore

@override
def get_session_id(self) -> str:
Expand All @@ -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:
Expand Down Expand Up @@ -510,7 +510,7 @@ def convert(self):


class InteractionCommandArgvEvent(InteractionCommandEvent):
argv: ArgvInteraction
argv: ArgvInteraction # type: ignore

@override
def get_event_description(self) -> str:
Expand All @@ -534,7 +534,7 @@ def convert(self):


class PrivateInteractionCommandArgvEvent(InteractionCommandArgvEvent):
user: User
user: User # type: ignore

@override
def get_session_id(self) -> str:
Expand All @@ -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:
Expand All @@ -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

Expand All @@ -585,7 +585,7 @@ def convert(self):


class PrivateInteractionCommandMessageEvent(InteractionCommandMessageEvent):
user: User
user: User # type: ignore

@override
def get_session_id(self) -> str:
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]"},
Expand Down

0 comments on commit d1c7036

Please sign in to comment.