Pycord-Development / pycord

Pycord is a modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python
https://docs.pycord.dev
MIT License
2.75k stars 462 forks source link

Bridge command decorators not called #1555

Closed alt-potato closed 2 years ago

alt-potato commented 2 years ago

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

Checklist

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.

lauralex commented 2 years ago

I have this problem too, but just for the release version