check() { if [[ -z "${CORP_ID}" ]]; then echo"Error: missing environment variable CORP_ID" exit 1 fi if [[ -z "${CORP_SECRET}" ]]; then echo"Error: missing environment variable CORP_SECRET" exit 1 fi command -v jq >/dev/null 2>&1 || { echo"Error: jq is not installed" exit 1 } if [ "$#" -eq 0 ]; then echo"Illegal number of parameters.\nUsage: ./notify.sh <message>" exit 1 fi }
main $@
发送复杂消息
接口支持发送文本、图片、语音、视频、文件、文本卡片等,我用 go 写的工具简单封装了这个接口,可以方便的使用,具体查看 Github。