Skip to content

Commit

Permalink
Merge pull request #2009 from coder2020official/fileupload
Browse files Browse the repository at this point in the history
Fixes #1944: uploading file from memory
  • Loading branch information
coder2020official authored Jul 8, 2023
2 parents 75d3fa2 + 916569c commit 3960115
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions telebot/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7250,7 +7250,7 @@ def _resolve_file(self, file):
_file = open(file, 'rb')
return _file, os.path.basename(_file.name)
elif isinstance(file, IOBase):
return file, os.path.basename(file.name)
return file, service_utils.generate_random_token()
elif isinstance(file, Path):
_file = open(file, 'rb')
return _file, os.path.basename(_file.name)
Expand Down Expand Up @@ -7742,4 +7742,4 @@ def to_dict(self) -> dict:
return json_dict

def to_json(self) -> str:
return json.dumps(self.to_dict())
return json.dumps(self.to_dict())

0 comments on commit 3960115

Please sign in to comment.