custom_bot

package
v0.0.0-...-842a331 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: LGPL-2.1 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FeishuCustomBotGenSign

func FeishuCustomBotGenSign(secret string, timestamp int64) (string, error)

飞书自定义机器人的签名

func FeishuSendCommMsg

func FeishuSendCommMsg(url, secret string, alert *dropbox.AlertPostCommApi) (string, error)

Types

type FeishuCustomBotComm

type FeishuCustomBotComm struct {
	Timestamp string                  `json:"timestamp,omitempty"`
	Sign      string                  `json:"sign,omitempty"`
	MsgType   string                  `json:"msg_type"`
	Content   *FeishuCustomBotPostMsg `json:"content"`
}
{
    "msg_type": "post",
    "content": {
        "post": {
            "zh_cn": {
                "title": "项目更新通知",
                "content": [
                    [
                        {
                            "tag": "text",
                            "text": "项目有更新: "
                        }
                    ]
                ]
            }
        }
    }
}

func CommAlertToFeishuPostTemplate

func CommAlertToFeishuPostTemplate(alertComm *dropbox.AlertPostCommApi) *FeishuCustomBotComm

func (*FeishuCustomBotComm) CommSendPostMsg

func (feishu *FeishuCustomBotComm) CommSendPostMsg(url string) (string, error)

func (*FeishuCustomBotComm) FeishuCustomBotSignature

func (feishu *FeishuCustomBotComm) FeishuCustomBotSignature(secret string) error

type FeishuCustomBotPostMsg

type FeishuCustomBotPostMsg struct {
	Post map[string]*FeishuCustomBotPostMsgContent `json:"post"`
}

type FeishuCustomBotPostMsgContent

type FeishuCustomBotPostMsgContent struct {
	Title   string                            `json:"title"`
	Content []*FeishuCustomBotPostMsgTemplate `json:"content"`
}

type FeishuCustomBotPostMsgTemplate

type FeishuCustomBotPostMsgTemplate []*FeishuCustomBotPostMsgText

type FeishuCustomBotPostMsgText

type FeishuCustomBotPostMsgText struct {
	Tag  string `json:"tag"`
	Text string `json:text`
}

Jump to

Keyboard shortcuts

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