Git Product home page Git Product logo

ding's Introduction

ding

一款非常简单的钉钉群机器人发送通知的Go模块

安装

go get github.com/wanghuiyt/[email protected]

获取机器人参数

钉钉群机器人必须设置为 "加签" 验证 (如何开启钉钉群机器人)

获取 AccessToken 和 Secret 参数, AccessToken 在加签机器人的 Webhook 地址里, 比如获取到的 Webhook 地址为 https://oapi.dingtalk.com/robot/send?access_token=8c03f234ddf2axxxxxxxxxxxx, 那么 AccessToken 应该填写 8c03f234ddf2axxxxxxxxxxxx

img-at

例子

普通群消息

import "github.com/wanghuiyt/ding"

d := ding.Webhook{
    AccessToken: "8c03f234ddf2axxxxxxxxxxxx",
    Secret:      "SECefded9b38b761fxxxxxxxx",
}
err := d.SendMessageText("这是普通的群消息")
...

Done !


使用

import "github.com/wanghuiyt/ding"

普通消息
d := ding.Webhook{
    AccessToken: "8c03f234ddf2axxxxxxxxxxxx",
    Secret:      "SECefded9b38b761fxxxxxxxx",
}
err := d.SendMessageText("这是普通消息")

img-at


@特定人的消息

@对象必须为绑定钉钉的手机号

...
err := d.SendMessageText("Lucy, Harvey, 你们的程序挂了", "18578924567", "+13414567890")

img-at


@所有人的消息
...
err := d.SendMessageText("这是@所有人的消息", "*")
...

i

ding's People

Contributors

huiw188 avatar xthz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ding's Issues

dingding@人告警bug

将dingding@人的手机号设置为变量就提示 "parameter error, "at" parameter must be in "*" or mobile phone number format"
例如at := " + "13188888888" + " + , + " + "13188888888" + "
SendMessageText(content, dingPhoneList)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.