From 5df7246db6fac58a9a0316a3632fc5d5dbf13361 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Fri, 27 Jan 2023 14:04:26 +0100 Subject: [PATCH] Include bullet in length calculation --- src/Postbuilder.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Postbuilder.ts b/src/Postbuilder.ts index baa9d52..fa41b09 100644 --- a/src/Postbuilder.ts +++ b/src/Postbuilder.ts @@ -289,10 +289,10 @@ export class Postbuilder { continue } const overview = await this.createOverviewForContributor(uid, changesetsMade) - if (overview.length + toSend.join("\n").length > 500) { + if (("- " + overview).length + toSend.join("\n").length > 500) { break } - toSend.push(" - " + overview) + toSend.push("- " + overview) } catch (e) { console.error("Could not add contributor " + uid, e) } @@ -337,14 +337,14 @@ export class Postbuilder { const images = await imageUploader.attemptToUpload(4) const authors = Array.from(new Set(imageUploader.getCurrentAuthors())) - if(authors.length > 0){ + if (authors.length > 0) { await this._poster.writeMessage([ "In total, " + totalImageContributorCount + " different contributors uploaded " + totalImagesCreated + " images.\n", "Images in this thread are randomly selected from them and were made by: ", ...authors.map(auth => "- " + auth), "", "All changes were made on " + date + (this._config.numberOfDays > 1 ? ` or at most ${this._config.numberOfDays} days before` : "") - + ].join("\n"), { inReplyToId: lastPostId, mediaIds: images,