Skip to content
This repository has been archived by the owner on Aug 28, 2020. It is now read-only.

Suggestion: RegExp prefix's #94

Closed
MrJacz opened this issue Nov 25, 2017 · 10 comments
Closed

Suggestion: RegExp prefix's #94

MrJacz opened this issue Nov 25, 2017 · 10 comments
Labels
Type: Proposal Issues that request a new feature or a change in the framework's interface.

Comments

@MrJacz
Copy link
Member

MrJacz commented Nov 25, 2017

A way to be able to have custom Prefix with regex's aka this.client.config.prefix could be new RegExp(/!/g) for example

@bdistin
Copy link
Contributor

bdistin commented Nov 25, 2017

Uh, this was a thing... If it's broken, that's a bug.

@MrJacz
Copy link
Member Author

MrJacz commented Nov 25, 2017

Confirmed bug

@kyranet
Copy link
Contributor

kyranet commented Nov 25, 2017

this.client.config.prefix has never been RegExp but string/string[]. This suggestion breaks several pieces including SettingGateway. Althought SGv2 will just throw a TypeError.

@kyranet kyranet added Bug: Unverified Issues that report unverified bugs. Pending for inspection. Type: Proposal Issues that request a new feature or a change in the framework's interface. labels Nov 25, 2017
@MrJacz
Copy link
Member Author

MrJacz commented Nov 25, 2017

I'm sure it was a thing in August I remember using it but I could be tripping this might break SGv2 but maybe there could be a RegexPrefix option in KlasaClientConfig so that RegexPrefix is the main prefix that couldn't be overridden aka Hey Skyra, ping would work always even if you used conf to change the prefix so it is not overridable.

@kyranet
Copy link
Contributor

kyranet commented Nov 25, 2017

Just like Komada 0.19.7's usage were so bugged the repeator tag was useless and it was capturing from the argument's position to the end (infinite catching), it got fixed in 0.20.0 with Ao's rewrite and that behaviour dissapeared. There has not been an infinite catching feature in Komada, nor in Klasa, although a bug allowed it to exist.

Same happens here with the prefixes, this.client.config.prefix being a RegExp (but guild prefixes defaulted to string|string[]). That was an unintended behaviour that worked due to a bug, but since the bug is now fixed, that does not longer work.

@MrJacz
Copy link
Member Author

MrJacz commented Nov 25, 2017

I see

@MrJacz
Copy link
Member Author

MrJacz commented Nov 25, 2017

@kyranet What is your opinion on the regexPrefix option in KlasaClientConfig? I think it would become handy

@MrJacz
Copy link
Member Author

MrJacz commented Nov 25, 2017

as mentionPrefix shouldn't be overridden and is only meant for mentionPrefix for the bot...

@kyranet
Copy link
Contributor

kyranet commented Nov 25, 2017

My opinion is that regexPrefix is a nice-to-have feature, but most developers will not find it handy. (Keep in mind that RegExp is a feature that many newbie developers find hard to use).

@MrJacz
Copy link
Member Author

MrJacz commented Nov 25, 2017

I can agree with it being a nice feature to have and very true that noobie developers dont know the power of Regular expresions

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Type: Proposal Issues that request a new feature or a change in the framework's interface.
Projects
None yet
Development

No branches or pull requests

3 participants