Skip to content

Commit 9db16eb

Browse files
MiddledotBobDotCom
andauthored
fix(ext.bridge): fix new issue with bridge_commands attribute (#1815)
* feat(ext.bridge): fix bridge_commands attribute * bump changelog * add back "no changes" line * Fix version link Co-authored-by: BobDotCom <[email protected]>
1 parent 49387eb commit 9db16eb

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ These changes are available on the `master` branch, but have not yet been releas
1212

1313
_No changes yet_
1414

15+
## [2.3.2] - 2022-12-03
16+
17+
### Fixed
18+
19+
- Fixed another `AttributeError` relating to the new `bridge_commands` attribute on
20+
`ext.bridge.Bot`. ([#1815](https://github.com/Pycord-Development/pycord/pull/1815))
21+
1522
## [2.3.1] - 2022-11-27
1623

1724
### Fixed
@@ -454,7 +461,8 @@ _No changes yet_
454461
- Fix py3.10 UnionType checks issue.
455462
([#1240](https://github.com/Pycord-Development/pycord/pull/1240))
456463

457-
[unreleased]: https://github.com/Pycord-Development/pycord/compare/v2.3.1...HEAD
464+
[unreleased]: https://github.com/Pycord-Development/pycord/compare/v2.3.2...HEAD
465+
[2.3.2]: https://github.com/Pycord-Development/pycord/compare/v2.3.1...v2.3.2
458466
[2.3.1]: https://github.com/Pycord-Development/pycord/compare/v2.3.0...v2.3.1
459467
[2.3.0]: https://github.com/Pycord-Development/pycord/compare/v2.2.2...v2.3.0
460468
[2.2.2]: https://github.com/Pycord-Development/pycord/compare/v2.2.1...v2.2.2

discord/cog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ def _inject(self: CogT, bot) -> CogT:
542542

543543
for index, command in enumerate(self.__cog_commands__):
544544
if hasattr(command, "add_to"):
545-
bot._bridge_commands.append(command)
545+
bot.bridge_commands.append(command)
546546
continue
547547

548548
command._set_cog(self)

discord/ext/bridge/bot.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ def bridge_commands(self) -> list[BridgeCommand | BridgeCommandGroup]:
4949

5050
return cmds
5151

52-
@bridge_commands.setter
53-
def bridge_commands(self, cmds):
54-
self._bridge_commands = cmds
55-
5652
async def get_application_context(
5753
self, interaction: Interaction, cls=None
5854
) -> BridgeApplicationContext:
@@ -74,10 +70,7 @@ def add_bridge_command(self, command: BridgeCommand):
7470
# Ignore the type hinting error here. All subclasses of BotBase pass the type checks.
7571
command.add_to(self) # type: ignore
7672

77-
if getattr(self, "_bridge_commands", None) is None:
78-
self._bridge_commands = []
79-
80-
self._bridge_commands.append(command)
73+
self.bridge_commands.append(command)
8174

8275
def bridge_command(self, **kwargs):
8376
"""A shortcut decorator that invokes :func:`bridge_command` and adds it to

0 commit comments

Comments
 (0)