message

package
v0.0.0-...-28bcc08 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MsgArray

type MsgArray []MsgElement

MsgArray contains MsgElements, used to send and revice message by using OneBot array message format.

type MsgBuilder

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

MsgBuilder is a builder used to build array messgae.

func (*MsgBuilder) Append

func (m *MsgBuilder) Append(e MsgElement) *MsgBuilder

Append a MsgElement to MsgBuilder.

func (*MsgBuilder) AppendArray

func (m *MsgBuilder) AppendArray(a MsgArray) *MsgBuilder

AppendArray to MsgBuilder.

func (*MsgBuilder) At

func (m *MsgBuilder) At(qq string) *MsgBuilder

At append an at message element to message array.

func (*MsgBuilder) CardImage

func (m *MsgBuilder) CardImage(args MsgBuilderArg) *MsgBuilder

CardImage append a CardImage message element to message array.

func (*MsgBuilder) Face

func (m *MsgBuilder) Face(id string) *MsgBuilder

Face append a face message element to message array.

func (*MsgBuilder) Forward

func (m *MsgBuilder) Forward(id string) *MsgBuilder

Forward append a forward message element to message array.

func (*MsgBuilder) GetArray

func (m *MsgBuilder) GetArray() MsgArray

GetArray form MsgBuilder

func (*MsgBuilder) Gift

func (m *MsgBuilder) Gift(qq, giftID string) *MsgBuilder

Gift append an gift message element to message array.

func (*MsgBuilder) Image

func (m *MsgBuilder) Image(args MsgBuilderArg) *MsgBuilder

Image append an image message element to message array.

func (*MsgBuilder) JSON

func (m *MsgBuilder) JSON(json string) *MsgBuilder

JSON append a JSON message element to message array.

func (*MsgBuilder) Marshal

func (m *MsgBuilder) Marshal() (string, error)

Marshal message array to string.

func (*MsgBuilder) Music

func (m *MsgBuilder) Music(args MsgBuilderArg) *MsgBuilder

Music append a music message element to message array.

func (*MsgBuilder) Node

func (m *MsgBuilder) Node(args MsgBuilderArg) *MsgBuilder

Node append a forward node element to message array.

You should read document before using this.

func (*MsgBuilder) Poke

func (m *MsgBuilder) Poke(qq string) *MsgBuilder

Poke append an Poke message element to message array.

func (*MsgBuilder) Record

func (m *MsgBuilder) Record(args MsgBuilderArg) *MsgBuilder

Record append a record message element to message array.

func (*MsgBuilder) Share

func (m *MsgBuilder) Share(args MsgBuilderArg) *MsgBuilder

Share append an share message element to message array.

func (*MsgBuilder) Text

func (m *MsgBuilder) Text(text string) *MsgBuilder

Text append a text message element to message array.

func (*MsgBuilder) Vedio

func (m *MsgBuilder) Vedio(args MsgBuilderArg) *MsgBuilder

Vedio append a vedio message element to message array.

func (*MsgBuilder) XML

func (m *MsgBuilder) XML(xml string) *MsgBuilder

XML append a XML message element to message array.

type MsgBuilderArg

type MsgBuilderArg any

MsgBuilderArg is used to represent complex parameters in the message element. Usually if the function that can recive more than one parameter need to use this.

For more detail, please read document.

type MsgElement

type MsgElement map[string]any

MsgElement is an element of array message.

type ParsedMessageElement

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

ParsedMessageElement is

func MsgParser

func MsgParser(message []byte) ([]ParsedMessageElement, error)

MsgParser is used to parser message of array format.

func (*ParsedMessageElement) Get

func (e *ParsedMessageElement) Get(key string) any

Get value form ParsedMessageElement

func (*ParsedMessageElement) GetElement

func (e *ParsedMessageElement) GetElement() MsgElement

GetElement form ParsedMessageElement

func (*ParsedMessageElement) Type

func (e *ParsedMessageElement) Type() string

Type reports the type of ParsedMessageElement

Jump to

Keyboard shortcuts

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