greycodee / dingbot

钉钉机器人 go库

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dingbot

钉钉机器人 go库

钉钉官方文档

快速开始

    go get github.com/greycodee/dingbot

示例程序:

package main

import (
	"fmt"
	"github.com/greycodee/dingbot"
	"github.com/greycodee/dingbot/message"
	"time"
)


func main() {
	bot:= dingbot.DingBot{
		Secret:      "你的加签秘钥",
		AccessToken: "你的AccessToken【从钉钉机器人的url上获取】",
	}
	msg := message.Message{
		MsgType: message.TextStr,
		Text:    message.Text_{
			Content: "go-钉钉机器人测试",
		},
	}
	bot.Send(msg)

}

消息支持

  • text类型
  • link类型
  • markdown类型
  • 整体跳转ActionCard类型
  • 独立跳转ActionCard类型
  • FeedCard类型

使用

查看使用文档

About

钉钉机器人 go库

License:MIT License


Languages

Language:Go 100.0%