-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace --enable-slash with --alias #148
Replace --enable-slash with --alias #148
Conversation
Can we add a new opt-parse argument that keeps backwards compat and have --alias default to |
Something like this? |
if @enableSlash | ||
newRegex = new RegExp("^(?:\/|#{@name}[:,]?)\\s*(?:#{pattern})", modifiers) | ||
if @alias | ||
alias = @alias.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") # escape alias for regexp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get why this is necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not coffee-script / javascprit guru (stil learning). But i think this need if define alias with standard regexp modificator e.g. [abc]
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You would need to escape the @alias when you put things like ?
or any other regex special character in the alias. I can't think of a cleaner way to do this in Javascript.
Almost! :D |
Any update on this? |
@tombell go ahead and merge it in if you can. It'll just have to wait for 2.0 |
…h-alias Add --alias (--enable-slash is deprecated)
Thanks for merging this, having more control over the aliases is really helpful for xmpp bots. |
…ash-with-alias Add --alias (--enable-slash is deprecated)
XMPP Clients reserved slash for command so i think better then --enable-slash is --alias for define custom alias (in XMPP MUC is "standardized" '!' for bot commands).