slash

package
v0.0.0-...-1520e54 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanBan

func CanBan(s *discordgo.Session, guildID string, m *discordgo.Member) bool

func HasPerm

func HasPerm(userPerms, hasPerm int64) bool

func IsChannelAdmin

func IsChannelAdmin(s *discordgo.Session, channelID, userID string) bool

func WaitForMessage

func WaitForMessage(s *discordgo.Session) chan *discordgo.MessageCreate

func WaitForUserMessage

func WaitForUserMessage(s *discordgo.Session, userID string) chan *discordgo.MessageCreate

func WaitForUserReact

func WaitForUserReact(s *discordgo.Session, userID string) chan *discordgo.MessageReactionAdd

Types

type Command

type Command struct {
	*discordgo.ApplicationCommand
	Middlewares []Middleware
	Handler     CommandHandler
}

func (*Command) ApplyMiddlewares

func (c *Command) ApplyMiddlewares() CommandHandler

type CommandHandler

type CommandHandler func(*Context) error

func IsAdmin

func IsAdmin(h CommandHandler) CommandHandler

type Context

type Context struct {
	*discordgo.Session
	*discordgo.Interaction
	Vars interface{}
}

type Middleware

type Middleware func(CommandHandler) CommandHandler

type Router

type Router struct {
	Commands []Command
}

func NewRouter

func NewRouter() *Router

func (*Router) AddCommands

func (r *Router) AddCommands(commands ...Command)

func (*Router) RegisterCommands

func (r *Router) RegisterCommands(s *discordgo.Session, g *discordgo.Guild)

func (*Router) Start

func (r *Router) Start(ses *discordgo.Session, v interface{})

Jump to

Keyboard shortcuts

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