1
0

delete message containing command after processing it

This commit is contained in:
2022-05-07 08:29:34 +02:00
parent d451b9b48f
commit 1239c8c699

View File

@ -3,7 +3,6 @@ package core
import (
"bytes"
"fmt"
"log"
"math/rand"
"sort"
"strings"
@ -81,6 +80,9 @@ func MessageHandler(s *discordgo.Session, m *discordgo.MessageCreate) {
}
var message string = strings.TrimPrefix(m.Content, alias)
CommandRegister[alias].command(s, m, message)
// delete the receveid command after processing it. less clutter
s.ChannelMessageDelete(m.ChannelID, m.ID)
}
}
}