Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions interactions/api/gateway/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ def _dispatch_event(self, event: str, data: dict) -> None:
"ChannelPins",
"MessageReaction",
"MessageReactionRemove",
"MessageDelete",
# Extend this for everything that should not be cached
]:
id = None
Expand Down Expand Up @@ -487,6 +488,8 @@ def __modify_guild_cache():
if id:
old_obj = _cache.pop(id)
self._dispatch.dispatch(f"on_{name}", old_obj)
elif "_delete_bulk" in name:
self._dispatch.dispatch(f"on_{name}", obj)

else:
self._dispatch.dispatch(f"on_{name}", obj)
Expand Down
16 changes: 16 additions & 0 deletions interactions/api/models/gw.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"ChannelPins",
"ThreadMembers",
"ThreadList",
"MessageDelete",
"MessageReactionRemove",
"MessageReaction",
"GuildIntegrations",
Expand Down Expand Up @@ -760,6 +761,21 @@ class Presence(ClientSerializerMixin):
client_status: ClientStatus = field(converter=ClientStatus)


@define()
class MessageDelete(DictSerializerMixin):
"""
A class object representing the gateway event ``MESSAGE_DELETE_BULK``.

:ivar List[Snowflake] ids: The message IDs of the event.
:ivar Snowflake channel_id: The channel ID of the event.
:ivar Optional[Snowflake] guild_id?: The guild ID of the event.
"""

ids: List[Snowflake] = field(converter=convert_list(Snowflake))
channel_id: Snowflake = field(converter=Snowflake)
guild_id: Optional[Snowflake] = field(converter=Snowflake, default=None)


@define()
class MessageReaction(DictSerializerMixin):
"""
Expand Down