Example #1
0
    def handle_msg(self, msgtype, c, e):
        """Handles all messages.

        | If a exception is thrown, catch it and display a nice traceback instead of crashing.
        | If we receive a !reload command, do the reloading magic.
        | Call the appropriate handler method for processing.
        """
        if e.target[0] == '#' or e.target[0] == '@' or e.target[0] == '+':
            target = e.target
        else:
            target = e.source.nick
        try:
            if msgtype != 'mode' and msgtype != 'nick' and msgtype != 'join':
                self.check_reload(target, c, e, msgtype)
            self.handler.handle_msg(msgtype, c, e)
        except Exception as ex:
            traceback.handle_traceback(ex, c, target, self.config)
Example #2
0
    def handle_msg(self, msgtype, c, e):
        """Handles all messages.

        | If a exception is thrown, catch it and display a nice traceback instead of crashing.
        | If we receive a !reload command, do the reloading magic.
        | Call the appropriate handler method for processing.
        """
        if e.target[0] == '#' or e.target[0] == '@' or e.target[0] == '+':
            target = e.target
        else:
            target = e.source.nick
        try:
            if msgtype != 'mode' and msgtype != 'nick' and msgtype != 'join':
                self.check_reload(target, c, e, msgtype)
            self.handler.handle_msg(msgtype, c, e)
        except Exception as ex:
            traceback.handle_traceback(ex, c, target, self.config)
Example #3
0
 def wrapper(send, msg, args):
     try:
         func(send, msg, args)
     except Exception as ex:
         handle_traceback(ex, self.handler.connection, self.target, self.handler.config['core']['ctrlchan'], "commands.%s" % self.names[0])
Example #4
0
 def wrapper(send, msg, msgtype, args):
     if msgtype in self.types:
         try:
             func(send, msg, args)
         except Exception as ex:
             handle_traceback(ex, self.handler.connection, self.target, self.handler.config['core']['ctrlchan'], func.__module__)