def handle_message(self, message: Dict[str, str], bot_handler: BotHandler) -> None: if message['content'] == '': bot_response = "Please specify the message you want to send to followup stream after @mention-bot" bot_handler.send_reply(message, bot_response) elif message['content'] == 'help': bot_handler.send_reply(message, self.usage()) else: bot_response = self.get_bot_followup_response(message) bot_handler.send_message( dict( type='stream', to=self.stream, subject=message['sender_email'], content=bot_response, ))
def send_message(self, bot_handler: BotHandler, message: str, stream: str, subject: str) -> None: # function for sending a message bot_handler.send_message( dict(type='stream', to=stream, subject=subject, content=message))