fix: don't crash when trying to log edited message with no old content

This commit is contained in:
spiral 2022-06-13 21:18:24 -04:00
parent b75e59da2f
commit 5833e7644d
No known key found for this signature in database
GPG Key ID: 244A11E4B0BCF40E

View File

@ -144,6 +144,9 @@ public class EmbedService
$"System ID: {systemHid} | Member ID: {member.Hid} | Sender: {triggerMessage.Author.Username}#{triggerMessage.Author.Discriminator} ({triggerMessage.Author.Id}) | Message ID: {proxiedMessage.Id} | Original Message ID: {triggerMessage.Id}"))
.Timestamp(timestamp.ToDateTimeOffset().ToString("O"));
if (oldContent == "")
oldContent = "*no message content*";
if (oldContent != null)
embed.Field(new Embed.Field("Old message", oldContent?.NormalizeLineEndSpacing().Truncate(1000)));