Beispiel #1
0
 def _execute(self, server, commands, **kwargs):
     for command in commands:
         line = command.format(**kwargs)
         if IRCLine.is_human(line):
             line = IRCLine.parse_human(line)
         else:
             line = IRCLine.parse_line(line)
         server.send(line)
Beispiel #2
0
    def raw(self, event):
        if IRCLine.is_human(event["spec"][0]):
            line = IRCLine.parse_human(event["spec"][0])
        else:
            line = IRCLine.parse_line(event["spec"][0])
        line = event["server"].send(line)

        if not line == None:
            event["stdout"].write("Sent: %s" % line.parsed_line.format())
        else:
            event["stderr"].write("Line was filtered")
    def rawctl(self, event):
        rawargs = str(event["data"]).split(" ", 1)
        server = self._server_from_alias(rawargs[0])
        if IRCLine.is_human(rawargs[1]):
            line = IRCLine.parse_human(rawargs[1])
        else:
            line = IRCLine.parse_line(rawargs[1])
        line = server.send(line)

        if not line == None:
            return "Sent: " + line.parsed_line.format()
        else:
            return "Line was filtered"
Beispiel #4
0
    def raw(self, event):
        """
        :help: Send a line of raw IRC data
        :usage: <raw line>
        :permission: raw
        """
        if IRCLine.is_human(event["args"]):
            line = IRCLine.parse_human(event["args"])
        else:
            line = IRCLine.parse_line(event["args"])
        line = event["server"].send(line)

        if not line == None:
            event["stdout"].write("Sent: %s" % line.parsed_line.format())
        else:
            event["stderr"].write("Line was filtered")