Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #7
0
def service(nickname, info, distribution='*', type=0, reserved='*'):
    """
    
    """
    
    return utils.format(constants.SERVICE, nickname, reserved, distribution,
                        type, reserved, info, spaced=True)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #11
0
def namesx():
    
    return utils.format(constants.NAMESX)
Beispiel #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)
Beispiel #13
0
def help():
    
    return utils.format(constants.HELP)
Beispiel #14
0
def away(message=None):
    
    if message is None:
        return utils.format(constants.AWAY)
    
    return utils.format(constants.AWAY, message, spaced=True)
Beispiel #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)
Beispiel #16
0
def userip(nickname):
    
    return utils.format(constants.USERIP, nickname)
Beispiel #17
0
def wallops(message):
    
    return utils.format(constants.WALLOPS, message, spaced=True)
Beispiel #18
0
def users(target=None):
    
    if target is None:
        return utils.format(constants.USERS)
        
    return utils.format(constants.USERS, target)
Beispiel #19
0
def restart():
    
    return utils.format(constants.RESTART)
Beispiel #20
0
def die():
    
    return utils.format(constants.DIE)
Beispiel #21
0
def rehash():
    
    return utils.format(constants.REHASH)
Beispiel #22
0
def rules():
    
    return utils.format(constants.RULES)
Beispiel #23
0
def setname(realname):
    
    return utils.format(constants.SETNAME, realname, spaced=True)
Beispiel #24
0
def ison(nickname, *nicknames):
    
    nicknames = nickname, *nicknames
    nicknames = ' '.join(nicknames)
    
    return utils.format(constants.ISON, nicknames)
Beispiel #25
0
def uhnames():
    
    return utils.format(constants.UHNAMES)
Beispiel #26
0
def cnotice(nickname, channel, message):
    
    return utils.format(constants.CNOTICE, nickname, channel, message, spaced=True)
Beispiel #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)
Beispiel #28
0
def cprivmsg(nickname, channel, message):
    
    return utils.format(constants.CPRIVMSG, nickname, channel, message, spaced=True)
Beispiel #29
0
def userhost(nickname, *nicknames):
    
    nicknames = nickname, *nicknames
    nicknames = ' '.join(nicknames)
    
    return utils.format(constants.USERHOST, nicknames)
Beispiel #30
0
def error(message):
    
    return utils.format(constants.ERROR, message, spaced=True)