mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Some speed
This commit is contained in:
parent
30d69d8d4a
commit
396e805a07
1 changed files with 3 additions and 3 deletions
|
|
@ -255,10 +255,10 @@ class Bot(ContextInstanceMixin["Bot"]):
|
||||||
"""
|
"""
|
||||||
if isinstance(file, str):
|
if isinstance(file, str):
|
||||||
file_id = file
|
file_id = file
|
||||||
elif hasattr(file, "file_id"):
|
|
||||||
file_id = file.file_id
|
|
||||||
else:
|
else:
|
||||||
raise TypeError("file can only be of the string or Downloadable type")
|
file_id = getattr(file, "file_id", None)
|
||||||
|
if file_id is None:
|
||||||
|
raise TypeError("file can only be of the string or Downloadable type")
|
||||||
|
|
||||||
_file = await self.get_file(file_id)
|
_file = await self.get_file(file_id)
|
||||||
# https://github.com/aiogram/aiogram/pull/282/files#r394110017
|
# https://github.com/aiogram/aiogram/pull/282/files#r394110017
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue