feishu

package
v0.0.0-...-7b8c353 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CardItem

type CardItem struct {
	Tag     string   `json:"tag"` //div,hr,button,markdown,note,hr
	Content string   `json:"content"`
	Text    CardText `json:"text,omitempty"`
}

CardItem 卡片内容项,参考:https://open.feishu.cn/document/common-capabilities/message-card/message-cards-content/card-structure/card-content

type CardText

type CardText struct {
	Tag     string `json:"tag"`
	Content string `json:"content"`
}

type FeiShu

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

func New

func New(webhookUrl string, secret string) *FeiShu

func (*FeiShu) SendCard

func (m *FeiShu) SendCard(templateId string, version string, variable map[string]interface{}) error

SendCard @Description: 发送卡片消息 https://open.feishu.cn/document/uAjLw4CM/ukzMukzMukzM/feishu-cards/quick-start/send-message-cards-with-custom-bot

func (*FeiShu) SendPostTxt

func (m *FeiShu) SendPostTxt(title string, contents []*PostItem) error

SendPostTxt @Description: 发送富文本

func (*FeiShu) SendTxt

func (m *FeiShu) SendTxt(txt string) error

func (*FeiShu) SendTxtWithTitle

func (m *FeiShu) SendTxtWithTitle(title string, txt string) error

type PostItem

type PostItem struct {
	Tag      string `json:"tag"` //text,a,at,img
	Text     string `json:"text,omitempty"`
	Href     string `json:"href,omitempty"`
	UserId   string `json:"user_id,omitempty"`
	ImageKey string `json:"image_key,omitempty"`
}

PostItem 富文本内容项,参考:https://open.feishu.cn/document/client-docs/bot-v3/add-custom-bot

type Response

type Response struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
}

Jump to

Keyboard shortcuts

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