aboutsummaryrefslogtreecommitdiff
path: root/events.go
diff options
context:
space:
mode:
authorWilliam Hergès <anhgelus.morhtuuzh@proton.me>2025-09-26 18:02:18 +0200
committerGitHub <noreply@github.com>2025-09-26 18:02:18 +0200
commit80c147d5430bb3d8894231de3b6e960bcae43694 (patch)
treec1aa0cdfec1b99761d393cb63b39057046be5b74 /events.go
parentc4a5e7db48edb5c69af8bec3e60e444951146d46 (diff)
parent30f110d8d49cd1174882c58916147f52e09dd51e (diff)
Merge pull request #14 from ascpial/new-config
[Feat] Finish upgrading config
Diffstat (limited to 'events.go')
-rw-r--r--events.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/events.go b/events.go
index 9f247d3..38f259c 100644
--- a/events.go
+++ b/events.go
@@ -27,7 +27,7 @@ func OnMessage(s *discordgo.Session, m *discordgo.MessageCreate) {
return
}
cfg := config.GetGuildConfig(m.GuildID)
- if cfg.IsDisabled(m.ChannelID) {
+ if cfg.IsDisabled(s, m.ChannelID) {
return
}
c := user.GetCopaing(m.Author.ID, m.GuildID)
@@ -48,13 +48,13 @@ func OnVoiceUpdate(s *discordgo.Session, e *discordgo.VoiceStateUpdate) {
return
}
cfg := config.GetGuildConfig(e.GuildID)
- if (e.BeforeUpdate == nil || cfg.IsDisabled(e.BeforeUpdate.ChannelID)) && e.ChannelID != "" {
- if cfg.IsDisabled(e.ChannelID) {
+ if (e.BeforeUpdate == nil || cfg.IsDisabled(s, e.BeforeUpdate.ChannelID)) && e.ChannelID != "" {
+ if cfg.IsDisabled(s, e.ChannelID) {
return
}
onConnection(s, e)
- } else if e.BeforeUpdate != nil && (e.ChannelID == "" || cfg.IsDisabled(e.ChannelID)) {
- if cfg.IsDisabled(e.BeforeUpdate.ChannelID) {
+ } else if e.BeforeUpdate != nil && (e.ChannelID == "" || cfg.IsDisabled(s, e.ChannelID)) {
+ if cfg.IsDisabled(s, e.BeforeUpdate.ChannelID) {
return
}
onDisconnect(s, e)