model

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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

func GenerateMessageUUID() (string, error)

GenerateMessageID generates a random ID for a message

func IsMessageOfAction

func IsMessageOfAction(text string) bool

func IsMessageOfScript

func IsMessageOfScript(text string) bool

func MessageScriptKind

func MessageScriptKind(text string) string

Types

type Message

type Message struct {
	UUID string
	Type string      `json:"type"`
	Text string      `json:"text"`
	Data interface{} `json:"data"`
}

type MessageAction

type MessageAction struct {
	Action string
	Cron   string
}

type MessageAt

type MessageAt struct {
	UserID         string
	UserTID        string
	UserName       string
	UserRemarkName string
	User           interface{}
}

type MessageAudio

type MessageAudio struct {
	Url     string
	Path    string
	Data    string
	MediaID string
}

type MessageContact

type MessageContact struct {
	UserID   string
	UserTID  string
	UserName string
}

type MessageFile

type MessageFile struct {
	Url     string
	Path    string
	Data    string
	MediaID string
}

type MessageGroup

type MessageGroup struct {
	GroupID   string
	GroupTID  string
	GroupName string
}

type MessageImage

type MessageImage struct {
	Url     string
	Path    string
	Data    string
	MediaID string
}
type MessageLink struct {
	Url     string
	Title   string
	Content string
	Image   string
}

type MessageLocation

type MessageLocation struct {
	Latitude    float64
	Longitude   float64
	Description string
}

type MessageRich

type MessageRich struct {
	Url         string
	Description string
}

type MessageScript

type MessageScript struct {
	Type string
	Code string
}

type MessageVideo

type MessageVideo struct {
	Url     string
	Path    string
	Data    string
	MediaID string
}

type Page

type Page struct {
	ID      int
	UUID    string `json:"uuid"`
	Title   string `json:"title"`
	Content string `json:"content"`
	Time    time.Time
}

type Subscribe

type Subscribe struct {
	ID          int
	Source      string
	IsSubscribe bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL