Example #1
0
def commands(bot, trigger):
    """Ritorna la lista dei comandi supportati"""
    names = ', '.join(sorted(iterkeys(bot.doc)))
    if not trigger.is_privmsg:
        bot.reply("Ti sto mandando tutti i comandi in query")
    bot.msg(trigger.nick, 'Comandi: ' + names + '.', max_messages=10)
    bot.msg(trigger.nick, ("Per aiuto sui singoli comandi, fai '%s: help comando'") % bot.nick)
Example #2
0
def commands(bot, trigger):
    """Return a list of bot's commands"""
    names = ', '.join(sorted(iterkeys(bot.doc)))
    if not trigger.is_privmsg:
        bot.reply("I am sending you a private message of all my commands!")
    bot.msg(trigger.nick, 'Commands I recognise: ' + names + '.', max_messages=10)
    bot.msg(trigger.nick, ("For help, do '%s: help example' where example is the " +
                    "name of the command you want help for.") % bot.nick)
Example #3
0
def commands(bot, trigger):
    """Return a list of bot's commands"""
    names = ', '.join(sorted(iterkeys(bot.doc)))
    if not trigger.is_privmsg:
        bot.reply("I am sending you a private message of all my commands!")
    bot.msg(trigger.nick, 'Commands I recognise: ' + names + '.', max_messages=10)
    bot.msg(trigger.nick, ("For help, do '%s: help example' where example is the " +
                           "name of the command you want help for.") % bot.nick)
Example #4
0
def commands(bot, trigger):
    """Devuelve una lista de comandos"""
    names = ', '.join(sorted(iterkeys(bot.doc)))
    if not trigger.is_privmsg:
        bot.reply("¡Te enviaré un mensaje privado con todos mis comandos!")
    bot.msg(trigger.nick, 'Comandos que actualmente reconozco: ' + names + '.', max_messages=10)
    bot.msg(trigger.nick, ("Para más ayuda, has '%s: help ejemplo' donde ejemplo es el " +
                    "nombre del comando que buscas.") % bot.nick)
Example #5
0
def commands(bot, trigger):
    """Return a list of bot's commands"""
    banned = ['blocks', 'join', 'tell', 'load', 'mangle', 'me', 'mode', 'msg', 'part', 'quit', 'reload', 'save', 'set', 'update']
    list = sorted(iterkeys(bot.doc))
    names = ''
    for name in list:
        if name not in banned:
            names += name + ', '
    bot.say('Commands: ' + names[:-2] + '.')
Example #6
0
def commands(bot, trigger):
    """Return a list of bot's commands"""
    banned = [
        'blocks', 'join', 'tell', 'load', 'mangle', 'me', 'mode', 'msg',
        'part', 'quit', 'reload', 'save', 'set', 'update'
    ]
    list = sorted(iterkeys(bot.doc))
    names = ''
    for name in list:
        if name not in banned:
            names += name + ', '
    bot.say('Commands: ' + names[:-2] + '.')
Example #7
0
def dumpReminders(fn, data, lock):
    lock.acquire()
    try:
        f = open(fn, 'w')
        for tellee in iterkeys(data):
            for remindon in data[tellee]:
                line = '\t'.join((tellee, ) + remindon)
                try:
                    f.write((line + '\n').encode('utf-8'))
                except IOError:
                    break
        try:
            f.close()
        except IOError:
            pass
    finally:
        lock.release()
    return True
Example #8
0
def dumpReminders(fn, data, lock):
    lock.acquire()
    try:
        f = open(fn, 'w')
        for tellee in iterkeys(data):
            for remindon in data[tellee]:
                line = '\t'.join((tellee,) + remindon)
                try:
                    f.write((line + '\n').encode('utf-8'))
                except IOError:
                    break
        try:
            f.close()
        except IOError:
            pass
    finally:
        lock.release()
    return True
Example #9
0
def commands(bot, trigger):
    """Return a list of bot's commands"""
    global admin_only
    names_list = sorted(iterkeys(bot.doc))
    names_list_send = []
    for i in range(len(names_list)): # sketchy as shit
        name = names_list[i]
        if name in admin_only and trigger.admin:
            names_list_send.append("\x0312%s\x03" % name)
        elif name not in admin_only and trigger.admin:
            names_list_send.append("\x0309%s\x03" % name)
        elif name not in admin_only:
            names_list_send.append(name)
    names = ', '.join(names_list_send)
    if not trigger.is_privmsg:
        bot.reply("I am sending you a private message of all my commands!")
    bot.msg(trigger.nick, 'Commands I recognise: ' + names + '.', max_messages=10)
    bot.msg(trigger.nick, ("For help, do '%s: help example' where example is the " +
                    "name of the command you want help for.") % bot.nick)
Example #10
0
def dumpReminders(fn, data, lock):
    lock.acquire()
    try:
        f = open(fn, 'w')
        for tellee in iterkeys(data):
            for remindon in data[tellee]:
                line = '\t'.join((tellee,) + remindon)
                try:
                    to_write = line + '\n'
                    if sys.version_info.major < 3:
                        to_write = to_write.encode('utf-8')
                    f.write(to_write)
                except IOError:
                    break
        try:
            f.close()
        except IOError:
            pass
    finally:
        lock.release()
    return True
Example #11
0
def dumpReminders(fn, data, lock):
    lock.acquire()
    try:
        f = open(fn, 'w')
        for tellee in iterkeys(data):
            for remindon in data[tellee]:
                line = '\t'.join((tellee, ) + remindon)
                try:
                    to_write = line + '\n'
                    if sys.version_info.major < 3:
                        to_write = to_write.encode('utf-8')
                    f.write(to_write)
                except IOError:
                    break
        try:
            f.close()
        except IOError:
            pass
    finally:
        lock.release()
    return True