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

KeyError in findButton(), Button class #468

Open
fwinn opened this issue Apr 17, 2023 · 0 comments
Open

KeyError in findButton(), Button class #468

fwinn opened this issue Apr 17, 2023 · 0 comments

Comments

@fwinn
Copy link

fwinn commented Apr 17, 2023

One of the checked button parameters in this method is custom_id.
The problem is that there are buttons which do not have a custom_id because they're buttons pointing to a URL. So when the method is checking a message with such a button, the following happens:

Traceback (most recent call last):
  File "/home/fwinn/.local/lib/python3.10/site-packages/discum/gateway/gateway.py", line 299, in _response_loop
    func(resp)
  File "/home/fwinn/xyz/discum_bot.py", line 47, in main
    print(btns.findButton(label="U1"))
  File "/home/fwinn/.local/lib/python3.10/site-packages/discum/utils/button.py", line 54, in findButton
    c["custom_id"],
KeyError: 'custom_id'
@fwinn fwinn changed the title Bug in findButton() in Button class KeyError in findButton(), Button class Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant