Danyc0 / Society-voting-bot

A Discord bot for doing society elections
Apache License 2.0
2 stars 4 forks source link
hacktoberfest

Society voting-bot

A Discord bot for doing society elections. The voting system used is Instant Runoff Voting.

Dependencies

pip install -U Discord.py python-dotenv pyrankvote aiorwlock

Setup

You'll need to create a discord bot of your own in the Discord Developer Portal with View Channels and Read Messages permissions. It's also handy if you have an empty server (or "guild") for you to test in. This section of this guide may be helpful to set that up.

You'll need to set seven environment variables:

You can put these in a .env file in the repo directory as it uses dotenv (see here for usage) so you don't have to keep them in your environment.

You will also need a token.json file to authorise access to the Google Sheets API and a Google account with access to the candidates spreadsheet. This guide will generate the correct token, as long as you set it up to use the "auth/spreadsheets" scope, in both the OAuth Credentials step, and the example code.

Bot requires send message and edit message permissions for full functionality

Contributions

In short, patches welcome. If you raise a PR, I'll review it, test it, and (probably) merge it. If you find any bugs/problems or have any suggestions, please raise an issue.