From 9f164c43d3bc46fc42be240ecdef5811cfa39389 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Wed, 4 Aug 2021 17:22:18 +0200 Subject: [PATCH] Add filter for configured guild Signed-off-by: Knut Ahlers --- mod_livePosting.go | 5 +++++ mod_liveRole.go | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/mod_livePosting.go b/mod_livePosting.go index bc1bbba..8c21e96 100644 --- a/mod_livePosting.go +++ b/mod_livePosting.go @@ -146,6 +146,11 @@ func (m modLivePosting) handlePresenceUpdate(d *discordgo.Session, p *discordgo. return } + if p.GuildID != config.GuildID { + // Bot is in multiple guilds, we don't have a config for this one + return + } + logger := log.WithFields(log.Fields{ "user": p.User.ID, }) diff --git a/mod_liveRole.go b/mod_liveRole.go index 26721be..2ed714c 100644 --- a/mod_liveRole.go +++ b/mod_liveRole.go @@ -66,6 +66,11 @@ func (m modLiveRole) handlePresenceUpdate(d *discordgo.Session, p *discordgo.Pre return } + if p.GuildID != config.GuildID { + // Bot is in multiple guilds, we don't have a config for this one + return + } + logger := log.WithFields(log.Fields{ "user": p.User.ID, })