pycord
pycord copied to clipboard
Bridge command decorators not called
Summary
before_invoke and after_invoke decorators are not called for bridge commands.
Reproduction Steps
- Create a bridge command.
- Add a before_invoke or after_invoke decorator for the command.
- Call the command.
Minimal Reproducible Code
import discord
from discord.ext import bridge
intents = discord.Intents.all()
bot = bridge.Bot(command_prefix="!", intents=intents)
@bot.bridge_command()
async def test(ctx):
print("test")
@test.before_invoke
async def before(ctx):
print("before")
@test.after_invoke
async def after(ctx):
print("after")
bot.run(<token>)
Expected Results
Upon calling the command, the code should print the following to the console:
before test after
Actual Results
When called, the code prints the following:
test
Intents
discord.Intents.all()
System Information
- Python v3.10.6-final
- py-cord v2.0.0-final
- aiohttp v3.8.1
- system info: Windows 10 10.0.19044
Checklist
- [X] I have searched the open issues for duplicates.
- [X] I have shown the entire traceback, if possible.
- [X] I have removed my token from display, if visible.
Additional Context
Replacing @bot.bridge_command()
with @bot.command()
produces the expected output. I was unable to test slash commands since my bot refuses to register them. For this reason, testing the bridge command was done using messages instead of the slash command system.
Reinstalling pycord does not solve the issue.