dingtalkbot_sdk

package module
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2021 License: MIT Imports: 10 Imported by: 0

README

DingTalk Robot SDK (Go)

Usage

export DINGTALK_TOKEN="change me"
export DINGTALK_SECRET="change me"

Test sending message:

go test ./... -v

Send with this SDK in Go:

bot := sdk.NewDingBot(os.Getenv("DINGTALK_TOKEN"), os.Getenv("DINGTALK_SECRET"))
bot.SendSimpleText("hello world")

LICENSE

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DingBot

type DingBot struct {
	// contains filtered or unexported fields
}

func NewDingBot

func NewDingBot(token, secret string) *DingBot

func (*DingBot) SendMessage

func (bot *DingBot) SendMessage(msg interface{}) error

func (*DingBot) SendSimpleText

func (bot *DingBot) SendSimpleText(text string) error

SendSimpleText to send a plain text

type DingResponse

type DingResponse struct {
	ErrCode int    `json:"errcode"`
	ErrMsg  string `json:"errmsg"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL