-
Notifications
You must be signed in to change notification settings - Fork 192
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
fix(app-cmds): before and after invoke hooks not working for function inside cogs #1004
Conversation
Co-authored-by: teaishealthy <76410798+teaishealthy@users.noreply.github.com>
@teaishealthy Reverted the previous change because it broke the fix. It needs the else statement or else the hook is called again with just the interaction parameter. |
Yeah I completely forgot the return in the if statement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Untested but overall looks fine to me
@okay1204 If you fix the merge conflicts, I'll look into merging this in. |
Summary
Fixes an issue where the
before_invoke
andafter_invoke
decorators were not able to be used on functions inside Cogs because of theself
parameter not being addressed. This fix simply checks how many arguments the passed in hook has and decides if the parent cog should be passed in for the self argument or not.Checklist
task pyright
and fixed the relevant issues.