Skip to content Skip to sidebar Skip to footer

Is The A Way To Use Prefix And Ping For Commands?

I've decided to create a much more helpful bot, and I would like to allow the commands to be activated in two ways: x. which is the default prefix and @xubot, aka pinging the bot.

Solution 1:

Pass the commands.when_mentioned_or function as your prefix:

from discord.ext.commands import Bot, when_mentioned_or

bot = Bot(command_prefix=when_mentioned_or("x."))

...

Post a Comment for "Is The A Way To Use Prefix And Ping For Commands?"