Skip to content

Commit ecb15d8

Browse files
author
thomate
committed
prefix in config
1 parent 5e4f24e commit ecb15d8

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
Carotte is an example of discord bot using discord.py.
15-
15+
This bot needs Python 3.5.3 or higher.
1616
API doc : <https://discordpy.readthedocs.io/en/latest/>
1717

1818
Install discord.py :
@@ -23,4 +23,10 @@ python3 -m pip install -U discord.py
2323
2424
# Windows
2525
py -3 -m pip install -U discord.py
26-
```
26+
```
27+
28+
In order to initialize Carotte, you must load cogs using
29+
```
30+
<p>load cogs_name
31+
```
32+
Where `<p>` is your prefix and `cogs_name` is a valid cog's name.

bot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
def get_prefix(bot, message):
77
"""A callable Prefix for our bot. This could be edited to allow per server prefixes."""
8-
prefixes = '!'
8+
prefixes = botconfig.config['prefixes']
99
return commands.when_mentioned_or(*prefixes)(bot, message)
1010

1111
# Define all of our cogs

botconfig.example.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
config = { 'token': 'BOT_TOKEN'
22
, 'invite_bot': 'https://discordapp.com/api/oauth2/authorize?client_id=CLIENT_ID&permissions=0&scope=bot'
3+
, 'prefixes': '!'
34
}

0 commit comments

Comments
 (0)