forked from GitHub/dbot
kick uses root admin_channel directive [#513]
This commit is contained in:
parent
fee7fedbf7
commit
2c2e1aefa2
@ -48,7 +48,7 @@ var commands = function(dbot) {
|
||||
timeout = event.input[1],
|
||||
banee = event.input[2],
|
||||
reason = event.input[3],
|
||||
adminChannel = this.config.admin_channel[event.server];
|
||||
adminChannel = dbot.config.servers[server].admin_channel,
|
||||
channels = dbot.config.servers[server].channels,
|
||||
network = event.server;
|
||||
|
||||
@ -107,29 +107,31 @@ var commands = function(dbot) {
|
||||
}
|
||||
|
||||
// Notify moderators, banee
|
||||
if(this.config.admin_channel[event.server]) {
|
||||
if(!_.isUndefined(adminChannel)) {
|
||||
channels = _.without(channels, adminChannel);
|
||||
} else {
|
||||
adminChannel = event.channel.name;
|
||||
}
|
||||
|
||||
dbot.api.report.notify(server, adminChannel, notifyString);
|
||||
dbot.say(event.server, adminChannel, notifyString);
|
||||
dbot.api.report.notify(server, adminChannel, notifyString);
|
||||
dbot.say(event.server, adminChannel, notifyString);
|
||||
|
||||
if(!_.isUndefined(timeout)) {
|
||||
dbot.say(event.server, banee, dbot.t('tbanned_notify', {
|
||||
'network': network,
|
||||
'banner': banner,
|
||||
'reason': reason,
|
||||
'hours': timeout,
|
||||
'admin_channel': adminChannel
|
||||
}));
|
||||
} else {
|
||||
dbot.say(event.server, banee, dbot.t('nbanned_notify', {
|
||||
'network': network,
|
||||
'banner': banner,
|
||||
'reason': reason,
|
||||
'hours': timeout,
|
||||
'admin_channel': adminChannel
|
||||
}));
|
||||
}
|
||||
if(!_.isUndefined(timeout)) {
|
||||
dbot.say(event.server, banee, dbot.t('tbanned_notify', {
|
||||
'network': network,
|
||||
'banner': banner,
|
||||
'reason': reason,
|
||||
'hours': timeout,
|
||||
'admin_channel': adminChannel
|
||||
}));
|
||||
} else {
|
||||
dbot.say(event.server, banee, dbot.t('nbanned_notify', {
|
||||
'network': network,
|
||||
'banner': banner,
|
||||
'reason': reason,
|
||||
'hours': timeout,
|
||||
'admin_channel': adminChannel
|
||||
}));
|
||||
}
|
||||
|
||||
// Ban the user from all channels
|
||||
|
@ -24,22 +24,24 @@ var kick = function(dbot) {
|
||||
'networkUnban': function(server, unbanee, unbanner, callback) {
|
||||
var channels = dbot.config.servers[server].channels,
|
||||
network = this.config.network_name[server] || server,
|
||||
adminChannel = this.config.admin_channel[server];
|
||||
adminChannel = dbot.config.servers[server].admin_channel;
|
||||
|
||||
if(_.has(this.hosts, server) && _.has(this.hosts[server], unbanee)) {
|
||||
var host = this.hosts[server][unbanee];
|
||||
|
||||
// Notify Staff
|
||||
if(!_.isUndefined(adminChannel)) {
|
||||
var notifyString = dbot.t('nunbanned', {
|
||||
'network': network,
|
||||
'unbanee': unbanee,
|
||||
'unbanner': unbanner
|
||||
});
|
||||
dbot.api.report.notify(server, adminChannel, notifyString);
|
||||
dbot.say(server, adminChannel, notifyString);
|
||||
if(_.isUndefined(adminChannel)) {
|
||||
adminChannel = event.channel.name;
|
||||
}
|
||||
|
||||
var notifyString = dbot.t('nunbanned', {
|
||||
'network': network,
|
||||
'unbanee': unbanee,
|
||||
'unbanner': unbanner
|
||||
});
|
||||
dbot.api.report.notify(server, adminChannel, notifyString);
|
||||
dbot.say(server, adminChannel, notifyString);
|
||||
|
||||
// Notify Unbanee
|
||||
dbot.say(server, unbanee, dbot.t('nunban_notify', {
|
||||
'network': network,
|
||||
|
Loading…
Reference in New Issue
Block a user