Linux Installation - LibreChat-AI/LibreChat-DiscordBot GitHub Wiki
Before proceeding with the installation, make sure you have the following requirements:
- Python 3.10 or higher installed
Install and set up the bot
-
Install git here
-
Clone the repository with
git clone http://github.com/Berry-13/LibreChat-DiscordBot.git -
Go to the Discord Developer Portal, create an application and name it. (You can use the included
bot_icon.pngfor the bot icon if you want) -
Select the
Bottab. Reset the token and copy it to a safe place.
- Select the OAuth2 tab. Copy the Client_ID to a safe place
-
Rename
bot_config.py.exampletobot_config.py -
In
bot_config.py, replace the following variables with the obtained values:TOKEN = 'your-discord-bot-token' CLIENT_ID = 'your-discord-bot-client-ID' -
Save the file by pressing
Ctrl+X, thenY, and finallyEnter. -
Install all dependencies with
pip install -r requirements.txtin the command prompt. -
Run the bot by executing
python3 bot.pyin the terminal. -
An invite link will be generated and displayed in the console, you can use it to invite the bot to your private discord server
Use PM2 to keep the bot always active
-
Install PM2 with
npm install pm2 -g -
Start bot.py using
pm2 start bot.py --interpreter python
At this point, PM2 will handle your bot.py script. PM2's feature includes automatic restart on crashes, which will keep your Python bot running a lot easier.
- Note: For Python3, you may need to specify python3 instead of python in the command.
⚠️ Warning: When using this bot, exercise caution with command permissions. It is strongly recommended to limit bot command permissions to yourself or trusted individuals. We advise using the bot on a private discord server to minimize risks. This precaution is crucial as certain commands allow manipulating the .env file, and have the potential to expose sensitive API keys.