Documentation
¶
Index ¶
- func CanBan(s *discordgo.Session, guildID string, m *discordgo.Member) bool
- func HasPerm(userPerms, hasPerm int64) bool
- func IsChannelAdmin(s *discordgo.Session, channelID, userID string) bool
- func WaitForMessage(s *discordgo.Session) chan *discordgo.MessageCreate
- func WaitForUserMessage(s *discordgo.Session, userID string) chan *discordgo.MessageCreate
- func WaitForUserReact(s *discordgo.Session, userID string) chan *discordgo.MessageReactionAdd
- type Context
- type Middleware
- type Parser
- type Prefixer
- type Route
- func (r *Route) AddMiddlewares(m ...Middleware) *Route
- func (r *Route) AddRoutes(subroutes ...*Route) *Route
- func (r *Route) Alias(a ...string) *Route
- func (r *Route) ApplyMiddlewares() RouteHandler
- func (r *Route) Desc(d string) *Route
- func (r *Route) Execute(s *discordgo.Session, parser Parser, prefixer Prefixer, ...) error
- func (r *Route) Find(name string) *Route
- func (r *Route) FindFull(args []string) (*Route, int)
- func (r *Route) On(name string, handler RouteHandler) *Route
- type RouteHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 Middleware ¶
type Middleware func(RouteHandler) RouteHandler
type Parser ¶
func NewDefaultParser ¶
func NewDefaultParser() Parser
type Prefixer ¶
type Prefixer func(*discordgo.MessageCreate) (prefix string, ok bool)
func NewDefaultPrefixer ¶
func NewGuildPrefixer ¶
type Route ¶
type Route struct { Name string Aliases []string Description string Handler RouteHandler Parent *Route Subroutes []*Route Middlewares []Middleware }
func (*Route) AddMiddlewares ¶
func (r *Route) AddMiddlewares(m ...Middleware) *Route
func (*Route) ApplyMiddlewares ¶
func (r *Route) ApplyMiddlewares() RouteHandler
func (*Route) Find ¶
Find finds a route with the given name It will return nil if nothing is found
name : name of route to find
func (*Route) FindFull ¶
FindFull a full path of routes by searching through their subroutes Until the deepest match is found. It will return the route matched and the depth it was found at
args : path of route you wish to find ex. FindFull(command, subroute1, subroute2, nonexistent) will return the deepest found match, which will be subroute2
type RouteHandler ¶
func IsAdmin ¶
func IsAdmin(h RouteHandler) RouteHandler
Click to show internal directories.
Click to hide internal directories.