third

package
v0.0.0-...-3b8996f Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AlertMsgKey = "3bc2c0f7-d1c6-4c31-9afe-42bd4e103bef"
	// WeChatSwitchOn 企业微信发送开关
	WeChatSwitchOn = true
)
View Source
const (
	WebHook = "https://open.feishu.cn/open-apis/bot/v2/hook/b1e8ca8e-154a-49c7-8efe-2e25360da46a"
)

Variables

View Source
var (
	SwitchOn    bool
	BaseUrl     string
	AccessToken string
)

钉钉机器人发送开关

Functions

func InitDingTalk

func InitDingTalk(c config.Conf) error

func SendLarkMsg

func SendLarkMsg(msg string) string

func SendMarkdownMessage

func SendMarkdownMessage(accessToken string, title string, text string, isAtAll bool, atUserIds []string, atMobiles []string) string

SendMarkdownMessage 发送POST请求,消息格式:markdown accessToken: 机器人access_token title: 消息标题 text: 消息正文 isAtAll: 是否@所有人 atUserIds: 希望通过user id@的人 atMobiles: 希望通过手机号@的人

func SendMarkdownMsg

func SendMarkdownMsg(key string, msg string) string

SendMarkdownMsg 发送POST请求,消息格式:markdown key: 微信机器人key msg: 消息内容 atList: 希望@的人 mentionedMobileList: 希望通过手机号@的人

func SendMsg

func SendMsg(key string, msg string, atList []string, mentionedMobileList []string) string

SendMsg 发送POST请求,消息格式:text key: 微信机器人key msg: 消息内容 atList: 希望@的人 mentionedMobileList: 希望通过手机号@的人

func SendTextMsg

func SendTextMsg(accessToken string, msg string, isAtAll bool, atUserIds []string, atMobiles []string) string

SendTextMsg 发送POST请求,消息格式:text accessToken: 机器人access_token msg: 消息内容 isAtAll: 是否@所有人 atUserIds: 希望通过user id@的人 atMobiles: 希望通过手机号@的人

Types

type AtBody

type AtBody struct {
	AtMobiles []string `json:"atMobiles"`
	AtUserIds []string `json:"atUserIds"`
	IsAtAll   bool     `bool:"isAtAll"`
}

type MarkdownBody

type MarkdownBody struct {
	Content string `json:"content"`
}

type MarkdownMsgBody

type MarkdownMsgBody struct {
	Title string `json:"title"`
	Text  string `json:"text"`
}

type MarkdownMsgParams

type MarkdownMsgParams struct {
	MsgType  string          `json:"msgtype"`
	MarkDown MarkdownMsgBody `json:"markdown"`
	At       AtBody          `json:"at"`
}

MarkdownMsgParams markdown类型消息数据

type MarkdownParams

type MarkdownParams struct {
	MsgType  string       `json:"msgtype"`
	MarkDown MarkdownBody `json:"markdown"`
}

MarkdownParams markdown类型消息数据

type TextBody

type TextBody struct {
	Content             string   `json:"content"`
	MentionedList       []string `json:"mentioned_list"`
	MentionedMobileList []string `json:"mentioned_mobile_list"`
}

type TextMsgBody

type TextMsgBody struct {
	Content string `json:"content"`
}

type TextMsgParams

type TextMsgParams struct {
	MsgType string      `json:"msgtype"`
	Text    TextMsgBody `json:"text"`
	At      AtBody      `json:"at"`
}

TextMsgParams text类型消息数据

type TextParams

type TextParams struct {
	MsgType string   `json:"msgtype"`
	Text    TextBody `json:"text"`
}

TextParams text类型消息数据

Jump to

Keyboard shortcuts

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