AttributeError originating from /discord/threads.py
Reproduction Steps
The only part of my script that uses this library is an on_message event that triggers for every message not sent by a webhook or the user it’s running on.
Code
if __name__ == '__main__':
webSend('Started')
class theClient(discord.Client):
async def on_message(self, msg):
try:
if msg.author == self.user: return
elif msg.webhook_id: return
# Omitted rest of code because it doesn’t pertain to this.
except:
print(traceback.format_exc())
Expected Results
Works as intended 99% of the time, triggering on messages. However, when some event happens (I haven’t dug into it too much myself, but I believe it’s from threads) the AttributeError occurs.
Actual Results
This is the complete traceback:
File "/python/lib/python3.10/site-packages/discord/threads.py", line 783, in init
self._from_data(data)
File "/python/lib/python3.10/site-packages/discord/threads.py", line 806, in _from_data
guild = self.parent.parent.guild # type: ignore
AttributeError: 'NoneType' object has no attribute 'guild'
Summary
AttributeError originating from /discord/threads.py
Reproduction Steps
The only part of my script that uses this library is an on_message event that triggers for every message not sent by a webhook or the user it’s running on.
Code
Expected Results
Works as intended 99% of the time, triggering on messages. However, when some event happens (I haven’t dug into it too much myself, but I believe it’s from threads) the AttributeError occurs.
Actual Results
This is the complete traceback:
File "/python/lib/python3.10/site-packages/discord/threads.py", line 783, in init self._from_data(data) File "/python/lib/python3.10/site-packages/discord/threads.py", line 806, in _from_data guild = self.parent.parent.guild # type: ignore AttributeError: 'NoneType' object has no attribute 'guild'
System Information
Python 3.10.6 discord.py-self v2.0.0-alpha discord.py-self pkg_resources: v2.0.0a2
Checklist
Additional Information
No response