From 09947921d17e44b89f561924662343fbfdebbe1c Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Tue, 27 Nov 2012 23:24:32 +0000 Subject: [PATCH] Added a report module for naughty users --- modules/report.js | 55 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 modules/report.js diff --git a/modules/report.js b/modules/report.js new file mode 100644 index 0000000..063865b --- /dev/null +++ b/modules/report.js @@ -0,0 +1,55 @@ +var report = function(dbot) { + var commands = { + '~report': function(event) { + var channelName = event.input[1]; + var nick = event.input[2]; + var reason = event.input[3]; + + if(dbot.instance.connections[event.server].channels.hasOwnProperty(channelName)) { + var channel = dbot.instance.connections[event.server].channels[channelName]; + if(channel.nicks.hasOwnProperty(nick)) { + var ops = []; + for(var possibOps in channel.nicks) { + if(channel.nicks[possibOps].op == true) { + ops.push(possibOps); + } + } + + for(var i=0;i