# Buggy code
async def queue(self, ctx: commands.Context, *, page: int = 1):
    """List the songs in the queue."""

    async def _queue_menu(
        ctx: commands.Context,
        pages: list,
        controls: dict,
        message: discord.Message,
        page: int,
        timeout: float,
        emoji: str,
    ):
        if message:
            await ctx.send_help(self.queue)
            with contextlib.suppress(discord.HTTPException):
                await message.delete()
            return None

    queue_controls = {
        "⬅": prev_page,
        "❌": close_menu,
        "➡": next_page,
        "ℹ": _queue_menu,
    }

    if not self._player_check(ctx):
        return await self._embed_msg(ctx, _("There's nothing in the queue."))
    player = lavalink.get_player(ctx.guild.id)
    if not player.queue:
        if player.current:
            arrow = await draw_time(ctx)
            pos = lavalink.utils.format_time(player.position)
            if player.current.is_stream:
                dur = "LIVE"
            else:
                dur = lavalink.utils.format_time(player.current.length)

            query = audio_dataclasses.Query.process_input(player.current)

            if query.is_local:
                if player.current.title != "Unknown title":
                    song = "**{track.author} - {track.title}**\n{uri}\n"
                else:
                    song = "{uri}\n"
            else:
                song = "**[{track.title}]({track.uri})**\n"
            song += _("Requested by: **{track.requester}**")
            song += "\n\n{arrow}`{pos}`/`{dur}`"
            song = song.format(
                track=player.current,
                uri=audio_dataclasses.LocalPath(player.current.uri).to_string_hidden()
                if audio_dataclasses.Query.process_input(player.current.uri).is_local
                else player.current.uri,
                arrow=arrow,
                pos=pos,
                dur=dur,
            )

            embed = discord.Embed(
                colour=await ctx.embed_colour(),
                title=_("Now Playing"),
                description=song,
            )
            if await self.config.guild(ctx.guild).thumbnail() and player.current:
                if player.current.thumbnail:
                    embed.set_thumbnail(url=player.current.thumbnail)

            shuffle = await self.config.guild(ctx.guild).shuffle()
            repeat = await self.config.guild(ctx.guild).repeat()
            autoplay = (
                await self.config.guild(ctx.guild).auto_play() or self.owns_autoplay
            )
            text = ""
            text += (
                _("Auto-Play")
                + ": "
                + ("\N{WHITE HEAVY CHECK MARK}" if autoplay else "\N{CROSS MARK}")
            )
            text += (
                (" | " if text else "")
                + _("Shuffle")
                + ": "
                + ("\N{WHITE HEAVY CHECK MARK}" if shuffle else "\N{CROSS MARK}")
            )
            text += (
                (" | " if text else "")
                + _("Repeat")
                + ": "
                + ("\N{WHITE HEAVY CHECK MARK}" if repeat else "\N{CROSS MARK}")
            )
            embed.set_footer(text=text)

            return await ctx.send(embed=embed)
        return await self._embed_msg(ctx, _("There's nothing in the queue."))

    async with ctx.typing():
        len_queue_pages = math.ceil(len(player.queue) / 10)
        queue_page_list = []
        for page_num in range(1, len_queue_pages + 1):
            embed = await self._build_queue_page(ctx, player, page_num)
            queue_page_list.append(embed)
        if page > len_queue_pages:
            page = len_queue_pages
    return await menu(ctx, queue_page_list, queue_controls, page=(page - 1))


# 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 queue(self, ctx: commands.Context, *, page: int = 1):
    """List the songs in the queue."""

    async def _queue_menu(
        ctx: commands.Context,
        pages: list,
        controls: MutableMapping,
        message: discord.Message,
        page: int,
        timeout: float,
        emoji: str,
    ):
        if message:
            await ctx.send_help(self.queue)
            with contextlib.suppress(discord.HTTPException):
                await message.delete()
            return None

    queue_controls = {
        "\N{LEFTWARDS BLACK ARROW}": prev_page,
        "\N{CROSS MARK}": close_menu,
        "\N{BLACK RIGHTWARDS ARROW}": next_page,
        "\N{INFORMATION SOURCE}": _queue_menu,
    }

    if not self._player_check(ctx):
        return await self._embed_msg(ctx, title=_("There's nothing in the queue."))
    player = lavalink.get_player(ctx.guild.id)
    if not player.queue:
        if player.current:
            arrow = await draw_time(ctx)
            pos = lavalink.utils.format_time(player.position)
            if player.current.is_stream:
                dur = "LIVE"
            else:
                dur = lavalink.utils.format_time(player.current.length)
            song = get_track_description(player.current)
            song += _("\n Requested by: **{track.requester}**")
            song += "\n\n{arrow}`{pos}`/`{dur}`"
            song = song.format(track=player.current, arrow=arrow, pos=pos, dur=dur)
            embed = discord.Embed(title=_("Now Playing"), description=song)
            if await self.config.guild(ctx.guild).thumbnail() and player.current:
                if player.current.thumbnail:
                    embed.set_thumbnail(url=player.current.thumbnail)

            shuffle = await self.config.guild(ctx.guild).shuffle()
            repeat = await self.config.guild(ctx.guild).repeat()
            autoplay = await self.config.guild(ctx.guild).auto_play()
            text = ""
            text += (
                _("Auto-Play")
                + ": "
                + ("\N{WHITE HEAVY CHECK MARK}" if autoplay else "\N{CROSS MARK}")
            )
            text += (
                (" | " if text else "")
                + _("Shuffle")
                + ": "
                + ("\N{WHITE HEAVY CHECK MARK}" if shuffle else "\N{CROSS MARK}")
            )
            text += (
                (" | " if text else "")
                + _("Repeat")
                + ": "
                + ("\N{WHITE HEAVY CHECK MARK}" if repeat else "\N{CROSS MARK}")
            )
            embed.set_footer(text=text)
            message = await self._embed_msg(ctx, embed=embed)
            dj_enabled = self._dj_status_cache.setdefault(
                ctx.guild.id, await self.config.guild(ctx.guild).dj_enabled()
            )
            vote_enabled = await self.config.guild(ctx.guild).vote_enabled()
            if dj_enabled or vote_enabled:
                if not await self._can_instaskip(
                    ctx, ctx.author
                ) and not await self._is_alone(ctx):
                    return

            expected = ("⏹", "⏯")
            emoji = {"stop": "⏹", "pause": "⏯"}
            if player.current:
                task = start_adding_reactions(message, expected[:4], ctx.bot.loop)
            else:
                task = None

            try:
                (r, u) = await self.bot.wait_for(
                    "reaction_add",
                    check=ReactionPredicate.with_emojis(expected, message, ctx.author),
                    timeout=30.0,
                )
            except asyncio.TimeoutError:
                return await self._clear_react(message, emoji)
            else:
                if task is not None:
                    task.cancel()
            reacts = {v: k for k, v in emoji.items()}
            react = reacts[r.emoji]
            if react == "stop":
                await self._clear_react(message, emoji)
                return await ctx.invoke(self.stop)
            elif react == "pause":
                await self._clear_react(message, emoji)
                return await ctx.invoke(self.pause)
            return
        return await self._embed_msg(ctx, title=_("There's nothing in the queue."))

    async with ctx.typing():
        len_queue_pages = math.ceil(len(player.queue) / 10)
        queue_page_list = []
        for page_num in range(1, len_queue_pages + 1):
            embed = await self._build_queue_page(ctx, player, page_num)
            queue_page_list.append(embed)
        if page > len_queue_pages:
            page = len_queue_pages
    return await menu(ctx, queue_page_list, queue_controls, page=(page - 1))