Skip to content

HeelMePlz/high-heels-discord-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

High Heels Discord Bot

A Discord bot I'm making to help me practice coding! :)

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=" >> .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

  • DISCORD_TOKEN can be found in the Bot tab. Copy it and append to our .env file.

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 Discord bot to be used for my personal Discord Server.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages