1.0.6 • Published 5 years ago
bot-notify v1.0.6
bot-notify
机器人消息通知
目前支持:
- 企业微信群机器人
- 飞书自定义机器人
- 钉钉自定义机器人
- Telegram Bot
- Discord Webhook
安装
npm install bot-notify通用配置
{
proxy?:string // http://127.0.0.1:1087
}企业微信群机器人
文档:官方文档
参数
{ token: string; }示例
import { WecomNotify } from 'bot-notify'; const wecomNotify = new WecomNotify({ token: 'xxx' }); await wecomNotify.sendText('Hello World'); // 其他类型消息 sendXXX
飞书自定义机器人
文档 官方文档
参数
{ token: string, secret?: string, }示例
import { LarkNotify } from 'bot-notify'; const larkNotify = new LarkNotify({ token: 'xxx', secret: 'xxx' }); await larkNotify.sendText('Hello World'); // 其他类型消息 sendXXX
钉钉自定义机器人
文档:官方文档
参数
{ token: string, secret?: string, }示例
import { DingNotify } from 'bot-notify'; const dingNotify = new DingNotify({ token: 'xxx', secret: 'xxx' }); await dingNotify.sendText('Hello World'); // 其他类型消息 sendXXX
Telegram Bot
文档:官方文档
参数
{ token: string, chat_id?: string }示例
import { TelegramNotify } from 'bot-notify'; const tgNotify = new TelegramNotify({ token: 'xxx' }); await tgNotify.sendText('Hello World');如何创建
Telegram BotTODO
如果获取
group或channel的chat_idTODO
Discord Webhook
文档:官方文档
参数
{ id: string, // {webhook.id} token: string, // {webhook.token} }示例
import { DiscordNotify } from 'bot-notify'; const disNotify = new DiscordNotify({ id: 'xxx', token: 'xxx' }); await disNotify.sendText('Hello World'); // 其他类型消息 sendXXX删除消息
TODO
编辑消息
TODO
License
MIT License - 0ahz