sir-lancebot
sir-lancebot copied to clipboard
Use buttons for bookmark command.
Relevant Issues
Closes #932
Description
I used buttons for the bookmark command, both to view the bookmarked message from DM's and for other members to bookmark a message that someone else invoked the command on.
Did you:
- [x] Join the Python Discord Community?
- [x] Read all the comments in this template?
- [x] Ensure there is an issue open, or link relevant discord discussions?
- [x] Read and agree to the contributing guidelines?
This pull request replaces the previous PR on the same issue which I deleted, #1091
If you're running black to do your formatting, you may want to change your line-length configuration to 120, which this project uses.
I also highly recommend installing pre-commit hooks using poetry run task precommit
to catch linting issues before committing.
@Diabolical5777 What's your status on this PR?
Thanks!
I'll be yoinking this.
I get this error clicking "Recieve Bookmark"
2022-11-02 18:09:50 | discord.ui.view | ERROR | Ignoring exception in view <SendBookmark timeout=180.0 children=1> for item <Button style=<ButtonStyle.success: 3> url=None disabled=False label='Receive Bookmark' emoji=None row=None> Traceback (most recent call last): File "sir-lancebot-i1MlkyY3-py3.10\lib\site-packages\discord\ui\view.py", line 425, in _scheduled_task await item.callback(interaction) File "sir-lancebot\bot\exts\utilities\bookmark.py", line 56, in button_callback if interaction.user.id in self.clicked: AttributeError: 'Button' object has no attribute 'user'
Is this because the
button
andinteraction
arguments are the wrong way round? I recall it changed in discord.py at some point.
yea, that would be it. likely introduced when Xith recently merged in main
Interesting. I will fix this.