mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-18 23:09:59 +00:00
25 lines
600 B
TypeScript
25 lines
600 B
TypeScript
import { EmbedField } from "discord.js";
|
|
import { chunkMessageLines, emptyEmbedValue } from "../utils";
|
|
|
|
export function getChunkedEmbedFields(name: string, value: string, inline?: boolean): EmbedField[] {
|
|
const fields: EmbedField[] = [];
|
|
|
|
const chunks = chunkMessageLines(value, 1014);
|
|
for (let i = 0; i < chunks.length; i++) {
|
|
if (i === 0) {
|
|
fields.push({
|
|
name,
|
|
value: chunks[i],
|
|
inline: false,
|
|
});
|
|
} else {
|
|
fields.push({
|
|
name: emptyEmbedValue,
|
|
value: chunks[i],
|
|
inline: false,
|
|
});
|
|
}
|
|
}
|
|
|
|
return fields;
|
|
}
|