From 99ca7a2aedf31f820674ab5a66e770acd74dac6d Mon Sep 17 00:00:00 2001 From: topi314 Date: Thu, 12 Dec 2024 21:04:51 +0100 Subject: [PATCH] fix: variables parsed after middleware runs --- handler/mux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/handler/mux.go b/handler/mux.go index ce865c1b..7faa89f9 100644 --- a/handler/mux.go +++ b/handler/mux.go @@ -108,9 +108,9 @@ func (r *Mux) Match(path string, t discord.InteractionType, t2 int) bool { // Handle handles the given interaction event. func (r *Mux) Handle(path string, event *InteractionEvent) error { - handlerChain := Handler(func(event *InteractionEvent) error { - path = parseVariables(path, r.pattern, event.Vars) + path = parseVariables(path, r.pattern, event.Vars) + handlerChain := Handler(func(event *InteractionEvent) error { t := event.Type() var t2 int switch i := event.Interaction.(type) {