feat(xp): disable xp in disabled channels
This commit is contained in:
parent
f97df035c3
commit
a8c0a395ac
2 changed files with 10 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue