Hi all,
I am trying to make my first discord bot.
I can get it to work, if I use my token directly.
But as soon as I use the secrets panel it wont work. (keyerror: “Token”)
It says the variable token hasnt been set, but the secret is “saved”
Please help
import discord
import os
intents = discord.Intents.default()
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.startswith('$hello'):
await message.channel.send('Hello!')
client.run(os.environ['TOKEN'])