24 lines
548 B
TypeScript
24 lines
548 B
TypeScript
![]() |
import { EmbedField } from "eris";
|
||
|
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],
|
||
|
});
|
||
|
} else {
|
||
|
fields.push({
|
||
|
name: emptyEmbedValue,
|
||
|
value: chunks[i],
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return fields;
|
||
|
}
|