Closed ellisonpatterson closed 1 year ago
I was mistaken, it's actually MESSAGE_UPDATE
that is responsible to update its thread
attribute. Discord API doesn't explain this specifically in their docs. So we do not have the code to handle this yet. Also the data received from event seems too partial where it only contains thread id and channel type, where normally the $message->thread
(after fetched manually) would have the thread object and its thread member data:
https://discord.com/developers/docs/resources/channel#message-object
I wouldn't fix it right inside startThread() function because that would only fix when the bot starts the thread from code, and not when the bot starts the thread from outside code (or other users starts the thread). So it needs to be handled from the events.
EDIT: MESSAGE_UPDATE does not contain thread object when we create the thread
Environment
Describe the bug When creating a thread linked to a message, the
thread
attribute does not get updated. As @SQKo said, it should update thethread
attribute in theTHREAD_CREATE
event, but it seems to not be working. I tried withTHREAD_CREATE
enabled and disabled in the DiscordPHP instance, with$message->thread
being null in both scenarios.To Reproduce Steps to reproduce the behavior:
Expected behavior The
thread
attribute for Message should have the newly-created thread as its value.