Skip to content

Commit 34a23eb

Browse files
OmLankepre-commit-ci[bot]BobDotCom
authored
fix: UnboundLocalError (#1928)
* fix UnboundLocalError Signed-off-by: Om <92863779+Om1609@users.noreply.github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Check if command is bridge command every time Signed-off-by: Om <92863779+Om1609@users.noreply.github.com> --------- Signed-off-by: Om <92863779+Om1609@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: BobDotCom <71356958+BobDotCom@users.noreply.github.com>
1 parent 71db6f6 commit 34a23eb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

discord/ext/bridge/bot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def decorator(func) -> BridgeCommandGroup:
120120
async def invoke(self, ctx: ExtContext | BridgeExtContext):
121121
if ctx.command is not None:
122122
self.dispatch("command", ctx)
123-
if br_cmd := isinstance(ctx.command, BridgeExtCommand):
123+
if isinstance(ctx.command, BridgeExtCommand):
124124
self.dispatch("bridge_command", ctx)
125125
try:
126126
if await self.can_run(ctx, call_once=True):
@@ -131,12 +131,12 @@ async def invoke(self, ctx: ExtContext | BridgeExtContext):
131131
await ctx.command.dispatch_error(ctx, exc)
132132
else:
133133
self.dispatch("command_completion", ctx)
134-
if br_cmd:
134+
if isinstance(ctx.command, BridgeExtCommand):
135135
self.dispatch("bridge_command_completion", ctx)
136136
elif ctx.invoked_with:
137137
exc = errors.CommandNotFound(f'Command "{ctx.invoked_with}" is not found')
138138
self.dispatch("command_error", ctx, exc)
139-
if br_cmd:
139+
if isinstance(ctx.command, BridgeExtCommand):
140140
self.dispatch("bridge_command_error", ctx, exc)
141141

142142
async def invoke_application_command(

0 commit comments

Comments
 (0)