Gets stats.

    Syntax: {command} <--high|--low|--userhigh|--nick <nick>|command>

def cmd(send, msg, args):
    """Gets stats.

    Syntax: {command} <--high|--low|--userhigh|--nick <nick>|command>

    """
    parser = arguments.ArgParser(args['config'])
    group = parser.add_mutually_exclusive_group()
    group.add_argument('--high', action='store_true')
    group.add_argument('--low', action='store_true')
    group.add_argument('--userhigh', action='store_true')
    group.add_argument('--nick', action=arguments.NickParser)
    group.add_argument('command', nargs='?')
    try:
        cmdargs = parser.parse_args(msg)
    except arguments.ArgumentException as e:
        send(str(e))
        return
    session = args['db']
    totals = get_command_totals(session)
    sortedtotals = sorted(totals, key=totals.get)
    if command_registry.is_registered(cmdargs.command):
        send(get_command(session, cmdargs.command, totals))
    elif cmdargs.command and not command_registry.is_registered(cmdargs.command):
        send("Command %s not found." % cmdargs.command)
    elif cmdargs.high:
        send('Most Used Commands:')
        high = list(reversed(sortedtotals))
        for x in range(3):
            if x < len(high):
                send("%s: %s" % (high[x], totals[high[x]]))
    elif cmdargs.low:
        send('Least Used Commands:')
        low = sortedtotals
        for x in range(3):
            if x < len(low):
                send("%s: %s" % (low[x], totals[low[x]]))
    elif cmdargs.userhigh:
        totals = get_nick_totals(session)
        sortedtotals = sorted(totals, key=totals.get)
        high = list(reversed(sortedtotals))
        send('Most active bot users:')
        for x in range(3):
            if x < len(high):
                send("%s: %s" % (high[x], totals[high[x]]))
    elif cmdargs.nick:
        send(get_nick(session, cmdargs.nick))
    else:
        command = choice(list(totals.keys()))
        send("%s has been used %s times." % (command, totals[command]))