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="")
| 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): |
no outgoing calls
no test coverage detected