Documentation
¶
Index ¶
- type Bot
- func (b *Bot) GetApprovalInstance(ctx context.Context, instanceCode string) (*larkapproval.GetInstanceRespData, error)
- func (b *Bot) GetDocRawContent(ctx context.Context, documentID string, lang int) (*string, error)
- func (b *Bot) GetIdByTypeAndEmails(ctx context.Context, userIdType string, emails []string) ([]*larkcontact.UserContactInfo, error)
- func (b *Bot) GetOpenIdByEmails(ctx context.Context, emails []string) ([]*larkcontact.UserContactInfo, error)
- func (b *Bot) ListApprovalInstance(ctx context.Context, approvalCode, startTime, endTime string) ([]string, error)
- func (b *Bot) ListFolderFileMetaInfo(ctx context.Context, folderToken string) ([]*larkdrive.File, error)
- func (b *Bot) MessageUrgentApp(ctx context.Context, messageId, openId string) error
- func (b *Bot) SendCard(ctx context.Context, receiveIdType, receiveId, content string) (*larkim.CreateMessageRespData, error)
- func (b *Bot) SendCardByEmail(ctx context.Context, email, content string) (*larkim.CreateMessageRespData, error)
- func (b *Bot) SendMsg(ctx context.Context, receiveIdType, receiveId, msgType, content string) (*larkim.CreateMessageRespData, error)
- func (b *Bot) SendText(ctx context.Context, receiveIdType, receiveId, text string) (*larkim.CreateMessageRespData, error)
- func (b *Bot) SendTextByEmail(ctx context.Context, email, text string) (*larkim.CreateMessageRespData, error)
- func (b *Bot) UpdateMessage(ctx context.Context, messageId, content string) error
- func (b *Bot) UploadApaasCompressImg(ctx context.Context, id string, quality int) (string, error)
- func (b *Bot) UploadApaasImg(ctx context.Context, id string) (string, error)
- func (b *Bot) UploadMessageImage2Apaas(ctx context.Context, messageId, imageKey string) (*structs.Attachment, error)
- type TextMessageParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
Bot 飞书bot
func NewBot ¶
func NewBot(id, secret string, options ...lark.ClientOptionFunc) *Bot
NewBot 新建一个飞书BOT
func (*Bot) GetApprovalInstance ¶
func (b *Bot) GetApprovalInstance(ctx context.Context, instanceCode string) (*larkapproval.GetInstanceRespData, error)
GetApprovalInstance 获取审批实例详情
func (*Bot) GetDocRawContent ¶
GetDocRawContent 获取云文档纯文本内容 https://open.larkoffice.com/document/server-docs/docs/docs/docx-v1/document/raw_content
func (*Bot) GetIdByTypeAndEmails ¶
func (b *Bot) GetIdByTypeAndEmails(ctx context.Context, userIdType string, emails []string) ([]*larkcontact.UserContactInfo, error)
GetIdByTypeAndEmails 获取用户的id
func (*Bot) GetOpenIdByEmails ¶
func (b *Bot) GetOpenIdByEmails(ctx context.Context, emails []string) ([]*larkcontact.UserContactInfo, error)
GetOpenIdByEmails 通过邮箱获取open_id
func (*Bot) ListApprovalInstance ¶
func (b *Bot) ListApprovalInstance(ctx context.Context, approvalCode, startTime, endTime string) ( []string, error)
ListApprovalInstance 批量获取审批实例ID
func (*Bot) ListFolderFileMetaInfo ¶
func (b *Bot) ListFolderFileMetaInfo(ctx context.Context, folderToken string) ([]*larkdrive.File, error)
ListFolderFileMetaInfo 获取文件夹下所有文件的元信息 https://open.larkoffice.com/document/server-docs/docs/drive-v1/folder/list
func (*Bot) MessageUrgentApp ¶
MessageUrgentApp APP内消息加急
func (*Bot) SendCard ¶
func (b *Bot) SendCard(ctx context.Context, receiveIdType, receiveId, content string) (*larkim.CreateMessageRespData, error)
SendCard 发送卡片消息
func (*Bot) SendCardByEmail ¶
func (b *Bot) SendCardByEmail(ctx context.Context, email, content string) (*larkim.CreateMessageRespData, error)
SendCardByEmail 通过邮箱发送卡片
func (*Bot) SendMsg ¶
func (b *Bot) SendMsg(ctx context.Context, receiveIdType, receiveId, msgType, content string) (*larkim.CreateMessageRespData, error)
SendMsg 发送消息
func (*Bot) SendText ¶
func (b *Bot) SendText(ctx context.Context, receiveIdType, receiveId, text string) (*larkim.CreateMessageRespData, error)
SendText 发送文本消息
func (*Bot) SendTextByEmail ¶
func (b *Bot) SendTextByEmail(ctx context.Context, email, text string) (*larkim.CreateMessageRespData, error)
SendTextByEmail 通过邮箱发送文本消息
func (*Bot) UpdateMessage ¶
UpdateMessage 更新消息
func (*Bot) UploadApaasCompressImg ¶
UploadApaasCompressImg 将aPaaS的图片压缩上传至Feishu 获得ImageKey
func (*Bot) UploadApaasImg ¶
UploadApaasImg 将aPaaS的图片上传至Feishu 获得ImageKey id 可以使用aPaaS的image的SourceId、Token 推荐使用SourceId
func (*Bot) UploadMessageImage2Apaas ¶
func (b *Bot) UploadMessageImage2Apaas(ctx context.Context, messageId, imageKey string) (*structs.Attachment, error)
UploadMessageImage2Apaas 将飞书聊天记录中的图片上传至aPaaS
type TextMessageParams ¶
type TextMessageParams struct {
Text string `json:"text"`
}
TextMessageParams 文本消息参数