File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ export class ClientBase extends EventEmitter {
86
86
twitterClient : Scraper ;
87
87
runtime : IAgentRuntime ;
88
88
directions : string ;
89
- lastCheckedTweetId : number | null = null ;
89
+ lastCheckedTweetId : bigint | null = null ;
90
90
imageDescriptionService : IImageDescriptionService ;
91
91
temperature : number = 0.5 ;
92
92
@@ -588,20 +588,20 @@ export class ClientBase extends EventEmitter {
588
588
589
589
async loadLatestCheckedTweetId ( ) : Promise < void > {
590
590
const latestCheckedTweetId =
591
- await this . runtime . cacheManager . get < number > (
591
+ await this . runtime . cacheManager . get < string > (
592
592
`twitter/${ this . profile . username } /latest_checked_tweet_id`
593
593
) ;
594
594
595
595
if ( latestCheckedTweetId ) {
596
- this . lastCheckedTweetId = latestCheckedTweetId ;
596
+ this . lastCheckedTweetId = BigInt ( latestCheckedTweetId ) ;
597
597
}
598
598
}
599
599
600
600
async cacheLatestCheckedTweetId ( ) {
601
601
if ( this . lastCheckedTweetId ) {
602
602
await this . runtime . cacheManager . set (
603
603
`twitter/${ this . profile . username } /latest_checked_tweet_id` ,
604
- this . lastCheckedTweetId
604
+ this . lastCheckedTweetId . toString ( )
605
605
) ;
606
606
}
607
607
}
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ export class TwitterInteractionClient {
127
127
for ( const tweet of uniqueTweetCandidates ) {
128
128
if (
129
129
! this . client . lastCheckedTweetId ||
130
- parseInt ( tweet . id ) > this . client . lastCheckedTweetId
130
+ BigInt ( tweet . id ) > this . client . lastCheckedTweetId
131
131
) {
132
132
elizaLogger . log ( "New Tweet found" , tweet . permanentUrl ) ;
133
133
@@ -167,7 +167,7 @@ export class TwitterInteractionClient {
167
167
} ) ;
168
168
169
169
// Update the last checked tweet ID after processing each tweet
170
- this . client . lastCheckedTweetId = parseInt ( tweet . id ) ;
170
+ this . client . lastCheckedTweetId = BigInt ( tweet . id ) ;
171
171
}
172
172
}
173
173
You can’t perform that action at this time.
0 commit comments