'use strict'; var i = require('axios'); function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } var i__default = /*#__PURE__*/_interopDefault(i); var c="https://qyapi.weixin.qq.com/cgi-bin";async function a(t,n){try{if(!t.startsWith(c))throw new Error("\u975E\u6CD5 webhook\u3002\u8BF7\u63D0\u4F9B\u5408\u6CD5\u7684 webhook \u5730\u5740\u3002\u53C2\u8003: https://open.work.weixin.qq.com/help2/pc/14931\u3002");await i__default.default.post(t,n);}catch(o){console.error(o);}}async function p(t){let{url:n,...o}=t;await a(n,{msgtype:"text",text:o});}async function r(t){let{url:n,...o}=t;await a(n,{msgtype:"markdown",markdown:o});}async function d(t){let{url:n,...o}=t;await a(n,{msgtype:"image",image:o});}async function w(t){let{url:n,...o}=t;await a(n,{msgtype:"news",news:o});}async function m(t){let{url:n,...o}=t;await a(n,{msgtype:"file",file:o});}async function O(t){let{url:n,...o}=t;await a(n,{msgtype:"voice",voice:o});}async function y(t){let{url:n,...o}=t,e={msgtype:"template_card",template_card:{card_type:"text_notice",...o}};await a(n,e);}async function x(t){let{url:n,...o}=t,e={msgtype:"template_card",template_card:{card_type:"news_notice",...o}};await a(n,e);} exports.sendFile = m; exports.sendImage = d; exports.sendMarkdown = r; exports.sendNews = w; exports.sendNewsNoticeCard = x; exports.sendText = p; exports.sendTextNoticeCard = y; exports.sendVoice = O;