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.0b11

add_user_to_voice(self, user_id: str) -> None:

Add an user to voice chat.

⚙️ Use cases

A simple usage can be done using a on_chat command passing an user:

async def on_chat(self, user: User, message: str) -> None:
        if message.lower().startswith("/voiceadd "):
            try:
                command, username = message.split(" ")
            except:
                await self.highrise.chat("Invalid command, please use /voiceadd <username>")
                return
            #gets room users and check if the user is in the room
            room_users = (await self.highrise.get_room_users()).content
            for room_user, position in room_users:
                if room_user.username.lower() == username.lower():
                    user_id = room_user.id
                    break
            if "user_id" not in locals():
                await self.highrise.chat(f"User '{username}' not found.")
                return
				
            #checks if the user is already in the voice list
            voice_list = (await self.highrise.get_voice_status()).users
            if user_id in voice_list:
				        await self.highrise.chat(f"User '{username}' is already in the voice list.")
                return
				    
            await self.highrise.add_user_to_voice(user_id)
            await self.highrise.chat(f"Added '{username}' to the voice list.")