Support message placeholders and configuration of message, logic/order error with message deletion

This commit is contained in:
Tyler 2020-12-17 18:57:19 -05:00
parent 05e12f4436
commit ce4fcb44e0
1 changed files with 11 additions and 11 deletions

22
main.go
View File

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