A simple poll bot for Discord
If you actually want to setup this bot you'll need to do all of the following steps and install the correct dependencies.
Dependency | Website URL |
---|---|
Python 3.6+ | https://www.python.org/ |
discord.py | https://discordpy.readthedocs.io/en/latest/intro.html#prerequisites |
Google Client Library | https://developers.google.com/sheets/api/quickstart/python#step_2_install_the_google_client_library |
- Go to this website and sign in with your Discord account
- Click "New Application"
- Give it a name
- Click "Create"
- Click on the application you just made
- Go to the Bot tab on the left
- Click "Add Bot" and agree to make the bot
- Scroll down to "Privileged Gateway Intents" and turn on the "Server Members Intent"
- Scroll back up and under where you input the bots username click the "Copy" button to copy the bots Token
- Clone this repository or download it
- Add a file to the repository called "token.secret"
- Open the "token.secret" file in a text editor and paste in your bots Token
- Save changes to "token.secret"
- Go to this website and click "Enable the Google Sheets API"
- Choose a name for your project and hit next
- Choose Desktop App and hit create
- Click "Download Client Configuration" and save it to your repository
If you want to disable Autopolling then you'll have to remove the appropriate code under the commands.py file
- Copy this link and paste it somewhere temporary - notepad for example
- Go back to the Discord Developer Portal and sign in if you have to
- Go to the application you created earlier
- Click on "Copy" under Client ID
- Replace the "INSERT_CLIENT_ID_HERE" in the link with the Client ID you just copied
- Copy the link and go to it in your web browser
- Follow through with inviting the bot to whatever server you wish
- Navigate back to your PollBot repository
- Run the "bot.py" Python file
After ~5 seconds the bot should come online. Enjoy! If you find any bugs then feel free to let me know on here under "Issues". I'd love to fix them.
As a quick sidenote, whenever you run the autopoll command for a new spreadsheet, it'll prompt you to Authorise for that spreadsheet to have it's data read.