Skip to content

[FAQ] handle all Text Messages

Housa Hitomi edited this page Jan 29, 2022 · 1 revision
  1. use RELexer:
@bot.command(regex=r'[\s\S]*')
async def foo(msg: Message):
    print(msg.content)
  1. register handler in client:
async def foo(msg: Message):
    print(msg.content)


bot.client.register(MessageTypes.TEXT, foo)

Clone this wiki locally