小编Ива*_*нов的帖子

如何使用 gitignore 隐藏机器人 Telegram 令牌?

在公共领域的 GitHub 上是我的电报机器人的代码,我的令牌在哪里。我想隐藏它,我该怎么办?我知道这应该用 gitignore 来完成

import telebot
import time
TOKEN = "872521057:AAF2Kx4Y3WC-cs................"
bot = telebot.TeleBot(TOKEN)
@bot.message_handler(commands=['start', 'help'])
def send_welcome(message):
    bot.reply_to(message, "Hello")
@bot.message_handler(func=lambda m: True)
def echo_all(message):
    bot.reply_to(message, message.text)
bot.polling(none_stop=True)
Run Code Online (Sandbox Code Playgroud)

github gitignore python-3.x telegram-bot

2
推荐指数
1
解决办法
2707
查看次数

标签 统计

github ×1

gitignore ×1

python-3.x ×1

telegram-bot ×1