From 1f9dc16e3e8b4da23260e5540606356259325308 Mon Sep 17 00:00:00 2001 From: pocketjawa Date: Fri, 1 May 2020 00:08:14 -0400 Subject: [PATCH] Fixed regex for xkcd comic selection. --- commands.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands.go b/commands.go index 3016e04..2ae37cb 100644 --- a/commands.go +++ b/commands.go @@ -103,7 +103,7 @@ func getXKCD(s *discordgo.Session, m *discordgo.Message, ctx *mux.Context) { } else { arg = "random" } - matchedNum, _ := regexp.MatchString(`[0-9]+`, arg) + matchedNum, _ := regexp.MatchString(`^[0-9]+$`, arg) if arg == "latest" { comic, err = xkclient.Latest(context.Background()) } else if matchedNum {