Get Started - Learn How To Make Your Bot!

Guides

Code Snippets

Get methods

Post methods

Web API

Useful links

List of all currently Free Items

List of Emotes

Highrise 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!")

Untitled