https://github.com/eldersjavas/esdingtalkbot_go
Using DingTalk GroupBot with one line
https://github.com/eldersjavas/esdingtalkbot_go
bot go golang
Last synced: over 1 year ago
JSON representation
Using DingTalk GroupBot with one line
- Host: GitHub
- URL: https://github.com/eldersjavas/esdingtalkbot_go
- Owner: EldersJavas
- License: apache-2.0
- Created: 2021-09-20T01:10:35.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-07-11T12:48:26.000Z (almost 4 years ago)
- Last Synced: 2025-01-27T08:43:11.659Z (over 1 year ago)
- Topics: bot, go, golang
- Language: Go
- Homepage:
- Size: 22.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# EsDingTalkBot_Go

[](https://pkg.go.dev/github.com/EldersJavas/EsDingTalkBot_Go)
[](https://github.com/EldersJavas/EsDingTalkBot_Go/blob/main/LICENSE)
[](https://github.com/EldersJavas/EsDingTalkBot_Go/stargazers)

Using DingTalk GroupBot with one line
So easy!
DingTalk Doc:https://developers.dingtalk.com/document/robots/custom-robot-access
# Use
## Text

```go
//func Text(token string, content string, AtMobiles []string, AtUserIds []string, IsAtAll bool) error
dingbot.Text("123","hello",[]string{},[]string{},false)
```
## Link

```go
//func Link(token string, content string, Title string, PicUrl string, MessageUrl string) error
dingbot.Link("123","Hello World!","Hello","https://github.com/fluidicon.png","https://github.com/EldersJavas/EsDingTalkBot_Go")
```
## MarkDown

```go
//func MD(token string, title string, content string, AtMobiles []string, AtUserIds []string, IsAtAll bool) error
dingbot.MD("123","# Hello",[]string{},[]string{},false)
```
## AActionCard

```go
//func AActionCard(token string, Title string, content string, BtnOrientation string, SingleTitle string, SingleURL string) error
dingbot.AActionCard("123","hello","Hello World!","1","EsDingTalkBot_Go","https://github.com/EldersJavas/EsDingTalkBot_Go")
```
## DActionCard

```go
/*
func DActionCard(token, Title, content, BtnOrientation string, Btns []struct {
Title string `json:"title"`
ActionURL string `json:"actionURL"`
}) error
*/
var Btn []struct {
Title string `json:"title"`
ActionURL string `json:"actionURL"`}
var Add struct{
Title string `json:"title"`
ActionURL string `json:"actionURL"`}
Add.Title="EsDingTalkBot_Go"
Add.ActionURL="https://github.com/EldersJavas/EsDingTalkBot_Go"
Btn = append(Btn, Add)
err := dingbot.DActionCard("123", "hello", "", "1", Btn)
```
## FeedCard

```go
/*
func func FeedCard(token string, Links []struct {
Title string `json:"title"`
MessageURL string `json:"messageURL"`
PicURL string `json:"picURL"`
}) error
*/
var Links []struct{
Title string `json:"title"`
MessageURL string `json:"messageURL"`
PicURL string `json:"picURL"`}
var Add struct{
Title string `json:"title"`
MessageURL string `json:"messageURL"`
PicURL string `json:"picURL"`}
Add.Title="EsDingTalkBot_Go"
Add.PicURL="https://github.com/fluidicon.png"
Add.MessageURL="https://github.com/EldersJavas/EsDingTalkBot_Go"
Links = append(Links, Add)
err := dingbot.FeedCard("123", Links)
```
# Error Back
```go
err := FeedCard("123", Links)
if err != nil {
return
}
```