From fba09f086bc7fba298bdc2b679adae559019277b Mon Sep 17 00:00:00 2001 From: Dmitrii Morozov Date: Thu, 21 Mar 2024 21:08:41 +0100 Subject: Hide token --- tgbot.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tgbot.py') diff --git a/tgbot.py b/tgbot.py index 5443d43..ccc8738 100755 --- a/tgbot.py +++ b/tgbot.py @@ -1,14 +1,18 @@ #!/usr/bin/python3 + +import os from telebot import TeleBot -from telebot import formatting from fortniteStatusWrapper import formatFortniteStatus from pythonFortniteStatus.FortniteStatus import * -bot = TeleBot('6860285100:AAFkBS_ncl38XN4_Em_nzSt93Jlwc5BJ9mU') +if "TELEBOT_BOT_TOKEN" not in os.environ: + raise AssertionError("Please configure TELEBOT_BOT_TOKEN as environment variables") + +bot = TeleBot(os.environ["TELEBOT_BOT_TOKEN"]) fortniteStatus = FortniteStatus() @bot.message_handler(commands = ['start']) -def url(message): +def startCommand(message): bot.reply_to(message, "This bot is doing nothing so far..") @bot.message_handler(commands = ['status']) -- cgit v1.2.3