Documentation ¶
Index ¶
- Constants
- type FeiShuApp
- func (r *FeiShuApp) CreateGroupChat(name, description string, userIDList []string, ...) (newChatID string, err error)
- func (r *FeiShuApp) IsAccessTokenExpired() bool
- func (r *FeiShuApp) SendImageMessage(target *FeiShuAppMessageSendTarget, imageKey string, options map[string]string) (messageResp FeiShuAppMessageSendResp, err error)
- func (r *FeiShuApp) SendPostMessage(target *FeiShuAppMessageSendTarget, title, i18nKey string, ...) (messageResp FeiShuAppMessageSendResp, err error)
- func (r *FeiShuApp) SendTextMessage(target *FeiShuAppMessageSendTarget, content string, options map[string]string) (messageResp FeiShuAppMessageSendResp, err error)
- type FeiShuAppCreateGroupOptions
- type FeiShuAppCreateGroupResp
- type FeiShuAppCreateGroupRespData
- type FeiShuAppGetTokenResp
- type FeiShuAppMessageSendReq
- type FeiShuAppMessageSendResp
- type FeiShuAppMessageSendRespData
- type FeiShuAppMessageSendTarget
- type FeiShuRobot
- type FeiShuRobotMessageResp
- type FeishuAppPostMessageContent
- type FeishuAppPostMessageContentItem
Constants ¶
const ( FeiShuAppPostMessageText = "text" FeiShuAppPostMessageHref = "a" FeiShuAppPostMessageAt = "at" FeiShuAppPostMessageImage = "img" )
const ( FeiShuAppMessageTypeText = "text" FeiShuAppMessageTypeImage = "image" FeiShuAppMessageTypePost = "post" )
const ( FeiShuAppI18nChinese = "zh_cn" FeiShuAppI18nJapanese = "ja_jp" FeiShuAppI18nEnglish = "en_us" )
const FeiShuAppCreateGroupAPI = "https://open.feishu.cn/open-apis/chat/v4/create/"
FeiShuAppCreateGroupAPI is the api to create group
const FeiShuAppSendMessageAPI = "https://open.feishu.cn/open-apis/message/v4/send/"
FeiShuAppSendMessageAPI is the api to send message to user or group
const FeiShuAppStatusOK = 0
FeiShuAppStatusOK is the ok status of api call
const FeiShuAppTenantAccessTokenAPI = "https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal/"
FeiShuAppTenantAccessTokenAPI is the api to get access token
const FeiShuAppTimeout = time.Second * 10
FeiShuAppTimeout is the default timeout to api call
const FeiShuRobotMessageAPI = "https://www.feishu.cn/flow/api/trigger-webhook/"
FeiShuRobotMessageAPI is the api to send the shortcut messages
const FeiShuRobotStatusOK = 0
const FeiShuRobotTimeout = time.Second * 10
FeiShuRobotTimeout is the feishu shortcut default timeout
const FeishuCodeAccessTokenExpired = 99991663
See doc https://open.feishu.cn/document/ukTMukTMukTM/ugjM14COyUjL4ITN
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FeiShuApp ¶
type FeiShuApp struct {
// contains filtered or unexported fields
}
func NewFeiShuApp ¶
NewFeiShuApp create a new feishu app
func NewFeiShuAppWithClient ¶
NewFeiShuAppWithClient create a new feishu app with http.Client
func NewFeiShuAppWithTimeout ¶
NewFeiShuAppWithTimeout create a new feishu app with timeout
func (*FeiShuApp) CreateGroupChat ¶
func (*FeiShuApp) IsAccessTokenExpired ¶
func (*FeiShuApp) SendImageMessage ¶
func (r *FeiShuApp) SendImageMessage(target *FeiShuAppMessageSendTarget, imageKey string, options map[string]string) (messageResp FeiShuAppMessageSendResp, err error)
func (*FeiShuApp) SendPostMessage ¶
func (r *FeiShuApp) SendPostMessage(target *FeiShuAppMessageSendTarget, title, i18nKey string, messageLines [][]FeishuAppPostMessageContentItem, options map[string]string) (messageResp FeiShuAppMessageSendResp, err error)
func (*FeiShuApp) SendTextMessage ¶
func (r *FeiShuApp) SendTextMessage(target *FeiShuAppMessageSendTarget, content string, options map[string]string) (messageResp FeiShuAppMessageSendResp, err error)
See doc https://open.feishu.cn/document/ukTMukTMukTM/uUjNz4SN2MjL1YzM options only support root_id now if you want to replay a specified message
type FeiShuAppCreateGroupResp ¶
type FeiShuAppCreateGroupResp struct { Code int `json:"code"` Message string `json:"msg"` Data FeiShuAppCreateGroupRespData `json:"data"` }
type FeiShuAppGetTokenResp ¶
type FeiShuAppMessageSendReq ¶
type FeiShuAppMessageSendReq struct { OpenID string `json:"open_id,omitempty"` UserID string `json:"user_id,omitempty"` Email string `json:"email,omitempty"` ChatID string `json:"chat_id,omitempty"` AppID string `json:"robot_id,omitempty"` MessageType string `json:"msg_type"` Content interface{} `json:"content"` }
See doc https://open.feishu.cn/document/ukTMukTMukTM/uMDMxEjLzATMx4yMwETM
type FeiShuAppMessageSendResp ¶
type FeiShuAppMessageSendResp struct { Code int `json:"code"` Message string `json:"msg"` Data FeiShuAppMessageSendRespData `json:"data"` }
type FeiShuAppMessageSendRespData ¶
type FeiShuAppMessageSendRespData struct {
MessageID string `json:"message_id"`
}
type FeiShuRobot ¶
type FeiShuRobot struct {
// contains filtered or unexported fields
}
FeiShuRobot is a robot to send feishu shortcut messages
func NewFeiShuRobot ¶
func NewFeiShuRobot() *FeiShuRobot
NewFeiShuRobot create a new feishu shortcut robot
func NewFeiShuRobotWithClient ¶
func NewFeiShuRobotWithClient(client *http.Client) *FeiShuRobot
NewFeiShuRobotWithClient create a new feishu shortcut robot with http.Client
func NewFeiShuRobotWithTimeout ¶
func NewFeiShuRobotWithTimeout(timeout time.Duration) *FeiShuRobot
NewFeiShuRobotWithTimeout create a new feishu shortcut robot with timeout
func (*FeiShuRobot) SendTextMessage ¶
func (r *FeiShuRobot) SendTextMessage(key, title, content string) (err error)
SendTextMessage send the text message
type FeiShuRobotMessageResp ¶
type FeishuAppPostMessageContent ¶
type FeishuAppPostMessageContent struct { Title string `json:"title"` Content [][]FeishuAppPostMessageContentItem `json:"content"` }
type FeishuAppPostMessageContentItem ¶
type FeishuAppPostMessageContentItem struct { Tag string `json:"tag"` UnEscape bool `json:"un_escape,omitempty"` Text string `json:"text,omitempty"` Lines int `json:"lines,omitempty"` Href string `json:"href,omitempty"` UserID string `json:"user_id,omitempty"` ImageKey string `json:"image_key,omitempty"` Height int `json:"height,omitempty"` Width int `json:"width,omitempty"` }