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

Added copyMessage method

This commit is contained in:
Alireza
2021-01-11 02:50:17 +03:30
parent 87574a7613
commit 58281f0a10
2 changed files with 48 additions and 1 deletions

View File

@@ -326,6 +326,30 @@ def forward_message(
return _make_request(token, method_url, params=payload)
def copy_message(token, chat_id, from_chat_id, message_id, caption=None, parse_mode=None, caption_entities=None,
reply_to_message_id=None, allow_sending_without_reply=None, reply_markup=None,
disable_notification=None, timeout=None):
method_url = r'copyMessage'
payload = {'chat_id': chat_id, 'from_chat_id': from_chat_id, 'message_id': message_id}
if caption is not None:
payload['caption'] = caption
if parse_mode is not None:
payload['parse_mode'] = parse_mode
if caption_entities is not None:
payload['caption_entities'] = caption_entities
if reply_to_message_id is not None:
payload['reply_to_message_id'] = reply_to_message_id
if reply_markup is not None:
payload['reply_markup'] = reply_markup
if allow_sending_without_reply is not None:
payload['allow_sending_without_reply'] = allow_sending_without_reply
if disable_notification is not None:
payload['disable_notification'] = disable_notification
if timeout:
payload['connect-timeout'] = timeout
return _make_request(token, method_url, params=payload)
def send_dice(
token, chat_id,
emoji=None, disable_notification=None, reply_to_message_id=None,