- if(m.address?)\r
- case m.message\r
- when (/^join\s+(\S+)\s+(\S+)$/i)\r
- @bot.join $1, $2 if(@bot.auth.allow?("join", m.source, m.replyto))\r
- when (/^join\s+(\S+)$/i)\r
- @bot.join $1 if(@bot.auth.allow?("join", m.source, m.replyto))\r
- when (/^part$/i)\r
- @bot.part m.target if(m.public? && @bot.auth.allow?("join", m.source, m.replyto))\r
- when (/^part\s+(\S+)$/i)\r
- @bot.part $1 if(@bot.auth.allow?("join", m.source, m.replyto))\r
- when (/^quit(?:\s+(.*))?$/i)\r
- @bot.quit $1 if(@bot.auth.allow?("quit", m.source, m.replyto))\r
- when (/^restart(?:\s+(.*))?$/i)\r
- @bot.restart $1 if(@bot.auth.allow?("quit", m.source, m.replyto))\r
- when (/^hide$/i)\r
- @bot.join 0 if(@bot.auth.allow?("join", m.source, m.replyto))\r
- when (/^save$/i)\r
- if(@bot.auth.allow?("config", m.source, m.replyto))\r
- @bot.save\r
- m.okay\r
- end\r
- when (/^nick\s+(\S+)$/i)\r
- @bot.nickchg($1) if(@bot.auth.allow?("nick", m.source, m.replyto))\r
- when (/^say\s+(\S+)\s+(.*)$/i)\r
- @bot.say $1, $2 if(@bot.auth.allow?("say", m.source, m.replyto))\r
- when (/^action\s+(\S+)\s+(.*)$/i)\r
- @bot.action $1, $2 if(@bot.auth.allow?("say", m.source, m.replyto))\r
- # when (/^topic\s+(\S+)\s+(.*)$/i)\r
- # topic $1, $2 if(@bot.auth.allow?("topic", m.source, m.replyto))\r
- when (/^mode\s+(\S+)\s+(\S+)\s+(.*)$/i)\r
- @bot.mode $1, $2, $3 if(@bot.auth.allow?("mode", m.source, m.replyto))\r
- when (/^ping$/i)\r
- @bot.say m.replyto, "pong"\r
- when (/^rescan$/i)\r
- if(@bot.auth.allow?("config", m.source, m.replyto))\r
- m.reply "saving ..."\r
- @bot.save\r
- m.reply "rescanning ..."\r
- @bot.rescan\r
- m.reply "done. #{@plugins.status(true)}"\r
- end\r
- when (/^quiet$/i)\r
- if(@bot.auth.allow?("talk", m.source, m.replyto))\r
- m.okay\r
- @bot.set_quiet\r
- end\r
- when (/^quiet in (\S+)$/i)\r
- where = $1\r
- if(@bot.auth.allow?("talk", m.source, m.replyto))\r
- m.okay\r
- where.gsub!(/^here$/, m.target) if m.public?\r
- @bot.set_quiet(where)\r
- end\r
- when (/^talk$/i)\r
- if(@bot.auth.allow?("talk", m.source, m.replyto))\r
- @bot.reset_quiet\r
- m.okay\r
- end\r
- when (/^talk in (\S+)$/i)\r
- where = $1\r
- if(@bot.auth.allow?("talk", m.source, m.replyto))\r
- where.gsub!(/^here$/, m.target) if m.public?\r
- @bot.reset_quiet(where)\r
- m.okay\r
- end\r
- when (/^status\??$/i)\r
- m.reply status if @bot.auth.allow?("status", m.source, m.replyto)\r
- when (/^registry stats$/i)\r
- if @bot.auth.allow?("config", m.source, m.replyto)\r
- m.reply @registry.stat.inspect\r
- end\r
- when (/^(help\s+)?config(\s+|$)/)\r
- @config.privmsg(m)\r
- when (/^(version)|(introduce yourself)$/i)\r
- @bot.say m.replyto, "I'm a v. #{$version} rubybot, (c) Tom Gilbert - http://linuxbrit.co.uk/rbot/"\r
- when (/^help(?:\s+(.*))?$/i)\r
- @bot.say m.replyto, help($1)\r
- #TODO move these to a "chatback" plugin\r
- when (/^(botsnack|ciggie)$/i)\r
- @bot.say m.replyto, @lang.get("thanks_X") % m.sourcenick if(m.public?)\r
- @bot.say m.replyto, @lang.get("thanks") if(m.private?)\r
- when (/^(hello|howdy|hola|salut|bonjour|sup|niihau|hey|hi(\W|$)|yo(\W|$)).*/i)\r
- @bot.say m.replyto, @lang.get("hello_X") % m.sourcenick if(m.public?)\r
- @bot.say m.replyto, @lang.get("hello") if(m.private?)\r
- end\r