import discord
from discord.ext import commands
import os
import asyncio
import yt_dlp
from dotenv import load_dotenv
import urllib.parse, urllib.request, re

def run_bot():
    load_dotenv()
    TOKEN = os.getenv('discord_token')
    intents = discord.Intents.default()
    intents.message_content = True
    client = commands.Bot(command_prefix="/", intents=intents)

    queues = {}
    voice_clients = {}
    currently_playing = {}
    youtube_base_url = 'https://www.youtube.com/'
    youtube_results_url = youtube_base_url + 'results?'
    youtube_watch_url = youtube_base_url + 'watch?v='
    yt_dl_options = {"format": "bestaudio/best"}
    ytdl = yt_dlp.YoutubeDL(yt_dl_options)

    ffmpeg_options = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5','options': '-vn -filter:a "volume=0.25"'}

    @client.event
    async def on_ready():
        print(f'{client.user} is now jamming')

    async def play_next(ctx):
        guild_id = ctx.guild.id
        if queues[guild_id] != []:
            link = queues[guild_id].pop(0)
            currently_playing[guild_id] = link
            await play(ctx, link=link)
    
    @client.command(name="play")
    async def play(ctx, *, link):
        guild_id = ctx.guild.id
        try:
            if guild_id not in voice_clients:
                voice_client = await ctx.author.voice.channel.connect()
                voice_clients[guild_id] = voice_client
            else:
                voice_client = voice_clients[guild_id]
                
            if youtube_base_url not in link:
                query_string = urllib.parse.urlencode({'search_query': link})
                content = urllib.request.urlopen(youtube_results_url + query_string)
                search_results = re.findall(r'/watch?v=(.{11})', content.read().decode())
                link = youtube_watch_url + search_results[0]
                
            data = await asyncio.to_thread(lambda: ytdl.extract_info(link, download=False))
            song = data['url']
            player = discord.FFmpegOpusAudio(song, **ffmpeg_options)
            currently_playing[guild_id] = link
            
            def after_playing(error):
                future = asyncio.run_coroutine_threadsafe(play_next(ctx), client.loop)
                try:
                    future.result()
                except:
                    print("Failed to play next song.")
                    
            voice_client.play(player, after=after_playing)
            await ctx.send(f"Now playing: {link}")
        except Exception as e:
            await ctx.send(f"An error occurred: {e}")

    @client.command(name="clear")
    async def clear_queue(ctx):
        if ctx.guild.id in queues:
            queues[ctx.guild.id].clear()
            await ctx.send("A plecat toata lumea de la coada la gogosi!")
        else:
            await ctx.send("N-am boss la ce sa dau clear")

    @client.command(name="pause")
    async def pause(ctx):
        try:
            voice_clients[ctx.guild.id].pause()
            await ctx.send("S-a pus pauza la distractie!")
        except Exception as e:
            print(e)

    @client.command(name="resume")
    async def resume(ctx):
        try:
            voice_clients[ctx.guild.id].resume()
            await ctx.send("Reincepe petrecerea!")
        except Exception as e:
            print(e)

    @client.command(name="stop")
    async def stop(ctx):
        try:
            voice_clients[ctx.guild.id].stop()
            await voice_clients[ctx.guild.id].disconnect()
            del voice_clients[ctx.guild.id]
        except Exception as e:
            print(e)

    @client.command(name="queue")
    async def queue(ctx, *, url):
        if ctx.guild.id not in queues:
            queues[ctx.guild.id] = []
        queues[ctx.guild.id].append(url)
        await ctx.send("Adaugat la cur!")
    
    @client.command(name="skip")
    async def skip(ctx):
        try:
            voice_clients[ctx.guild.id].stop()
            await play_next(ctx)
            await ctx.send("Skip la prostia asta!")
        except Exception as e:
            print(e)

    @client.command(name="current")
    async def current(ctx):
        guild_id = ctx.guild.id
        if guild_id in currently_playing and currently_playing[guild_id]:
            await ctx.send(f"Currently playing: {currently_playing[guild_id]}")
        else:
            await ctx.send("No song is currently playing.")
    
    @client.command(name="skip_to")
    async def skip_to(ctx, index: int):
        guild_id = ctx.guild.id
        if guild_id in queues and 0 <= index < len(queues[guild_id]):
            queues[guild_id] = queues[guild_id][index:]
            await play_next(ctx)
        else:
            await ctx.send("Invalid index.")
    
    @client.command(name="shuffle")
    async def shuffle(ctx):
        guild_id = ctx.guild.id
        if guild_id in queues:
            from random import shuffle
            shuffle(queues[guild_id])
            await ctx.send("Queue shuffled!")
        else:
            await ctx.send("Queue is empty.")

    @client.command(name="list")
    async def queue_list(ctx):
        guild_id = ctx.guild.id
        if guild_id in queues and queues[guild_id]:
            queue_str = "\n".join([f"{idx+1}: {song}" for idx, song in enumerate(queues[guild_id])])
            await ctx.send(f"Queue:\n{queue_str}")
        else:
            await ctx.send("The queue is empty.")

    client.run(TOKEN)

I want you to use this code as a skeleton code. When I have a song already in play and the user requests another song, I want it to add the song requested in queue