From 5f004fdab066f16580f41076a4e6d8668fe743c9 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Tue, 6 Dec 2022 13:48:38 +0100 Subject: [PATCH] Fix: Do not try to compare non existing embed Signed-off-by: Knut Ahlers --- mod_reactionRole.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod_reactionRole.go b/mod_reactionRole.go index 87b02f2..e1460c1 100644 --- a/mod_reactionRole.go +++ b/mod_reactionRole.go @@ -111,7 +111,7 @@ func (m modReactionRole) Setup() error { Content: contentString, Embed: msgEmbed, }) - } else if !isDiscordMessageEmbedEqual(managedMsg.Embeds[0], msgEmbed) || managedMsg.Content != contentString { + } else if (len(managedMsg.Embeds) > 0 && !isDiscordMessageEmbedEqual(managedMsg.Embeds[0], msgEmbed)) || managedMsg.Content != contentString { _, err = m.discord.ChannelMessageEditComplex(&discordgo.MessageEdit{ Content: &contentString, Embed: msgEmbed,