diff --git a/commands/migrate.go b/commands/migrate.go index dee0d91..ee0ee5a 100644 --- a/commands/migrate.go +++ b/commands/migrate.go @@ -12,6 +12,9 @@ import ( ) 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 { util.SendFailEmbed( 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.") - level.RecalculateEverything(dg, m.GuildID) rand.Seed(time.Now().UnixNano()) calculationCode = randomBase64(20) + level.RecalculateEverything(dg, m.GuildID) + util.SendSuccessEmbed(dg, m.ChannelID, "Level recalculated successfully.") } const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+="