pkg

package
v1.1.2-0...-d05e646 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2020 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EmbedLimitTitle       = 256
	EmbedLimitDescription = 2048
	EmbedLimitFieldValue  = 1024
	EmbedLimitFieldName   = 256
	EmbedLimitField       = 25
	EmbedLimitFooter      = 2048
	EmbedLimit            = 4000
)

Constants for message embed character limits

View Source
const FONTPATH = "./assets/fonts/unifont.ttf"

Variables

This section is empty.

Functions

func AddImageToGif

func AddImageToGif(gifImages *gif.GIF, img *image.Image, delay int)

func IsSnowflake

func IsSnowflake(input string) bool

func NameToGif

func NameToGif(name string, avatarURL string) (*bytes.Buffer, error)

func NewReactionator

func NewReactionator(channelID string, discord *discordgo.Session, reactionListener *ReactionListener,
	listenToRemove bool, removeReaction bool, messageType ReactionatorType, user *discordgo.User) *reactionator

func StringInSlice

func StringInSlice(a string, list []string) bool

Types

type Author

type Author struct {
	Name      string
	URL       string
	AvatarURL string
}

type Context

type Context struct {
	Discord     *discordgo.Session
	TextChannel *discordgo.Channel
	Message     *discordgo.MessageCreate
	Args        []string
}

func NewContext

func NewContext(discord *discordgo.Session, textChannel *discordgo.Channel,
	message *discordgo.MessageCreate, args []string) *Context

func (*Context) DM

func (context *Context) DM(content string) error

func (*Context) Delete

func (context *Context) Delete() error

func (*Context) GetVoiceChannel

func (context *Context) GetVoiceChannel() (*discordgo.VoiceState, error)

func (*Context) IsDM

func (context *Context) IsDM() bool

func (*Context) JoinUserVoiceChannel

func (context *Context) JoinUserVoiceChannel() (*discordgo.VoiceConnection, error)

func (*Context) Reply

func (context *Context) Reply(content string) (*discordgo.Message, error)

func (*Context) ReplyComplex

func (context *Context) ReplyComplex(message *discordgo.MessageSend) (*discordgo.Message, error)

func (*Context) ReplyComplexNoMention

func (context *Context) ReplyComplexNoMention(message *discordgo.MessageSend) (*discordgo.Message, error)

func (*Context) ReplyEmbed

func (context *Context) ReplyEmbed(embed *discordgo.MessageEmbed) (*discordgo.Message, error)

func (*Context) ReplyEmbedNoMention

func (context *Context) ReplyEmbedNoMention(embed *discordgo.MessageEmbed) (*discordgo.Message, error)

func (*Context) ReplyNoMention

func (context *Context) ReplyNoMention(content string) (*discordgo.Message, error)

type Controller

type Controller struct {
	Message *discordgo.Message
	// contains filtered or unexported fields
}

func NewController

func NewController(discord *discordgo.Session, channel *discordgo.Channel, previousStatus *discordgo.UpdateStatusData, reactionListener *ReactionListener) (*Controller, error)

func (*Controller) AddToQueue

func (controller *Controller) AddToQueue(context *Context) error

func (*Controller) NewControllerMessage

func (controller *Controller) NewControllerMessage(reactionListener *ReactionListener) error

func (*Controller) PauseResume

func (controller *Controller) PauseResume()

func (*Controller) Play

func (controller *Controller) Play() error

func (*Controller) Skip

func (controller *Controller) Skip()

func (*Controller) Stop

func (controller *Controller) Stop()

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

AddField [name] [value]

func (*Embed) InlineAllFields

func (e *Embed) InlineAllFields() *Embed

InlineAllFields sets all fields in the embed to be inline

func (*Embed) SetAuthor

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

SetAuthor ...

func (*Embed) SetColor

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

SetColor ...

func (*Embed) SetDescription

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

SetDescription [desc]

func (*Embed) SetFooter

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

SetFooter [Text] [iconURL]

func (*Embed) SetImage

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

SetImage ...

func (*Embed) SetThumbnail

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

SetThumbnail ...

func (*Embed) SetTitle

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

SetTitle ...

func (*Embed) SetURL

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

SetURL ...

func (*Embed) Truncate

func (e *Embed) Truncate() *Embed

Truncate truncates any embed value over the character limit.

func (*Embed) TruncateDescription

func (e *Embed) TruncateDescription() *Embed

TruncateDescription ...

func (*Embed) TruncateFields

func (e *Embed) TruncateFields() *Embed

TruncateFields truncates fields that are too long

func (*Embed) TruncateFooter

func (e *Embed) TruncateFooter() *Embed

TruncateFooter ...

func (*Embed) TruncateTitle

func (e *Embed) TruncateTitle() *Embed

TruncateTitle ...

type Metadata

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

type ReactionListener

type ReactionListener struct {
	Messages map[string]*reactionator
	Users    map[string]*activeReactionators
	// contains filtered or unexported fields
}

func NewReactionListener

func NewReactionListener(discord *discordgo.Session) ReactionListener

func (*ReactionListener) React

func (reactionListener *ReactionListener) React(message *discordgo.MessageReaction) error

type ReactionatorType

type ReactionatorType int8
const (
	ReactionatorTypeHelp ReactionatorType = iota
	ReactionatorTypeController
)

type Song

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

type VideoInfo

type VideoInfo struct {
	Title        string
	Author       *Author
	Duration     string
	ThumbnailURL string
}

func GetYoutubeInfo

func GetYoutubeInfo(url string) (*VideoInfo, error)

Jump to

Keyboard shortcuts

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