edisonchee / slimbot

Telegram Bot API for Node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: Please provide a Telegram Bot Token when instantiating

Joni4Games opened this issue · comments

So.. I've added the first sample code. I've requested the Telegram Bot API Key via the BotFather and added it in there. Now I get the error:
Error: Please provide a Telegram Bot Token when instantiating

My Key looks like:

123456789:Ab1Cd2Ef3Gh4Ij5Kl6Mn7Op8Qr9

I'm using Node v8.1.2

Nothing found in the web
1
2
PS: Anyway you whole project looks good

Worked by simply removing the "process.env".
3

commented

Worked by removing the "process.env". Thank u @Joni4Games

Sorry for not following up on this. process.env is for environment variables that are loaded into your shell, usually found in ~/.profile.

An example inside your ~/.profile would be:

export TELEGRAM_BOT_TOKEN='token string'

And you'd use it in Node like this:

const token = process.env['TELEGRAM_BOT_TOKEN']