The Discord Poll Bot is designed to address the limitations of built-in Discord polls, which restrict the poll duration to a maximum of one week and limit the number of options to ten. This bot allows you to create polls with an indefinite duration and without a limit on the number of options, providing greater flexibility and utility for your Discord server.
- Create polls with an indefinite duration
- No limit on the number of options
- Vote casting through button interactions
- Anonymous voting
- Real-time vote counting
- Admins can delete polls using the poll ID
- Python (v3.7 or higher)
- Required Python packages listed in
requirements.txt
-
Clone the repository:
git clone https://github.com/pdiegel/Discord-Poll-Bot.git
-
Navigate to the project directory:
cd Discord-Poll-Bot
-
Install the required Python packages:
pip install -r requirements.txt
-
Create a
.env
file in the root directory of the project. -
Add your Discord bot token to the
.env
file:BOT_TOKEN=your_discord_bot_token
-
Ensure you have a
.env
file in the root directory with the following content:BOT_TOKEN=your_discord_bot_token
-
Start the bot:
python bot.py
-
Invite the bot to your Discord server.
-
Use the bot commands to create and manage polls.
This command creates a poll using a question string and an options string. The options string should be a comma-delimited set of poll options. If there are less than 2 options, the bot will raise a warning.
/createpoll "What's your favorite color?" "Red,Blue,Green"
This command deletes a poll using the Poll ID. If the poll ID is found, it will create a modal for deletion confirmation and then delete the poll.
/deletepoll 12345
Each Poll ID is shown at the end of each poll message from the bot.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature
). - Make your changes.
- Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature/your-feature
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.