def dispatch(self, msg):
        badcmd = 'bad command, type /help for more info'
        if not msg:
            return
        if msg.startswith('/'):
            args = msg[1:].split()
            try:
                cmd = args.pop(0)
            except IndexError:
                error(badcmd)
                return
            method = getattr(self, 'cmd_' + cmd, None)
            if method:
                try:
                    method(*args)
                except __HOLE__:
                    error(badcmd)
                    return
            else:
                error(badcmd)
        else:
            self.sendmsg(msg)
dataset/ETHPy150Open vlasovskikh/convoread/convoread/console.py/Console.dispatch