discord.js-selfbot-v13 icon indicating copy to clipboard operation
discord.js-selfbot-v13 copied to clipboard

Creating poll/Submit answer

Open xvqm opened this issue 10 months ago • 2 comments

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 []

xvqm avatar Apr 20 '24 19:04 xvqm

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

TheDevYellowy avatar Apr 20 '24 23:04 TheDevYellowy

yea i have the same error

xvqm avatar Apr 21 '24 12:04 xvqm

v3.2.0 🎉

aiko-chan-ai avatar Jul 03 '24 16:07 aiko-chan-ai