/create

Endpoint Headers:

  • bot-token - Token of the Bot [String] (Required)

  • apikey - Your Api Auth Key [String] (Required)

  • guild-id - ID of the guild to be fetched [Snowflake] (Required)

  • channel-id - ID of the channel to send the poll in [Snowflake] (Required)

Endpoint Body Parameters

  • question - The question to ask [String] (Required)

  • answers - Array of answer objects to choose from [Array] (Required) (See below)

  • duration - How long, in hours, the poll runs for, default 24 [Integer] (Optional)

  • multiselect - Allow users to select multiple answers, default false [Boolean] (Optional)

  • content - Message content outside the poll to send [String] (Optional)

Answer Objects

The answers array will consist of an object for each choice

  • text - The actual content of the answer choice [String] (Required)

  • emoji - An emoji object to display on the answer choice [Object] (Optional)

Emoji Objects

Within the answer objects, is also an emoji object

  • name - Name of emoji, only use for default discord emojis [Unicode Emoji] (Optional)*

  • id - Id of emoji, only use for custom emojis [Snowflake] (Optional)*

Examples:

Data API version required. Must replace <version> with either release or beta.

Bot Designer for Discord

Example usage of /poll/create endpoint using BDFD

Discord.js

Example usage of /poll/create endpoint using Discord.js

Possible Responses (Codes)

Code 200

API succeeded and details were fetched.

Code 400

An error occurred that stopped execution.

Code 401

Invalid bot token was provided.

Last updated