From dc5e64aaac60f29cb29d021b83d5abb468a2f8f1 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 30 Nov 2022 10:17:50 +0100 Subject: [PATCH] lib/client: unify checks for chathistory end --- lib/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client.js b/lib/client.js index dc787b6..03eb519 100644 --- a/lib/client.js +++ b/lib/client.js @@ -916,7 +916,7 @@ export default class Client extends EventTarget { if (limit <= 0) { throw new Error("Cannot fetch all chat history: too many messages"); } - if (messages.length == max) { + if (messages.length >= max) { // There are still more messages to fetch after.time = messages[messages.length - 1].tags.time; return this.fetchHistoryBetween(target, after, before, limit);