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