mirror of
https://github.com/flibusta-apps/telegram_files_server.git
synced 2025-12-06 12:35:39 +01:00
Fix RAM usage
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import abc
|
||||
from io import BytesIO
|
||||
from typing import AsyncIterator, Union, Optional
|
||||
|
||||
import telethon.client
|
||||
import telethon.errors
|
||||
import telethon.hints
|
||||
import telethon.tl.types
|
||||
|
||||
from core.config import env_config
|
||||
@@ -23,7 +23,7 @@ class BaseStorage(abc.ABC):
|
||||
...
|
||||
|
||||
async def upload(
|
||||
self, file: BytesIO, caption: Optional[str] = None
|
||||
self, file: telethon.hints.FileLike, caption: Optional[str] = None
|
||||
) -> Optional[tuple[Union[str, int], int]]:
|
||||
message = await self.client.send_file(
|
||||
self.channel_id, file=file, caption=caption
|
||||
|
||||
Reference in New Issue
Block a user