Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

Commit

Permalink
fix: legacy arguments being passed to GuildLeft
Browse files Browse the repository at this point in the history
  • Loading branch information
LordOfPolls committed Nov 1, 2022
1 parent bb33ba2 commit 97281e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 4 additions & 1 deletion naff/api/events/discord.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,12 @@ class GuildUpdate(BaseEvent):


@attrs.define(eq=False, order=False, hash=False, kw_only=False)
class GuildLeft(GuildEvent):
class GuildLeft(BaseEvent):
"""Dispatched when a guild is left."""

guild: "Guild" = attrs.field(repr=True)
"""The guild this event is dispatched from"""


@attrs.define(eq=False, order=False, hash=False, kw_only=False)
class GuildAvailable(GuildEvent):
Expand Down
7 changes: 1 addition & 6 deletions naff/api/events/processors/guild_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,7 @@ async def _on_raw_guild_delete(self, event: "RawGatewayEvent") -> None:
guild = self.cache.get_guild(guild_id)
self.cache.delete_guild(guild_id)

self.dispatch(
events.GuildLeft(
guild_id,
guild or MISSING,
)
)
self.dispatch(events.GuildLeft(guild))

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

0 comments on commit 97281e7

Please sign in to comment.