Im trying to make a discord bot and Im having the error, I don’t know what’s the problem, since i put the token on the secret window:
Traceback (most recent call last):
File “main.py”, line 21, in
client.run(os.environ(‘TOKEN’))
TypeError: ‘_Environ’ object is not callable
The code:
import discord
import os
intents = discord.Intents.default()
intents.message_content = True
client = discord.Client(intents=intents)
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startwith('$hello'):
await message.channel.send('Hello!')
client.run(os.environ('TOKEN'))