From 129e21d1b16ac389fced46c82dee489f7b53ff3d Mon Sep 17 00:00:00 2001 From: Elnath Date: Tue, 9 Feb 2021 23:07:41 +0100 Subject: [PATCH] Setting bitrate and user limit of created channel based on joined channel --- VocalMaisBot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/VocalMaisBot.py b/VocalMaisBot.py index d1aafea..62fa679 100755 --- a/VocalMaisBot.py +++ b/VocalMaisBot.py @@ -257,9 +257,13 @@ class VocalMaisBot(commands.Cog): user_default_channel_name = "{user}'s channel" channel_name = discord_utils.voice_channel_safe_name(user_default_channel_name, user_name_replacement = user.display_name) + # We set bitrate and user limit for the new channel the same as the channel that has been joined to create + bitrate = channel.bitrate + user_limit = channel.user_limit + # Creating the channel and moving the user into it logger.debug(f"[{discord_utils.to_string(channel.guild)}] Creating channel {channel_name} for {discord_utils.to_string(user)}") - user_channel = await category.create_voice_channel(channel_name, overwrites = channel_permissions) + user_channel = await category.create_voice_channel(channel_name, overwrites = channel_permissions, bitrate = bitrate, user_limit = user_limit) await user.move_to(user_channel) logger.info(f"[{discord_utils.to_string(channel.guild)}] Created channel {discord_utils.to_string(user_channel)} for {discord_utils.to_string(user)}")