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

Creating poll/Submit answer #1150

Open
002-sans opened this issue Apr 20, 2024 · 2 comments
Open

Creating poll/Submit answer #1150

002-sans opened this issue Apr 20, 2024 · 2 comments
Labels
Feature Request a new feature

Comments

@002-sans
Copy link

002-sans commented Apr 20, 2024

Which package is the feature request for?

The core library

Feature

I would like that they can create a survey directly through the module and not through the api (I didn't test from the api)

Ideal solution or implementation

https://discord.com/api/v9/channels/ChannelId/polls/MessageId/answers/@me - PUT
https://discord.com/api/v9/channels/ChannelId/messages - POST

Creating a poll

{
    "mobile_network_type": "unknown",
    "content": "",
    "nonce": "1231317440764313600",
    "tts": false,
    "flags": 0,
    "poll": {
        "question": {
            "text": "my question"
        },
        "answers": [
            {
                "poll_media": {
                    "text": "my first answer"
                }
            },
            {
                "poll_media": {
                    "text": "my second answer"
                }
            }
        ],
        "allow_multiselect": false,
        "duration": 24,
        "layout_type": 1
    }
}

Alternative solutions or implementations

maybe create a function like <Channel>.createPoll(question: String, answers: Array[]: String, time: Number, multiSelect: Boolean)

question: Required
answers: Required
time: Optional (1000 * 60 * 60 * 24 by default)
multiSelect: Optional (false/true by default)

Send a Poll Answer

{
    "answer_ids": [
        "1" // answer_id
    ]
}

This can be like <Message>.sendAnswer(answerId: String/Array idk)
deleting the answer is []

@002-sans 002-sans added the Feature Request a new feature label Apr 20, 2024
@TheDevYellowy
Copy link
Contributor

#1147 yeah I tried implementing this already but got this error

@002-sans
Copy link
Author

yea i have the same error

@002-sans 002-sans changed the title Creating poll Creating poll/Submit answer Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request a new feature
Projects
None yet
Development

No branches or pull requests

2 participants