fix(bot): use correct channel id for log channel lookup

This commit is contained in:
alyssa 2024-12-10 05:35:32 +09:00
parent 0b283f5631
commit 48e53e45dd

View file

@ -63,12 +63,12 @@ public class LogChannelService
return null;
var guildId = proxiedMessage.Guild ?? trigger.GuildId.Value;
var rootChannel = await _cache.GetRootChannel(guildId, trigger.ChannelId);
var rootChannel = await _cache.GetRootChannel(guildId, proxiedMessage.Channel);
// get log channel info from the database
var guild = await _repo.GetGuild(guildId);
var logChannelId = guild.LogChannel;
var isBlacklisted = guild.LogBlacklist.Any(x => x == trigger.ChannelId || x == rootChannel.Id);
var isBlacklisted = guild.LogBlacklist.Any(x => x == proxiedMessage.ChannelId || x == rootChannel.Id);
// if (ctx.SystemId == null ||
// removed the above, there shouldn't be a way to get to this code path if you don't have a system registered