Giter Club home page Giter Club logo

canyonbot's Introduction

Canyonbot

Discord music bot built using Spring and Discord4J.

Description

Canyonbot enables users to play music in Discord channels from various sources by leveraging Lavalink server. The bot offers commands that can be used within text channels to control playback. The project is structured in a flexible manner, allowing for potential expansion into different functionalities in the future.

Installation

You can install Canyonbot either using a Docker image or the provided artifact in the release. Regardless of the version chosen, ensure to specify the required environmental variables, particularly the Discord API token.

Environmental variables

Variable Description
DISCORD_BOT_TOKEN Discord api token. If you don't have one, follow this tutorial
CONFIG_PATH Alternative path to application.properties file

a. Using docker

...

b. Using docker compose

An example docker-compose.yml:

version: "3.8"

services:
  #According to https://lavalink.dev/configuration/docker.html
  lavalink:
    image: ghcr.io/lavalink-devs/lavalink:4
    container_name: lavalink
    restart: unless-stopped
    environment:
      - _JAVA_OPTIONS=-Xmx2G
      - SERVER_PORT=2333
      - LAVALINK_SERVER_PASSWORD=youshallnotpass
    volumes:
      - ./application.yml:/opt/Lavalink/application.yml
      - ./plugins/:/opt/Lavalink/plugins/
    networks:
      - lavalink
    expose:
      - 2333
    ports:
      - "2333:2333"
  canyonbot:
    image: canyonbot:latest
    container_name: canyonbot
    restart: unless-stopped
    environment:
      - _JAVA_OPTIONS=-Xmx2G
      - DISCORD_BOT_TOKEN=<your discord token here>
      - CONFIG_PATH=/opt/canyonbot/application.yml
    volumes:
      - ./application.yml:/opt/canyonbot/application.yml
      - ./logback.xml:/opt/canyonbot/logback.xml
    networks:
      - lavalink
networks:
  lavalink:
    name: lavalink

Then run using docker compose up -d.

c. Using jar artifact

...

Usage

Generate invite link for bot and use /play command to verify that the application is functioning correctly.

Configuration

To enable the music module, you must provide at least one Lavalink node. Below is an example application.properties file:

player.nodes[0].name=Local Lavalink server
player.nodes[0].uri=ws://localhost:2333
player.nodes[0].password=youshallnotpass
player.nodes[0].httpTimeout=5000

If you are using Docker Compose, your URI should be ws://<lavalink container name>:2333.

canyonbot's People

Contributors

mkkl1 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.