Support message placeholders and configuration of message, logic/order error with message deletion
This commit is contained in:
parent
05e12f4436
commit
ce4fcb44e0
22
main.go
22
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 {
|
||||
|
|
Loading…
Reference in New Issue