Skip to content

Commit 2e09718

Browse files
authored
fix: AttributeErrors from event handler move (#1946)
Fix event issues from #1907
1 parent 34a23eb commit 2e09718

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

discord/cog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ def _remove_module_references(self, name: str) -> None:
735735
self.remove_application_command(cmd)
736736

737737
# remove all the listeners from the module
738-
for event_list in self.extra_events.copy().values():
738+
for event_list in self._event_handlers.copy().values():
739739
remove = [
740740
index
741741
for index, event in enumerate(event_list)

discord/ext/commands/bot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ async def on_command_error(
159159
160160
This only fires if you do not specify any listeners for command error.
161161
"""
162-
if self.extra_events.get("on_command_error", None):
162+
if self._event_handlers.get("on_command_error", None):
163163
return
164164

165165
command = context.command

0 commit comments

Comments
 (0)