-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
converted slashcommand-join coffee to js #6469
Conversation
@@ -0,0 +1,10 @@ | |||
RocketChat.slashCommands.add('join', void 0, { |
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.
Do not use void 0
*/ | ||
|
||
|
||
const Join = function(command, params, item) { |
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.
IMHO named functions are better for theses cases, cuz the stack trace of the errors will be more clear.
What do you think about change const Join = function(command...
by function Join(command...
?
}, user.language) | ||
}); | ||
} | ||
if (room.usernames.indexOf(user.username) > -1) { |
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.
Can you replace the indexOf
by includes
?
@RocketChat/core