This commit is contained in:
2023-08-06 14:05:34 +02:00
parent 217adb85ed
commit 2f1fdecd5f
21 changed files with 273 additions and 1053 deletions

View File

@@ -25,9 +25,12 @@ class BaseStorage:
self, file: telethon.hints.FileLike, caption: Optional[str] = None
) -> Optional[tuple[Union[str, int], int]]:
try:
message = await self.client.send_file(
entity=self.channel_id, file=file, caption=caption
)
if caption:
message = await self.client.send_file(
entity=self.channel_id, file=file, caption=caption
)
else:
message = await self.client.send_file(entity=self.channel_id, file=file)
except telethon.errors.FilePartInvalidError:
return None
except telethon.errors.PhotoInvalidError: