Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Respond ¶
func Respond(response *discordgo.InteractionResponse, request *InteractionRequest)
Respond will take the response and send it to discord.
Types ¶
type InteractionHandler ¶
type InteractionHandler = func(*discordgo.InteractionResponse, *InteractionRequest)
InteractionHandler is standard signature for interaction handler functions. should feel similar to http.Handler.
func LogInteraction ¶
func LogInteraction(next InteractionHandler) InteractionHandler
LogInteraction is a middleware to print structured log lines for interactions
use "github.com/rs/zerolog/log".Ctx(request.Context) to get the logger.
type InteractionMiddleware ¶
type InteractionMiddleware = func(InteractionHandler) InteractionHandler
type InteractionMux ¶
type InteractionMux struct {
// contains filtered or unexported fields
}
InteractionMux handles interaction commands.
func NewInteractionMux ¶
func NewInteractionMux(ctx context.Context) InteractionMux
func (*InteractionMux) Add ¶
func (i *InteractionMux) Add(command string, handler InteractionHandler)
func (*InteractionMux) Serve ¶
func (m *InteractionMux) Serve() func(s *discordgo.Session, i *discordgo.InteractionCreate)
Serve will serve interaction responses to be used by discordgo session.AddHandler()
func (*InteractionMux) Use ¶
func (i *InteractionMux) Use(middlewares ...InteractionMiddleware)
Use appends a middleware to the middleware stack
type InteractionRequest ¶
Click to show internal directories.
Click to hide internal directories.