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 /config | |
| parent | f97df035c36c546afd665a1ec7da04cad35d869a (diff) | |
feat(xp): disable xp in disabled channels
Diffstat (limited to 'config')
| -rw-r--r-- | config/guild.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/config/guild.go b/config/guild.go index 5728759..6ed07c6 100644 --- a/config/guild.go +++ b/config/guild.go @@ -3,6 +3,7 @@ package config import ( "github.com/anhgelus/gokord" "gorm.io/gorm" + "strings" ) type GuildConfig struct { @@ -33,6 +34,10 @@ func (cfg *GuildConfig) Save() { gokord.DB.Save(cfg) } +func (cfg *GuildConfig) IsDisabled(channelID string) bool { + return strings.Contains(cfg.DisabledChannels, channelID) +} + func (cfg *GuildConfig) FindXpRole(roleID string) (int, *XpRole) { for i, r := range cfg.XpRoles { if r.RoleID == roleID { |
