feat: add file_hash column and related index to files table; refactor Telegram API utilities for improved file handling

This commit is contained in:
MythEclipse
2026-05-21 22:55:42 +07:00
parent 52340ee77d
commit 10c968cf01
5 changed files with 24 additions and 95 deletions
+1 -1
View File
@@ -2,6 +2,7 @@ import { findFileByPublicId } from '../db/files';
import { formatCreatedAt, getErrorMessage } from '../utils/file';
import logger from '../utils/logger';
import { checkRateLimit } from '../utils/rateLimit';
import { getBot } from '../utils/telegram';
type RequestWithParams = Request & {
params?: {
@@ -25,7 +26,6 @@ export const handleFileRedirect = async (req: RequestWithParams): Promise<Respon
return Response.json({ error: 'File not found' }, { status: 404 });
}
const { getBot } = await import('../utils/telegram');
const bot = getBot();
const fileInfo = await bot.telegram.getFile(file.telegramFileId);