Skip to content

$createPoll

$createPoll will create a poll on the channel.

Usage

$createPoll[channelID?;question;duration;allowMultiselect?;...answers]

Parameters

FieldTypeDescriptionRequired
channelID?numberThe channel ID where the poll will be created.false
questionstringThe poll question.true
durationstringThe duration of the poll. This must be not less than 1 hour and not longer than 7 days.false
allowMultiselect?booleanWhether users are allowed to choose more than one answer. (Default: false)false
…answersstringThe emoji and answer for each options.true

Example(s)

This will create a one-hour poll with the question “Is aoi.js great?” with two options, only one answer can be chosen:

1
client.command({
2
name: "createPoll",
3
code: `$createPoll[$channelID;Is aoi.js great?;1h;false;Yes:✅;No:❌]`
4
});

You can also remove the emojis:

1
client.command({
2
name: "createPoll",
3
code: `$createPoll[$channelID;Is aoi.js great?;1h;false;Yes;No]`
4
});