1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Update file_name to visible_file_name in send_document

This commit is contained in:
Badiboy
2021-06-29 13:30:01 +03:00
parent 30e304ffb5
commit a4e73a05c6
3 changed files with 7 additions and 7 deletions

View File

@ -806,14 +806,14 @@ def send_audio(token, chat_id, audio, caption=None, duration=None, performer=Non
def send_data(token, chat_id, data, data_type, reply_to_message_id=None, reply_markup=None, parse_mode=None,
disable_notification=None, timeout=None, caption=None, thumb=None, caption_entities=None,
allow_sending_without_reply=None, disable_content_type_detection=None, file_name=None):
allow_sending_without_reply=None, disable_content_type_detection=None, visible_file_name=None):
method_url = get_method_by_type(data_type)
payload = {'chat_id': chat_id}
files = None
if not util.is_string(data):
file_data = data
if file_name is not None:
file_data = (file_name, data)
if visible_file_name:
file_data = (visible_file_name, data)
files = {data_type: file_data}
else:
payload[data_type] = data