Skip to content

Commit

Permalink
fix telegram media sending
Browse files Browse the repository at this point in the history
  • Loading branch information
RLKRo committed Dec 5, 2023
1 parent 16aa9ae commit 81673b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dff/messengers/telegram/messenger.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def send_response(self, chat_id: Union[str, int], response: Union[str, dict, Mes
with open(attachment.source, "rb") as file:
method(chat_id, file, **params)
else:
method(chat_id, attachment.source or attachment.id, **params)
method(chat_id, str(attachment.source or attachment.id), **params)
else:

def cast(file):
Expand All @@ -99,7 +99,7 @@ def cast(file):
cast_to_media_type = types.InputMediaVideo
else:
raise TypeError(type(file))
return cast_to_media_type(media=file.source or file.id, caption=file.title)
return cast_to_media_type(media=str(file.source or file.id), caption=file.title)

files = map(cast, ready_response.attachments.files)
with batch_open_io(files) as media:
Expand Down

0 comments on commit 81673b5

Please sign in to comment.