Added possibility to define multiple prefixes
This commit is contained in:
parent
212e10d9a7
commit
9b1fd2f315
1 changed files with 11 additions and 2 deletions
13
pybot-f.py
13
pybot-f.py
|
@ -45,11 +45,20 @@ config.read('bot.ini')
|
||||||
|
|
||||||
|
|
||||||
bottoken = config['General']['bottoken']
|
bottoken = config['General']['bottoken']
|
||||||
botprefix = config['General']['botprefix']
|
botprefixes = config['General']['botprefixes']
|
||||||
|
|
||||||
|
|
||||||
|
def get_prefixes(bot, message):
|
||||||
|
"""
|
||||||
|
For setting the bots prefixes in addition to mentions.
|
||||||
|
"""
|
||||||
|
|
||||||
|
prefixes = botprefixes # Can be a list of strings
|
||||||
|
return commands.when_mentioned_or(*prefixes)(bot, message)
|
||||||
|
|
||||||
|
|
||||||
# Setting up commands.Bot
|
# Setting up commands.Bot
|
||||||
bot = commands.Bot(command_prefix=botprefix, description=description, intents=intents)
|
bot = commands.Bot(command_prefix=get_prefixes, description=description, intents=intents)
|
||||||
|
|
||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue