Translate something.

    Syntax: {command} [--from <language code>] [--to <language code>] <text>
    See https://cloud.google.com/translate/v2/translate-reference#supported_languages for a list of valid language codes

def cmd(send, msg, args):
    """Translate something.

    Syntax: {command} [--from <language code>] [--to <language code>] <text>
    See https://cloud.google.com/translate/v2/translate-reference#supported_languages for a list of valid language codes

    """
    parser = arguments.ArgParser(args['config'])
    parser.add_argument('--lang', '--from', default=None)
    parser.add_argument('--to', default='en')
    parser.add_argument('msg', nargs='+')
    try:
        cmdargs = parser.parse_args(msg)
    except arguments.ArgumentException as e:
        send(str(e))
        return
    send(gen_translate(' '.join(cmdargs.msg), cmdargs.lang, cmdargs.to))