S
S
svlytkin2018-01-09 23:13:20
Bots
svlytkin, 2018-01-09 23:13:20

How to hide the telegram bot token with an open repository on github and hosting on openshift?

I want to place a telegram bot on openshift, but don't show the token.
uploaded the bot to github to my open repository to connect it to openshift, but the code contains my bot token, which everyone can see. How to hide the token correctly so that the bot is launched and the real token is not visible in the github?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
igorzakhar, 2018-07-08
@igorzakhar

Through the web console "OpenShift" add an environment variable, for example "TOKEN".
In the bot code (example using the pyTelegramBotAPI library):

import os

token = os.getenv("TOKEN")
bot = telebot.TeleBot(token)
...

D
Denis, 2018-01-10
@Norkotik

Make it a launch parameter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question