im

package
v0.0.0-...-63efac0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgTypeText      = "text"
	MsgTypeRichText  = "rich_text"
	MsgTypeCard      = "interactive"
	MsgTypePost      = "post"
	MsgTypeImage     = "image"
	MsgTypeShareCard = "share_chat"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ImMsg

type ImMsg struct {
	Content string
	MsgType string
}

func NewCardMsg

func NewCardMsg(content string) *ImMsg

func NewTextMsg

func NewTextMsg(text string) *ImMsg

type ImMsgResponse

type ImMsgResponse struct {
	lark_core.CodeMsg
	Data struct {
		MessageID  string `json:"message_id"`
		RootID     string `json:"root_id"`
		ParentID   string `json:"parent_id"`
		MsgType    string `json:"msg_type"`
		CreateTime string `json:"create_time"`
		UpdateTime string `json:"update_time"`
		Deleted    bool   `json:"deleted"`
		Updated    bool   `json:"updated"`
		ChatID     string `json:"chat_id"`
		Sender     struct {
			ID         string `json:"id"`
			IDType     string `json:"id_type"`
			SenderType string `json:"sender_type"`
			TenantKey  string `json:"tenant_key"`
		} `json:"sender"`
		Body struct {
			Content string `json:"content"`
		} `json:"body"`
		Mentions []struct {
			Key       string `json:"key"`
			ID        string `json:"id"`
			IDType    string `json:"id_type"`
			Name      string `json:"name"`
			TenantKey string `json:"tenant_key"`
		} `json:"mentions"`
		UpperMessageID string `json:"upper_message_id"`
	}
}

type ImService

type ImService interface {
	RelayMsgByMsgID(ctx context.Context, msgID string, msg *ImMsg) (*ImMsgResponse, error)
	SendMsgByOpenID(ctx context.Context, openID string, msg *ImMsg) (*ImMsgResponse, error)
	SendMsgByChatID(ctx context.Context, chatID string, msg *ImMsg) (*ImMsgResponse, error)
}

func NewService

func NewService(cli *lark_core.Client) ImService

func NewServiceMock

func NewServiceMock() ImService

Jump to

Keyboard shortcuts

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