1
0
Fork 0
mirror of synced 2024-04-25 08:12:15 +12:00

Correct when_mentioned_or usage

This commit is contained in:
Dan Hess 2021-05-21 14:43:07 -08:00
parent 99fe741438
commit 8756b39357

View file

@ -115,6 +115,8 @@ db_opts = {
def command_prefix(bot, message):
if not message.guild:
return default_prefix
return commands.when_mentioned_or(
bot.cache.prefixes.get(message.guild.id) or default_prefix
)(bot, message)
prefixes = bot.cache.prefixes.get(message.guild.id)
if prefixes:
return commands.when_mentioned_or(prefixes)(bot, message)
else:
return commands.when_mentioned_or(*default_prefix)(bot, message)