dolfies / discord.py-self

A fork of the popular discord.py for user accounts.
https://discordpy-self.rtfd.io/en/latest/
MIT License
680 stars 161 forks source link

Button clicking: invalid form body, Did not receive a response from Discord, asyncio.exceptions.TimeoutError #385

Closed theAbdoSabbagh closed 1 year ago

theAbdoSabbagh commented 1 year ago

Summary

I'm getting TONS of errors while trying to click a button

Reproduction Steps

try to click a button

Code

await message.components[0].children[0].click()

Expected Results

It should click the button

Actual Results

Ignoring exception in on_message
Traceback (most recent call last):
  File "C:\Users\.\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 396, in _run_event
    await coro(*args, **kwargs)
  File ".", line 64, in f_event
    await message.components[0].children[0].click()
  File "C:\Users\.\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\components.py", line 227, in click
    await state.http.interact(type, self.to_dict(), message.channel, message, nonce=nonce)
  File "C:\Users\.\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 580, in request
    raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In data: [{'code': 'COMPONENT_VALIDATION_FAILED', 'message': 'Component validation failed'}]
Ignoring exception in on_message
Traceback (most recent call last):
  File "C:\Users\.\AppData\Local\Programs\Python\Python310\lib\asyncio\tasks.py", line 456, in wait_for
    return fut.result()
asyncio.exceptions.CancelledError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\.\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\components.py", line 228, in click
    i = await state.client.wait_for(
  File "C:\Users\.\AppData\Local\Programs\Python\Python310\lib\asyncio\tasks.py", line 458, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\.\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 396, in _run_event
    await coro(*args, **kwargs)
  File ".", line 45, in other_event
    await message.components[0].children[0].click()
  File "C:\Users\.\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\components.py", line 234, in click
    raise InvalidData('Did not receive a response from Discord') from exc
discord.errors.InvalidData: Did not receive a response from Discord

System Information

Checklist

Additional Information

No response

NoMeansNowastaken commented 1 year ago

+1 getting same error

dolfies commented 1 year ago

Duplicate of #380 (same source).