# shellcheck shell=dash

___x_cmd_qywx_jqu(){
    local IFS=" "
    printf "%s" "$*" | ___x_cmd_cmds_awk '
{
    text = (text == "") ? $0 : (text "\n" $0)
}
END{
    gsub(/\\/, "\\\\", text)
    gsub("\n", "\\n", text)
    gsub("\t", "\\t", text)
    gsub("\"", "\\\"", text)
    printf("\"%s\"", text)
}
'
}

___x_cmd_qywx___get_key_(){
    local webhook="$1"
    [ -n "$webhook" ] || {
        ___x_cmd_qywx_cur webhook:= 2>/dev/null
        [ -n "$webhook" ] || N=qywx M="Please setting up your webhook first ==> 'x qywx --cfg webhook=<your webhook url>'" log:ret:1
    }

    local key="${webhook#*"key="}"
    x_="${key%%&*}"
}
