adding custom prefix
This commit is contained in:
parent
f62a4b37a6
commit
099cf2cc06
3 changed files with 7 additions and 4 deletions
|
@ -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)
|
[![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__
|
## __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:
|
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_ID="yourValue" \
|
||||||
--TOKEN_REDDIT_CLIENT_SECRET="yourValue" \
|
--TOKEN_REDDIT_CLIENT_SECRET="yourValue" \
|
||||||
--TOKEN_REDDIT_USER_AGENT="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)
|
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__
|
## __Features__
|
||||||
|
|
||||||
Everything is explained by doing `.help`
|
Everything is explained by doing the `help` command.
|
||||||
|
|
|
@ -10,4 +10,5 @@ services:
|
||||||
- TOKEN_REDDIT_CLIENT_SECRET=your-reddit-client-secret
|
- TOKEN_REDDIT_CLIENT_SECRET=your-reddit-client-secret
|
||||||
- TOKEN_REDDIT_USER_AGENT=your-reddit-user-agent
|
- TOKEN_REDDIT_USER_AGENT=your-reddit-user-agent
|
||||||
- TIMEZONE=your-timezone # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
- TIMEZONE=your-timezone # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
||||||
|
- PREFIX=your-prefix
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
|
@ -5,8 +5,9 @@ from discord.ext import commands
|
||||||
from random import choice
|
from random import choice
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from pytz import timezone
|
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...")
|
print("Chargement des extensions & librairie...")
|
||||||
client.load_extension("cogs.help")
|
client.load_extension("cogs.help")
|
||||||
|
|
Reference in a new issue