pycord icon indicating copy to clipboard operation
pycord copied to clipboard

Bridge command decorators not called

Open alt-potato opened this issue 1 year ago • 0 comments

Summary

before_invoke and after_invoke decorators are not called for bridge commands.

Reproduction Steps

  1. Create a bridge command.
  2. Add a before_invoke or after_invoke decorator for the command.
  3. 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.

alt-potato avatar Aug 08 '22 23:08 alt-potato