All Projects → ineo6 → hubot-dingtalk

ineo6 / hubot-dingtalk

Licence: other
hubot-dingtalk:支持钉钉Outgoing

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to hubot-dingtalk

Botframework Hubot
Hubot adapter for botframework
Stars: ✭ 91 (+213.79%)
Mutual labels:  hubot, adapter
dingtalk
DingTalk(dingding) 是钉钉机器人的 go 实现。支持 Docker、Jenkinsfile、命令行模式,module 模式,加签安全设置,支持链式语法创建消息,支持文本、链接、Markdown、ActionCard、FeedCard消息类型; DingTalk (dingding) is the go implementation of the DingTalk robot. Support Docker, Jenkinsfile, command line mode, module mode, signature security settings, chain syntax to create messages, support text, link, markd…
Stars: ✭ 187 (+544.83%)
Mutual labels:  dingtalk, dingtalk-robot
laravel-help-plugin
Laravel综合辅助工具包. 消息通知、获取国家列表 支持钉钉机器人 企业微信机器人 微信模板消息/广播驱动及消息通知 、Openexchangerates 汇率实时获取,自定义汇率获取、国家列表、汉语拼音转换威妥玛式拼音
Stars: ✭ 55 (+89.66%)
Mutual labels:  dingtalk, dingtalk-robot
hubot-markov
Hubot watches all, and builds a markov model from everything you say.
Stars: ✭ 63 (+117.24%)
Mutual labels:  hubot
dingtalk
go版本的钉钉开发api
Stars: ✭ 71 (+144.83%)
Mutual labels:  dingtalk
hubot-suggest
Suggest hubot commands when not found
Stars: ✭ 29 (+0%)
Mutual labels:  hubot
deepin.com.dingtalk.com
This is a Unofficial deepin-wine container for Dingtalk | 这是个非官方钉钉容器
Stars: ✭ 39 (+34.48%)
Mutual labels:  dingtalk
vscode-server-connector
📦 Connects Visual Studio Code to your server adapters and run, deploy apps !!
Stars: ✭ 41 (+41.38%)
Mutual labels:  adapter
hubot-messenger-bot
🔌 A Hubot adapter for Facebook Messenger Platform (Bots) with zero external dependencies.
Stars: ✭ 44 (+51.72%)
Mutual labels:  hubot
laravel-casbin
This repository has moved to https://github.com/php-casbin/laravel-authz
Stars: ✭ 42 (+44.83%)
Mutual labels:  adapter
RvAdapter
万能Adapter for RecyclerView.
Stars: ✭ 34 (+17.24%)
Mutual labels:  adapter
ioBroker.vis-inventwo
Individualisierbare VIS Widgets für den ioBroker
Stars: ✭ 38 (+31.03%)
Mutual labels:  adapter
hubot-ansible
A hubot script for launching ansible commands
Stars: ✭ 14 (-51.72%)
Mutual labels:  hubot
blackmagic-espidf
Blackmagic Wireless SWD Debug probe hosted on esp-idf SDK (for ESP8266) with UART on Telnet port and HTTP using xterm.js
Stars: ✭ 165 (+468.97%)
Mutual labels:  adapter
Swiperoo
An extendable adapter which provides swipe-to-delete feature on your customized row item
Stars: ✭ 38 (+31.03%)
Mutual labels:  adapter
sqlx-adapter
Asynchronous casbin adapter for mysql, postgres, sqlite based on sqlx-rs
Stars: ✭ 27 (-6.9%)
Mutual labels:  adapter
GenericAdapter
⛳️ Easy to use android databinding ready recyclerview adapter
Stars: ✭ 26 (-10.34%)
Mutual labels:  adapter
hubot-typescript-boilerplate
ChatOps made easier
Stars: ✭ 20 (-31.03%)
Mutual labels:  hubot
ioBroker.homepilot20
Rademacher Homepilot 2.0 (version >= 5.0.39)
Stars: ✭ 19 (-34.48%)
Mutual labels:  adapter
golang-zabbix-alter-to-dingding
zabbix报警到钉钉
Stars: ✭ 59 (+103.45%)
Mutual labels:  dingtalk

hubot-dingtalk

Hubotdingtalk适配器,让钉钉机器人无缝接入hubot

注意: 需要先配置好hubot

目前支持:

  • 企业内部机器人(签名sign方式)
  • 自定义机器人(token匹配方式)

环境变量:

  • HUBOT_DINGTALK_AUTH_TYPE (认证类型:token,sign)
  • HUBOT_DINGTALK_TOKEN (认证类型为token时)
  • HUBOT_DINGTALK_SECRET (认证类型为sign时)
  • HUBOT_DINGTALK_MODE (会话类型,1:全部,2:单聊,3:群聊)
  • HUBOT_DINGTALK_BLACKLIST (会话黑名单,格式为cidyyyy==,cidxxxx=,优先极高)
  • HUBOT_DINGTALK_WHITELIST (会话白名单,格式为cidyyyy==,cidxxxx=)

Adapter 配置

添加自定义机器人

打开钉钉添加机器人页面,在底部找到POST 地址Token(需要开通Outgoing权限)

POST 地址

Adapter在启动之后会创建回调/hubot/dingtalk/message/用于接收消息。

POST 地址填入域名/hubot/dingtalk/message/

添加企业内部机器人

登录钉钉开发平台创建。

权限认证

1.token比较

配置环境变量:

  • HUBOT_DINGTALK_AUTH_TYPE=token
  • HUBOT_DINGTALK_TOKEN

HUBOT_DINGTALK_TOKEN对应钉钉自定义机器人outgoing回调token,用于校验POST 地址接收请求的有效性。

2.sign签名

配置环境变量:

  • HUBOT_DINGTALK_AUTH_TYPE=sign
  • HUBOT_DINGTALK_SECRET

HUBOT_DINGTALK_SECRET在企业机器人配置appSecret一栏。

会话控制

目前支持基础的会话控制,包含会话类型(单聊、群聊),会话黑白名单(基于conversationId

  • HUBOT_DINGTALK_MODE=1
  • HUBOT_DINGTALK_BLACKLIST=cidyyyy==,cidxxxx=
  • HUBOT_DINGTALK_WHITELIST=cidyyyy==,cidxxxx=

会优先使用黑名单,关于要使用哪种方式可以自由选取。

该方案目前是简单实现,conversationId的获取还没想到比较好的方式,因为时间问题,临时获取方式是在控制台中输出。

配置Webhook主动发送

在机器人目录conf目录(没有请创建),添加dingtalk-room.json文件。

同一个机器人在不同群的access_token是不一样的,所以要主动发送消息到群是要指定access_token

这里通过维护别名的方式来实现发送到指定群,room是自定义的名称,可以设置成群聊名称一样,envaccess_token的环境变量名称。

[
  {
    "room": "room1",
    "env": "HUBOT_DINGTALK_ACCESS_TOKEN"
  },
  {
    "room": "room2",
    "env": "HUBOT_DINGTALK_ACCESS_TOKEN2"
  }
]

如何发送?

调用robot.messageRoom时,传入你想要发送的群聊别名即可。

module.exports = (robot) ->
  robot.hear "dingtalk", (params) ->
    robot.messageRoom 'room1', "response"

这段代码使用了coffeescript,所以建立的文件扩展名必须是.coffee,当然你也可以转换为js语法,然后放到.js的文件里。

Todo

  • 接入主动发消息webhook
  • 优化消息显示

反馈

Github Issue 钉钉群
issues

如果喜欢的话

如果喜欢的话,欢迎请我喝一杯咖啡。star,follow也是对我工作的肯定和鼓励。

wechat-like

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].