예제 #1
0
파일: moderation.py 프로젝트: kamaal44/Code
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
파일: admin.py 프로젝트: HeyMan7/Code
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
파일: admin.py 프로젝트: HeyMan7/Code
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
파일: moderation.py 프로젝트: HeyMan7/Code
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])