mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-13 05:37:29 +08:00
40 lines
1.2 KiB
Go
40 lines
1.2 KiB
Go
package bus
|
|
|
|
type MediaItem struct {
|
|
Source string `json:"source,omitempty"`
|
|
Type string `json:"type,omitempty"`
|
|
Ref string `json:"ref,omitempty"`
|
|
Path string `json:"path,omitempty"`
|
|
Channel string `json:"channel,omitempty"`
|
|
}
|
|
|
|
type InboundMessage struct {
|
|
Channel string `json:"channel"`
|
|
SenderID string `json:"sender_id"`
|
|
ChatID string `json:"chat_id"`
|
|
Content string `json:"content"`
|
|
Media []string `json:"media,omitempty"`
|
|
MediaItems []MediaItem `json:"media_items,omitempty"`
|
|
SessionKey string `json:"session_key"`
|
|
Metadata map[string]string `json:"metadata,omitempty"`
|
|
}
|
|
|
|
type Button struct {
|
|
Text string `json:"text"`
|
|
Data string `json:"data"`
|
|
}
|
|
|
|
type OutboundMessage struct {
|
|
Channel string `json:"channel"`
|
|
ChatID string `json:"chat_id"`
|
|
Content string `json:"content"`
|
|
Media string `json:"media,omitempty"`
|
|
ReplyToID string `json:"reply_to_id,omitempty"`
|
|
Buttons [][]Button `json:"buttons,omitempty"`
|
|
Action string `json:"action,omitempty"`
|
|
MessageID string `json:"message_id,omitempty"`
|
|
Emoji string `json:"emoji,omitempty"`
|
|
}
|
|
|
|
type MessageHandler func(InboundMessage) error
|