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:
parent
1d688f36b8
commit
0f02125b0f
1 changed files with 12 additions and 0 deletions
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue