|
|
|
@ -8,13 +8,13 @@ import (
|
|
|
|
|
"github.com/bwmarrin/discordgo"
|
|
|
|
|
|
|
|
|
|
"PermissionGacha/db"
|
|
|
|
|
"PermissionGacha/modules/config"
|
|
|
|
|
"PermissionGacha/modules/level"
|
|
|
|
|
"PermissionGacha/modules/log"
|
|
|
|
|
"PermissionGacha/modules/roles"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const emojiCheck = "✅"
|
|
|
|
|
const prestigeRequirement = 90000
|
|
|
|
|
|
|
|
|
|
var prestigeList = make(map[string]string)
|
|
|
|
|
|
|
|
|
@ -28,7 +28,7 @@ func handlePrestigeCommand(s *discordgo.Session, args []string, m *discordgo.Mes
|
|
|
|
|
if err != nil {
|
|
|
|
|
return fmt.Errorf("commands: handlePrestigeCommand: error while getting current XP: %w", err)
|
|
|
|
|
}
|
|
|
|
|
newPrestigeLevel := xp/prestigeRequirement + 1
|
|
|
|
|
newPrestigeLevel := xp/config.PrestigeRequirement + 1
|
|
|
|
|
|
|
|
|
|
currentLevel, _ := level.ConvertXPIntoLevel(xp)
|
|
|
|
|
|
|
|
|
@ -52,7 +52,7 @@ func handlePrestigeCommand(s *discordgo.Session, args []string, m *discordgo.Mes
|
|
|
|
|
m.Author.ID,
|
|
|
|
|
currentPrestigeLevel,
|
|
|
|
|
newPrestigeLevel,
|
|
|
|
|
nextNearestLogicalPrestige, float64(xp)/float64(prestigeRequirement*(nextNearestLogicalPrestige-1))*100,
|
|
|
|
|
nextNearestLogicalPrestige, float64(xp)/float64(config.PrestigeRequirement*(nextNearestLogicalPrestige-1))*100,
|
|
|
|
|
lowerLevelWarning,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
@ -86,7 +86,7 @@ func ListenPrestigeReact(s *discordgo.Session, m *discordgo.MessageReactionAdd)
|
|
|
|
|
log.Error(s, "checkPrestigeReact", "GetXP", err)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
newPrestigeLevel := xp/prestigeRequirement + 1
|
|
|
|
|
newPrestigeLevel := xp/config.PrestigeRequirement + 1
|
|
|
|
|
go roles.RemoveAllLevelRoles(s, m.UserID)
|
|
|
|
|
err = db.SetPrestigeMultiplier(m.UserID, newPrestigeLevel)
|
|
|
|
|
if err != nil {
|
|
|
|
|