grammyjs / commands

Work-in-progress plugin for managing commands with grammY.
https://grammy.dev
MIT License
12 stars 2 forks source link

feat: allow command casing to be ignored #30

Closed roziscoding closed 3 months ago

roziscoding commented 3 months ago

Fixes #27

carafelix commented 3 months ago

How should the plugin handle the case of hasCommand(/REGEX/i, { ignoreCase: false }) ?

I think the RegExp should always take priority, not only because ignoreCase is set to false as a default, but more importantly, because is more likely for someone to set the i flag when working with regex's and not care / notice about the ignoreCase option, than to purposely add the i flag and manually set ignoreCase to true

KnorpelSenf commented 3 months ago

In other words, if either i or ignoreCase: true is provided, casing will be ignored, and case-sensitive matching will only happen when none of the two options are set. Correct?

carafelix commented 3 months ago

In other words, if either i or ignoreCase: true is provided, casing will be ignored, and case-sensitive matching will only happen when none of the two options are set. Correct?

Exactly