From f986a23d2b3fa0a19c8413c0a99e0559ccc4a5fd Mon Sep 17 00:00:00 2001 From: Valerie Date: Fri, 13 Jun 2025 19:32:12 -0400 Subject: [PATCH] Implement user movement and channel info saving in AutoRoom This update enhances the AutoRoom functionality by saving channel information and moving users to newly created voice channels. It includes error handling for potential movement failures, ensuring a smoother user experience when utilizing the AutoRoom feature. --- autoroom/autoroom.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/autoroom/autoroom.py b/autoroom/autoroom.py index 00705d2..0baf195 100644 --- a/autoroom/autoroom.py +++ b/autoroom/autoroom.py @@ -521,6 +521,22 @@ class AutoRoom( overwrites=perms.overwrites if perms.overwrites else {}, ) + # Save channel info + await self.config.channel(new_voice_channel).source_channel.set( + autoroom_source.id + ) + if asc["room_type"] != "server": + await self.config.channel(new_voice_channel).owner.set(member.id) + + # Move user to new channel + try: + await member.move_to( + new_voice_channel, reason="AutoRoom: Move user to new AutoRoom." + ) + except discord.HTTPException: + await self._process_autoroom_delete(new_voice_channel, member) + return + # Create control panel in the voice channel's text chat await self.control_panel.create_control_panel(new_voice_channel)