# Buggy code
async def _genre_search_button_action(
    ctx: commands.Context, options, emoji, page, playlist=False
):
    try:
        if emoji == "1⃣":
            search_choice = options[0 + (page * 5)]
        elif emoji == "2⃣":
            search_choice = options[1 + (page * 5)]
        elif emoji == "3⃣":
            search_choice = options[2 + (page * 5)]
        elif emoji == "4⃣":
            search_choice = options[3 + (page * 5)]
        elif emoji == "5⃣":
            search_choice = options[4 + (page * 5)]
        else:
            search_choice = options[0 + (page * 5)]
            # TODO: Verify this doesn't break exit and arrows
    except IndexError:
        search_choice = options[-1]
    if not playlist:
        return list(search_choice.items())[0]
    else:
        return search_choice.get("uri")


# 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 _genre_search_button_action(
    ctx: commands.Context, options, emoji, page, playlist=False
):
    try:
        if emoji == "\N{DIGIT ONE}\N{COMBINING ENCLOSING KEYCAP}":
            search_choice = options[0 + (page * 5)]
        elif emoji == "\N{DIGIT TWO}\N{COMBINING ENCLOSING KEYCAP}":
            search_choice = options[1 + (page * 5)]
        elif emoji == "\N{DIGIT THREE}\N{COMBINING ENCLOSING KEYCAP}":
            search_choice = options[2 + (page * 5)]
        elif emoji == "\N{DIGIT FOUR}\N{COMBINING ENCLOSING KEYCAP}":
            search_choice = options[3 + (page * 5)]
        elif emoji == "\N{DIGIT FIVE}\N{COMBINING ENCLOSING KEYCAP}":
            search_choice = options[4 + (page * 5)]
        else:
            search_choice = options[0 + (page * 5)]
    except IndexError:
        search_choice = options[-1]
    if not playlist:
        return list(search_choice.items())[0]
    else:
        return search_choice.get("uri")