Skip to content

Commit

Permalink
fix: Chunk embeds by 10 in PublishLogAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
sabihoshi committed Apr 7, 2023
1 parent 3530e2b commit d067565
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion HuTao.Services/Logging/LoggingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ActionDetails?> TryGetAuditLogDetails(IMessage? message, IGuild guild)
Expand Down

0 comments on commit d067565

Please sign in to comment.