Merubokkusu / Discord-S.C.U.M

A Discord API Wrapper for Userbots/Selfbots written in Python.
MIT License
581 stars 170 forks source link

KeyError in findButton(), Button class #468

Open fwinn opened 1 year ago

fwinn commented 1 year ago

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'