Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Go handler.Middleware = func(next handler.Handler) handler.Handler { return func(e *events.InteractionCreate) error { go func() { if err := next(e); err != nil { e.Client().Logger().Errorf("failed to handle interaction: %s\n", err) } }() return nil } }
Go is a middleware that runs the next handler in a goroutine
View Source
var Logger handler.Middleware = func(next handler.Handler) handler.Handler { return func(e *events.InteractionCreate) error { e.Client().Logger().Infof("handling interaction: %s\n", e.Interaction.ID()) return next(e) } }
Functions ¶
func Defer ¶ added in v0.16.8
func Defer(interactionType discord.InteractionType, updateMessage bool, ephemeral bool) handler.Middleware
Defer is a middleware that defers the specified interaction type. If updateMessage is true, it will respond with discord.InteractionResponseTypeDeferredUpdateMessage instead of discord.InteractionResponseTypeDeferredCreateMessage. If ephemeral is true, it will respond with discord.MessageFlagEphemeral flag in case of a discord.InteractionResponseTypeDeferredCreateMessage. Note: You can use this middleware multiple times with different interaction types. Note: You can use this middleware in combination with the Go middleware to defer & run in a goroutine.
func Print ¶
func Print(content string) handler.Middleware
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.