NanderTGA / msgroom-orm

A MsgRoom client.
https://nandertga.github.io/msgroom-orm/
MIT License
4 stars 0 forks source link

Change datatype of commandPrefixes to Set #42

Closed NanderTGA closed 1 year ago

NanderTGA commented 1 year ago

A Set makes more sense here. No duplicates + easier to remove specific prefixes.

NanderTGA commented 1 year ago

One possible issue with this though: Some code (e.g. built-in help command) uses the first value in the array of commandPrefixes to get the "main" prefix. I have noticed the order does not get changed by Set though. I could replace this.commandPrefixes[0] with this.commandPrefixes.keys().next(), but this just makes it too long. I'll go with a new property this.mainCommandPrefix.

I'm also thinking about renaming this.commandPrefixes to this.prefixes (name for the new property has not been decided yet) Not sure about this though. What is better? commandPrefixes or prefixes?

mybearworld commented 1 year ago

I prefer prefixes, it's shorter, and it should be pretty obvious what it's used for.

NanderTGA commented 1 year ago

I'm also taking the opportunity here to provide the ability disable the command system completely. If you want to disable the command system, set the main prefix to an empty string.

msgroom-js-semantic-release[bot] commented 9 months ago

:tada: This issue has been resolved in version 2.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

mybearworld commented 9 months ago

Thank you, msgroom-js-semantic-release, this is really helpful to know

NanderTGA commented 9 months ago

I'm sorry if that message was annoying, I didn't know it would comment on every issue and PR closed in the last eight months. It does explain why it took around ten minutes to run though. But I still think it can be pretty useful in the future.

mybearworld commented 9 months ago

It's fine - it was just a bit surprising. (Also, merging 2.0 while msgroom is down is kind of funny :P)