npm install egg-dingtalk-bot --save
// {app_root}/config/plugin.js
exports.dingtalkRobot = {
enable: true,
package: 'egg-dingtalk-bot',
};
// {app_root}/config/config.default.js
// {app_root}/app/router.js
app.get('/sendText', function* () {
this.body = yield this.app.dingtalkRobot.sendText('测试测试!');
});
app.dingtalkRobot.sendText(text, opts) - send text
app.dingtalkRobot.sendTextAt(text, atMobiles, opts) - send text at mobiles
app.dingtalkRobot.sendTextAtAll(text, opts) - send text at all
app.dingtalkRobot.sendLink(link, opts) - send link
app.dingtalkRobot.sendMarkdown(markdown, opts) - send markdown
app.dingtalkRobot.send(opts) - send raw
Please let us know what we can help, check issues for bug reporting and suggestion.