MCPcopy Create free account
hub / github.com/eternnoir/pyTelegramBotAPI / reply_to

Method reply_to

telebot/__init__.py:6757–6788  ·  view source on GitHub ↗

Convenience function for `send_message(message.chat.id, text, reply_parameters=(message.message_id...), **kwargs)` :param message: Instance of :class:`telebot.types.Message` :type message: :obj:`types.Message` :param text: Text of the message. :type text: :

(self, message: types.Message, text: str, **kwargs)

Source from the content-addressed store, hash-verified

6755
6756
6757 def reply_to(self, message: types.Message, text: str, **kwargs) -> types.Message:
6758 """
6759 Convenience function for `send_message(message.chat.id, text, reply_parameters=(message.message_id...), **kwargs)`
6760
6761 :param message: Instance of :class:`telebot.types.Message`
6762 :type message: :obj:`types.Message`
6763
6764 :param text: Text of the message.
6765 :type text: :obj:`str`
6766
6767 :param kwargs: Additional keyword arguments which are passed to :meth:`telebot.TeleBot.send_message`
6768
6769 :return: On success, the sent Message is returned.
6770 :rtype: :class:`telebot.types.Message`
6771 """
6772 if kwargs:
6773 reply_parameters = kwargs.pop("reply_parameters", None)
6774 if "allow_sending_without_reply" in kwargs:
6775 logger.warning("The parameter 'allow_sending_without_reply' is deprecated. Use 'reply_parameters' instead.")
6776 else:
6777 reply_parameters = None
6778
6779 if not reply_parameters:
6780 reply_parameters = types.ReplyParameters(
6781 message.message_id,
6782 allow_sending_without_reply=kwargs.pop("allow_sending_without_reply", None) if kwargs else None
6783 )
6784
6785 if not reply_parameters.message_id:
6786 reply_parameters.message_id = message.message_id
6787
6788 return self.send_message(message.chat.id, text, reply_parameters=reply_parameters, **kwargs)
6789
6790
6791 def answer_inline_query(

Callers 15

test_reply_toMethod · 0.95
startmsgFunction · 0.45
send_welcomeFunction · 0.45
echo_allFunction · 0.45
send_welcomeFunction · 0.45
startFunction · 0.45
web_appFunction · 0.45
get_reactionsFunction · 0.45
send_welcomeFunction · 0.45
set_timerFunction · 0.45

Calls 1

send_messageMethod · 0.95

Tested by 2

test_reply_toMethod · 0.76