Get Started - Learn How To Make Your Bot!
List of all currently Free Items
Added on version 23.1.0b13
leave_conversation(self, conversation_id: str) -> None:
Leave a conversation.
This will leave conversation, and bot will no longer receive messages from user in that conversation or have that conversation in his list.
Here we will firts use the leave_conversation method to leave an existing conversation, then we will use the get_message method to retrieve an specific conversation from the bot and store it in a variable called specific_conversation and then we will print it on terminal to see how the response from it looks like.
async def on_start(self, session_metadata: SessionMetadata) -> None:
conversation_id = '1_on_1:6111e1fb22dcb50edf32e4a8:649b87f63cf84acc47487627'
await self.highrise.leave_conversation(conversation_id)
specific_conversation = await self.highrise.get_messages(conversation_id)
print (specific_conversation)
Response:
Error(message='Server error', rid='1')
As you can see, diferently from observed on π Get_messages, the conversation seases to exist and an error is returned when printing the response from the specific_conversation since it doesnβt exist anymore.