Secrets wont work

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

Repl link:

import discord
import os

intents = discord.Intents.default()
client = discord.Client(intents=intents)

async def on_ready():
    print('We have logged in as {0.user}'.format(client))

async def on_message(message):
    if == client.user:

    if message.content.startswith('$hello'):

The Key must be TOKEN (or, I prefer DISCORD_TOKEN) and the Value must be your bot token.


Thank you so much, I knew it had to be something silly like this!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.