Documentation
¶
Index ¶
- func GetImage(ctx context.Context, messageId, imageKey string) (io.Reader, error)
- func GetMessage(ctx context.Context, messageId string) (*larkim.Message, error)
- func NewImageContent(imageKey string) string
- func ParseImageKey(context string) (string, bool)
- func ParseTextContent(text string) (string, bool)
- func ReplyCard(ctx context.Context, messageId, card string) error
- func ReplyCardTemplate(ctx context.Context, messageId, templateId string, vars map[string]interface{}) error
- func ReplyImage(ctx context.Context, messageId, imageKey string) error
- func ReplyMessage(ctx context.Context, message, messageId, messageType string) error
- func ReplyText(ctx context.Context, messageId, title string, text ...string) error
- func SendCardTemplateToGroup(ctx context.Context, groupId, templateId string, vars map[string]interface{}) (string, error)
- func SendCardTemplateToUser(ctx context.Context, openId, templateId string, vars map[string]interface{}) (string, error)
- func SendCardToGroup(ctx context.Context, groupId, card string) (string, error)
- func SendCardToUser(ctx context.Context, openId, card string) (string, error)
- func SendImageToGroup(ctx context.Context, groupId, imageKey string) (string, error)
- func SendImageToUser(ctx context.Context, openId, imageKey string) (string, error)
- func SendMessage(ctx context.Context, receiverIdType, message, receiveId, messageType string) (string, error)
- func SendMessageToGroup(ctx context.Context, groupId, message, messageType string) (string, error)
- func SendMessageToUser(ctx context.Context, openId, message, messageType string) (string, error)
- func SendTextToGroup(ctx context.Context, groupId, title string, text ...string) (string, error)
- func SendTextToUser(ctx context.Context, openId, title string, text ...string) (string, error)
- func SetGlobalClient(client *Client)
- func UploadImage(ctx context.Context, reader io.Reader) (string, error)
- type BotAddedEvent
- type BotInfo
- type ChatCreatedEvent
- type Client
- func (c *Client) FilterTextContent(text string, mentions []*larkim.MentionEvent) (string, bool, bool)
- func (c *Client) GetBotInfo() (*BotInfo, error)
- func (c *Client) GetDocFile(ctx context.Context, fileToken string) (io.Reader, string, error)
- func (c *Client) GetDocMedia(ctx context.Context, fileToken string) (io.Reader, string, error)
- func (c *Client) GetImage(ctx context.Context, messageId, imageKey string) (io.Reader, error)
- func (c *Client) GetImportDocStatus(ctx context.Context, ticket string) (*larkdrive.ImportTask, error)
- func (c *Client) GetMessage(ctx context.Context, messageId string) (*larkim.Message, error)
- func (c *Client) GetRecord(ctx context.Context, baseId, tableId, recordId string) (*larkbitable.AppTableRecord, error)
- func (c *Client) GetRecords(ctx context.Context, baseId, tableId, viewId string, limit int) ([]*larkbitable.AppTableRecord, error)
- func (c *Client) ImportDoc(ctx context.Context, fileExt, fileToken, targetType, fileName string, ...) (string, error)
- func (c *Client) ListBaseTables(ctx context.Context, baseId string) ([]*larkbitable.AppTable, error)
- func (c *Client) MoveDocToWiki(ctx context.Context, spaceId, objType, objToken, parentWikiToken string) (*larkwiki.MoveDocsToWikiSpaceNodeRespData, error)
- func (c *Client) ReplyCard(ctx context.Context, messageId, card string) error
- func (c *Client) ReplyCardTemplate(ctx context.Context, messageId, templateId string, vars map[string]interface{}) error
- func (c *Client) ReplyImage(ctx context.Context, messageId, imageKey string) error
- func (c *Client) ReplyMessage(ctx context.Context, message, messageId, messageType string) error
- func (c *Client) ReplyText(ctx context.Context, messageId, title string, text ...string) error
- func (c *Client) SendCardTemplateToGroup(ctx context.Context, groupId, templateId string, vars map[string]interface{}) (string, error)
- func (c *Client) SendCardTemplateToUser(ctx context.Context, openId, templateId string, vars map[string]interface{}) (string, error)
- func (c *Client) SendCardToGroup(ctx context.Context, groupId, card string) (string, error)
- func (c *Client) SendCardToUser(ctx context.Context, openId, card string) (string, error)
- func (c *Client) SendImageToGroup(ctx context.Context, groupId, imageKey string) (string, error)
- func (c *Client) SendImageToUser(ctx context.Context, openId, imageKey string) (string, error)
- func (c *Client) SendMessage(ctx context.Context, receiverIdType, message, receiveId, messageType string) (string, error)
- func (c *Client) SendMessageToGroup(ctx context.Context, groupId, message, messageType string) (string, error)
- func (c *Client) SendMessageToUser(ctx context.Context, openId, message, messageType string) (string, error)
- func (c *Client) SendTextToGroup(ctx context.Context, groupId, title string, text ...string) (string, error)
- func (c *Client) SendTextToUser(ctx context.Context, openId, title string, text ...string) (string, error)
- func (c *Client) UpdateBaseRecord(ctx context.Context, baseId, tableId, recordId string, ...) error
- func (c *Client) UploadDocFile(ctx context.Context, name, parentType, parentNode string, size int, ...) (string, error)
- func (c *Client) UploadDocMedia(ctx context.Context, name, parentType, parentNode, extras string, size int, ...) (string, error)
- func (c *Client) UploadImage(ctx context.Context, reader io.Reader) (string, error)
- func (c *Client) UploadToWiki(ctx context.Context, name, ext, docType, spaceId, parentNode string, size int, ...) (*larkwiki.MoveDocsToWikiSpaceNodeRespData, error)
- type ClientOption
- func WithBotAddedEventSubscribe(evtChan chan *BotAddedEvent) ClientOption
- func WithChatCreatedEventSubscribe(evtChan chan *ChatCreatedEvent) ClientOption
- func WithCustomizedEventSubscribe(eventType string, evtChan chan *larkevent.EventReq) ClientOption
- func WithMenuEventSubscribe(evtChan chan *MenuEvent) ClientOption
- func WithMessageEventSubscribe(evtChan chan *MessageEvent) ClientOption
- type Config
- type CustomizedEvent
- type DocumentClient
- type ImageClient
- type MenuEvent
- type MenuEventBody
- type MessageClient
- type MessageEvent
- type Operator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMessage ¶
GetMessage 获取指定消息
func ReplyCardTemplate ¶
func ReplyCardTemplate(ctx context.Context, messageId, templateId string, vars map[string]interface{}) error
ReplyCardTemplate 使用模板卡片回复消息
func ReplyImage ¶
ReplyImage 使用图片回复消息
func ReplyMessage ¶
ReplyMessage 回复消息
func SendCardTemplateToGroup ¶
func SendCardTemplateToGroup(ctx context.Context, groupId, templateId string, vars map[string]interface{}) (string, error)
SendCardTemplateToGroup 使用模板卡片发送消息到群组
func SendCardTemplateToUser ¶
func SendCardTemplateToUser(ctx context.Context, openId, templateId string, vars map[string]interface{}) (string, error)
SendCardTemplateToUser 使用模板卡片发送消息到用户
func SendCardToGroup ¶
SendCardToGroup 使用卡片发送消息到群组
func SendCardToUser ¶
SendCardToUser 使用卡片发送消息到用户
func SendImageToGroup ¶
SendImageToGroup 使用图片发送消息到群组
func SendImageToUser ¶
SendImageToUser 使用图片发送消息到用户
func SendMessage ¶
func SendMessage(ctx context.Context, receiverIdType, message, receiveId, messageType string) (string, error)
SendMessage 发送消息
func SendMessageToGroup ¶
SendMessageToGroup 发送消息到群组
func SendMessageToUser ¶
SendMessageToUser 发送消息到用户
func SendTextToGroup ¶
SendTextToGroup 使用文本发送消息到群组
func SendTextToUser ¶
SendTextToUser 使用文本发送消息到用户
func SetGlobalClient ¶
func SetGlobalClient(client *Client)
Types ¶
type BotAddedEvent ¶ added in v0.0.3
type BotAddedEvent struct {
*larkim.P2ChatMemberBotAddedV1Data
}
type ChatCreatedEvent ¶ added in v0.0.3
type ChatCreatedEvent struct {
*larkim.P1P2PChatCreatedV1Data
}
type Client ¶
type Client struct { *lark.Client *Config *BotInfo EventDispatcher *dispatcher.EventDispatcher MessageClient ImageClient }
var GlobalClient *Client
func NewClient ¶
func NewClient(appId, appSecret, verifyToken, encryptKey string, options ...ClientOption) (*Client, error)
func NewClientFromEnv ¶ added in v0.2.0
func NewClientWithConfig ¶
func NewClientWithConfig(config *Config, options ...ClientOption) (*Client, error)
func (*Client) FilterTextContent ¶ added in v0.0.8
func (c *Client) FilterTextContent(text string, mentions []*larkim.MentionEvent) (string, bool, bool)
FilterTextContent 返回过滤掉 @ 信息后的文本内容和是否需要忽略,若包含@全体成员,则忽略,否则返回去除@信息后的文本内容 @return text, atbot, atall
func (*Client) GetDocFile ¶ added in v0.0.6
func (*Client) GetDocMedia ¶ added in v0.0.6
func (*Client) GetImportDocStatus ¶ added in v0.3.0
func (*Client) GetMessage ¶
GetMessage 获取指定消息
func (*Client) GetRecord ¶ added in v0.0.4
func (c *Client) GetRecord(ctx context.Context, baseId, tableId, recordId string) (*larkbitable.AppTableRecord, error)
func (*Client) GetRecords ¶ added in v0.0.3
func (c *Client) GetRecords(ctx context.Context, baseId, tableId, viewId string, limit int) ([]*larkbitable.AppTableRecord, error)
func (*Client) ListBaseTables ¶ added in v0.1.0
func (*Client) MoveDocToWiki ¶ added in v0.3.0
func (*Client) ReplyCardTemplate ¶
func (c *Client) ReplyCardTemplate(ctx context.Context, messageId, templateId string, vars map[string]interface{}) error
ReplyCardTemplate 使用模板卡片回复消息
func (*Client) ReplyImage ¶
ReplyImage 使用图片回复消息
func (*Client) ReplyMessage ¶
ReplyMessage 回复消息
func (*Client) SendCardTemplateToGroup ¶
func (c *Client) SendCardTemplateToGroup(ctx context.Context, groupId, templateId string, vars map[string]interface{}) (string, error)
SendCardTemplateToGroup 使用模板卡片发送消息到群组
func (*Client) SendCardTemplateToUser ¶
func (c *Client) SendCardTemplateToUser(ctx context.Context, openId, templateId string, vars map[string]interface{}) (string, error)
SendCardTemplateToUser 使用模板卡片发送消息到用户
func (*Client) SendCardToGroup ¶
SendCardToGroup 使用卡片发送消息到群组
func (*Client) SendCardToUser ¶
SendCardToUser 使用卡片发送消息到用户
func (*Client) SendImageToGroup ¶
SendImageToGroup 使用图片发送消息到群组
func (*Client) SendImageToUser ¶
SendImageToUser 使用图片发送消息到用户
func (*Client) SendMessage ¶ added in v0.0.7
func (*Client) SendMessageToGroup ¶
func (c *Client) SendMessageToGroup(ctx context.Context, groupId, message, messageType string) (string, error)
SendMessageToGroup 发送消息到群组
func (*Client) SendMessageToUser ¶
func (c *Client) SendMessageToUser(ctx context.Context, openId, message, messageType string) (string, error)
SendMessageToUser 发送消息到用户
func (*Client) SendTextToGroup ¶
func (c *Client) SendTextToGroup(ctx context.Context, groupId, title string, text ...string) (string, error)
SendTextToGroup 使用文本发送消息到群组
func (*Client) SendTextToUser ¶
func (c *Client) SendTextToUser(ctx context.Context, openId, title string, text ...string) (string, error)
SendTextToUser 使用文本发送消息到用户
func (*Client) UpdateBaseRecord ¶ added in v0.0.3
func (*Client) UploadDocFile ¶ added in v0.3.0
func (*Client) UploadDocMedia ¶ added in v0.3.0
func (*Client) UploadImage ¶
UploadImage 上传图片
type ClientOption ¶ added in v0.0.9
type ClientOption func(*Client)
func WithBotAddedEventSubscribe ¶ added in v0.0.9
func WithBotAddedEventSubscribe(evtChan chan *BotAddedEvent) ClientOption
func WithChatCreatedEventSubscribe ¶ added in v0.0.9
func WithChatCreatedEventSubscribe(evtChan chan *ChatCreatedEvent) ClientOption
func WithCustomizedEventSubscribe ¶ added in v0.0.9
func WithCustomizedEventSubscribe(eventType string, evtChan chan *larkevent.EventReq) ClientOption
func WithMenuEventSubscribe ¶ added in v0.0.9
func WithMenuEventSubscribe(evtChan chan *MenuEvent) ClientOption
func WithMessageEventSubscribe ¶ added in v0.0.9
func WithMessageEventSubscribe(evtChan chan *MessageEvent) ClientOption
type CustomizedEvent ¶ added in v0.0.9
func (*CustomizedEvent) GetAsMenuEvent ¶ added in v0.0.9
func (e *CustomizedEvent) GetAsMenuEvent() (*MenuEventBody, error)
type DocumentClient ¶ added in v0.0.3
type DocumentClient interface{}
type ImageClient ¶ added in v0.0.3
type MenuEvent ¶ added in v0.0.9
type MenuEvent struct {
*larkapplication.P2BotMenuV6Data
}
type MenuEventBody ¶ added in v0.0.9
type MessageClient ¶ added in v0.0.3
type MessageClient interface { GetMessage(ctx context.Context, messageId string) (*larkim.Message, error) ReplyMessage(ctx context.Context, message, messageId, messageType string) error ReplyText(ctx context.Context, messageId, title string, text ...string) error ReplyImage(ctx context.Context, messageId, imageKey string) error ReplyCard(ctx context.Context, messageId, card string) error ReplyCardTemplate(ctx context.Context, messageId, templateId string, vars map[string]interface{}) error SendMessage(ctx context.Context, receiverIdType, message, receiveId, messageType string) (string, error) SendMessageToGroup(ctx context.Context, groupId, message, messageType string) (string, error) SendTextToGroup(ctx context.Context, groupId, title string, text ...string) (string, error) SendImageToGroup(ctx context.Context, groupId, imageKey string) (string, error) SendCardToGroup(ctx context.Context, groupId, card string) (string, error) SendCardTemplateToGroup(ctx context.Context, groupId, templateId string, vars map[string]interface{}) (string, error) SendMessageToUser(ctx context.Context, openId, message, messageType string) (string, error) SendTextToUser(ctx context.Context, openId, title string, text ...string) (string, error) SendImageToUser(ctx context.Context, openId, imageKey string) (string, error) SendCardToUser(ctx context.Context, openId, card string) (string, error) SendCardTemplateToUser(ctx context.Context, openId, templateId string, vars map[string]interface{}) (string, error) }
type MessageEvent ¶
type MessageEvent struct {
*larkim.P2MessageReceiveV1Data
}