Skip to content

Commit

Permalink
Merge branch 'master' into once-decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
OmLanke committed Feb 26, 2023
2 parents edf1aba + 2e09718 commit 8f535fc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion discord/cog.py
Expand Up @@ -735,7 +735,7 @@ def _remove_module_references(self, name: str) -> None:
self.remove_application_command(cmd)

# remove all the listeners from the module
for event_list in self.extra_events.copy().values():
for event_list in self._event_handlers.copy().values():
remove = [
index
for index, event in enumerate(event_list)
Expand Down
6 changes: 3 additions & 3 deletions discord/ext/bridge/bot.py
Expand Up @@ -120,7 +120,7 @@ def decorator(func) -> BridgeCommandGroup:
async def invoke(self, ctx: ExtContext | BridgeExtContext):
if ctx.command is not None:
self.dispatch("command", ctx)
if br_cmd := isinstance(ctx.command, BridgeExtCommand):
if isinstance(ctx.command, BridgeExtCommand):
self.dispatch("bridge_command", ctx)
try:
if await self.can_run(ctx, call_once=True):
Expand All @@ -131,12 +131,12 @@ async def invoke(self, ctx: ExtContext | BridgeExtContext):
await ctx.command.dispatch_error(ctx, exc)
else:
self.dispatch("command_completion", ctx)
if br_cmd:
if isinstance(ctx.command, BridgeExtCommand):
self.dispatch("bridge_command_completion", ctx)
elif ctx.invoked_with:
exc = errors.CommandNotFound(f'Command "{ctx.invoked_with}" is not found')
self.dispatch("command_error", ctx, exc)
if br_cmd:
if isinstance(ctx.command, BridgeExtCommand):
self.dispatch("bridge_command_error", ctx, exc)

async def invoke_application_command(
Expand Down
2 changes: 1 addition & 1 deletion discord/ext/commands/bot.py
Expand Up @@ -159,7 +159,7 @@ async def on_command_error(
This only fires if you do not specify any listeners for command error.
"""
if self.extra_events.get("on_command_error", None):
if self._event_handlers.get("on_command_error", None):
return

command = context.command
Expand Down

0 comments on commit 8f535fc

Please sign in to comment.