Skip to content

A tool to aid Overwatch content creator mL7 determine what are the top upvoted user-submitted challenges in his community Discord server for his Spinning Wheel Challenge.

License

Notifications You must be signed in to change notification settings

HeelMePlz/spinning-wheel-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spinning-wheel-challenge

A tool to aid Overwatch content creator mL7 determine what are the top upvoted user-submitted challenges in his community Discord server for his Spinning Wheel Challenge.

Invite Link

To invite the bot your server, click here.

Maintenance

Use the following command to upgrade packages in requirements.txt:

pip install -U -r requirements.txt

Installation

These instructions are mostly for myself, so I can remember how to re-install the project.

Development Environment

After cloning the repo, create a virtual environment and activate it:

python3 -m venv .venv
source .venv/bin/activate

Now you can install the packages using the requirements file:

pip install -r requirements.txt

The following command creates a .env file containing our environment variables:

echo -e "DISCORD_TOKEN=\nCHANNEL_ID=\nUSER_ID=\n" >> .env

Create the bot account and invite it to your Server

Head to https://discord.com/developers/applications and Create a New Application.

After creating your application, head to the Bot tab and create a new bot.

Then add the bot to a server using the OAuth2 tab, scroll down to scopes, check bot and visit the generated URL.

Environment Variables

To obtain the CHANNEL_ID and USER_ID, enable Developer Mode on Discord. User Settings > Advanced > Developer Mode.

  • DISCORD_TOKEN can be found in the Bot tab. Copy it and append to our .env file.
  • CHANNEL_ID can be obtained by right-clicking the channel and selecting "Copy ID"
  • USER_ID can be obtained by right-clicking the user and selecting "Copy ID"

Run the script

To run the script for the bot, simply run

python3 bot.py

Running the bot as a process

I use PM2 to run the bot as a process in the background.

To install PM2:

npm install -g pm2

In the project directory, start the bot:

pm2 start bot.py --interpreter=/usr/bin/python3

Useful commands

pm2 list                list all pm2 processes
pm2 stop bot.py         stop the bot
pm2 restart bot.py      restart the bot

Troubleshooting

ModuleNotFoundError

When starting the bot for the first time, if you get the following error:

ModuleNotFoundError: No module named 'discord'

Run the command:

pm2 start bot.py --interpreter python3 --interpreter-args -u

This will flush everything [Stackoverflow].

About

A tool to aid Overwatch content creator mL7 determine what are the top upvoted user-submitted challenges in his community Discord server for his Spinning Wheel Challenge.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages