From 7d6e889b46253325ff1e3a87f3f6179d01cf1f04 Mon Sep 17 00:00:00 2001 From: grant Date: Mon, 26 Feb 2024 16:54:18 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=89=20fixing=20twitter=20bot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Classes/TwitterBot.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Classes/TwitterBot.ts b/src/Classes/TwitterBot.ts index 93ecd09..e6cf769 100644 --- a/src/Classes/TwitterBot.ts +++ b/src/Classes/TwitterBot.ts @@ -110,9 +110,13 @@ export class TwitterBot { error.errors[0]?.message.includes('since_id') ) { const messageSplit = error.errors[0]?.message.split(' ') - const lastId = messageSplit[messageSplit.length - 1] - console.log('TwitterBot since_id is invalid - setting to', lastId) - this.lastTweetId = lastId + const lastId = BigInt(messageSplit[messageSplit.length - 1]) + const adjustedLastId = (lastId + BigInt(1000)).toString() + console.log( + 'TwitterBot since_id is invalid - setting to', + adjustedLastId + ) + this.lastTweetId = adjustedLastId } else { console.error('Error searching Twitter:', error) }