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.0b11
remove_user_to_voice(self, user_id: str) -> None:
Remove 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("/voiceremove "): try: command, username = message.split(" ") except: await self.highrise.chat("Invalid command, please use /voiceremove <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 not in voice_list: await self.highrise.chat(f"User '{username}' is not in the voice list.") return await self.highrise.remove_user_from_voice(user_id) await self.highrise.chat(f"Removed '{username}' from the voice list.")