lark

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRobot

func AddRobot(ctx context.Context, chatId string, robots []string) error

func CreateGroup

func CreateGroup(ctx context.Context, name string, users []string) (string, error)

func DeleteGroup

func DeleteGroup(ctx context.Context, chatId string) error

func Init

func Init(_domain, _appId, _appSecret string) error

New create new sender

func TemplateSimpleMessage

func TemplateSimpleMessage(content string, extra map[string]interface{}) map[string]interface{}

func UserIds

func UserIds(ctx context.Context, emails []string) (map[string]string, error)

func UserInfos

func UserInfos(ctx context.Context, emails []string) (map[string]UserInfo, error)

Types

type AuthTokenInternalResponse

type AuthTokenInternalResponse struct {
	Code           int    `json:"code"`
	AppAccessToken string `json:"app_access_token"`
	Expire         int    `json:"expire"`
}

type EventBody

type EventBody struct {
	Type          string `json:"type"`
	AppID         string `json:"app_id"`
	TenantKey     string `json:"tenant_key"`
	ChatType      string `json:"chat_type"`
	ChatName      string `json:"chat_name,omitempty"`
	MsgType       string `json:"msg_type"`
	RootID        string `json:"root_id,omitempty"`
	ParentID      string `json:"parent_id,omitempty"`
	OpenID        string `json:"open_id,omitempty"`
	OpenChatID    string `json:"open_chat_id,omitempty"`
	OpenMessageID string `json:"open_message_id,omitempty"`
	IsMention     bool   `json:"is_mention,omitempty"`
	Title         string `json:"title,omitempty"`
	Text          string `json:"text,omitempty"`
	RealText      string `json:"text_without_at_bot,omitempty"`
	ImageKey      string `json:"image_key,omitempty"`
	ImageURL      string `json:"image_url,omitempty"`
	FileKey       string `json:"file_key,omitempty"`
}

EventBody ...

type EventMessage

type EventMessage struct {
	UUID      string `json:"uuid"`
	Timestamp string `json:"ts"`
	// Token is shown by Lark to indicate it is not a fake message, check at your own need
	Token     string    `json:"token"`
	EventType string    `json:"type"`
	Challenge string    `json:"challenge,omitempty"`
	Event     EventBody `json:"event"`
}

func ParseEvent

func ParseEvent(data []byte) (EventMessage, error)

ParseEvent unmarshal the body and return the Lark Event

type Response

type Response struct {
	Code    int         `json:"code"`
	Message string      `json:"msg"`
	Data    interface{} `json:"data"`
}

type TenantAuthTokenInternalResponse

type TenantAuthTokenInternalResponse struct {
	Code                 int    `json:"code"`
	TenantAppAccessToken string `json:"tenant_access_token"`
	Expire               int    `json:"expire"`
}

TenantAuthTokenInternalResponse .

type UserInfo

type UserInfo struct {
	UserId string `json:"user_id"`
	Email  string `json:"email"`
	Mobile string `json:"mobile"`
}

func GetUserInfo

func GetUserInfo(ctx context.Context, email string) (UserInfo, error)

Jump to

Keyboard shortcuts

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