- Brian Demyan
- Deni Velasquez
- Kaleb Missmer
This Discord bot is a simple example bot that can be used to interact with users in a Discord server. It can respond to various commands and events, such as greeting users when they send a specific message.
- Greeting users with a response when they send
!hello
in a text channel. - Providing inspiring quotes to users who send
!motivate
command.
- Python 3.6 or higher
- Discord.py library
- Redis database
- Clone or download this repository to your local machine.
- Create a Discord bot and obtain its token. You can follow the official Discord documentation on how to create a bot and obtain its token.
- Create a
.env
file in the project directory and add the following line to it:BOT_TOKEN=YOUR_DISCORD_BOT_TOKEN
-
Make the run_bot.sh script executable by running:
chmod +x run_bot.sh
-
Run the bot by executing the
run_bot.sh
script:./run_bot.sh
-
The bot will log in and be ready to respond to commands and events in the Discord server.
-
Install git
sudo yum install git
-
Clone the repository
-
Go into to your discord-bot folder
-
Create the virtual environment
python3 -m venv .venv source .venv/bin/activate
-
Install requirements
pip install -r requirements.txt
-
Install redis6 for AWS 2023
sudo yum install redis6
-
Open a new terminal and run Redis6 server
redis6-server
-
Make a third terminal and confirm the server is connected
redis6-cli
-
Create a Discord bot and obtain its token. You can follow the official Discord documentation on how to create a bot and obtain its token.
-
Create a
.env
file in the project directory and add the following line to it:BOT_TOKEN=YOUR_DISCORD_BOT_TOKEN
-
Run the application
python3 app.py
- Install Docker
sudo yum install -y docker
- Launch Docker
sudo systemctl enable docker sudo systemctl starat docker
- Interact as ec-2 user
sudo usermod -a -G docker ec2-user
- Change host in db.py
edit:
to:
def __init__(self, host='localhost', port=6379, db=0):
def __init__(self, host='redisdb', port=6379, db=0):
- Build the Docker image for the program
cd discord-bot/ docker build -t discord-bot .
- Create a Docker network for your redis database to run over
docker network create -d bridge botdb
- Run dock_aws.sh to run redis and the bot through Docker
bash dock_aws.sh
!hello
: Greet the user who sends the command with a response.!motivate
: Gives the user who sends the command an inspiring quote.
- Install Certifi
pip install certifi
- Run the script
/Applications/Python\ 3.12/Install\ Certificates.command