3 "add" => "handle_addop",
5 "list" => "handle_listop"
8 def help(plugin, topic="")
9 "perform autoop based on hostmask - usage: addop <hostmask>, rmop <hostmask>, listop"
14 @registry.each { |mask,channels|
15 if(Irc.netmaskmatch(mask, m.source) && channels.include?(m.channel))
16 @bot.mode(m.channel, "+o", m.sourcenick)
24 if (!m.params || m.params == "list")
26 elsif (m.params =~ /^add\s+(.+)$/)
28 elsif (m.params =~ /^rm\s+(.+)$/)
32 m.reply "private message only please!"
36 def handle_addop(m, params)
37 ma = /^(.+?)(\s+(.+))?$/.match(params)
38 channels = ma[2] ? ma[2] : @bot.config['irc.join_channels']
40 @registry[ma[1]] = channels
43 m.reply @bot.lang.get('dunno')
47 def handle_rmop(m, params)
48 if(!@registry.delete(params))
49 m.reply @bot.lang.get('dunno')
57 @registry.each { |mask,channels|
58 m.reply "#{mask} in #{channels.join(', ')}"
67 plugin.register("autoop")