From ce4fcb44e0e6869ccb143fd68484a61d04ac0118 Mon Sep 17 00:00:00 2001 From: Tyler Date: Thu, 17 Dec 2020 18:57:19 -0500 Subject: [PATCH] Support message placeholders and configuration of message, logic/order error with message deletion --- main.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/main.go b/main.go index 79f5a78..546f788 100644 --- a/main.go +++ b/main.go @@ -117,17 +117,6 @@ func messageCreate(e *gateway.MessageCreateEvent) { return } - err := s.DeleteMessage(e.ChannelID, e.ID) - - if err != nil { - log.WithFields(log.Fields{ - "guildId": e.GuildID, - "userId": e.Author.ID, - "messageId": e.ID, - }).Debug("Unable to delete message") - return - } - member, err := s.Member(e.GuildID, e.Author.ID) if err != nil || !member.Joined.IsValid() { @@ -148,6 +137,17 @@ func messageCreate(e *gateway.MessageCreateEvent) { return } + err = s.DeleteMessage(e.ChannelID, e.ID) + + if err != nil { + log.WithFields(log.Fields{ + "guildId": e.GuildID, + "userId": e.Author.ID, + "messageId": e.ID, + }).Debug("Unable to delete message") + return + } + ch, err := s.CreatePrivateChannel(e.Author.ID) if err != nil {