My Discord Bot is not working :(

I wrote a python3 code for my discord server, but it didn’t work .
Please help me fix it !

import discord
from discord.ext.commands import Bot
from discord.ext import commands
import youtube_dl
import asyncio
import time
import os

Client = discord.Client()
client = commands.Bot(command_prefix = '.')

players = {}

async def on_ready():
    print ("Hi")
    await client.change_presence(game=discord.Game(name="Music for everyone !"))
async def on_message(message):
    if message.content.startswith('.join'):
        channel =
        await client.join_voice_channel(channel)
    if message.content.startswith('.leave'):
        server = ctx.message.server
        voice_client = client.voice_client_in(server)
        await voice_client.disconnect()
async def play(ctx, url):
    server = ctx.message.server
    voice_client = client.voice_client_in(server)
    player = voice_client.create_ytdl_player(url)
    players[] = player

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make easier to read.

Note: Backticks are not single quotes.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.


Also, apologies post needing to be approved: the automatic forum filter kicked in, assuming because it mentions bots a lot.

you can go <a href="">here</a>to know how you can make the discord bot easily