message

package
v0.0.0-...-3c4a4f3 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SOURCE = Type("Source")
	PLAIN  = Type("Plain")
	AT     = Type("At")
	Quote  = Type("Quote")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AtMessage

type AtMessage struct {
	BaseImp
	Target  uint64 `json:"target"`
	Display string `json:"display"`
}

type Base

type Base interface {
	GetType() Type
}

type BaseImp

type BaseImp struct {
	Type Type `json:"type,omitempty"`
}

func (*BaseImp) GetType

func (b *BaseImp) GetType() Type

type Chain

type Chain []Base

func GetMessageChain

func GetMessageChain(results []gjson.Result) (Chain, error)

func NewMessageChain

func NewMessageChain() *Chain

func (*Chain) AddAt

func (c *Chain) AddAt(target uint64, display string) *Chain

func (*Chain) AddPlain

func (c *Chain) AddPlain(text string) *Chain

func (*Chain) AddQuote

func (c *Chain) AddQuote(id, groupId, senderId, targetId uint64, origin Chain) *Chain

type PlainMessage

type PlainMessage struct {
	BaseImp
	Text string `json:"text,omitempty"`
}

type QuoteMessage

type QuoteMessage struct {
	BaseImp
	Id       uint64 `json:"id"`
	GroupId  uint64 `json:"groupId"`
	SenderId uint64 `json:"senderId"`
	TargetId uint64 `json:"targetId"`
	Origin   Chain  `json:"origin"`
}

type SourceMessage

type SourceMessage struct {
	BaseImp
	Time uint64 `json:"time,omitempty"`
	ID   uint64 `json:"id,omitempty"`
}

type Type

type Type string

Jump to

Keyboard shortcuts

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