-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
Description
Description
I use the position
attribute to determine whether a message is in a thread without knowledge of its parent channel type; if a value exists, it's a thread message. However, I discovered today that after editing a message, Discord will incorrectly populate the value with 0
.
This issue occurs when editing bot messages as well as webhook messages, but I encountered it using webhooks (and it is more salient for my use case since webhook message endpoints require knowledge of threadhood)
Steps to Reproduce
- Send a webhook message in a non-thread channel:
curl --request POST \
--url 'https://discord.com/api/v10/webhooks/{id}/{token}?wait=true' \
--header 'Content-Type: application/json' \
--header 'User-Agent: insomnia/11.1.0' \
--data '{"content":"test"}'
- Observe that
position
is not present in the response - Update the message:
curl --request PATCH \
--url 'https://discord.com/api/v10/webhooks/{id}/{token}/messages/{message_id}' \
--header 'Content-Type: application/json' \
--header 'User-Agent: insomnia/11.1.0' \
--data '{"content":"new content"}'
- Observe
position
in the response:
- Fetch the message again:
curl --request GET \
--url 'https://discord.com/api/v10/webhooks/{id}/{token}/messages/{message_id}' \
--header 'User-Agent: insomnia/11.1.0'
- Observe that
position
is not present in the response
Expected Behavior
position
should not be present in any message that is not in a thread
Current Behavior
position
is included for a non-thread message
Screenshots/Videos
No response
Client and System Information
Used Insomnia 11.1.0 to generate cURL samples for this issue, but I discovered this while using the discordjs/rest package