mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 15:35:35 +01:00
Fix image downloading
This commit is contained in:
@@ -24,6 +24,7 @@ export async function download(source_id: number, remote_id: number, file_type:
|
||||
|
||||
|
||||
export async function downloadImage(path: string) {
|
||||
try {
|
||||
const response = await got(path);
|
||||
|
||||
if (response.statusCode === 200) {
|
||||
@@ -31,4 +32,7 @@ export async function downloadImage(path: string) {
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,8 +185,6 @@ export function getCallbackArgs(ctx: Context): { query: string, page: number} |
|
||||
|
||||
const [ _, query, sPage ] = ctx.callbackQuery.data.split('_');
|
||||
|
||||
console.log(_, query, sPage);
|
||||
|
||||
const page = parseInt(sPage);
|
||||
|
||||
if (isNaN(page)) {
|
||||
|
||||
@@ -89,7 +89,7 @@ export default class BotsManager {
|
||||
await oldBot.telegram.deleteWebhook();
|
||||
await oldBot.telegram.logOut();
|
||||
} catch (e) {
|
||||
Sentry.captureException(e);
|
||||
// Sentry.captureException(e);
|
||||
}
|
||||
|
||||
let bot: Telegraf;
|
||||
@@ -97,7 +97,7 @@ export default class BotsManager {
|
||||
try {
|
||||
bot = await getBot(state.token, state);
|
||||
} catch (e) {
|
||||
Sentry.captureException(e);
|
||||
// Sentry.captureException(e);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user