Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNeedToken = errors.New("feishu: need token") // 需要提供令牌
)
预定义错误
Functions ¶
This section is empty.
Types ¶
type BotClient ¶
type BotClient struct { Client *http.Client // 底层 http client。不填则使用默认值。 Logger *slog.Logger // 日志 logger。不填则使用默认值。 BaseURL string // 飞书接口基础地址。不填则使用默认值。 Token string // 机器人令牌。 }
飞书机器人客户端
type Message ¶
type Message struct { MsgType MessageType `json:"msg_type"` // 信息类型 Content any `json:"content"` // 信息内容 }
信息
type MessageType ¶
type MessageType = string
信息类型
const (
MessageTypeText MessageType = "text" // 文本信息类型
)
type SendResponse ¶
type SendResponse[T any] struct { Code int `json:"code"` // 响应码。非 0 为异常。 Data T `json:"data"` // 返回数据 Msg string `json:"msg"` // 异常信息 }
发送响应
Click to show internal directories.
Click to hide internal directories.