MCPcopy Index your code
hub / github.com/InstaPy/InstaPy / send_message

Method send_message

instapy/plugins/telegram_util.py:156–167  ·  view source on GitHub ↗

function to be able to send messages from anywhere else in the instapy code :param text: the text of the message you want to send remember we cannot send_messages if we don't have the chat_id to get the chat_id, user has to send at little one /start to the bot

(self, text="")

Source from the content-addressed store, hash-verified

154 )
155
156 def send_message(self, text=""):
157 """
158 function to be able to send messages from anywhere else in the instapy code
159 :param text: the text of the message you want to send
160 remember we cannot send_messages if we don't have the chat_id
161 to get the chat_id, user has to send at little one /start to the bot
162 :return:
163 """
164 if (self.__chat_id is None) and (self.__context is None):
165 raise TelegramError
166 else:
167 self.__context.bot.send_message(chat_id=self.__chat_id, text=text)
168
169 @staticmethod
170 def telegram_delete_session(session):

Callers 7

telegram_botMethod · 0.80
_startMethod · 0.80
_reportMethod · 0.80
_stopMethod · 0.80
_unknownMethod · 0.80
_check_authorizedMethod · 0.80
endMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected