File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
import TelegramBot from "node-telegram-bot-api" ;
2
+ import { Readable , type Stream } from "stream" ;
2
3
import { z } from "zod" ;
3
- import { Readable } from "node:stream" ;
4
4
5
5
// https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#file-options-metadata
6
6
process . env . NTBA_FIX_350 = "false" ;
@@ -184,7 +184,7 @@ class Bot {
184
184
}
185
185
) : Promise < void > {
186
186
const downloadUrl = cobaltResult . url ;
187
- let downloadFrom : string | Readable = downloadUrl ;
187
+ let downloadFrom : string | Stream = downloadUrl ;
188
188
let contentType : string | undefined ;
189
189
if ( downloadUrl . includes ( "cdninstagram.com" ) ) {
190
190
// proxy instead because Telegram blocks instagram.com domains
@@ -224,6 +224,8 @@ class Bot {
224
224
}
225
225
console . error ( `Error al enviar el video ${ downloadUrl } :` , e ) ;
226
226
throw e ;
227
+ } finally {
228
+ Bun . gc ( true ) ;
227
229
}
228
230
}
229
231
}
You can’t perform that action at this time.
0 commit comments