mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
refactor(Embed): use embedLength function from builders (#8735)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const { embedLength } = require('@discordjs/builders');
|
||||
const isEqual = require('fast-deep-equal');
|
||||
|
||||
/**
|
||||
@@ -181,13 +182,7 @@ class Embed {
|
||||
* @readonly
|
||||
*/
|
||||
get length() {
|
||||
return (
|
||||
(this.data.title?.length ?? 0) +
|
||||
(this.data.description?.length ?? 0) +
|
||||
(this.data.fields?.reduce((prev, curr) => prev + curr.name.length + curr.value.length, 0) ?? 0) +
|
||||
(this.data.footer?.text.length ?? 0) +
|
||||
(this.data.author?.name.length ?? 0)
|
||||
);
|
||||
return embedLength(this.data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user