Updated the loop button in controller

This commit is contained in:
Choco
2024-04-15 13:56:54 +08:00
parent 610e70da71
commit b3fcd4bbb3

View File

@@ -213,11 +213,7 @@ class Loop(ControlButton):
if current_repeat_mode not in self.btn_emojis:
raise ValueError(f"Invalid repeat mode: {current_repeat_mode}")
emojis = list(self.btn_emojis.keys())
current_index = emojis.index(current_repeat_mode)
next_index = (current_index + 1) % len(emojis)
return self.btn_emojis[emojis[next_index]]
return self.btn_emojis[current_repeat_mode]
async def callback(self, interaction: discord.Interaction):
if not self.player.is_privileged(interaction.user):