Skip to content

Linux Installation

Fuegovic edited this page Aug 27, 2023 · 10 revisions

Before proceeding with the installation, make sure you have the following requirements:

  • Python 3.10 or higher installed

Install and set up the bot

  1. Install git here

  2. Clone the repository with git clone http://github.com/Berry-13/LibreChat-DiscordBot.git

  3. 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)

  4. Select the Bot tab. Reset the token and copy it to a safe place.

image

  1. Select the OAuth2 tab. Copy the Client_ID to a safe place

image

  1. Rename bot_config.py.example to bot_config.py

  2. In bot_config.py, replace the following variables with the obtained values:

    TOKEN = 'your-discord-bot-token'
    CLIENT_ID = 'your-discord-bot-client-ID'
  3. Save the file by pressing Ctrl+X, then Y, and finally Enter.

  4. Install all dependencies with pip install -r requirements.txt in the command prompt.

  5. Run the bot by executing python3 bot.py in the terminal.

  6. 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

  1. Install PM2 with npm install pm2 -g

  2. 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.

Clone this wiki locally