Skip to content
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

Merged
merged 9 commits into from
May 16, 2024

Conversation

valdotle
Copy link
Contributor

Adds notes about polls being locked behind the message content intent where they are missing.

Copy link
Contributor

@shaydewael shaydewael left a 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/Change_Log.md Outdated Show resolved Hide resolved
| 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).
Copy link
Contributor

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

Copy link
Contributor

@MCausc78 MCausc78 May 15, 2024

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
  }
}

Copy link
Contributor Author

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...

@shaydewael shaydewael self-assigned this May 15, 2024
Copy link
Contributor

@shaydewael shaydewael left a 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

docs/Change_Log.md Outdated Show resolved Hide resolved
docs/resources/Channel.md Outdated Show resolved Hide resolved
@shaydewael shaydewael merged commit 57673f3 into discord:main May 16, 2024
4 checks passed
@valdotle valdotle deleted the polls-message-content-intent branch May 16, 2024 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants