discord

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EmbedColor            = 0x00ff00
	EmbedLimitTitle       = 256
	EmbedLimitDescription = 2048
	EmbedLimitFieldValue  = 1024
	EmbedLimitFieldName   = 256
	EmbedLimitField       = 25
	EmbedLimitFooter      = 2048
	EmbedSizeLimit        = 4500
)

Variables

This section is empty.

Functions

func BuildLink(text string, url string) string

Types

type Embed

type Embed struct {
	*discordgo.MessageEmbed
}

func NewEmbed

func NewEmbed() *Embed

NewEmbed returns a new embed object

func (*Embed) AddField

func (e *Embed) AddField(name, value string) *Embed

func (*Embed) InlineAllFields

func (e *Embed) InlineAllFields() *Embed

func (*Embed) SetAuthor

func (e *Embed) SetAuthor(args ...string) *Embed

func (*Embed) SetColor

func (e *Embed) SetColor(clr int) *Embed

func (*Embed) SetDescription

func (e *Embed) SetDescription(description string) *Embed

func (*Embed) SetFields

func (e *Embed) SetFields(fields []*discordgo.MessageEmbedField) *Embed

func (*Embed) SetFooter

func (e *Embed) SetFooter(args ...string) *Embed

func (*Embed) SetImage

func (e *Embed) SetImage(args ...string) *Embed

func (*Embed) SetThumbnail

func (e *Embed) SetThumbnail(args ...string) *Embed

func (*Embed) SetTimestamp

func (e *Embed) SetTimestamp(timestamp string) *Embed

func (*Embed) SetTitle

func (e *Embed) SetTitle(name string) *Embed

func (*Embed) SetURL

func (e *Embed) SetURL(URL string) *Embed

func (*Embed) Truncate

func (e *Embed) Truncate() *Embed

func (*Embed) TruncateDescription

func (e *Embed) TruncateDescription() *Embed

func (*Embed) TruncateFields

func (e *Embed) TruncateFields() *Embed

func (*Embed) TruncateFooter

func (e *Embed) TruncateFooter() *Embed

func (*Embed) TruncateTitle

func (e *Embed) TruncateTitle() *Embed

type MessageEmbedFieldBuilder added in v1.1.0

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

func (*MessageEmbedFieldBuilder) Append added in v1.1.0

func (b *MessageEmbedFieldBuilder) Append(m string)

func (*MessageEmbedFieldBuilder) IsEmpty added in v1.1.0

func (b *MessageEmbedFieldBuilder) IsEmpty() bool

func (*MessageEmbedFieldBuilder) SetName added in v1.1.0

func (b *MessageEmbedFieldBuilder) SetName(name string)

func (*MessageEmbedFieldBuilder) ToMessageEmbedFields added in v1.1.0

func (b *MessageEmbedFieldBuilder) ToMessageEmbedFields() []*discordgo.MessageEmbedField

type Session

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

func New

func New(cfg SessionConfig) (*Session, error)

func (*Session) Close

func (s *Session) Close() error

func (*Session) IsGuildMember

func (s *Session) IsGuildMember(guildID string) (bool, error)

func (*Session) SendEmbed

func (s *Session) SendEmbed(channelID string, e *Embed) error

func (*Session) SendMessage

func (s *Session) SendMessage(channelID, message string) error

func (*Session) UpdateStatus

func (s *Session) UpdateStatus(status string) error

type SessionConfig

type SessionConfig struct {
	Token                 string
	CommandPrefix         string
	Status                string
	ServerRepository      server.Repository
	GroupRepository       group.Repository
	ObservationRepository observation.Repository
	API                   *sdk.SDK
}

Jump to

Keyboard shortcuts

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