Ejemplo n.º 1
0
def handle_alldel(bot, ievent):
    """ remove a command from the all allowed list. """

    if not ievent.rest:
        ievent.missing('<command>')
        return

    target = aliasget(ievent.rest) or ievent.rest

    if target in bot.state['allowed']:
        bot.state['allowed'].remove(target)
        ievent.reply('%s command is removed from allowed list' % target)
    else:
        ievent.reply('%s command is not in allowed list' % target)
Ejemplo n.º 2
0
def handle_alldel(bot, ievent):

    """ remove a command from the all allowed list. """

    if not ievent.rest:
        ievent.missing('<command>')
        return

    target = aliasget(ievent.rest) or ievent.rest

    if target in bot.state['allowed']:
        bot.state['allowed'].remove(target)
        ievent.reply('%s command is removed from allowed list' % target)
    else:
        ievent.reply('%s command is not in allowed list' % target)
Ejemplo n.º 3
0
def handle_alladd(bot, ievent):
    """ add a command to the allow all list. """

    if not ievent.rest:
        ievent.missing('<command>')
        return

    target = aliasget(ievent.rest) or ievent.rest

    if not 'OPER' in cmnds.perms(target):
        bot.state['allowed'].append(target)
        bot.state.save()
        ievent.reply('%s command is now allowed for all clients' % target)
    else:
        ievent.reply('sorry')
Ejemplo n.º 4
0
def handle_alladd(bot, ievent):

    """ add a command to the allow all list. """

    if not ievent.rest:
        ievent.missing('<command>')
        return

    target = aliasget(ievent.rest) or ievent.rest

    if not 'OPER' in cmnds.perms(target):
        bot.state['allowed'].append(target)
        bot.state.save()
        ievent.reply('%s command is now allowed for all clients' % target)
    else:
        ievent.reply('sorry')
Ejemplo n.º 5
0
def handle_getalias(bot, ievent):

    """ alias-get <word> .. show alias. """

    try:
        what = ievent.args[0]
    except IndexError:
        ievent.missing('<what>')
        return
    # del alias and save

    alias = aliasget(what)

    if not alias:
        ievent.reply('there is no %s alias' % what)
        return

    ievent.reply(alias)