Windows Installation - LibreChat-AI/LibreChat-DiscordBot GitHub Wiki
Before proceeding with the installation, ensure that 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.png
for the bot icon if you want) -
Select the
Bot
tab. 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.example
tobot_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+S.
-
Install all dependencies with
pip install -r requirements.txt
in the command prompt. -
Run the bot by opening the command prompt, navigating to the folder containing
bot.py
, and executing the following command:python bot.py
-
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 (Optional)
-
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.
⚠️ 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.