UNPKG

t-comm

Version:

专业、稳定、纯粹的工具库

79 lines (78 loc) 2.01 kB
/** * 给机器人发送普通消息 * @param {Object} config 配置内容 * @param {string} config.webhookUrl - 钩子链接 * @param {string} config.chatId - 会话id * @param {string} config.alias - 别名 * @param {string} config.content - 内容 * @returns {Promise<object>} Promise * * @example * * sendWxRobotMsg({ * webhookUrl: 'xxx', * chatId: 'xxx', * content: 'xxx', * alias: 'xxx', * }).then(() => { * * }) */ export declare function sendWxRobotMsg({ webhookUrl, chatId, alias, content }: { webhookUrl: string; content: string; chatId?: string; alias?: string | Array<string>; }): Promise<object>; /** * 给机器人发送Markdown消息 * @param {Object} config 配置内容 * @param {string} config.webhookUrl - 钩子链接 * @param {string} config.chatId - 会话id * @param {string} config.content - 内容 * @param {Array<object>} config.attachments - 附加内容 * @returns {Promise<object>} 请求Promise * @example * * sendWxRobotMarkdown({ * webhookUrl: 'xxx', * chatId: 'xxx', * content: 'xxx', * attachments: [] * }).then(() => { * * }) */ export declare function sendWxRobotMarkdown({ webhookUrl, chatId, content, attachments, isV2, }: { webhookUrl: string; content: string; chatId?: string; attachments?: Array<object>; isV2?: boolean; }): Promise<object>; /** * 给机器人发送图片 * @param {Object} config 配置参数 * @param {string} config.webhookUrl 钩子链接 * @param {string} config.chatId 会话id * @param {string} config.content 内容 * @param {string} config.md5Val md5内容 * @returns {Promise<object>} 请求Promise * * @example * * sendWxRobotImg({ * webhookUrl: 'xxx', * chatId: 'xxx', * content: 'xxx', * md5Val: 'xxx' * }).then(() => { * * }) */ export declare function sendWxRobotImg({ webhookUrl, chatId, content, md5Val }: { webhookUrl: string; content: string; md5Val: string; chatId?: string; }): Promise<object>;