Skip to main content

Polls

The Polls module enables creating polls with voting buttons, automatic timers, anonymous mode, and multiple voting. Results update in real time.

Enabling the Module

  1. Dashboard → Your server → toggle Polls
  2. Click Edit to set default poll parameters
  3. Save changes

Configuration

OptionTypeDefaultDescription
colorhex#5865F2Poll embed color
default_durationstringDefault duration (e.g., "24h")
default_anonymousbooleanfalseHide voters by default
default_multiplebooleanfalseAllow multiple votes by default
create_permissionstring"everyone"Who can create polls
create_roleslist[]Creation roles (when permission = "custom")

create_permission values

  • "everyone" — everyone can create polls
  • "moderation_roles" — only roles from moderation_roles
  • "custom" — only roles from create_roles

Dashboard — Configuration

The edit panel contains:

  • Color — color picker
  • Default Duration — text field (format: 30m, 1h, 24h, 7d, 2w)
  • Default Anonymous — checkbox
  • Default Multiple — checkbox
  • Create Permission — radio: Everyone / Moderation Roles / Custom
  • Custom Roles — multi-select (visible when Custom)

Commands

/poll

Creates a new poll.

ParameterRequiredDescription
questionPoll question (max 256 characters)
option1First option
option2Second option
option3option10Additional options (max 10 total)
durationDuration (overrides default). Format: 30m, 1h, 7d, 2w
anonymousHide voters (overrides default)
multipleAllow multiple votes (overrides default)

Supported time formats:

  • m — minutes (e.g., 30m)
  • h — hours (e.g., 24h)
  • d — days (e.g., 7d)
  • w — weeks (e.g., 2w)

/polls

Displays a list of active polls on the server (max 10, ephemeral).

Voting

The poll is displayed as an embed with numbered buttons corresponding to options:

┌─────────────────────────────────────┐
│ What is your favorite color? │
│ │
│ 1. Red — 5 votes (50%) │
│ 2. Blue — 3 votes (30%) │
│ 3. Green — 2 votes (20%) │
│ │
│ ⏰ Ends in 23 hours │
├─────────────────────────────────────┤
│ [1. Red] [2. Blue] [3. Green] │
└─────────────────────────────────────┘

Single vote mode (multiple = false)

  • Clicking an option casts a vote
  • Clicking the same option again retracts the vote
  • Clicking a different option changes the vote (old one removed, new one added)

Multiple vote mode (multiple = true)

  • Clicking an option adds/removes a vote (toggle)
  • Users can vote on multiple options simultaneously

Real-time updates

After each vote, the embed is edited with new results (% and vote count).

Auto-closing

When a poll has a set duration:

  • The bot checks expired polls every 60 seconds
  • After expiration: embed title changes to "📊 POLL CLOSED — [question]"
  • Results are presented as progress bars (bar chart)
  • Buttons become inactive (disabled)
  • Color changes to gray (#6B7280)

Closed poll format

1. Red
█████░░░░░ 50% (5 votes)
2. Blue
███░░░░░░░ 30% (3 votes)
3. Green
██░░░░░░░░ 20% (2 votes)

Listened Events

EventAction
on_interactionHandles voting button clicks

Scheduled Task

  • _check_expired_polls — checks and closes expired polls every 60 seconds

Logging

Actions logged by Logs under the polls category:

  • 📊 Poll Created — question, creator, number of options, expiration time
  • 📊 Poll Closed — question, total vote count

Database

Poll data is stored in tables:

  • polls — poll metadata (question, options, expires_at, closed, anonymous, multiple)
  • poll_votes — individual votes (poll_message_id, user_id, option_index)

Tips

Best practices
  • Set default_duration to 24h — most polls don't need more
  • anonymous mode is good for controversial topics
  • Restrict create_permission to moderators if you want to avoid poll spam
  • Polls without a duration will never auto-close — keep that in mind
info

Polls use persistent custom_ids — they work even after a bot restart. Votes are stored in the database, so a restart doesn't affect results.