Skip to content Skip to sidebar Skip to footer

Discord.py Commands.when_mentioned Not Working With Custom Prefix

What I'm trying to do: If someone doesn't know the prefix, they can mention the bot and use the mention instead. After some research, I had found How to send commands to a bot by n

Solution 1:

when_mentioned_or is supposed to be passed a list of prefixes, not a function for getting that list. It's easy enough to modify though:

def when_mentioned_or_function(func):
    def inner(bot, message):
        r = func(bot, message)
        r = commands.when_mentioned(bot, msg) + r
        return r
    return inner

Post a Comment for "Discord.py Commands.when_mentioned Not Working With Custom Prefix"