Get Started - Learn How To Make Your Bot!
List of all currently Free Items
Added on version 23.1.0b13
on_message(self, user_id: str, conversation_id: str, is_new_conversation: bool) -> None:
Handler that is triggered when bot received message from user
Simple print on what this method returns:
async def on_message(self, user_id: str, conversation_id: str, is_new_conversation: bool) -> None:
print(f"New message from {user_id} in {conversation_id}! Is new conversation: {is_new_conversation}")
Output: New message from 6111e1fb22dcb50edf32e4a8 in 1_on_1:6111e1fb22dcb50edf32e4a8:649b87f63cf84acc47487627! Is new conversation: False
You can use this method whenever you wnat that an action is triggered from a user sending a message to the bot.