Commando icon indicating copy to clipboard operation
Commando copied to clipboard

Regex Prefixes?

Open Glorken opened this issue 8 years ago • 4 comments

I see that the prefix given is internally turned into a regular expression. Would it be possible to give the option to provide a regular expression for a prefix instead? Technically, adding an option for aliases would work, too.

Glorken avatar Feb 28 '17 02:02 Glorken

How would you express a regular expression prefix to the user? And how would you set one in a guild?

Gawdl3y avatar Mar 01 '17 10:03 Gawdl3y

For the first question, the randexp module could possibly be used for examples, and/or the regex itself could be shown.

As for the second, if the issue is distinguishing a normal prefix from a normal one, I suppose either ending the command with /r or surrounding the expression with ``` ``` or / / could work. These would rule out prefixes with those characteristics, though. A separate command could be used, instead? Then it could work alongside a normal prefix?

Glorken avatar Mar 02 '17 23:03 Glorken

And what would be the purpose of this in the first place?

Gawdl3y avatar Mar 03 '17 00:03 Gawdl3y

For example, a user would be able to specify multiple prefixes with /bot|robot|hey/i, or they could specify optional parts of the prefix with /(hey )?bot,?/i. Of course, these could also be done with allowing multiple prefixes.

Glorken avatar Mar 03 '17 13:03 Glorken