Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

293
Views
How can I use a secret on Repl.it with my JavaScript code for Telegram using Telegraf?

I have this code:

const bot = new Telegraf('tokengoeshereblablablabla')

And I want it to look like this:

const bot = new Telegraf(TOKEN)

So my Telegram token wont be leaked. I know it's possible, but I don't find it eather here in StackOverflow either Google.

Thanks in advance.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

In repl.it you can set your secret variables in specific section Look at this image below you can set key as TOKEN and value [YOURTOKEN] enter image description here

Simply you can use it in nodejs file like:

const bot = new Telegraf(process.env.TOKEN)

Note: if you can't access it like above line, you will need to install dotenv package to load environment variables.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!