Skip to content

Commit

Permalink
feat(voice): prevent first channel from being rearranged
Browse files Browse the repository at this point in the history
The rearranging function in main.py has been updated to ignore the first channel. This change ensures that the first channel maintains its original position, providing better control and consistency over channel positions.
  • Loading branch information
joeyaurel committed Dec 28, 2023
1 parent a90d3d1 commit d70e934
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ async def rearrange_voice_channels(channel_prefix: Optional[str]):
if len(channels) > 1:
channels.sort(key=lambda x: x.position)
first_channel_position = channels[0].position
for i, channel in enumerate(channels):
# Ignore rearranging the first channel
for i, channel in enumerate(channels[1:], start=1):
# Position the voice channel relative to the first voice channel
await channel.edit(position=first_channel_position + i)

Expand Down

0 comments on commit d70e934

Please sign in to comment.