aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-05-27 22:17:58 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-05-27 22:17:58 -0400
commit8978f6e0cd20ee18f27cad8296858288ba3d1b2b (patch)
treed1956448686a7335471c269c7e6d9cf7a7524251
parent9ff23742d8605470bf7a87dfbbc82bcfae1385cd (diff)
downloadtanzanite-8978f6e0cd20ee18f27cad8296858288ba3d1b2b.tar.gz
tanzanite-8978f6e0cd20ee18f27cad8296858288ba3d1b2b.tar.bz2
tanzanite-8978f6e0cd20ee18f27cad8296858288ba3d1b2b.zip
fix(BushClientUtil#overflowEmbed): correctly overflow
-rw-r--r--src/lib/extensions/discord-akairo/BushClientUtil.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/extensions/discord-akairo/BushClientUtil.ts b/src/lib/extensions/discord-akairo/BushClientUtil.ts
index aea515a..7629c38 100644
--- a/src/lib/extensions/discord-akairo/BushClientUtil.ts
+++ b/src/lib/extensions/discord-akairo/BushClientUtil.ts
@@ -984,8 +984,11 @@ export class BushClientUtil extends ClientUtil {
for (const line of lines) {
let current = embeds.length ? embeds.at(-1)! : makeEmbed();
- const joined = current.data.description ? `${current.data.description}\n${line}` : line;
- if (joined.length >= maxLength) current = makeEmbed();
+ let joined = current.data.description ? `${current.data.description}\n${line}` : line;
+ if (joined.length > maxLength) {
+ current = makeEmbed();
+ joined = line;
+ }
current.setDescription(joined);
}