diff --git a/modules/report/commands.js b/modules/report/commands.js index 8653f4a..fead6d6 100644 --- a/modules/report/commands.js +++ b/modules/report/commands.js @@ -13,10 +13,14 @@ var commands = function(dbot) { }, '~report': function(event) { - var channelName = event.input[1], + var channelName = (event.input[1] || event.channel), nick = event.input[2], reason = event.input[3].trim(); + if(channelName == event.user) { + channelName = dbot.config.servers[event.server].admin_channel; + } + if(reason.charAt(reason.length - 1) != '.') reason += '.'; dbot.api.users.resolveUser(event.server, nick, function(reportee) { @@ -124,7 +128,7 @@ var commands = function(dbot) { }.bind(this)); } }; - commands['~report'].regex = [/^report ([^ ]+) ([^ ]+) (.+)$/, 4]; + commands['~report'].regex = /^report (#[^ ]+ )?([^ ]+) (.*)$/; commands['~notify'].regex = [/^notify ([^ ]+) (.+)$/, 3]; commands['~nunsub'].regex = [/^nunsub ([^ ]+)$/, 2]; commands['~ununsub'].regex = [/^ununsub ([^ ]+)$/, 2]; diff --git a/modules/report/usage.json b/modules/report/usage.json index 36139fd..2f03eec 100644 --- a/modules/report/usage.json +++ b/modules/report/usage.json @@ -1,4 +1,4 @@ { - "~report": "~report [#channel] [username] [reason for reporting]", + "~report": "~report ([#channel]) [username] [reason for reporting]", "~notify": "~notify [#channel] [message]" }