Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// /hubot/help
//
// Configuration:
// HUBOT_HELP_REPLY_IN_PRIVATE - if set to any avlue, all `hubot help` replies are sent in private
// HUBOT_HELP_REPLY_IN_PRIVATE - if set to any value, all `hubot help` replies are sent in private
// HUBOT_HELP_DISABLE_HTTP - if set, no web entry point will be declared
// HUBOT_HELP_HIDDEN_COMMANDS - comma-separated list of commands that will not be displayed in help
//
Expand Down Expand Up @@ -76,7 +76,7 @@ module.exports = (robot) => {

const emit = cmds.join('\n')

if (replyInPrivate && msg.message && msg.message.user && msg.message.user.name) {
if (replyInPrivate && msg.message && msg.message.user && msg.message.user.name && msg.message.user.name != msg.message.room) {
msg.reply('replied to you in private!')
return robot.send({ room: msg.message.user.name }, emit)
} else {
Expand Down Expand Up @@ -113,10 +113,10 @@ var getHelpCommands = function getHelpCommands (robot) {

helpCommands = helpCommands.map((command) => {
if (robotName.length === 1) {
return command.replace(/^hubot\s*/i, robotName)
return command.replace(/^hubot\s*/i, '@'+robotName)
}

return command.replace(/^hubot/i, robotName)
return command.replace(/^hubot/i, '@'+robotName)
})

return helpCommands.sort()
Expand Down