forked from MapComplete/MastodonBot
Include bullet in length calculation
This commit is contained in:
parent
750c76c80e
commit
5df7246db6
1 changed files with 4 additions and 4 deletions
|
@ -289,10 +289,10 @@ export class Postbuilder {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
const overview = await this.createOverviewForContributor(uid, changesetsMade)
|
const overview = await this.createOverviewForContributor(uid, changesetsMade)
|
||||||
if (overview.length + toSend.join("\n").length > 500) {
|
if (("- " + overview).length + toSend.join("\n").length > 500) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
toSend.push(" - " + overview)
|
toSend.push("- " + overview)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Could not add contributor " + uid, e)
|
console.error("Could not add contributor " + uid, e)
|
||||||
}
|
}
|
||||||
|
@ -337,14 +337,14 @@ export class Postbuilder {
|
||||||
|
|
||||||
const images = await imageUploader.attemptToUpload(4)
|
const images = await imageUploader.attemptToUpload(4)
|
||||||
const authors = Array.from(new Set(imageUploader.getCurrentAuthors()))
|
const authors = Array.from(new Set(imageUploader.getCurrentAuthors()))
|
||||||
if(authors.length > 0){
|
if (authors.length > 0) {
|
||||||
await this._poster.writeMessage([
|
await this._poster.writeMessage([
|
||||||
"In total, " + totalImageContributorCount + " different contributors uploaded " + totalImagesCreated + " images.\n",
|
"In total, " + totalImageContributorCount + " different contributors uploaded " + totalImagesCreated + " images.\n",
|
||||||
"Images in this thread are randomly selected from them and were made by: ",
|
"Images in this thread are randomly selected from them and were made by: ",
|
||||||
...authors.map(auth => "- " + auth),
|
...authors.map(auth => "- " + auth),
|
||||||
"",
|
"",
|
||||||
"All changes were made on " + date + (this._config.numberOfDays > 1 ? ` or at most ${this._config.numberOfDays} days before` : "")
|
"All changes were made on " + date + (this._config.numberOfDays > 1 ? ` or at most ${this._config.numberOfDays} days before` : "")
|
||||||
|
|
||||||
].join("\n"), {
|
].join("\n"), {
|
||||||
inReplyToId: lastPostId,
|
inReplyToId: lastPostId,
|
||||||
mediaIds: images,
|
mediaIds: images,
|
||||||
|
|
Loading…
Reference in a new issue