Documentation
¶
Index ¶
- Constants
- func GenerateMessageUUID() (string, error)
- func IsMessageOfAction(text string) bool
- func IsMessageOfScript(text string) bool
- func MessageScriptKind(text string) string
- type Event
- type EventContext
- type EventData
- type Message
- type MessageAction
- type MessageAt
- type MessageAudio
- type MessageContact
- type MessageFile
- type MessageGroup
- type MessageImage
- type MessageLink
- type MessageLocation
- type MessageRich
- type MessageScript
- type MessageVideo
- type Page
- type Subscribe
Constants ¶
View Source
const ( EventTypeMessage = "message" EventTypeNotice = "notice" EventTypeRequest = "request" )
View Source
const ( MessageTypeText = "text" MessageTypeAt = "at" MessageTypeAudio = "audio" MessageTypeImage = "image" MessageTypeFile = "file" MessageTypeLocation = "location" MessageTypeVideo = "video" MessageTypeLink = "link" MessageTypeContact = "contact" MessageTypeGroup = "group" MessageTypeRich = "rich" MessageTypeAction = "action" MessageTypeScript = "script" )
View Source
const ( MessageScriptOfJavascript = "javascript" MessageScriptOfFlowscript = "flowscript" MessageScriptOfUndefined = "undefined" )
View Source
const ( PlatformSlack = "slack" PlatformTelegram = "telegram" PlatformDiscord = "discord" )
Variables ¶
This section is empty.
Functions ¶
func GenerateMessageUUID ¶
GenerateMessageID generates a random ID for a message
func IsMessageOfAction ¶
func IsMessageOfScript ¶
func MessageScriptKind ¶
Types ¶
type Event ¶
type Event struct {
ID int
UUID string
Type string
Time time.Time
Context EventContext `gorm:"-"`
Data EventData `gorm:"-"`
Event string `json:"event"`
}
FIXME
type EventContext ¶
type EventContext struct {
Platform string `json:"platform"`
Via string `json:"via"`
Type string `json:"type"`
UserID string `json:"user_id"`
UserTID string `json:"user_tid"`
GroupID string `json:"group_id"`
GroupTID string `json:"group_tid"`
DiscussID string `json:"discuss_id"`
DiscussTID string `json:"discuss_tid"`
Extra interface{}
}
type EventData ¶
type EventData struct {
Type string `json:"type"`
Message Message `json:"message"`
SenderID string `json:"sender_id"`
SenderTID string `json:"sender_tid"`
SenderName string `json:"sender_name"`
SenderRemarkName string `json:"sender_remark_name"`
Sender string `json:"sender"`
GroupID string `json:"group_id"`
GroupTID string `json:"group_tid"`
GroupName string `json:"group_name"`
GroupRemarkName string `json:"group_remark_name"`
Group string `json:"group"`
DiscussID string `json:"discuss_id"`
DiscussTID string `json:"discuss_tid"`
DiscussName string `json:"discuss_name"`
DiscussRemarkName string `json:"discuss_remark_name"`
Discuss string `json:"discuss"`
SenderRole string `json:"sender_role"`
Extra interface{} `json:"extra"`
}
type MessageAction ¶
type MessageContact ¶
type MessageGroup ¶
type MessageLocation ¶
type MessageRich ¶
type MessageScript ¶
Click to show internal directories.
Click to hide internal directories.