Skip to content

Commit 168311f

Browse files
authored
feat: Provide Guild ID in GuildLeft event (#1435)
1 parent 635dee7 commit 168311f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

interactions/api/events/discord.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def on_guild_join(event):
2929
from interactions.api.events.base import GuildEvent, BaseEvent
3030
from interactions.client.const import Absent
3131
from interactions.client.utils.attr_utils import docs
32+
from interactions.models.discord.snowflake import to_snowflake
3233

3334
__all__ = (
3435
"ApplicationCommandPermissionsUpdate",
@@ -292,6 +293,9 @@ class GuildUpdate(BaseEvent):
292293
class GuildLeft(BaseEvent):
293294
"""Dispatched when a guild is left."""
294295

296+
guild_id: "Snowflake_Type" = attrs.field(repr=True, converter=to_snowflake)
297+
"""The ID of the guild"""
298+
295299
guild: "Guild" = attrs.field(repr=True)
296300
"""The guild this event is dispatched from"""
297301

interactions/api/events/processors/guild_events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ async def _on_raw_guild_delete(self, event: "RawGatewayEvent") -> None:
6969
guild = self.cache.get_guild(guild_id)
7070
self.cache.delete_guild(guild_id)
7171

72-
self.dispatch(events.GuildLeft(guild))
72+
self.dispatch(events.GuildLeft(guild_id, guild))
7373

7474
@Processor.define()
7575
async def _on_raw_guild_ban_add(self, event: "RawGatewayEvent") -> None:

0 commit comments

Comments
 (0)