question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I cannot make the BOT_TOKEN work

See original GitHub issue

Hello,

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:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

11reactions
DinoLeungcommented, May 4, 2018

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 this BOT_TOKEN='123456789:AbCdfGhIJKlmNoQQRsTUVwxyZ' npm start

hope you find it helpful

5reactions
Otto-AAcommented, May 10, 2018

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");

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found