3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-24 04:49:25 +01:00

missing usage

This commit is contained in:
reality 2013-06-05 20:12:52 +00:00
commit 5879baeff5
5 changed files with 40 additions and 3 deletions

View File

@ -19,7 +19,7 @@
"en": "Usage for {command}: {usage}.", "en": "Usage for {command}: {usage}.",
"na'vi": "Nga tsun sivar ìlä {command}: {usage}.", "na'vi": "Nga tsun sivar ìlä {command}: {usage}.",
"cy": "Defnydd o {command}: {usage}.", "cy": "Defnydd o {command}: {usage}.",
"nl": "{command} wordt op de volgende manier gebruikt: {usage}.". "nl": "{command} wordt op de volgende manier gebruikt: {usage}.",
"de": "Benutzung von {command}: [usage}." "de": "Benutzung von {command}: [usage}."
}, },
"no_usage_info": { "no_usage_info": {

View File

@ -47,11 +47,18 @@ var commands = function(dbot) {
reason = event.input[2], reason = event.input[2],
channels = dbot.config.servers[server].channels; channels = dbot.config.servers[server].channels;
_.each(channels, function(channel) { var i = 0;
var banChannel = function(channels) {
if(i >= channels.length) return;
var channel = channels[i];
this.api.ban(server, banee, channel); this.api.ban(server, banee, channel);
this.api.kick(server, banee, channel, reason + this.api.kick(server, banee, channel, reason +
' (network-wide ban requested by ' + banner + ')'); ' (network-wide ban requested by ' + banner + ')');
}, this); setTimeout(function() {
i++; banChannel(channels);
}, 1000);
}.bind(this);
banChannel(channels);
var notifyString = dbot.t('nbanned', { var notifyString = dbot.t('nbanned', {
'banner': banner, 'banner': banner,

View File

@ -17,3 +17,7 @@ will be that all of the users which are currently marked as operators in the
reporting channel will receive a PM telling them a user has been reported, by reporting channel will receive a PM telling them a user has been reported, by
whom, in which channel and why. If there is an administrative channel for the whom, in which channel and why. If there is an administrative channel for the
reporting channel (e.g. ##channel), the report will be posted there as well. reporting channel (e.g. ##channel), the report will be posted there as well.
#### ~notify [#channel] [message]
Notify staff of a channel of a message. This can be run in either PM or in the
channel. If notifyVoice is set, voiced users will also receive notifications.

View File

@ -43,9 +43,29 @@ var report = function(dbot) {
} else { } else {
event.reply(dbot.t('not_in_channel', { 'channel': channelName })); event.reply(dbot.t('not_in_channel', { 'channel': channelName }));
} }
},
'~notify': function(event) {
var channelName = event.input[1];
var message = event.input[2];
if(_.has(event.allChannels, channelName)) {
this.api.notify(event.server, channelName, dbot.t('notify', {
'channel': channelName,
'notifier': event.user,
'message': message
}));
event.reply(dbot.t('notified', {
'user': event.user,
'channel': channelName
}));
} else {
event.reply(dbot.t('not_in_channel', { 'channel': channelName }));
}
} }
}; };
commands['~report'].regex = [/^~report ([^ ]+) ([^ ]+) (.+)$/, 4]; commands['~report'].regex = [/^~report ([^ ]+) ([^ ]+) (.+)$/, 4];
commands['~notify'].regex = [/^~notify ([^ ]+) (.+)$/, 3];
this.commands = commands; this.commands = commands;
}; };

View File

@ -26,5 +26,11 @@
"cy": "Dydw i ddim yn bresennol yn {channel}.", "cy": "Dydw i ddim yn bresennol yn {channel}.",
"nl": "Ik ben niet aanwezig in {channel}.", "nl": "Ik ben niet aanwezig in {channel}.",
"de": "Ich bin nicht in {channel} aktiv." "de": "Ich bin nicht in {channel} aktiv."
},
"notify": {
"en": "Attention {channel}: {notifier}: {message}"
},
"notified": {
"en": "{user}: {channel} staff notified."
} }
} }