dgoutils

package
v0.0.0-...-1120f02 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotRange    = errors.New("not range")
	ErrRangeSyntax = errors.New("range low is higher than range high")
)

Functions

func ExpireMessage

func ExpireMessage(b *bot.Bot, s *discordgo.Session, msg *discordgo.Message)

Deletes a specified message after a certain time

func MemberHasPermission

func MemberHasPermission(s *discordgo.Session, guildID string, userID string, permission int64) (bool, error)

func TrimChannel

func TrimChannel(ctx *gumi.Ctx, n int) string

func TrimUserMention

func TrimUserMention(ctx *gumi.Ctx, n int) string

Types

type EmbedWidget

type EmbedWidget struct {
	Pages []*discordgo.MessageEmbed
	// contains filtered or unexported fields
}

EmbedWidget is an interactive DiscordGo widget interface

func NewWidget

func NewWidget(s *discordgo.Session, author string, embeds []*discordgo.MessageEmbed) *EmbedWidget

func (*EmbedWidget) Start

func (w *EmbedWidget) Start(channelID string) error

func (*EmbedWidget) WithCallback

func (w *EmbedWidget) WithCallback(fn func(WidgetAction, int) error)

type Range

type Range struct {
	Low  int
	High int
}

func NewRange

func NewRange(s string) (*Range, error)

func (*Range) Array

func (r *Range) Array() []int

func (*Range) Map

func (r *Range) Map() map[int]struct{}

type WidgetAction

type WidgetAction int
const (
	WidgetActionFirstPage WidgetAction = iota
	WidgetActionFiveDown
	WidgetActionPreviousPage
	WidgetActionStop
	WidgetActionNextPage
	WidgetActionFiveUp
	WidgetActionLastPage
)

func (WidgetAction) String

func (a WidgetAction) String() string

Jump to

Keyboard shortcuts

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