Merge pull request #1 from anhgelus/feat/xp-reducer

[Feat] Add XP reducer
This commit is contained in:
Anhgelus Morhtuuzh 2024-04-16 15:46:52 +02:00 committed by GitHub
commit 6b595b8b11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 303 additions and 9 deletions

View file

@ -31,6 +31,7 @@ func OnMessage(s *discordgo.Session, m *discordgo.MessageCreate) {
return
}
c := GetCopaing(m.Author.ID, m.GuildID)
LastEventUpdate(s, c)
// add xp
trimmed := utils.TrimMessage(strings.ToLower(m.Content))
m.Member.User = m.Author
@ -67,6 +68,7 @@ func OnVoiceUpdate(s *discordgo.Session, e *discordgo.VoiceStateUpdate) {
if e.Member.User.Bot {
return
}
LastEventUpdate(s, GetCopaing(e.UserID, e.GuildID))
cfg := config.GetGuildConfig(e.GuildID)
if cfg.IsDisabled(e.ChannelID) {
return