Skip to content

Commit bd28a34

Browse files
authored
fix(ext.bridge): Handle BridgeCommand while unloading cogs (#2048)
* handle BridgeCommand * Update CHANGELOG.md * Update CHANGELOG.md
1 parent ea3e3db commit bd28a34

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ These changes are available on the `master` branch, but have not yet been releas
9393
([#2029](https://github.com/Pycord-Development/pycord/pull/2029))
9494
- Reflecting the api for gettings bans correctly.
9595
([#1922](https://github.com/Pycord-Development/pycord/pull/1922))
96+
- Fixed unloading of cogs having bridge commands.
97+
([#2048](https://github.com/Pycord-Development/pycord/pull/2048))
9698

9799
## [2.4.1] - 2023-03-20
98100

discord/cog.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,10 @@ def _eject(self, bot) -> None:
586586

587587
try:
588588
for command in self.__cog_commands__:
589-
if isinstance(command, ApplicationCommand):
589+
if hasattr(command, "add_to"):
590+
bot.bridge_commands.remove(command)
591+
continue
592+
elif isinstance(command, ApplicationCommand):
590593
bot.remove_application_command(command)
591594
elif command.parent is None:
592595
bot.remove_command(command.name)

0 commit comments

Comments
 (0)