finish ChannelUpdate responder

This commit is contained in:
sam 2024-08-20 18:18:17 +02:00
parent eb40872254
commit df8af75dd4
14 changed files with 155 additions and 63 deletions

View file

@ -1,6 +1,5 @@
using System.Diagnostics;
using App.Metrics;
using Catalogger.Backend.Cache;
using Catalogger.Backend.Cache.InMemoryCache;
using Catalogger.Backend.Database;
using Humanizer;

View file

@ -153,9 +153,9 @@ public class WebhookExecutorService(
if (logChannelType is LogChannelType.MessageUpdate or LogChannelType.MessageDelete
or LogChannelType.MessageDeleteBulk)
{
if (GetDefaultLogChannel(guild, logChannelType) == null) return null;
if (GetDefaultLogChannel(guild, logChannelType) == 0) return null;
ulong categoryRedirect = categoryId != null
var categoryRedirect = categoryId != null
? guild.Channels.Redirects.GetValueOrDefault(categoryId.Value.Value)
: 0;
@ -168,7 +168,7 @@ public class WebhookExecutorService(
return GetDefaultLogChannel(guild, logChannelType);
}
public static ulong? GetDefaultLogChannel(Guild guild, LogChannelType channelType) => channelType switch
public static ulong GetDefaultLogChannel(Guild guild, LogChannelType channelType) => channelType switch
{
LogChannelType.GuildUpdate => guild.Channels.GuildUpdate,
LogChannelType.GuildEmojisUpdate => guild.Channels.GuildEmojisUpdate,