# Buggy code
async def _skip_action(self, ctx: commands.Context, skip_to_track: int = None):
    player = lavalink.get_player(ctx.guild.id)
    autoplay = (
        await self.config.guild(player.channel.guild).auto_play() or self.owns_autoplay
    )
    if not player.current or (not player.queue and not autoplay):
        try:
            pos, dur = player.position, player.current.length
        except AttributeError:
            return await self._embed_msg(ctx, _("There's nothing in the queue."))
        time_remain = lavalink.utils.format_time(dur - pos)
        if player.current.is_stream:
            embed = discord.Embed(
                colour=await ctx.embed_colour(),
                title=_("There's nothing in the queue."),
            )
            embed.set_footer(
                text=_("Currently livestreaming {track}").format(
                    track=player.current.title
                )
            )
        else:
            embed = discord.Embed(
                colour=await ctx.embed_colour(),
                title=_("There's nothing in the queue."),
            )
            embed.set_footer(
                text=_("{time} left on {track}").format(
                    time=time_remain, track=player.current.title
                )
            )
        return await ctx.send(embed=embed)
    elif autoplay and not player.queue:
        embed = discord.Embed(
            colour=await ctx.embed_colour(),
            title=_("Track Skipped"),
            description=await get_description(player.current),
        )
        await ctx.send(embed=embed)
        return await player.skip()

    queue_to_append = []
    if skip_to_track is not None and skip_to_track != 1:
        if skip_to_track < 1:
            return await self._embed_msg(
                ctx, _("Track number must be equal to or greater than 1.")
            )
        elif skip_to_track > len(player.queue):
            return await self._embed_msg(
                ctx,
                _(
                    "There are only {queuelen} songs currently queued.".format(
                        queuelen=len(player.queue)
                    )
                ),
            )
        embed = discord.Embed(
            colour=await ctx.embed_colour(),
            title=_(
                "{skip_to_track} Tracks Skipped".format(skip_to_track=skip_to_track)
            ),
        )
        await ctx.send(embed=embed)
        if player.repeat:
            queue_to_append = player.queue[
                0 : min(skip_to_track - 1, len(player.queue) - 1)
            ]
        player.queue = player.queue[
            min(skip_to_track - 1, len(player.queue) - 1) : len(player.queue)
        ]
    else:
        embed = discord.Embed(
            colour=await ctx.embed_colour(),
            title=_("Track Skipped"),
            description=await get_description(player.current),
        )
        await ctx.send(embed=embed)
    self.bot.dispatch(
        "red_audio_skip_track", player.channel.guild, player.current, ctx.author
    )
    await player.play()
    player.queue += queue_to_append


# Traceback (RuntimeError)
Traceback (most recent call last):
File "/home/martinebots/martinebotsvenv/lib/python3.7/site-packages/discord/ext/commands/core.py", line 79, in wrapped
ret = await coro(*args, **kwargs)
File "/home/martinebots/martinebotscogs/cogs_modified/audio/audio.py", line 3183, in play
await self._enqueue_tracks(ctx, query)
File "/home/martinebots/martinebotscogs/cogs_modified/audio/audio.py", line 3885, in _enqueue_tracks
result, called_api = await self.music_cache.lavalink_query(ctx, player, query)
File "/home/martinebots/martinebotscogs/cogs_modified/audio/apis.py", line 911, in lavalink_query
results = await player.load_tracks(query)
File "/home/martinebots/martinebotsvenv/lib/python3.7/site-packages/lavalink/rest_api.py", line 300, in load_tracks
self.__check_node_ready()
File "/home/martinebots/martinebotsvenv/lib/python3.7/site-packages/lavalink/rest_api.py", line 268, in __check_node_ready
raise RuntimeError("Cannot execute REST request when node not ready.")
RuntimeError: Cannot execute REST request when node not ready.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/martinebots/martinebotsvenv/lib/python3.7/site-packages/discord/ext/commands/bot.py", line 863, in invoke
await ctx.command.invoke(ctx)
File "/home/martinebots/martinebotsvenv/lib/python3.7/site-packages/discord/ext/commands/core.py", line 728, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "/home/martinebots/martinebotsvenv/lib/python3.7/site-packages/discord/ext/commands/core.py", line 88, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: RuntimeError: Cannot execute REST request when node not ready.```

# Fixed code
async def _skip_action(self, ctx: commands.Context, skip_to_track: int = None):
    player = lavalink.get_player(ctx.guild.id)
    autoplay = await self.config.guild(player.channel.guild).auto_play()
    if not player.current or (not player.queue and not autoplay):
        try:
            pos, dur = player.position, player.current.length
        except AttributeError:
            return await self._embed_msg(ctx, title=_("There's nothing in the queue."))
        time_remain = lavalink.utils.format_time(dur - pos)
        if player.current.is_stream:
            embed = discord.Embed(title=_("There's nothing in the queue."))
            embed.set_footer(
                text=_("Currently livestreaming {track}").format(
                    track=player.current.title
                )
            )
        else:
            embed = discord.Embed(title=_("There's nothing in the queue."))
            embed.set_footer(
                text=_("{time} left on {track}").format(
                    time=time_remain, track=player.current.title
                )
            )
        return await self._embed_msg(ctx, embed=embed)
    elif autoplay and not player.queue:
        embed = discord.Embed(
            title=_("Track Skipped"), description=get_track_description(player.current)
        )
        await self._embed_msg(ctx, embed=embed)
        return await player.skip()

    queue_to_append = []
    if skip_to_track is not None and skip_to_track != 1:
        if skip_to_track < 1:
            return await self._embed_msg(
                ctx, title=_("Track number must be equal to or greater than 1.")
            )
        elif skip_to_track > len(player.queue):
            return await self._embed_msg(
                ctx,
                title=_(
                    "There are only {queuelen} songs currently queued.".format(
                        queuelen=len(player.queue)
                    )
                ),
            )
        embed = discord.Embed(
            title=_(
                "{skip_to_track} Tracks Skipped".format(skip_to_track=skip_to_track)
            )
        )
        await self._embed_msg(ctx, embed=embed)
        if player.repeat:
            queue_to_append = player.queue[
                0 : min(skip_to_track - 1, len(player.queue) - 1)
            ]
        player.queue = player.queue[
            min(skip_to_track - 1, len(player.queue) - 1) : len(player.queue)
        ]
    else:
        embed = discord.Embed(
            title=_("Track Skipped"), description=get_track_description(player.current)
        )
        await self._embed_msg(ctx, embed=embed)
    self.bot.dispatch(
        "red_audio_skip_track", player.channel.guild, player.current, ctx.author
    )
    await player.play()
    player.queue += queue_to_append