|
|
|
@ -19,8 +19,15 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
|
|
|
|
|
|
|
|
|
|
func handleXPRequest(s *discordgo.Session, m *discordgo.MessageCreate) {
|
|
|
|
|
level, xp := getLevelAndXP(s, m.Author.ID)
|
|
|
|
|
levelUpRequirement := levelUpRequirementCache[level-1]
|
|
|
|
|
if level > 1 {
|
|
|
|
|
levelUpRequirement -= levelUpRequirementCache[level-2]
|
|
|
|
|
}
|
|
|
|
|
s.ChannelMessageSend(
|
|
|
|
|
m.ChannelID,
|
|
|
|
|
fmt.Sprintf("<@%s> is now level %d. (%d XP/%d XP)", m.Author.ID, level, xp, levelUpRequirementCache[level-1]),
|
|
|
|
|
fmt.Sprintf(
|
|
|
|
|
"<@%s> is now level %d. (%d XP/%d XP)",
|
|
|
|
|
m.Author.ID, level, xp, levelUpRequirement,
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|