Ejemplo n.º 1
0
def is_x_up(context):
    server = find_server(context.line['regex_search'].group(1))
    if not server:
        return 'failed to find server'

    if server[0] == 'mumble.nerd.nu':
        context.args = '{0}:{1}'.format(server[0], server[1])
        info = mumble.mumble(context)
        return info

    info = get_info(server[0], server[1])
    if info:
        return '{0} is online with {players}/{max_players} {1} online.'.format(server[0], silly_label(server), **info)
    else:
        return '{0} seems to be down :(.'.format(server[0])
Ejemplo n.º 2
0
def isup(context):
    '''Usage: .isup <MC server address>'''
    server = find_server(context.args)
    if not server:
        match = server_re.match(context.args)
        if not match:
            return
        server = (match.group(1), match.group(2) or 25565, 'players')

    if server[0] == 'mumble.nerd.nu':
        context.args = '{0}:{1}'.format(server[0], server[1])
        info = mumble.mumble(context)
        return info

    info = get_info(server[0], server[1])
    if info:
        return '{0} is online with {players}/{max_players} {1} online.'.format(server[0], silly_label(server), **info)
    else:
        return '{0} seems to be down :(.'.format(server[0])