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
- Dashboard → Your server → toggle Polls
- Click Edit to set default poll parameters
- Save changes
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
color | hex | #5865F2 | Poll embed color |
default_duration | string | — | Default duration (e.g., "24h") |
default_anonymous | boolean | false | Hide voters by default |
default_multiple | boolean | false | Allow multiple votes by default |
create_permission | string | "everyone" | Who can create polls |
create_roles | list | [] | Creation roles (when permission = "custom") |
create_permission values
"everyone"— everyone can create polls"moderation_roles"— only roles frommoderation_roles"custom"— only roles fromcreate_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.
| Parameter | Required | Description |
|---|---|---|
question | ✅ | Poll question (max 256 characters) |
option1 | ✅ | First option |
option2 | ✅ | Second option |
option3–option10 | ❌ | Additional options (max 10 total) |
duration | ❌ | Duration (overrides default). Format: 30m, 1h, 7d, 2w |
anonymous | ❌ | Hide voters (overrides default) |
multiple | ❌ | Allow 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
| Event | Action |
|---|---|
on_interaction | Handles 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_durationto24h— most polls don't need more anonymousmode is good for controversial topics- Restrict
create_permissionto 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.