message

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TEXT        string = "text"
	POST        string = "post"
	IMAGE       string = "image"
	SHARE_CHAT  string = "share_chat"
	INTERACTIVE string = "interactive"
)
View Source
const (
	PostMessageContentPostZhCnContentTagText    = "text"
	PostMessageContentPostZhCnContentTagA       = "a"
	PostMessageContentPostZhCnContentTagAt      = "at"
	PostMessageContentPostZhCnContentTagImg     = "img"
	PostMessageContentPostZhCnContentTagMedia   = "media"
	PostMessageContentPostZhCnContentTagEmotion = "emotion"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
}

type ErrMessageResponse

type ErrMessageResponse struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Data Data   `json:"data"`
}

type ImageMessage

type ImageMessage struct {
	MsgType string              `json:"msg_type"`
	Content ImageMessageContent `json:"content"`
}

ImageMessage 图片

func NewImageMessage

func NewImageMessage(imageKey string) *ImageMessage

type ImageMessageContent

type ImageMessageContent struct {
	ImageKey string `json:"image_key"`
}

type InteractiveMessage

type InteractiveMessage struct {
	MsgType string                 `json:"msg_type"`
	Card    InteractiveMessageCard `json:"card"`
}

InteractiveMessage 消息卡片

type InteractiveMessageCard

type InteractiveMessageCard struct {
	Elements InteractiveMessageCardElements `json:"elements"`
	Header   InteractiveMessageCardHeader   `json:"header"`
}

type InteractiveMessageCardElements

type InteractiveMessageCardElements []struct {
	Tag     string                                `json:"tag"`
	Text    InteractiveMessageCardElementsText    `json:"text,omitempty"`
	Actions InteractiveMessageCardElementsActions `json:"actions,omitempty"`
}

type InteractiveMessageCardElementsActions

type InteractiveMessageCardElementsActions []struct {
	Tag   string                                    `json:"tag"`
	Text  InteractiveMessageCardElementsActionsText `json:"text"`
	Url   string                                    `json:"url"`
	Type  string                                    `json:"type"`
	Value struct {
	} `json:"value"`
}

type InteractiveMessageCardElementsActionsText

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

type InteractiveMessageCardElementsText

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

type InteractiveMessageCardHeader

type InteractiveMessageCardHeader struct {
	Title InteractiveMessageCardHeaderTitle `json:"title"`
}

type InteractiveMessageCardHeaderTitle

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

type MessageResponse

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

type PostMessage

type PostMessage struct {
	MsgType string             `json:"msg_type"`
	Content PostMessageContent `json:"content"`
}

PostMessage 富文本消息

func NewPostMessage

func NewPostMessage(title string, content [][]PostMessageContentPostZhCnContent) *PostMessage

type PostMessageContent

type PostMessageContent struct {
	Post PostMessageContentPost `json:"post"`
}

type PostMessageContentPost

type PostMessageContentPost struct {
	ZhCn PostMessageContentPostZhCn `json:"zh_cn"`
}

type PostMessageContentPostZhCn

type PostMessageContentPostZhCn struct {
	Title   string                                `json:"title"`
	Content [][]PostMessageContentPostZhCnContent `json:"content"`
}

type PostMessageContentPostZhCnContent

type PostMessageContentPostZhCnContent struct {
	Tag       string `json:"tag"`
	Text      string `json:"text,omitempty"`
	Href      string `json:"href,omitempty"`
	UserId    string `json:"user_id,omitempty"`
	UserName  string `json:"user_name,omitempty"`
	ImageKey  string `json:"image_key,omitempty"`
	FileKey   string `json:"file_key,omitempty"`
	EmojiType string `json:"emoji_type,omitempty"`
}

func NewPostMessageContentPostZhCnContent

func NewPostMessageContentPostZhCnContent(tag string, text string, href string, userId string, userName string, imageKey string, fileKey string, emojiType string) *PostMessageContentPostZhCnContent

type ShareChatMessage

type ShareChatMessage struct {
	MsgType string                  `json:"msg_type"`
	Content ShareChatMessageContent `json:"content"`
}

ShareChatMessage 群名片

func NewShareChatMessage

func NewShareChatMessage(shareChatId string) *ShareChatMessage

type ShareChatMessageContent

type ShareChatMessageContent struct {
	ShareChatId string `json:"share_chat_id"`
}

type TextMessage

type TextMessage struct {
	MsgType string             `json:"msg_type"`
	Content TextMessageContent `json:"content"`
}

TextMessage 文本消息

func NewTextMessage

func NewTextMessage(text string) *TextMessage

type TextMessageContent

type TextMessageContent struct {
	Text string `json:"text"`
}

Jump to

Keyboard shortcuts

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