Here is my code:
import discord
intents = discord.Intents.default()
intents.members = True
client = discord.Client(intents=intents)
@client.event
async def on_ready():
print(f'Info: Logged in as {client.user} with ID: {client.user.id}')
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content == '-h':
await message.channel.send('''
-p <music> - play selected music options:
1 - a thousand years
-ps - pause music
-rs - resume music
-bye - go offline
''')
elif message.content == '-bye':
await message.channel.send('-_-')
exit(0)
#if message.content.startswith('-p 1'):
await message.channel.send(f'Type -h to display help on {client.user}.')
client.run("Here I have my token")
I tried to make a music bot but:
- IDK why my code doesn’t even work (that question has higher priority.)
- IDK how to make it play music from youtube
And I was expecting it to work, but it didn’t.
New contributor
Ludmila Mizus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.