def robocop(self, message, scantype, pa_id, x, y, z, names): nicks = [] reply = "%s on %s:%s:%s " % ( PA.get(scantype, "name"), x, y, z, ) reply += Config.get("URL", "viewscan") % (pa_id, ) for name in names.split(","): user = User.load(name) for nick in CUT.get_user_nicks(name): nicks.append(nick) message.privmsg(self.url(reply, user), nick) reply = "%s on %s:%s:%s " % ( PA.get(scantype, "name"), x, y, z, ) reply += "delivered to: " reply += ", ".join(nicks) if not Config.getboolean( "Misc", "anonscans") else "Anon" from Hooks.scans.request import request message.privmsg(reply, request().scanchan())
def robocop(self, message, scantype, pa_id, x, y, z, names): nicks = [] [nicks.extend(nick) for nick in [CUT.list_user_nicks(name) for name in names.split(",")]] reply = "%s on %s:%s:%s " % (PA.get(scantype,"name"),x,y,z,) reply+= Config.get("URL","viewscan") % (pa_id,) for nick in nicks: message.privmsg(reply, nick) reply = "%s on %s:%s:%s " % (PA.get(scantype,"name"),x,y,z,) reply+= "delivered to: " reply+= ", ".join(nicks) from Hooks.scans.request import request message.privmsg(reply, request().scanchan())
def robocop(self, message, scantype, pa_id, x, y, z, names, scanner, reqs, old=False): nicks = [] reply = "Old " if old else "" reply += "%s on %s:%s:%s " % ( PA.get(scantype, "name"), x, y, z, ) if ("showscanner" in Config.options("Misc") and Config.getboolean("Misc", "showscanner") and scanner != 'None'): reply += "from %s " % (User.load(id=scanner).name) if User.load( id=scanner) not in (None, 'None') else "" reply += Config.get("URL", "viewscan") % (pa_id, ) if old: reply += " !request cancel %s if this is suitable." % (reqs) for name in names.split(","): user = User.load(name) for nick in CUT.get_user_nicks(name): nicks.append(nick) message.privmsg(self.url(reply, user), nick) if not old: reply = "[-%s] %s on %s:%s:%s " % ( reqs, PA.get(scantype, "name"), x, y, z, ) reply += "delivered to: " reply += ", ".join(nicks) if not Config.getboolean( "Misc", "anonscans") else "Anon" if Config.getboolean("Misc", "showurls"): reply += " (%s)" % (Config.get("URL", "viewscan") % (pa_id, )) from Hooks.scans.request import request message.privmsg(reply, request().scanchan())
def robocop(self, message, scantype, pa_id, x, y, z, names): nicks = [] reply = "%s on %s:%s:%s " % (PA.get(scantype,"name"),x,y,z,) reply+= Config.get("URL","viewscan") % (pa_id,) for name in names.split(","): user = User.load(name) for nick in CUT.get_user_nicks(name): nicks.append(nick) message.privmsg(self.url(reply, user), nick) reply = "%s on %s:%s:%s " % (PA.get(scantype,"name"),x,y,z,) reply+= "delivered to: " reply+= ", ".join(nicks) if not Config.getboolean("Misc", "anonscans") else "Anon" from Hooks.scans.request import request message.privmsg(reply, request().scanchan())
def execute(self, message, user, params): if params.group(1): if not user.is_admin(): message.alert("Insufficient access to send the help to %s." % params.group(1)) return from Hooks.scans.request import request tnick = params.group(1).strip() if not CUT.nick_in_chan(tnick,request().scanchan()): message.alert("%s does not appear to be in the scanner channel. Aborting." % tnick) return if message.reply_type() == NOTICE_REPLY: message.notice(self.helptext, tnick, 2) else: message.privmsg(self.helptext, tnick, 2) elif message.reply_type() == PUBLIC_REPLY and not user.is_admin(): message.alert("Insufficient access to spam the channel. Try another prefix." % params.group(1)) else: message.reply(self.helptext, 2)
def execute(self, message, user, params): if params.group(1): if not user.is_admin(): message.alert("Insufficient access to send the help to %s." % params.group(1)) return from Hooks.scans.request import request tnick = params.group(1).strip() if not CUT.nick_in_chan(tnick, request().scanchan()): message.alert( "%s does not appear to be in the scanner channel. Aborting." % tnick) return if message.reply_type() == NOTICE_REPLY: message.notice(self.helptext, tnick, 2) else: message.privmsg(self.helptext, tnick, 2) elif message.reply_type() == PUBLIC_REPLY and not user.is_admin(): message.alert( "Insufficient access to spam the channel. Try another prefix." % params.group(1)) else: message.reply(self.helptext, 2)
def robocop(self, message, scantype, pa_id, x, y, z, names, scanner, reqs, old=False): nicks = [] reply = "Old " if old else "" reply += "%s on %s:%s:%s " % (PA.get(scantype,"name"),x,y,z,) if ("showscanner" in Config.options("Misc") and Config.getboolean("Misc", "showscanner") and scanner != 'None'): reply+= "from %s " % (User.load(id=scanner).name) if User.load(id=scanner) not in (None, 'None') else "" reply += Config.get("URL","viewscan") % (pa_id,) if old: reply += " !request cancel %s if this is suitable." % (reqs) for name in names.split(","): user = User.load(name) for nick in CUT.get_user_nicks(name): nicks.append(nick) message.privmsg(self.url(reply, user), nick) if not old: reply = "[-%s] %s on %s:%s:%s " % (reqs,PA.get(scantype,"name"),x,y,z,) reply+= "delivered to: " reply+= ", ".join(nicks) if not Config.getboolean("Misc", "anonscans") else "Anon" if Config.getboolean("Misc", "showurls"): reply += " (%s)" % (Config.get("URL","viewscan") % (pa_id,)) from Hooks.scans.request import request message.privmsg(reply, request().scanchan())