message

package
v0.0.0-...-2a859bb Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: ISC Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const AvatarURL = "" +
	"https://gist.github.com/diamondburned/" +
	"945744c2b5ce0aa0581c9267a4e5cf24/raw/" +
	"598069da673093aaca4cd4aa0ede1a0e324e9a3a/" +
	"astolfo_selfie.png"

Variables

This section is empty.

Functions

func ParseID

func ParseID(id string) (uint32, error)

Types

type Author

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

func NewAuthor

func NewAuthor(name text.Rich) Author

func RandomAuthor

func RandomAuthor() Author

func (Author) Avatar

func (a Author) Avatar() string

func (Author) Equal

func (a Author) Equal(other Author) bool

Equal returns true if this author is the same as the given other author.

func (Author) ID

func (a Author) ID() string

func (Author) Name

func (a Author) Name() text.Rich
type Header struct {
	// contains filtered or unexported fields
}

func NewHeader

func NewHeader(id uint32, t time.Time) Header

func (Header) ID

func (m Header) ID() string

func (Header) RealID

func (m Header) RealID() uint32

func (Header) Time

func (m Header) Time() time.Time

type Message

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

func Echo

func Echo(sendable cchat.SendableMessage, id uint32, author Author) Message

func NewEmpty

func NewEmpty(id uint32, author Author) Message

func NewRandom

func NewRandom(id uint32, author Author) Message

func NewRandomFromMessage

func NewRandomFromMessage(old Message) Message

func Random

func Random(id uint32) Message

func RandomWithAuthor

func RandomWithAuthor(id uint32, author Author) Message

func (Message) Author

func (m Message) Author() cchat.Author

func (Message) AuthorName

func (m Message) AuthorName() string

AuthorName returns the message author's username in string.

func (Message) Content

func (m Message) Content() text.Rich

func (Message) Mentioned

func (m Message) Mentioned() bool

Mentioned is true when the message content contains the author's name.

func (Message) Nonce

func (m Message) Nonce() string

func (Message) RealAuthor

func (m Message) RealAuthor() Author

func (*Message) SetContent

func (m *Message) SetContent(content string)

Jump to

Keyboard shortcuts

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