Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

Polls Sub bot

Aaron Graubert edited this page Nov 13, 2018 · 1 revision

Polls

This sub-bot adds utilities for creating reaction-based polls. You can enable this suite by calling EnablePolls on a CoreBot or by passing EnablePolls to CoreBot.EnableAll.

Commands

  • !poll <poll title> | [Option 1 | ...] : Creates a new reaction poll

    NOTE: This command is delimited by pipe ('|'). Place a | after the poll title and between each option to indicate separation.

    Creates a new reaction poll. The bot will delete the invocation command (as they are usually ugly) and create a poll which states the title, and then an enumerated list of options. The bot then adds a reaction for each option allowing users to click to cast a vote. The bot will DM the issuer of the command the first time a user votes on a poll

    NOTE: This can only support up to 10 options

Event Subscriptions

  • This adds a subscriber to reaction_add, which takes the following arguments:

    • The event ('reaction_add')
    • The Reaction object which was added to a message
    • The User who reacted

    If the reaction's message exists in an in-memory list of created polls, and the user has not already reacted to this poll, the original creator of the poll will be notified. Note: Because the list of polls is stored in-memory, the bot cannot notify users about reactions to polls created before the bot was last restarted.

Example

(Animated gif example to be added later)

Sending !poll How do you feel about this? | I feel great | I'm not so sure | This is a terrible idea would create the following poll message:

some_user has started a poll:
How do you feel about this?
1) I feel great
2) I'm not so sure
3) This is a terrible idea

React with your vote

And add the discord reactions 1, 2, and 3. Users can then click on a reaction to cast their vote(s).

Clone this wiki locally