I cannot make the BOT_TOKEN work
See original GitHub issueHello,
I am trying to build a BOT, but when I initiate my functions I do cannot make the bot works…
the problem I have is with the BOT_TOKEN:
const bot = new Telegraf(process.env.BOT_TOKEN)
const bot = new Telegraf(process.env.123456789:AbCdfGhIJKlmNoQQRsTUVwxyZ);
because there is a colon (😃 between numbers and the code, it seems not to recognise the overall BOT_TOKEN…
Anyone can help?
Cheers
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Bot token not working · Issue #2016 · discord/discord-api-docs
Few day ago i tried to start my bot but it came with token error, i tried regenerating token several times but its...
Read more >How to Get a Discord Bot Token - WriteBots
2.1 1. Go to the Discord Developer Portal · 2.2 2. Give Your Bot a Name · 2.3 3. Bring Your Bot to...
Read more >Why can't I copy my bot's token? - Developers - Discord
Open your App on the Developer Portal. · Go to the Bot settings from the side menu. · Press the Reset Token button...
Read more >discord bot: client.start(Token) not working - Stack Overflow
Essentially, check that you copied the correct token into the TOKEN variable. When you go to the developer portal and click on your...
Read more >Discord Bot Token seems unavailable? Need help/advice
The Token I need to retrieve to put into my JS file, somehow can't be copied. The only button I'm getting in the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
with
const bot = new Telegraf(process.env.BOT_TOKEN)
you need to declare the environment variable when you start the app so you start your app like thisBOT_TOKEN='123456789:AbCdfGhIJKlmNoQQRsTUVwxyZ' npm start
hope you find it helpful
Just to note, if you wouldn’t care about the token being in the code, you could just enter the string into the constructor
const bot = new Telegraf("123456789:AbCdfGhIJKlmNoQQRsTUVwxyZ");