chore: clean up .net sentry exceptions
Some checks failed
Build and push Docker image / .net docker build (push) Has been cancelled
.net checks / run .net tests (push) Has been cancelled
.net checks / dotnet-format (push) Has been cancelled

This commit is contained in:
alyssa 2026-01-25 06:53:15 -05:00
parent ce0983ba16
commit 09ed215e6c
6 changed files with 38 additions and 17 deletions

View file

@ -58,13 +58,19 @@ public class MessageEdited: IEventHandler<MessageUpdateEvent>
var channel = await _cache.TryGetChannel(guildId, evt.ChannelId); // todo: is this correct for message update?
if (channel == null)
throw new Exception("could not find self channel in MessageEdited event");
{
_logger.Warning("could not find self channel in MessageEdited event");
return;
}
if (!DiscordUtils.IsValidGuildChannel(channel))
return;
var rootChannel = await _cache.GetRootChannel(guildId, channel.Id);
var guild = await _cache.TryGetGuild(channel.GuildId!.Value);
if (guild == null)
throw new Exception("could not find self guild in MessageEdited event");
{
_logger.Warning("could not find self guild in MessageEdited event");
return;
}
var lastMessage = (await _lastMessageCache.GetLastMessage(evt.GuildId.HasValue ? evt.GuildId.Value ?? 0 : 0, evt.ChannelId))?.Current;
// Only react to the last message in the channel