|
|
@ -12,6 +12,9 @@ import (
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
func handleRecalculateLevel(dg *discordgo.Session, m *discordgo.MessageCreate, arguments []string) {
|
|
|
|
func handleRecalculateLevel(dg *discordgo.Session, m *discordgo.MessageCreate, arguments []string) {
|
|
|
|
|
|
|
|
if !level.ShouldListen {
|
|
|
|
|
|
|
|
util.SendFailEmbed(dg, m.ChannelID, "Recalculation In Progress", "❌ Recalculation is already in progress!")
|
|
|
|
|
|
|
|
}
|
|
|
|
if len(arguments) == 0 {
|
|
|
|
if len(arguments) == 0 {
|
|
|
|
util.SendFailEmbed(
|
|
|
|
util.SendFailEmbed(
|
|
|
|
dg, m.ChannelID, "Bot Owner Access Required",
|
|
|
|
dg, m.ChannelID, "Bot Owner Access Required",
|
|
|
@ -26,9 +29,10 @@ func handleRecalculateLevel(dg *discordgo.Session, m *discordgo.MessageCreate, a
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
util.SendSuccessEmbed(dg, m.ChannelID, "Level is being recalculated.")
|
|
|
|
util.SendSuccessEmbed(dg, m.ChannelID, "Level is being recalculated.")
|
|
|
|
level.RecalculateEverything(dg, m.GuildID)
|
|
|
|
|
|
|
|
rand.Seed(time.Now().UnixNano())
|
|
|
|
rand.Seed(time.Now().UnixNano())
|
|
|
|
calculationCode = randomBase64(20)
|
|
|
|
calculationCode = randomBase64(20)
|
|
|
|
|
|
|
|
level.RecalculateEverything(dg, m.GuildID)
|
|
|
|
|
|
|
|
util.SendSuccessEmbed(dg, m.ChannelID, "Level recalculated successfully.")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+="
|
|
|
|
const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+="
|
|
|
|