-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add user param to menu() #4913
Add user param to menu() #4913
Conversation
The way this is currently done is breaking as arguments to |
A simple fix would be adding the user argument as the last argument in the fingerprint which should make it non breaking in positional usages |
Actually that's a pretty annoying problem which I didn't think of. Yeah, passing the user as last argument wouldn't break anything, but that would then make the docs invalid
Is this worth a breaking change? Can't think of a way to follow that without breaking other installations |
Based on Jack's comments, I modified the way it's done. I'm aware of the new d.py menus function, didn't really look into it when first writing this PR. If you prefer to close this in favor of their menus, that's ok, I'm probably going to switch to their menus too anyway. Just wanted to make that PR working at least. |
2cf8a22
to
621d678
Compare
621d678
to
d13b17e
Compare
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.
I think this is a useful change that shouldn't affect anything badly with the current implementation where we only call controls differently if the argument is passed.
Since the menu()
API is ancient (aside from the recently added set usebuttons
functionality and related fixes) I added provisional notes expiring in 2 months, let's see if we run into any issues here. Thanks for making the PR!
Co-authored-by: jack1142 <[email protected]> Co-authored-by: Jakub Kuczys <[email protected]>
Type
Description of the changes
A user can be provided when using menus instead of having to rely on the hardcoded
ctx.author
for defining who should be allowed to interact. If nothing is provided, falls back to that defaultctx.author