mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
12 lines
349 B
TypeScript
12 lines
349 B
TypeScript
import type { APIEmbed } from 'discord-api-types/v10';
|
|
|
|
export function embedLength(data: APIEmbed) {
|
|
return (
|
|
(data.title?.length ?? 0) +
|
|
(data.description?.length ?? 0) +
|
|
(data.fields?.reduce((prev, curr) => prev + curr.name.length + curr.value.length, 0) ?? 0) +
|
|
(data.footer?.text.length ?? 0) +
|
|
(data.author?.name.length ?? 0)
|
|
);
|
|
}
|