Files
clawgo/pkg/bus/types.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