mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Added the parameter emoji to the method sendSticker to specify an emoji for just uploaded stickers.
This commit is contained in:
parent
09e4a2a437
commit
54caf30f69
@ -2099,7 +2099,8 @@ class TeleBot:
|
|||||||
allow_sending_without_reply: Optional[bool]=None,
|
allow_sending_without_reply: Optional[bool]=None,
|
||||||
protect_content:Optional[bool]=None,
|
protect_content:Optional[bool]=None,
|
||||||
data: Union[Any, str]=None,
|
data: Union[Any, str]=None,
|
||||||
message_thread_id: Optional[int]=None) -> types.Message:
|
message_thread_id: Optional[int]=None,
|
||||||
|
emoji: Optional[str]=None) -> types.Message:
|
||||||
"""
|
"""
|
||||||
Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers.
|
Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers.
|
||||||
On success, the sent Message is returned.
|
On success, the sent Message is returned.
|
||||||
@ -2139,6 +2140,9 @@ class TeleBot:
|
|||||||
:param message_thread_id: The thread to which the message will be sent
|
:param message_thread_id: The thread to which the message will be sent
|
||||||
:type message_thread_id: :obj:`int`
|
:type message_thread_id: :obj:`int`
|
||||||
|
|
||||||
|
:param emoji: Emoji associated with the sticker; only for just uploaded stickers
|
||||||
|
:type emoji: :obj:`str`
|
||||||
|
|
||||||
:return: On success, the sent Message is returned.
|
:return: On success, the sent Message is returned.
|
||||||
:rtype: :class:`telebot.types.Message`
|
:rtype: :class:`telebot.types.Message`
|
||||||
"""
|
"""
|
||||||
@ -2156,7 +2160,7 @@ class TeleBot:
|
|||||||
reply_to_message_id=reply_to_message_id, reply_markup=reply_markup,
|
reply_to_message_id=reply_to_message_id, reply_markup=reply_markup,
|
||||||
disable_notification=disable_notification, timeout=timeout,
|
disable_notification=disable_notification, timeout=timeout,
|
||||||
allow_sending_without_reply=allow_sending_without_reply,
|
allow_sending_without_reply=allow_sending_without_reply,
|
||||||
protect_content=protect_content, message_thread_id=message_thread_id))
|
protect_content=protect_content, message_thread_id=message_thread_id, emoji=emoji))
|
||||||
|
|
||||||
def send_video(
|
def send_video(
|
||||||
self, chat_id: Union[int, str], video: Union[Any, str],
|
self, chat_id: Union[int, str], video: Union[Any, str],
|
||||||
|
@ -896,7 +896,7 @@ 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,
|
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,
|
disable_notification=None, timeout=None, caption=None, thumb=None, caption_entities=None,
|
||||||
allow_sending_without_reply=None, disable_content_type_detection=None, visible_file_name=None,
|
allow_sending_without_reply=None, disable_content_type_detection=None, visible_file_name=None,
|
||||||
protect_content = None, message_thread_id=None):
|
protect_content = None, message_thread_id=None, emoji=None):
|
||||||
method_url = get_method_by_type(data_type)
|
method_url = get_method_by_type(data_type)
|
||||||
payload = {'chat_id': chat_id}
|
payload = {'chat_id': chat_id}
|
||||||
files = None
|
files = None
|
||||||
@ -937,6 +937,8 @@ def send_data(token, chat_id, data, data_type, reply_to_message_id=None, reply_m
|
|||||||
payload['disable_content_type_detection'] = disable_content_type_detection
|
payload['disable_content_type_detection'] = disable_content_type_detection
|
||||||
if message_thread_id:
|
if message_thread_id:
|
||||||
payload['message_thread_id'] = message_thread_id
|
payload['message_thread_id'] = message_thread_id
|
||||||
|
if emoji:
|
||||||
|
payload['emoji'] = emoji
|
||||||
return _make_request(token, method_url, params=payload, files=files, method='post')
|
return _make_request(token, method_url, params=payload, files=files, method='post')
|
||||||
|
|
||||||
|
|
||||||
|
@ -2958,7 +2958,8 @@ class AsyncTeleBot:
|
|||||||
allow_sending_without_reply: Optional[bool]=None,
|
allow_sending_without_reply: Optional[bool]=None,
|
||||||
protect_content: Optional[bool]=None,
|
protect_content: Optional[bool]=None,
|
||||||
data: Union[Any, str]=None,
|
data: Union[Any, str]=None,
|
||||||
message_thread_id: Optional[int]=None) -> types.Message:
|
message_thread_id: Optional[int]=None,
|
||||||
|
emoji: Optional[str]=None) -> types.Message:
|
||||||
"""
|
"""
|
||||||
Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers.
|
Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers.
|
||||||
On success, the sent Message is returned.
|
On success, the sent Message is returned.
|
||||||
@ -2998,6 +2999,9 @@ class AsyncTeleBot:
|
|||||||
:param message_thread_id: Identifier of a message thread, in which the message will be sent
|
:param message_thread_id: Identifier of a message thread, in which the message will be sent
|
||||||
:type message_thread_id: :obj:`int`
|
:type message_thread_id: :obj:`int`
|
||||||
|
|
||||||
|
:param emoji: Emoji associated with the sticker; only for just uploaded stickers
|
||||||
|
:type emoji: :obj:`str`
|
||||||
|
|
||||||
:return: On success, the sent Message is returned.
|
:return: On success, the sent Message is returned.
|
||||||
:rtype: :class:`telebot.types.Message`
|
:rtype: :class:`telebot.types.Message`
|
||||||
"""
|
"""
|
||||||
@ -3016,7 +3020,7 @@ class AsyncTeleBot:
|
|||||||
reply_to_message_id=reply_to_message_id, reply_markup=reply_markup,
|
reply_to_message_id=reply_to_message_id, reply_markup=reply_markup,
|
||||||
disable_notification=disable_notification, timeout=timeout,
|
disable_notification=disable_notification, timeout=timeout,
|
||||||
allow_sending_without_reply=allow_sending_without_reply, protect_content=protect_content,
|
allow_sending_without_reply=allow_sending_without_reply, protect_content=protect_content,
|
||||||
message_thread_id=message_thread_id))
|
message_thread_id=message_thread_id, emoji=emoji))
|
||||||
|
|
||||||
async def send_video(
|
async def send_video(
|
||||||
self, chat_id: Union[int, str], video: Union[Any, str],
|
self, chat_id: Union[int, str], video: Union[Any, str],
|
||||||
|
@ -888,7 +888,7 @@ async def send_audio(token, chat_id, audio, caption=None, duration=None, perform
|
|||||||
async def send_data(token, chat_id, data, data_type, reply_to_message_id=None, reply_markup=None, parse_mode=None,
|
async 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,
|
disable_notification=None, timeout=None, caption=None, thumb=None, caption_entities=None,
|
||||||
allow_sending_without_reply=None, disable_content_type_detection=None, visible_file_name=None, protect_content=None,
|
allow_sending_without_reply=None, disable_content_type_detection=None, visible_file_name=None, protect_content=None,
|
||||||
message_thread_id=None):
|
message_thread_id=None, emoji=None):
|
||||||
method_url = await get_method_by_type(data_type)
|
method_url = await get_method_by_type(data_type)
|
||||||
payload = {'chat_id': chat_id}
|
payload = {'chat_id': chat_id}
|
||||||
files = None
|
files = None
|
||||||
@ -929,6 +929,8 @@ async def send_data(token, chat_id, data, data_type, reply_to_message_id=None, r
|
|||||||
payload['disable_content_type_detection'] = disable_content_type_detection
|
payload['disable_content_type_detection'] = disable_content_type_detection
|
||||||
if message_thread_id:
|
if message_thread_id:
|
||||||
payload['message_thread_id'] = message_thread_id
|
payload['message_thread_id'] = message_thread_id
|
||||||
|
if emoji:
|
||||||
|
payload['emoji'] = emoji
|
||||||
return await _process_request(token, method_url, params=payload, files=files, method='post')
|
return await _process_request(token, method_url, params=payload, files=files, method='post')
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user