Skip to content
github-actions[bot] edited this page Nov 15, 2024 · 19 revisions

⚙️ Configure .env

You can use Docker Compose or install all dependencies and source code locally. But in both cases, you need to configure .env a file.

Also you need retrieve token, client id and enable intents on Discord Developer Portal.

  • Create file .env.production (if you developer create .env.development)
  • Fill all fields in .env.production If the field is marked as (Optional), you can skip it (don't include field in .env.production and don't set field to "undefined").
  • (Required) To get Discord Token and enable intents, follow the Discord Developer Portal section.
  • (Optional) To get YouTube cookies and bypass different errors with YouTube, follow the YouTube section
  • (Optional) To get Spotify Secret and ID, follow the Spotify section.
  • (Optional) To get Yandex Music token, follow the Yandex Music section.
  • (Optional) To get SoundCloud token, follow the Soundcloud section.
  • (Optional) To get Genius token, follow the Genius section.
  • (Optional) To get VKontakte token, follow the VKontakte section.
Name Example Description Required
BOT_VERBOSE_LOGGING false The bot will give more info to the console, useful for debugging
BOT_FFMPEG_LOGGING false The bot will give info about FFMPEG to the console, useful for debugging
BOT_COMMAND_PREFIX // Used only for text commands ✔️
BOT_MAX_SONGS_IN_QUEUE 500 Define max songs count per queue
BOT_MAX_SONGS_HISTORY_SIZE 60 Define max songs history per guild, set to 0 if you want to disable history (this will not delete history in database which already exists)
BOT_LANGUAGE en Supported values: en ru
MONGO_URI Docker: mongodb://aicbot-mongo:27017 or Local: mongodb://localhost:27017 IP address of MongoDB ✔️
MONGO_DATABASE_NAME aicbot Database name in MongoDB ✔️
BOT_DISCORD_TOKEN ODEzNzUwMTY1N... Token from Discord Developer Portal ✔️
BOT_DISCORD_CLIENT_ID 813750165783... Application ID from Discord Developer Portal ✔️
BOT_DISCORD_OVERPOWERED_ID 29016845994426.... Discord bot owner user ID, required for having more bot control for owner ✔️
BOT_GOOGLE_EMAIL Used to automate cookies fetching for YouTube
BOT_GOOGLE_PASSWORD Used to automate cookies fetching for YouTube
BOT_SPOTIFY_CLIENT_SECRET Used when the Spotify module cannot get the credentials automatically
BOT_SPOTIFY_CLIENT_ID Used when the Spotify module get the credentials automatically
BOT_YANDEXMUSIC_TOKEN Provide to enable Yandex Music module
BOT_YANDEXMUSIC_UID Provide to enable Yandex Music module
BOT_VKONTAKTE_TOKEN Provide to fetch songs from VKontakte
BOT_SOUNDCLOUD_CLIENT_ID Provide to fetch more data with SoundCloud Go+ account
BOT_SOUNDCLOUD_TOKEN Provide to fetch more data with SoundCloud Go+ account
BOT_GENIUS_TOKEN Provide to fetch songs lyrics from Genius

🐋 Run in Docker (recommended)

Caution

MONGO_URI in .env.production must be mongodb://aicbot-mongo:27017.

  • Install Docker
  • Copy docker-compose.yml in empty folder
  • Follow the Configure .env section and copy .env.production in folder with docker-compose.yml.
  • (Optional) Follow the YouTube Cookie section and copy yt-cookies.json in the folder with docker-compose.yml etc.
  • Your file structure must be like this
AICoTest/
  ├─ .env.production
  ├─ docker-compose.yml
  ├─ yt-cookies.json

🖥️ Run locally (if you are not a developer, this way is no sense)

  • Install Node.js 22 or higher
  • Install Python 3.12
  • Install C++ compiler. Follow this guide
  • Install FFMpeg. Follow this guide
  • Clone repository to your computer
  • Follow the Configure .env section and copy .env.development in folder with repository.
  • (Optional) Follow the YouTube Cookie and copy yt-cookies.json in the folder with repository.
  • Install Node.js packages in the folder with repository
npm install
  • Compile bot
npm run build
  • Run the bot
npm run production

or if you are a developer

npm run development