Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

0ahz/bot-notify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 Bot

    TODO

  • 如果获取 groupchannelchat_id

    TODO

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

About

机器人消息通知

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published