Whatever I do my bot simply refuses to read any messages. Messages do not appear in the run menu.
import discord
from discord.ext import commands
import youtube_dl
intents = discord.Intents.default()
intents.typing = False
intents.messages = True
intents.presences = True # Enable the Presence Intent
intents.voice_states = True
bot = commands.Bot(command_prefix='!', intents=intents)
@bot.event
async def on_ready():
print(f'Logged in as {bot.user.name}')
print('------')
print('Guilds (servers):')
for guild in bot.guilds:
print(f'- {guild.name} (id: {guild.id})')
@bot.command()
async def join(ctx):
channel = ctx.author.voice.channel
await channel.connect()
@bot.command()
async def leave(ctx):
voice_client = ctx.guild.voice_client
if voice_client:
await voice_client.disconnect()
@bot.command()
async def play(ctx, *, query):
voice_client = ctx.guild.voice_client
if not voice_client:
channel = ctx.author.voice.channel
voice_client = await channel.connect()
ydl_opts = {
'format': 'bestaudio/best',
'postprocessors': [{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',
'preferredquality': '192',
}],
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
info = ydl.extract_info(query, download=False)
url = info['formats'][0]['url']
voice_client.stop()
voice_client.play(discord.FFmpegPCMAudio(url, before_options="-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5"))
@bot.command()
async def stop(ctx):
voice_client = ctx.guild.voice_client
if voice_client and voice_client.is_playing():
voice_client.stop()
bot.run('MY TOKEN SHOULD BE HERE')
Messages should appear here but they are not

I gave my bot all the permissions in the Discord applications there are no errors in the console or while debugging