diff options
| author | William Hergès <william@herges.fr> | 2025-09-26 18:30:57 +0200 |
|---|---|---|
| committer | William Hergès <william@herges.fr> | 2025-09-26 18:30:57 +0200 |
| commit | b61a834b608df3d5e617912eefb28924ef3a46df (patch) | |
| tree | 00d2e373ba52b6091585c6a2c91e4b9f36c9af86 /config/guild.go | |
| parent | 80c147d5430bb3d8894231de3b6e960bcae43694 (diff) | |
build(gokord): bump to latest nightly
Diffstat (limited to 'config/guild.go')
| -rw-r--r-- | config/guild.go | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/config/guild.go b/config/guild.go index 9cdb7e4..10c64fd 100644 --- a/config/guild.go +++ b/config/guild.go @@ -4,7 +4,7 @@ import ( "strings" "github.com/anhgelus/gokord" - discordgo "github.com/nyttikord/gokord" + "github.com/nyttikord/gokord/bot" ) type GuildConfig struct { @@ -32,18 +32,21 @@ func (cfg *GuildConfig) Save() error { return gokord.DB.Save(cfg).Error } -func (cfg *GuildConfig) IsDisabled(s *discordgo.Session, channelID string) bool { +func (cfg *GuildConfig) IsDisabled(s bot.Session, channelID string) bool { ok := true for channelID != "" && ok { ok = !strings.Contains(cfg.DisabledChannels, channelID) - c, err := s.State.Channel(channelID) + c, err := s.ChannelAPI().State.Channel(channelID) if err != nil { - s.LogError(err, "Unable to find channel %s in state", c) + s.LogError(err, "unable to find channel %s in state", c) c, err = s.ChannelAPI().Channel(channelID) if err == nil { - s.State.ChannelAdd(c) + err = s.ChannelAPI().State.ChannelAdd(c) + if err != nil { + s.LogError(err, "unable to add channel %s to state", c) + } } else { - s.LogError(err, "Unable to fetch channel %s", s) + s.LogError(err, "unable to fetch channel %s", s) return false } } |
