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

[Enhancement] Polls #257

Open
gaussandhisgun opened this issue Mar 23, 2024 · 0 comments
Open

[Enhancement] Polls #257

gaussandhisgun opened this issue Mar 23, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@gaussandhisgun
Copy link

Discord has added polls into their app. So far they are only available on specific servers (such as Exyl's one ) and barely work on mobile, but i am fairly certain this will be a big deal in the near future.

This is what it looks like:

изображение

and this is what it looks like on Dissent (so far):

изображение

Here's a json of a message containing a poll:

{
    "activity": null,
    "activityInstance": null,
    "application": null,
    "applicationId": null,
    "attachments": [],
    "author": {
        "...": usual author stuff goes here
    },
    "blocked": false,
    "bot": false,
    "call": null,
    "channel_id": "661411243294195740",
    "codedLinks": [],
    "components": [],
    "content": "",
    "editedTimestamp": null,
    "embeds": [],
    "flags": 0,
    "giftCodes": [],
    "id": "1221026979025911810",
    "interaction": null,
    "interactionData": null,
    "interactionError": null,
    "interactionMetadata": null,
    "isSearchHit": false,
    "loggingName": null,
    "mentionChannels": [],
    "mentioned": false,
    "mentionEveryone": false,
    "mentionRoles": [],
    "mentions": [],
    "messageReference": null,
    "nonce": null,
    "pinned": false,
    "poll": {
        "question": {
            "text": "are you cute"
        },
        "answers": [
            {
                "answer_id": 1,
                "poll_media": {
                    "text": "im cute",
                    "emoji": {
                        "id": "875378845832847380",
                        "name": "AdminChanPlead"
                    }
                }
            },
            {
                "answer_id": 2,
                "poll_media": {
                    "text": "im not cute",
                    "emoji": {
                        "id": null,
                        "name": "🤷🏻"
                    }
                }
            }
        ],
        "expiry": "2024-03-24T09:25:17.421Z",
        "allow_multiselect": false,
        "layout_type": 1,
        "results": {
            "answer_counts": [
                {
                    "id": 1,
                    "count": 2,
                    "me_voted": true
                }
            ],
            "is_finalized": false
        }
    },
    "reactions": [
        {
            "count_details": {
                "vote": 2
            },
            "me_vote": true,
            "emoji": {
                "id": "1",
                "name": "",
                "animated": false
            },
            "me": false,
            "me_burst": false,
            "count": 0,
            "burst_count": 0
        }
    ],
    "referralTrialOfferId": null,
    "state": "SENT",
    "stickerItems": [],
    "stickers": [],
    "timestamp": "2024-03-23T09:25:17.384Z",
    "tts": false,
    "type": 0,
    "webhookId": null
}

grabbed with Vencord.

It has a new "poll": {…} field that does not appear in messages that do not have a poll.

Hope this will be helpful in one way or another!

@diamondburned diamondburned added the enhancement New feature or request label Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants