Answer the question
In order to leave comments, you need to log in
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
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)
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question