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