diff --git a/backend/src/utils.ts b/backend/src/utils.ts index 8a7f7c55..97e0bdbb 100644 --- a/backend/src/utils.ts +++ b/backend/src/utils.ts @@ -1012,6 +1012,18 @@ export async function createChunkedMessage( } } +export async function createChunkedEmbedMessage( + channel: TextChannel | ThreadChannel | User, + messageEmbeds: MessageEmbed[], + allowedMentions?: MessageMentionOptions, + maxChunkLength = 10, +) { + const chunks = chunkArray(messageEmbeds, maxChunkLength); + for (const chunk of chunks) { + await channel.send({ embeds: chunk, allowedMentions }); + } +} + /** * Downloads the file from the given URL to a temporary file, with retry support */