# Bot Discord [![Version](https://img.shields.io/badge/version-1.5-green?style=for-the-badge)](https://gitlab.com/ConfrerieDuKassoulait/KassouBot/-/releases) [![Build](https://img.shields.io/gitlab/pipeline/ConfrerieDuKassoulait/KassouBot/dev?style=for-the-badge)](https://gitlab.com/ConfrerieDuKassoulait/KassouBot/container_registry) ## __Setting up__ You have to replace `TOKEN_DISCORD`, `PREFIX`, `TOKEN_GENIUS`, `TOKEN_REDDIT_CLIENT_ID`, `TOKEN_REDDIT_CLIENT_SECRET`, `TOKEN_REDDIT_USER_AGENT` and [`TIMEZONE`](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) with your desired values. You must also specify a path to the folder where the database will be. With a [docker-compose](https://gitlab.com/ConfrerieDuKassoulait/KassouBot/-/blob/main/docker-compose.yml) or in command line: ``` docker run -d \ --name="Lavalink" \ registry.gitlab.com/confreriedukassoulait/lavalink:latest \ lavalink \ -p 2333:2333 \ --network="default" \ --restart=unless-stopped \ && \ docker run -d \ --name="KassouBot" \ registry.gitlab.com/confreriedukassoulait/kassoubot \ --TOKEN_DISCORD="yourTokenDiscord" \ --TOKEN_GENIUS="yourTokenGenius" \ --TOKEN_REDDIT_CLIENT_ID="yourRedditClientID" \ --TOKEN_REDDIT_CLIENT_SECRET="yourRedditClientSecret" \ --TOKEN_REDDIT_USER_AGENT="yourRedditUserAgent" \ --TIMEZONE="yourTimezone" \ --PREFIX="yourPrefix" \ -v /here/your/path/:/opt/db \ --network="default" \ --restart=unless-stopped ``` You shouldn't change at least the service name of the Lavalink container because the bot is using his DNS name (and it's based on the service's name). You can add the environment variable `DEACTIVATE` to disable some cogs (separate the cogs with commas and no spaces between). You can add the environment variable `REGION_DISCORD` to force the Lavalink server to use your voice region. To find reddit tokens, go to [this site](https://www.reddit.com/prefs/apps) and here are the instructions: ![instructions](https://i.imgur.com/tEzYKDA.png) *redirection uri (for copy/paste) : http://localhost:8080* To find Genius token, go to [this site](https://genius.com/api-clients), `login to your account` and on the left select `New API Client`. Fill the field with what you want then click `Save`. Now your token is the `CLIENT ACCESS TOKEN`. ## __Add the bot to your server__ - In the [Discord Dev Portal](https://discord.com/developers/applications) create an application, and make sure it's a `Bot` (third tab). - To invite it, go to the `OAuth2` (second tab) tab, select the scopes `bot` (required) and `applications.commands` (for the slashs commands) and in the bot permissions select `Administrator` (You can select manually at your own risk). - You have the link to copy above between the two blocks `scopes` and `permissions`. - If you need help, you can [join my Discord](https://discord.gg/Z5ePxH4). ## __Features__ - Using [discord.py](https://github.com/Rapptz/discord.py) (rewrite) - Everything is explained by doing the `help` command. - Using [SQLite](https://www.sqlite.org/index.html) for the database. - Using [Lavalink](https://github.com/freyacodes/Lavalink) with a [Wavelink client](https://github.com/PythonistaGuild/Wavelink). ## __Launching locally__ If you want to run it without Docker, clone the repo (and his submodules by doing `git submodule update --force --recursive --init --remote` in the git folder) then create an .env file to store variables in the root folder (there is an example [here](https://gitlab.com/ConfrerieDuKassoulait/KassouBot/-/blob/main/.envexample)). Install all the requirements by doing `python3 -m pip install -r requirements.txt`. Simply run `start.bat` if you are on Windows or `start.sh` if on Linux inside the `src` folder to launch the bot.