From 6f5e62c8d8cf14790e60723a486f75b074734007 Mon Sep 17 00:00:00 2001 From: Daniel Gu Date: Tue, 2 May 2023 22:56:07 +0800 Subject: Update on-message-event.md --- bot/resources/tags/on-message-event.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/resources/tags/on-message-event.md b/bot/resources/tags/on-message-event.md index 89c43ff0b..fd2454eb8 100644 --- a/bot/resources/tags/on-message-event.md +++ b/bot/resources/tags/on-message-event.md @@ -5,7 +5,7 @@ embed: Registering the `on_message` event with [`@bot.event`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.Bot.event) will override the default behavior of the event. This may cause prefix commands to stop working, because they rely on the default `on_message` event handler. -Instead, use [`@bot.listen`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.Bot.listen) to add a listener. Listeners get added alongside the default `on_message` event, rather than overriding it, so prefix commands can still be invoked as usual: +Instead, use [`@bot.listen`](https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.Bot.listen) to add a listener. Listeners get added alongside the default `on_message` handler which allows you to have multiple handlers for the same event. This means prefix commands can still be invoked as usual. Here's an example: ```python @bot.listen() async def on_message(message): -- cgit v1.2.3