Пример #1
0
 async def restart(self, ctx):
     '''Restarts the current song.'''
     state = TempState(ctx.author.guild)
     voice = get(self.client.voice_clients, guild=ctx.guild)
     if voice:
         temp = state.loop_song
         state.loop_song = True
         
         voice.stop()
         if ctx.author.guild in gen.time_l:
             gen.time_l.remove(ctx.author.guild)
             
         state.time = 0
         await asyncio.sleep(0.01)
         state.loop_song = temp
     else:
         self.log("Restart failed")
         await ctx.send(">>> Ya know to restart stuff, stuff also needs to be playing first.")
Пример #2
0
    async def loop(self, ctx, toggle=""):
        state = TempState(ctx.author.guild)
        '''Loops the current song, doesn't affect the skip command tho. If on/off not passed it will toggle it.'''
    
        if toggle.lower() == "on":
            state.loop_song = True
            await ctx.send(">>> **Looping current song now**")

        elif toggle.lower() == 'off':
            state.loop_song = False
            await ctx.send(">>> **NOT Looping current song now**")

        else:

            if state.loop_song:
                state.loop_song = False
                await ctx.send(">>> **NOT Looping current song now**")

            else:
                state.loop_song = True
                await ctx.send(">>> **Looping current song now**")