Discord bot for running star elections
- Enable Developer Mode for your User: User Gear -> App Settings -> Advanced -> Developer Mode
- Add bot to server where you have admin access
- Reference bettervoting.py for commands (example:
.list_star_candidates "Yoda" "Han Solo"
)
- Clone the repository:
git clone git@github.com:Equal-Vote/discord-bot.git cd discord-bot
- Install Dependencies:
Ensure you have Python 3.10+ and pip installed. Then run:
pip install -r requirements.txt
- Create a Discord Application and Bot User:
- Go to the Discord Developer Portal.
- Create a new application and add a Bot user.
- Copy the Bot Token from the Developer Portal.
- Enable Priviledged Intents
- Under your appication -> Bot -> Priviledged Gateway intents, enable all 3 intents
- Set environment variables:
Create a
.env
file in the project directory, and:Of course, use the token you copied in the previous step in place ofDISCORD_TOKEN=your-token-here
your-token-here
. - Run the bot:
If successful, you should see
python bettervoting.py
YourBotName#XXXX has connected to Discord!
- Invite the bot to your server:
- In the Discord Developer Portal's OAuth2 tab, select the
bot
andapplications.commands
scopes. - Copy the generated invite link and open it in a browser.
- Authorize the bot to join your server.
- In the Discord Developer Portal's OAuth2 tab, select the