Exemple #1
0
    def on_pubmsg(self, c, e):
        # Check if this message is prefixed with the bot's username:
        a = e.arguments[0].split(":", 1)
        if (
            len(a) > 1
            and strings.lower(a[0]) == strings.lower(
                self.connection.get_nickname()
            )
        ):
            self.do_command(e, a[1].strip())

        # And, check if the argument was prefixed with a '!'.
        if e.arguments[0][0] == '!':
            self.do_command(e, e.arguments[0][1:].strip())
        return
Exemple #2
0
    def on_pubmsg(self, c, e):
        # Check if this message is prefixed with the bot's username:
        a = e.arguments[0].split(":", 1)
        if (
            len(a) > 1 and
            strings.lower(a[0]) == strings.lower(
                self.connection.get_nickname()
            )
        ):
            self.do_command(e, a[1].strip())

        # And, check if the argument was prefixed with a '!'.
        if e.arguments[0][0] == '!':
            self.do_command(e, e.arguments[0][1:].strip())
        return
Exemple #3
0
 def on_pubmsg(self, c, e):
     # first try to defer the message to the active modules
     for m in self.modules:
         if m.on_pubmsg(c, e):
             return
     
     # default behaviour if no module processes the message.
     if "fidi" in lower(e.arguments[0]):
         log.debug("Failed to understand public message '%s' from user %s",
                   e.arguments[0], e.source.nick)
         c.privmsg(e.target, _("Someone talking about me? Duh!"))
Exemple #4
0
 def on_pubmsg(self, c, e):
     # first try to defer the message to the active modules
     for m in self.modules:
         if m.on_pubmsg(c, e):
             return
     
     # don't do default behaviour for the GitHub bots
     if 'github' in e.source.nick.lower():
         return
     # default behaviour if no module processes the message.
     if self.callsign in lower(e.arguments[0]):
         log.debug("Failed to understand public message '%s' from user %s",
                   e.arguments[0], e.source.nick)
         c.privmsg(e.target, _("Someone talking about me? Duh!"))
Exemple #5
0
 def on_privmsg(self, c, e):
     # split incoming string into "command message"
     command = lower(e.arguments[0].split(" ", 1)[0])
     try:
         msg = e.arguments[0].split(" ", 1)[1]
     except IndexError:
         msg = ""
     
     if command == "pes":
         if msg:
             c.privmsg(self.channel, msg)
         else:
             c.privmsg(e.source.nick, "Ti na pw?")
     else:
         c.privmsg(e.source.nick, "Ti thes na peis %s?" % command)
Exemple #6
0
 def on_privmsg(self, c, e):
     # first try to defer the message to the active modules
     for m in self.modules:
         if m.on_privmsg(c, e):
             return
     
     # default behaviour if no module processes the message.
     command = lower(e.arguments[0].split(" ", 1)[0])
     if self.callsign in command:
         # maybe someone is calling us by name?
         c.privmsg(e.source.nick, _("You don't have to call me by name in private"))
         return
     log.debug("Failed to understand private message '%s' from user %s",
               e.arguments[0], e.source.nick)
     c.privmsg(e.source.nick, _("I don't understand %s") % command)
Exemple #7
0
 def on_privmsg(self, c, e):
     # first try to defer the message to the active modules
     for m in self.modules:
         if m.on_privmsg(c, e):
             return
     
     # default behaviour if no module processes the message.
     command = lower(e.arguments[0].split(" ", 1)[0])
     if "fidi" in command:
         # maybe someone is calling us by name?
         c.privmsg(e.source.nick, _("You don't have to call me by name in private"))
         return
     log.debug("Failed to understand private message '%s' from user %s",
               e.arguments[0], e.source.nick)
     c.privmsg(e.source.nick, _("I don't understand %s") % command)
Exemple #8
0
 def __init__(self, identity=None, password=None, nickserv='NickServ'):
     self.identity = identity
     self.password = password
     self.nickserv = ircstr.lower(nickserv)
Exemple #9
0
 def on_pubmsg(self, c, e):
     string = e.arguments[0]
     string_low = lower(e.arguments[0])
     if "fidi" in string_low:
         answer = " ".join([word for word in string.split() if "fidi" not in lower(word)])
         c.privmsg(e.target, answer)