diff options
| author | Anhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me> | 2024-04-15 16:48:16 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me> | 2024-04-15 16:48:16 +0200 |
| commit | a8c0a395acc257ac019851f69d9913fd3fa51c9f (patch) | |
| tree | 0a6986991f87e44fd0f0ba46c5cf9253557cf6f9 /xp/events.go | |
| parent | f97df035c36c546afd665a1ec7da04cad35d869a (diff) | |
feat(xp): disable xp in disabled channels
Diffstat (limited to 'xp/events.go')
| -rw-r--r-- | xp/events.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/xp/events.go b/xp/events.go index f936bd2..9796e72 100644 --- a/xp/events.go +++ b/xp/events.go @@ -6,6 +6,7 @@ import ( "fmt" "github.com/anhgelus/gokord" "github.com/anhgelus/gokord/utils" + "github.com/anhgelus/les-copaings-bot/config" "github.com/bwmarrin/discordgo" "github.com/redis/go-redis/v9" "slices" @@ -24,6 +25,10 @@ func OnMessage(s *discordgo.Session, m *discordgo.MessageCreate) { if m.Author.Bot { return } + cfg := config.GetGuildConfig(m.GuildID) + if cfg.IsDisabled(m.ChannelID) { + return + } c := GetCopaing(m.Author.ID, m.GuildID) // add xp trimmed := utils.TrimMessage(strings.ToLower(m.Content)) |
