Closed serenity091 closed 1 year ago
There's a good chance that the recent upstream pull broke something relating to this, but I cannot reproduce this (and it doesn't really seem possible looking at the code). Can you elaborate on how you are getting this error?
I get a specific exception if I try to click a button:
Version: discord.py-self 2.0.0a2 Commit: 82b5f5d
code:
message = "......"
for comp in message.components:
for child in comp.children:
if child.label == "XXX":
await child.click()
23-04-01 15:14:54 ERROR discord.ext.tasks Unhandled exception in internal background task 'test'.
Traceback (most recent call last):
File "/home/user/anaconda3/lib/python3.9/site-packages/discord/ext/tasks/__init__.py", line 239, in _loop
await self.coro(*args, **kwargs)
File "reload_module.py", line 38, in test
await child.click()
File "/home/user/anaconda3/lib/python3.9/site-packages/discord/components.py", line 228, in click
message._state,
AttributeError: '_MissingSentinel' object has no attribute '_state'
OK. Got a hotfix:
message = "......"
for comp in message.components:
for child in comp.children:
if child.label == "XXX":
child.message = message
await child.click()
Should be fixed now. This is why I didn't immediately release after the upstream merge :)
Summary
_MissingSentinel' object has no attribute '_state' is the exception when attempting to click
Reproduction Steps
` try: await asyncio.sleep(0.3)
`
Code
Expected Results
I am trying to click a button but it ends up not clicking. Previous versions of this library have done this without a problem.
Actual Results
Nothing happens.
System Information
Checklist
Additional Information
No response