reactiflux / reactibot

Useful saved commands, auto-moderation tools, and more, for the Reactiflux server.
MIT License
27 stars 40 forks source link

text in code blocks is treated as commands #412

Open kristersd opened 1 month ago

kristersd commented 1 month ago

Text written in code blocks is treated as commands. We should ignore code blocks, for example, to avoid triggering the bot when the user has:

if (!auth) {}

Implementation details:

vcarl commented 1 month ago

There's an existing string helper that "simplifies" text by stripping diacriticals, emoji, and whitespace (it gets used in the track logic to determine if something is "the same message" for tracking purposes across channels). This makes sense to me as another string helper, a filter pass to remove irrelevant text before it gets processed by other logic. Quoted text probably also good to ignore