mirror of
https://github.com/reality/dbot.git
synced 2024-12-24 11:42:36 +01:00
fix report [#511]
This commit is contained in:
parent
08d5f15679
commit
6faedb59a8
@ -20,13 +20,13 @@ var report = function(dbot) {
|
||||
|
||||
var commands = {
|
||||
'~report': function(event) {
|
||||
var channelName = event.input[1];
|
||||
var nick = event.input[2];
|
||||
var reason = event.input[3];
|
||||
var channelName = event.input[1],
|
||||
nick = event.input[2];
|
||||
reason = event.input[3];
|
||||
|
||||
dbot.api.users.resolveUser(event.server, nick, function(reportee) {
|
||||
if(_.has(event.allChannels, channelName)) {
|
||||
if(dbot.api.users.isChannelUser(event.server, nick, channelName, true)) {
|
||||
nick = dbot.api.users.resolveUser(event.server, nick, true);
|
||||
if(reportee) {
|
||||
this.api.notify(event.server, channelName, dbot.t('report', {
|
||||
'reporter': event.user,
|
||||
'reported': nick,
|
||||
@ -43,11 +43,12 @@ var report = function(dbot) {
|
||||
} else {
|
||||
event.reply(dbot.t('not_in_channel', { 'channel': channelName }));
|
||||
}
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
'~notify': function(event) {
|
||||
var channelName = event.input[1];
|
||||
var message = event.input[2];
|
||||
var channelName = event.input[1],
|
||||
message = event.input[2];
|
||||
|
||||
if(_.has(event.allChannels, channelName)) {
|
||||
this.api.notify(event.server, channelName, dbot.t('notify', {
|
||||
|
Loading…
Reference in New Issue
Block a user