From 931825bd5a4cc4bdc85df13a2326c7327199d5e4 Mon Sep 17 00:00:00 2001 From: = Date: Wed, 24 Nov 2021 10:35:47 -0500 Subject: [PATCH] make sure there is embed before trying operations --- discordMessage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discordMessage.go b/discordMessage.go index eb07544..1a7d510 100644 --- a/discordMessage.go +++ b/discordMessage.go @@ -11,7 +11,7 @@ import ( func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) { defer log.PanicSafe() - if m.Author.ID == "302050872383242240" && strings.Contains(m.Embeds[0].Description, "minutes until the server can be bumped") { + if m.Author.ID == "302050872383242240" && len(m.Embeds) > 0 && strings.Contains(m.Embeds[0].Description, "minutes until the server can be bumped") { log.LogDebug("Failed bump detected") re := regexp.MustCompile("Please wait another (.*) minutes until the server can be bumped") match := re.FindStringSubmatch(m.Embeds[0].Description)