msg

package
v0.0.0-...-7be24de Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Content

type Content struct {
	Data []byte      `json:"data,omitempty"`
	Type ContentType `json:"type,omitempty"`
}

type ContentType

type ContentType int
const (
	ContentTypeText ContentType = iota
	ContentTypeFile
	ContentTypeImage
	ContentTypeVideo
)

type Message

type Message struct {
	// contains filtered or unexported fields
}

func (*Message) Content

func (m *Message) Content() Content

func (*Message) ForwardTime

func (m *Message) ForwardTime() time.Time

func (*Message) GroupName

func (m *Message) GroupName() string

func (*Message) MentionedNames

func (m *Message) MentionedNames() []string

func (*Message) Parse

func (m *Message) Parse(js []byte) error

func (*Message) SendTime

func (m *Message) SendTime() time.Time

func (*Message) Sender

func (m *Message) Sender() Sender

func (*Message) Serialize

func (m *Message) Serialize() ([]byte, error)

func (*Message) SetContent

func (m *Message) SetContent(content Content)

func (*Message) SetForwardTime

func (m *Message) SetForwardTime(forwardTime time.Time)

func (*Message) SetGroupName

func (m *Message) SetGroupName(groupName string)

func (*Message) SetMentionedNames

func (m *Message) SetMentionedNames(mentionedNames ...string)

func (*Message) SetSendTime

func (m *Message) SetSendTime(sendTime time.Time)

func (*Message) SetSender

func (m *Message) SetSender(sender Sender)

func (*Message) String

func (m *Message) String() string

type Sender

type Sender struct {
	UUId string `json:"uuid,omitempty"`
	Name string `json:"name,omitempty"`
}

func (*Sender) CreateMessage

func (s *Sender) CreateMessage(contentType ContentType, contentData []byte, groupName string, mentionedNames ...string) Message

Jump to

Keyboard shortcuts

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