From d06756586d9a6718c4ce4df1ae4145742904ea26 Mon Sep 17 00:00:00 2001 From: sabihoshi Date: Sat, 8 Apr 2023 04:56:19 +0800 Subject: [PATCH] fix: Chunk embeds by 10 in PublishLogAsync --- HuTao.Services/Logging/LoggingService.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/HuTao.Services/Logging/LoggingService.cs b/HuTao.Services/Logging/LoggingService.cs index 91ed321..fe9c2c5 100644 --- a/HuTao.Services/Logging/LoggingService.cs +++ b/HuTao.Services/Logging/LoggingService.cs @@ -199,7 +199,9 @@ private async Task PublishLogAsync(ILog? log, LogType type, IGuild guild, Cancel private static async Task PublishLogAsync(EmbedLog? log, IMessageChannel? channel) { if (log is null || channel is null) return; - await channel.SendFilesAsync(log.Attachments, embeds: log.Embeds.ToArray()); + var message = await channel.SendFilesAsync(log.Attachments, embeds: log.Embeds.Take(10).ToArray()); + foreach (var chunk in log.Embeds.Skip(10).Chunk(10)) + await message.ReplyAsync(embeds: chunk.ToArray()); } private static async Task TryGetAuditLogDetails(IMessage? message, IGuild guild)