Client.run() doesn't run discord bot

Heres the code:

import os
from discord.ext import commands
import discord.ext.commands.bot
import discord
intents = discord.Intents.default()
intents.message_content = True #v2

client = commands.Bot(command_prefix=‘!’, intents=intents)

@client.event
async def on_ready():
print(f’Successfully logged in as {client.user}')

@client.event
async def on_message(message):
await client.process_commands(message)

@client.command()
async def hello(ctx):
await ctx.channel.send(f’Hello {ctx.author}')

my_secret = os.environ[‘T’]
token = my_secret
client.run(token) #The error starts here

I have no idea whats going on and how to fix it.

Where you have (token) is there an actual token there, or do you have it saved in secrets with the name token?

Also, have you set up the bot in the Discord Developer Portal?

Yes and I have set up the developer portal it goes online if I remove the “intents.message_content = True” but then the messages won’t work for some reason.

Here is the error that is ruining the commands: “discord.ext.commands.bot Privileged message content intent is missing, commands may not work as expected.”

Nvm I fixed it I had to replace something