make sure there is embed before trying operations

This commit is contained in:
2021-11-24 10:35:47 -05:00
parent 5c39cbdafb
commit 931825bd5a

View File

@ -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)