Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SlashCommandGroup.before_invoke #1935

Closed
3 tasks done
krigjo25 opened this issue Feb 22, 2023 · 0 comments · Fixed by #2091
Closed
3 tasks done

SlashCommandGroup.before_invoke #1935

krigjo25 opened this issue Feb 22, 2023 · 0 comments · Fixed by #2091
Labels
bug Something isn't working priority: medium Medium Priority

Comments

@krigjo25
Copy link

krigjo25 commented Feb 22, 2023

Summary

before_invoke is not called in Slash Command Group

Reproduction Steps

Same steps as if i were using Bot.goup()

  • Creating a group
  • Creating a command
  • Instruct the program what to do before the command should be invoked

Minimal Reproducible Code

channel = d.SlashCommandGroup(name = "channel", description = "Create something", default_member_permissions = d.Permissions(manage_channels = True))

    @channel.command()
    async def test(self, ctx:d.ApplicationContext, text = None):
        print(ctx.guild.categories)
        return

    @channel.before_invoke
    async def check_channels(self, ctx:d.ApplicationContext):

        print("test, before_invoke")
        
        return

Expected Results

Expected it to print out "before_invoke " in the terminal, before the command invoked.

Actual Results

Function not even called

Intents

bans, guilds, emojis, typing, members, messages, prresence, message_content

System Information

  • Python v3.10.10-final
  • py-cord v2.4.None-final
  • aiohttp v3.8.4
  • system info: Windows 10 10.0.19045

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

For further details on what has been already tested visit discord channel search for before & after invoke by krigjo25

The code above is tested, and is just a demo, to show @before_invoke doesnt work. The actual code can be found in the authors responsories. if more code information is required, the bot code source can be found at the authors responsories called Discord /pymod

  • @after_invoke works as expected

Case has been discussed in the discord channel, recently closed since the helper also might think its a library issue.

Thanks for reading this issues, and for the assistance.

sincerely
@krigjo25

@krigjo25 krigjo25 added the unconfirmed bug A bug report that needs triaging label Feb 22, 2023
@JustaSqu1d JustaSqu1d added bug Something isn't working priority: medium Medium Priority and removed unconfirmed bug A bug report that needs triaging labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: medium Medium Priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants