We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
embedLength
1 parent d7a45a0 commit cb3826cCopy full SHA for cb3826c
packages/discord.js/src/structures/Embed.js
@@ -1,5 +1,6 @@
1
'use strict';
2
3
+const { embedLength } = require('@discordjs/builders');
4
const isEqual = require('fast-deep-equal');
5
6
/**
@@ -181,13 +182,7 @@ class Embed {
181
182
* @readonly
183
*/
184
get length() {
- return (
185
- (this.data.title?.length ?? 0) +
186
- (this.data.description?.length ?? 0) +
187
- (this.data.fields?.reduce((prev, curr) => prev + curr.name.length + curr.value.length, 0) ?? 0) +
188
- (this.data.footer?.text.length ?? 0) +
189
- (this.data.author?.name.length ?? 0)
190
- );
+ return embedLength(this.data);
191
}
192
193
0 commit comments