chat

package
v0.0.0-...-b730334 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Chat     = 0
	System   = 1
	GameInfo = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	// String component
	Text string `json:"text,omitempty"`

	// Translation component
	Translate string    `json:"translate,omitempty"`
	With      []Message `json:"with,omitempty"`

	// Common
	Bold          bool      `json:"bold,boolean,omitempty"`
	Italic        bool      `json:"italic,boolean,omitempty"`
	Underlined    bool      `json:"underlined,boolean,omitempty"`
	Strikethrough bool      `json:"strikethrough,boolean,omitempty"`
	Obfuscated    bool      `json:"obfuscated,boolean,omitempty"`
	Color         string    `json:"color,omitempty"`
	Extra         []Message `json:"extra,omitempty"`
}

func NewStringComponent

func NewStringComponent(text string) Message

func NewTranslationComponent

func NewTranslationComponent(key string, with ...Message) Message

func (*Message) Append

func (m *Message) Append(msgs ...Message)

func (Message) AsJSON

func (m Message) AsJSON() string

Jump to

Keyboard shortcuts

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