Ejemplo n.º 1
0
    async def reset(self, ctx):
        """ Reset the players pitch and speed """
        player = self.bot.wavelink.get_player(ctx.guild.id, cls=Player, context=ctx)

        await player.set_filter(wavelink.Timescale())

        await ctx.send(_("{0} Reset the players filter, give up to 10 seconds for player to take effect.").format(self.bot.settings['emojis']['misc']['white-mark']))
Ejemplo n.º 2
0
    async def speed(self, ctx, speed: float):
        """ Set the players speed."""
        player = self.bot.wavelink.get_player(ctx.guild.id, cls=Player, context=ctx)

        if speed < 0.1:
            return await ctx.send(_("The value you provided is invalid and will crash the player."))

        try:
            await player.set_filter(wavelink.Timescale(speed=speed, pitch=player.filter.pitch if hasattr(player.filter, 'pitch') else 1.0))
        except Exception:
            raise commands.BadArgument(_("The value you provided can't be negative or above 2.0"))

        await ctx.send(_("{0} Changed the speed to **{1}x**, give up to 10 seconds for player to take effect").format(self.bot.settings['emojis']['misc']['white-mark'], speed))