Exemplo n.º 1
0
def whois(mask, *masks, target=None):
    masks = mask, *masks
    masks = ','.join(masks)
    
    if target is None:
        return utils.format(constants.WHOIS, masks)
    
    return utils.format(constants.WHOIS, target, masks)
Exemplo n.º 2
0
def kick(channel, nickname, *nicknames, message=None):
    
    nicknames = nickname, *nicknames
    nicknames = ','.join(nicknames)
    
    if message is None:
        return utils.format(constants.KICK, channel, nicknames)
    
    return utils.format(constants.KICK, channel, nicknames, message, spaced=True)
Exemplo n.º 3
0
def list(channel, *channels, target=None):
    
    channels = channel, *channels
    channels = ','.join(channels)
    
    if target is None:
        return utils.format(constants.LIST, channels)
    
    return utils.format(constants.LIST, channels, target)
Exemplo n.º 4
0
def names(channel, *channels, target=None):
    
    channels = channel, *channels
    channels = ','.join(channels)
    
    if target is None:
        return utils.format(constants.NAMES, channels)
    
    return utils.format(constants.NAMES, channels, target)
Exemplo n.º 5
0
def part(channel, *channels, message=None):
    
    channels = channel, *channels
    channels = ','.join(channels)
    
    if message is None:
        return utils.format(constants.PART, channels)
    
    return utils.format(constants.PART, channels, message, spaced=True)
Exemplo n.º 6
0
def join(channel, *channels, keys=None):
    channels = channel, *channels
    
    if keys is None:
        channels = ','.join(channels)        
        return utils.format(constants.JOIN, channels)
    
    channels, keys = zip(*itertools.zip_longest(channels, keys, fillvalue=''))
    
    channels = ','.join(channels)
    keys = ','.join(keys)
    
    return utils.format(constants.JOIN, channels, keys)
Exemplo n.º 7
0
def service(nickname, info, distribution='*', type=0, reserved='*'):
    """
    
    """
    
    return utils.format(constants.SERVICE, nickname, reserved, distribution,
                        type, reserved, info, spaced=True)
Exemplo n.º 8
0
def unsilence(nickname, *nicknames):
    # only removes nicknames to ignore list, see silence to add
    nicknames = nickname, *nicknames
    formatted = ['-{}'.format(nick) for nick in nicknames]
    
    
    return utils.format(constants.SILENCE, *formatted)
Exemplo n.º 9
0
def summon(user, target=None, channel=None):
    
    args = [constants.SUMMON, user]
    
    if target is not None:
        args.append(target)
        
    if channel is not None:
        args.append(channel)
        
    return utils.format(*args)
Exemplo n.º 10
0
def whowas(nickname, *nicknames, count=None, target=None):
    nicknames = nickname, *nicknames
    nicknames = ','.join(nicknames)
    
    args = [constants.WHOWAS, nicknames]
    
    if count is not None:
        args.append(count)
        
    if target is not None:
        args.append(target)
        
    return utils.format(*args)
Exemplo n.º 11
0
def namesx():
    
    return utils.format(constants.NAMESX)
Exemplo n.º 12
0
def knock(channel, message=None):
    
    if message is None:
        return utils.format(constants.KNOCK, channel)
    
    return utils.format(constants.KNOCK, channel, message, spaced=True)
Exemplo n.º 13
0
def help():
    
    return utils.format(constants.HELP)
Exemplo n.º 14
0
def away(message=None):
    
    if message is None:
        return utils.format(constants.AWAY)
    
    return utils.format(constants.AWAY, message, spaced=True)
Exemplo n.º 15
0
def unwatch(nickname, *nicknames):
    # only removes nicknames to watch list, see watch to add
    nicknames = nickname, *nicknames
    formatted = ['-{}'.format(nick) for nick in nicknames]
    
    return utils.format(constants.WATCH, *formatted)
Exemplo n.º 16
0
def userip(nickname):
    
    return utils.format(constants.USERIP, nickname)
Exemplo n.º 17
0
def wallops(message):
    
    return utils.format(constants.WALLOPS, message, spaced=True)
Exemplo n.º 18
0
def users(target=None):
    
    if target is None:
        return utils.format(constants.USERS)
        
    return utils.format(constants.USERS, target)
Exemplo n.º 19
0
def restart():
    
    return utils.format(constants.RESTART)
Exemplo n.º 20
0
def die():
    
    return utils.format(constants.DIE)
Exemplo n.º 21
0
def rehash():
    
    return utils.format(constants.REHASH)
Exemplo n.º 22
0
def rules():
    
    return utils.format(constants.RULES)
Exemplo n.º 23
0
def setname(realname):
    
    return utils.format(constants.SETNAME, realname, spaced=True)
Exemplo n.º 24
0
def ison(nickname, *nicknames):
    
    nicknames = nickname, *nicknames
    nicknames = ' '.join(nicknames)
    
    return utils.format(constants.ISON, nicknames)
Exemplo n.º 25
0
def uhnames():
    
    return utils.format(constants.UHNAMES)
Exemplo n.º 26
0
def cnotice(nickname, channel, message):
    
    return utils.format(constants.CNOTICE, nickname, channel, message, spaced=True)
Exemplo n.º 27
0
def watch(nickname, *nicknames):
    # only adds nicknames to watch list, see unwatch to remove
    nicknames = nickname, *nicknames
    formatted = ['+{}'.format(nick) for nick in nicknames]
    
    return utils.format(constants.WATCH, *formatted)
Exemplo n.º 28
0
def cprivmsg(nickname, channel, message):
    
    return utils.format(constants.CPRIVMSG, nickname, channel, message, spaced=True)
Exemplo n.º 29
0
def userhost(nickname, *nicknames):
    
    nicknames = nickname, *nicknames
    nicknames = ' '.join(nicknames)
    
    return utils.format(constants.USERHOST, nicknames)
Exemplo n.º 30
0
def error(message):
    
    return utils.format(constants.ERROR, message, spaced=True)