sir-lancebot icon indicating copy to clipboard operation
sir-lancebot copied to clipboard

Use buttons for bookmark command.

Open Diabolical5777 opened this issue 2 years ago • 2 comments

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:

Diabolical5777 avatar Aug 30 '22 12:08 Diabolical5777

This pull request replaces the previous PR on the same issue which I deleted, #1091

Diabolical5777 avatar Aug 30 '22 13:08 Diabolical5777

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.

ChrisLovering avatar Sep 18 '22 21:09 ChrisLovering

@Diabolical5777 What's your status on this PR?

Thanks!

Xithrius avatar Oct 12 '22 19:10 Xithrius

I'll be yoinking this.

Xithrius avatar Oct 26 '22 22:10 Xithrius

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 and interaction 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

ChrisLovering avatar Nov 02 '22 18:11 ChrisLovering

Interesting. I will fix this.

Xithrius avatar Nov 02 '22 21:11 Xithrius