Get Started - Learn How To Make Your Bot!Code SnippetsGet methodsPost methodsWeb APIUseful linksList of all currently Free ItemsList of all currently Free EmotesHighrise Bot SDK Changelog
Added on version 23.1.0b13
send_message(self, conversation_id: str, content: str, message_type: Literal["text", "invite"] = "text", room_id: str | None = None,) -> None:
Send a message to conversation.
This can be only used on existing conversation, and will fail if conversation is not found. Bot can only send two types of messages,Β
text
Β andΒ invite
. Text is the normal message in which bot can send text to user, and invite is used to invite user to room. If type is invite then room_id must be provided in order to generate room invite for users.βοΈ Use cases
A very common use case of this method is to respond to messages that the bot receives on messages.
Hereβs a simple code where the bot will respond with βHello World!β to any βHelloβ messages they receive on messages:
async def on_message(self, user_id: str, conversation_id: str, is_new_conversation: bool) -> None: response = await self.highrise.get_messages(conversation_id) if isinstance(response, GetMessagesRequest.GetMessagesResponse): message = response.messages[0].content print (message) if message == "Hello": await self.highrise.send_message(conversation_id, "Hello World!")
Β
Β