Merge branch 'develop' of ssh://davte.it:8445/Davte/davtelepot into develop
This commit is contained in:
commit
7f7ba35276
@ -1752,8 +1752,10 @@ class Bot(TelegramBot, ObjectWithDatabase, MultiLanguageObject):
|
|||||||
mode='raw'
|
mode='raw'
|
||||||
)
|
)
|
||||||
path = path or self.path
|
path = path or self.path
|
||||||
if file_name is None:
|
while file_name is None:
|
||||||
file_name = get_secure_key(length=10)
|
file_name = get_secure_key(length=10)
|
||||||
|
if os.path.exists(f"{path}/{file_name}"):
|
||||||
|
file_name = None
|
||||||
try:
|
try:
|
||||||
with open(f"{path}/{file_name}", 'wb') as local_file:
|
with open(f"{path}/{file_name}", 'wb') as local_file:
|
||||||
local_file.write(file_bytes)
|
local_file.write(file_bytes)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user