3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-21 16:55:03 +00:00

add createChunkedEmbedMessage util

This commit is contained in:
metal 2021-08-27 15:37:44 +00:00 committed by GitHub
parent 1d688f36b8
commit 0f02125b0f

View file

@ -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<MessageEmbed>(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
*/