paginator

package
v0.0.0-...-a30b172 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2022 License: MIT Imports: 13 Imported by: 2

Documentation

Index

Constants

View Source
const (
	LeftArrowEmoji  = "⬅"
	RightArrowEmoji = "➡"
	CloseEmoji      = "🇽"
	NumbersEmoji    = "🔢"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Name        string
	ContentType string
	Data        []byte
}

type PagedEmbedMessage

type PagedEmbedMessage struct {
	Files           []*File
	FullEmbed       *discordgo.MessageEmbed
	TotalNumOfPages int
	CurrentPage     int
	FieldsPerPage   int
	Color           int
	MessageID       string
	ChannelID       string
	UserID          string // user who triggered the message
	Type            Type
	Embeds          []*discordgo.MessageEmbed
	DM              bool
	BotID           string
}

type Paginator

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

func NewPaginator

func NewPaginator(
	logger *zap.Logger,
	redis *redis.Client,
	state *state.State,
	tokens map[string]string,
) (*Paginator, error)

func (*Paginator) EmbedPaginator

func (p *Paginator) EmbedPaginator(
	botID string,
	channelID string,
	userID string,
	dm bool,
	embeds ...*discordgo.MessageEmbed,
) error

func (*Paginator) FieldsPaginator

func (p *Paginator) FieldsPaginator(
	botID string,
	channelID string,
	userID string,
	embed *discordgo.MessageEmbed,
	fieldsPerPage int,
	dm bool,
) error

CreatePagedMessage creates the paged messages

func (*Paginator) HandleMessageCreate

func (p *Paginator) HandleMessageCreate(messageCreate *discordgo.MessageCreate) error

func (*Paginator) HandleMessageReactionAdd

func (p *Paginator) HandleMessageReactionAdd(messageReactionAdd *discordgo.MessageReactionAdd) error

func (*Paginator) ImagePaginator

func (p *Paginator) ImagePaginator(
	botID string,
	channelID string,
	userID string,
	embed *discordgo.MessageEmbed,
	files []*File,
	dm bool,
) error

ImagePaginator creates the paged image messages

type Type

type Type int
const (
	FieldType Type = iota
	ImageType
	EmbedType
)

Jump to

Keyboard shortcuts

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