-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
polls and message content intent #6869
polls and message content intent #6869
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it can be in the same callouts, but we should document that poll
isn't passed at all if you don't have message content intent (it's not empty). left comment with more~
docs/resources/Channel.md
Outdated
| call? | [message call](#DOCS_RESOURCES_CHANNEL/message-call-object) object | the call associated with the message | | ||
|
||
|
||
\* The author object follows the structure of the user object, but is only a valid user in the case where the message is generated by a user or bot user. If the message is generated by a webhook, the author object corresponds to the webhook's id, username, and avatar. You can tell if a message is generated by a webhook by checking for the `webhook_id` on the message object. | ||
|
||
\*\* An app will receive empty values in the `content`, `embeds`, `attachments`, and `components` fields if they have not configured (or been approved for) the [`MESSAGE_CONTENT` privileged intent (`1 << 15`)](#DOCS_TOPICS_GATEWAY/message-content-intent). | ||
\*\* An app will receive empty values in the `content`, `embeds`, `attachments`, `components`, and `poll` fields if they have not configured (or been approved for) the [`MESSAGE_CONTENT` privileged intent (`1 << 15`)](#DOCS_TOPICS_GATEWAY/message-content-intent). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so im all for documenting this behavior more explicitly, but when i was testing it looked like polls was a bit different—content
, embeds
, and attachments
are empty values, but poll
is actually just not sent as a field when you don't have message content intent enabled.
would love for this to be consistent at API layer at some point and have it actually just be an empty object or a partial, but for now we should probably document explicitly that it isn't passed if the app doesn't have message content intent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
personally i would like it to be present without MESSAGE_CONTENT, but with empty strings and no emoji:
With intent:
{
"id": "1",
"fields fields fields": "fields",
"poll": {
"question": {"text": "Favorite Discord Clients"},
"answers": [
{"answer_id": 1, "poll_media": {"text": "Stable"}},
{"answer_id": 2, "poll_media": {"text": "PTB"}},
{"answer_id": 3, "poll_media": {"text": "Canary"}}
],
"expiry": "2024....",
"allow_multiselect": true,
"layout_type": 1,
"results": {...} // missing without intent
}
}
Without intent:
{
"id": "1",
"fields fields fields": "",
"poll": {
"question": {"text": ""},
"answers": [
{"answer_id": 1, "poll_media": {"text": ""}},
{"answer_id": 2, "poll_media": {"text": ""}},
{"answer_id": 3, "poll_media": {"text": ""}}
],
"expiry": "2024....",
"allow_multiselect": true,
"layout_type": 1
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh well, I just intended to add the bits #6746 missed, but it seems like I opened a (small) can of worms here. Guess I'll think of a way to convey this as little verbose as possible these days / am open to suggestions in the meantime...
Co-authored-by: shay <swdewael@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sry for back and forth, last round lol ty for edits
Adds notes about polls being locked behind the message content intent where they are missing.