Пример #1
0
def unban(code, input):
    """ unban <user> - Unbans a user from the current channel. """
    banmask = matchmask(input.group(2))
    if not banmask:
        return code.say(
            'Invalid banmask! For more info, see: https://github.com/lrstanley/Code/wiki/Masks'
        )
    return code.write(['MODE', input.sender, '-b', banmask])
Пример #2
0
def unignore(code, input):
    """ unignore <mask> - Removes <mask> from ignore list. """
    mask = matchmask(input.group(2))
    if not mask:
        return code.say('Invalid mask! For more info, see: https://github.com/Liamraystanley/Code/wiki/Masks')
    blocks = database.get(code.nick, 'ignore', [])
    if mask not in blocks:
        return code.say('%s doesn\'t exist in the ignore list!' % mask)
    del blocks[blocks.index(mask)]
    code.blocks = blocks
    code.blocks = [convertmask(x) for x in blocks]
    database.set(code.nick, blocks, 'ignore')
    return code.say('Successfully removed %s from the ignore list.' % mask)
Пример #3
0
def ignore(code, input):
    """ ignore <mask> - Makes code ignore anyone matching <mask> """
    mask = matchmask(input.group(2))
    if not mask:
        return code.say('Invalid mask! For more info, see: https://github.com/Liamraystanley/Code/wiki/Masks')
    blocks = database.get(code.nick, 'ignore', [])
    if mask not in blocks:
        blocks.append(mask)
    else:
        return code.say('%s is already in the ignorelist!' % mask)
    code.blocks = blocks
    code.re_blocks = [convertmask(x) for x in blocks]
    database.set(code.nick, blocks, 'ignore')
    return code.say('Successfully added %s to the ignore list.' % mask)
Пример #4
0
def unignore(code, input):
    """ unignore <mask> - Removes <mask> from ignore list. """
    mask = matchmask(input.group(2))
    if not mask:
        return code.say(
            'Invalid mask! For more info, see: https://github.com/lrstanley/Code/wiki/Masks'
        )
    blocks = database.get(code.nick, 'ignore', [])
    if mask not in blocks:
        return code.say('%s doesn\'t exist in the ignore list!' % mask)
    del blocks[blocks.index(mask)]
    code.blocks = blocks
    code.blocks = [convertmask(x) for x in blocks]
    database.set(code.nick, blocks, 'ignore')
    return code.say('Successfully removed %s from the ignore list.' % mask)
Пример #5
0
def ignore(code, input):
    """ ignore <mask> - Makes code ignore anyone matching <mask> """
    mask = matchmask(input.group(2))
    if not mask:
        return code.say(
            'Invalid mask! For more info, see: https://github.com/lrstanley/Code/wiki/Masks'
        )
    blocks = database.get(code.nick, 'ignore', [])
    if mask not in blocks:
        blocks.append(mask)
    else:
        return code.say('%s is already in the ignorelist!' % mask)
    code.blocks = blocks
    code.re_blocks = [convertmask(x) for x in blocks]
    database.set(code.nick, blocks, 'ignore')
    return code.say('Successfully added %s to the ignore list.' % mask)
Пример #6
0
def unban(code, input):
    """ unban <user> - Unbans a user from the current channel. """
    banmask = matchmask(input.group(2))
    if not banmask:
        return code.say('Invalid banmask! For more info, see: https://github.com/Liamraystanley/Code/wiki/Masks')
    return code.write(['MODE', input.sender, '-b', banmask])