Skip to content

A advanced discord music bot made with lavalink, poru and lots of love ❤

License

Notifications You must be signed in to change notification settings

Reishimanfr/The-World-Machine-Bot

Repository files navigation

Image source: https://steamcommunity.com/sharedfiles/filedetails/?id=2110317453

A Discord music bot made with ❤️ by Rei!

Invite twm to server  Support server 
twm bot release version  Docker Pulls

⭐ Features

  • YouTube, Spotify, and Soundcloud playback support
  • Sponsorblock integration
  • Lots of QoL features to make the experience smooth
  • Amazing support from the bot's developer
  • Docker support for easy hosting

🚀 Installation using Docker (recommended)

Important

This assumes you have Docker and Docker Compose installed and working correctly.

  1. Copy the docker-compose.yml file:
version: '3.7'

services:
  lavalink:
    container_name: twm_lavalink
    image: ghcr.io/lavalink-devs/lavalink:4
    restart: on-failure
    environment:
      - SERVER_PORT=2333
      - SERVER_ADDRESS=0.0.0.0
      - LAVALINK_SERVER_PASSWORD=youshallnotpass
    volumes:
      - ./lavalink/application.yml:/opt/Lavalink/application.yml
      - ./lavalink/plugins:/opt/Lavalink/plugins/
    healthcheck:
      test: 'curl -H "Authorization: youshallnotpass" -s http://localhost:2333/version'
      interval: 10s
      timeout: 10s
      retries: 5
      start_period: 10s
    
  postgres:
    container_name: twm_postgres
    image: postgres:latest
    restart: on-failure
    environment:
      POSTGRES_DB: twm
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: twmIsAwesome
    volumes:
      - ./postgres-data:/var/lib/postgresql/data

  discord-bot:
    container_name: twm
    image: reishimanfr/the-world-machine:latest
    environment:
      # Your discord bot token. Never show it to anyone
      - BOT_TOKEN=
      # Time after which the bot will leave vc if inactive (in minutes)
      - PLAYER_TIMEOUT=10
      # This is only needed if you want the starboard feature
      # to embed tenor gifs. You can safely ignore it.
      - TENOR_API_KEY=null

      # Create a new empty guild and paste it's ID here. You
      # only have to do this once.
      - CUSTOM_EMOJIS_GUILD_ID=1234567890

      # Changes if (/) commands should be registered on bot startup.
      - REGISTER_COMMANDS_ON_START=true

      # This changes if the bot should leave servers where it's
      # been inactive for 3 months.
      - LEAVE_INACTIVE_GUILDS=true

      # Don't change these unless you know what you're doing
      - LOG_LEVEL=info      
      # Lavalink stuff
      - LAVALINK_HOST=lavalink
      - LAVALINK_PORT=2333
      - LAVALINK_PASSWORD=youshallnotpass
      # Postgres stuff
      - DATABASE_DIALECT=postgres
      - DATABASE_HOST=postgres
      - DATABASE_PORT=5432
      - DATABASE_NAME=twm
      - DATABASE_USERNAME=postgres
      - DATABASE_PASSWORD=twmIsAwesome
      - DOCKER=true
    volumes:
      - ./:/usr/src/app
    restart: on-failure
    depends_on:
      - lavalink
      - postgres
  1. Edit the environment variables like the bot token
  2. cd into the folder where you placed the compose file
cd path/to/the/folder
  1. Build the container
docker-compose up -d
The -d flag means "detached" which will run the container in the background.

To update, run this command:

docker-compose up --force-recreate -d

If you want to provide your application.yml file for lavalink:

  1. Create a new directory in the root folder called lavalink
mkdir lavalink
  1. Create a file called applcation.yml and fill it out according to your needs.
touch application.yml
nano application.yml

🚀 Installation using the source code

  1. Clone the source code
git clone https://github.com/Reishimanfr/The-World-Machine-Bot
  1. Go into the newly created directory
cd The-World-Machine-Bot
  1. Install dependencies
npm i --omit=dev
  1. Rename the .env.example file to .env and fill it out
  2. Start the bot
npm start

❓ Support

Join the support server... or message me on discord directly! (@rei.shi)

✨ Some project stats

Alt