Discord bot for personal preferences
Project Mercury is a customizable Discord bot designed to cater to specific personal preferences. It includes features such as music playback, AI-powered chat responses, and chess tournaments.
- Music Playback: Play high-quality music from various sources.
- AI Chat Responses: Engage in conversations with AI-powered responses.
- Chess Tournaments: Organize and manage chess games.
- Clone the repository:
git clone https://github.com/kmosoti/project_mercury.git
- Navigate to the project directory:
cd project_mercury
- Install the dependencies:
npm install
- Set up environment variables:
- Create a
.env
file in the root directory and add your keys.
- Create a
- Run the bot:
node index.js
Invite the bot to your Discord server and interact using defined commands.
!play <song_name>
- Play a song.!pause
- Pause the current song.!resume
- Resume the paused song.!stop
- Stop the music playback.
!chat <message>
- Engage in a conversation with the AI-powered bot.
!startchess
- Start a new chess game.!move <move>
- Make a move in the ongoing chess game.!status
- Check the status of the current game.
To keep the bot running 24/7, you can host it on a cloud service. In my case, I used AWS Lightsail successfully by running it as a PM2 process.
-
Create a Lightsail Instance:
- Log in to your AWS account and navigate to Lightsail.
- Create a new instance with the desired configuration.
-
SSH into the Instance:
- Use the provided SSH key or the Lightsail console to access your instance.
-
Clone the Repository on the Instance:
git clone https://github.com/kmosoti/project_mercury.git cd project_mercury
-
Install Dependencies:
npm install
-
Set Up Environment Variables:
- Create a
.env
file and add your keys.
- Create a
-
Install PM2:
npm install pm2 -g
-
Start the Bot with PM2:
pm2 start index.js pm2 save pm2 startup
This ensures the bot will restart automatically if the instance reboots.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
Kennedy R. Mosoti
LinkedIn: Kennedy Mosoti