-
Couldn't load subscription status.
- Fork 43
[FAQ] command: @bot
Housa Hitomi edited this page May 16, 2022
·
3 revisions
from khl.command import Rule
@bot.command(rules=[Rule.is_bot_mentioned(bot)])
async def echo(m: Message, n: int, mentioned: str):
await m.reply(f'{mentioned}! you typed: {n}')you can invoke this command such like /echo 2 @bot (do not forget the space between 2 and @bot)
look at the trigger message: /echo 2 @bot, this content can be viewed as a command with 2 args: 2 and @bot
you can customize your command scheme as well just follow general command design rules