@@ -11,15 +11,15 @@ interface FetchMessagesParameters {
1111type ParsedLimit =
1212 | { type : 'count' ; value : number }
1313 | { type : 'date' ; value : Date }
14- | { type : 'last_out_msg ' }
14+ | { type : 'lastout ' }
1515
1616const sleep = ( ms : number ) => new Promise ( r => setTimeout ( r , ms ) )
1717
1818function parseLimit ( limit : string ) : ParsedLimit {
1919 const zone = process . env . SUMMARY_TIMEZONE || process . env . TZ || 'Europe/Moscow'
2020
21- if ( limit === 'since:last_out_msg ' ) {
22- return { type : 'last_out_msg ' }
21+ if ( limit === 'since:lastout ' ) {
22+ return { type : 'lastout ' }
2323 }
2424
2525 // since:HH:MM — today at that time
@@ -58,7 +58,7 @@ function parseLimit(limit: string): ParsedLimit {
5858 const count = Number ( limit )
5959 if ( isNaN ( count ) || count <= 0 ) {
6060 throw new Error (
61- `Invalid limit: "${ limit } ". Use a number, since:HH:MM, since:DD-MM-YYYY_HH:MM, last:Nm/Nh/Nd, or since:last_out_msg `
61+ `Invalid limit: "${ limit } ". Use a number, since:HH:MM, since:DD-MM-YYYY_HH:MM, last:Nm/Nh/Nd, or since:lastout `
6262 )
6363 }
6464 return { type : 'count' , value : count }
@@ -138,7 +138,7 @@ export async function fetchMessages({
138138 return fetchByCount ( client , chatId , parsed . value )
139139 case 'date' :
140140 return fetchByDate ( client , chatId , parsed . value )
141- case 'last_out_msg ' :
141+ case 'lastout ' :
142142 return fetchSinceLastOutgoing ( client , chatId )
143143 }
144144}
0 commit comments