@@ -142,6 +142,12 @@ async def command_now(self, ctx: commands.Context):
142142 + ": "
143143 + ("\N{WHITE HEAVY CHECK MARK} " if repeat else "\N{CROSS MARK} " )
144144 )
145+ text += (
146+ (" | " if text else "" )
147+ + _ ("Repeat Current" )
148+ + ": "
149+ + ("\N{WHITE HEAVY CHECK MARK} " if player .repeat_current else "\N{CROSS MARK} " )
150+ )
145151
146152 message = await self .send_embed_msg (ctx , embed = embed , footer = text )
147153
@@ -784,6 +790,46 @@ async def command_repeat(self, ctx: commands.Context):
784790 if self ._player_check (ctx ):
785791 await self .set_player_settings (ctx )
786792
793+ @commands .command (name = "repeatcurrent" )
794+ @commands .guild_only ()
795+ @commands .bot_has_permissions (embed_links = True )
796+ async def command_repeat_current (self , ctx : commands .Context ):
797+ """Toggle repeat current."""
798+ dj_enabled = self ._dj_status_cache .setdefault (
799+ ctx .guild .id , await self .config .guild (ctx .guild ).dj_enabled ()
800+ )
801+ can_skip = await self ._can_instaskip (ctx , ctx .author )
802+ if dj_enabled and not can_skip and not await self ._has_dj_role (ctx , ctx .author ):
803+ return await self .send_embed_msg (
804+ ctx ,
805+ title = _ ("Unable To Toggle Repeat Current" ),
806+ description = _ ("You need the DJ role to toggle repeat current." ),
807+ )
808+ if not self ._player_check (ctx ):
809+ return await self .send_embed_msg (
810+ ctx ,
811+ title = _ ("Unable To Toggle Repeat Current" ),
812+ description = _ ("Nothing playing." ),
813+ )
814+
815+ await self .set_player_settings (ctx )
816+ player = lavalink .get_player (ctx .guild .id )
817+ if (not ctx .author .voice or ctx .author .voice .channel != player .channel ) and not can_skip :
818+ return await self .send_embed_msg (
819+ ctx ,
820+ title = _ ("Unable To Toggle Repeat Current" ),
821+ description = _ ("You must be in the voice channel to toggle repeat current." ),
822+ )
823+ player .store ("notify_channel" , ctx .channel .id )
824+
825+ msg = _ ("Repeat current track: {true_or_false}." ).format (
826+ true_or_false = _ ("Enabled" ) if not player .repeat_current else _ ("Disabled" )
827+ )
828+ player .repeat_current = not player .repeat_current
829+
830+ embed = discord .Embed (title = _ ("Setting Changed" ), description = msg )
831+ await self .send_embed_msg (ctx , embed = embed )
832+
787833 @commands .command (name = "remove" )
788834 @commands .guild_only ()
789835 @commands .bot_has_permissions (embed_links = True )
0 commit comments