fix: fall back to default log channel if the queried channel isn't in cache

This commit is contained in:
sam 2024-12-13 14:39:51 +01:00
parent 27e1903c4b
commit 0d7e809ef6
Signed by: sam
GPG key ID: 5F3C3C1B3166639D

View file

@ -323,7 +323,13 @@ public class WebhookExecutorService(
);
if (!channelCache.TryGet(channelId, out var channel))
{
_logger.Verbose(
"Channel with ID {ChannelId} is not cached, returning default log channel",
channelId
);
return GetDefaultLogChannel(guild, logChannelType);
}
Snowflake? categoryId;
if (
@ -401,7 +407,13 @@ public class WebhookExecutorService(
}
if (!channelCache.TryGet(channelId.Value, out var channel))
return null;
{
_logger.Verbose(
"Channel with ID {ChannelId} is not cached, returning default log channel",
channelId
);
return GetDefaultLogChannel(guild, logChannelType);
}
Snowflake? categoryId;
if (