From 099cf2cc0641c440b16631e7cfcbd0be89b7b1f4 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 7 May 2021 16:44:47 +0200 Subject: [PATCH] adding custom prefix --- README.md | 7 ++++--- docker-compose.yml | 1 + src/main.py | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8dc34c7..140bbce 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![Github forks](https://img.shields.io/github/forks/Confrerie-du-Kassoulait/KassouBot?label=Github%20Forks&style=for-the-badge)](https://github.com/Confrerie-du-Kassoulait/KassouBot/network) ## __Setting up__ -You have to replace `TOKEN_DISCORD`, `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 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. With a [docker-compose](https://github.com/Confrerie-du-Kassoulait/KassouBot/blob/master/docker-compose.yml) or in command line: ``` @@ -19,7 +19,8 @@ docker run -d \ --TOKEN_REDDIT_CLIENT_ID="yourValue" \ --TOKEN_REDDIT_CLIENT_SECRET="yourValue" \ --TOKEN_REDDIT_USER_AGENT="yourValue" \ - --TIMEZONE="yourTimezone" + --TIMEZONE="yourTimezone" \ + --PREFIX="." ``` 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) @@ -34,4 +35,4 @@ To find reddit tokens, go to [this site](https://www.reddit.com/prefs/apps) and ## __Features__ -Everything is explained by doing `.help` +Everything is explained by doing the `help` command. diff --git a/docker-compose.yml b/docker-compose.yml index e438608..ec26ed5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,4 +10,5 @@ services: - TOKEN_REDDIT_CLIENT_SECRET=your-reddit-client-secret - TOKEN_REDDIT_USER_AGENT=your-reddit-user-agent - TIMEZONE=your-timezone # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + - PREFIX=your-prefix restart: unless-stopped diff --git a/src/main.py b/src/main.py index a178da4..9098819 100644 --- a/src/main.py +++ b/src/main.py @@ -5,8 +5,9 @@ from discord.ext import commands from random import choice from datetime import datetime from pytz import timezone +customPrefix = os.environ['PREFIX'] -client = commands.Bot(command_prefix = ".", case_insensitive = True, intents = discord.Intents.all()) +client = commands.Bot(command_prefix = customPrefix, case_insensitive = True, intents = discord.Intents.all()) print("Chargement des extensions & librairie...") client.load_extension("cogs.help")