Alert detection overriden by insult detection #82

Closed
opened 2025-10-22 20:32:27 -04:00 by sirdog3355 · 0 comments
sirdog3355 commented 2025-10-22 20:32:27 -04:00 (Migrated from github.com)

Unbeknownst to me, Discord.py does not allow 2 on_message listeners to exist in the same cog. At the moment, it seems the most recent listener (put another way, the last defined listener) in a cog is the one that actually listens. All others are ignored.

In this instance, the listener for whether to insult users has taken precedence over the listener that stops people from pinging @SYS:OP raw for issues and redirects to using /alert.

The solution is to separate these 2 into different cogs.

Quite frankly, I should probably move these listener files into a dedicated listeners folder so I can differentiate between code that is executed by command and code executed by an event of some sort.

Unbeknownst to me, Discord.py does not allow 2 `on_message` listeners to exist in the same cog. At the moment, it seems the most recent listener (put another way, the last defined listener) in a cog is the one that actually listens. All others are ignored. In this instance, the listener for whether to insult users has taken precedence over the listener that stops people from pinging `@SYS:OP` raw for issues and redirects to using `/alert`. The solution is to separate these 2 into different cogs. Quite frankly, I should probably move these listener files into a dedicated `listeners` folder so I can differentiate between code that is executed by command and code executed by an event of some sort.
Sign in to join this conversation.
No description provided.