make sure there is embed before trying operations
This commit is contained in:
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user