Implement user movement and channel info saving in AutoRoom
Some checks are pending
Run pre-commit / Run pre-commit (push) Waiting to run
Some checks are pending
Run pre-commit / Run pre-commit (push) Waiting to run
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.
This commit is contained in:
parent
fa6cd01476
commit
f986a23d2b
1 changed files with 16 additions and 0 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue