refactored to use python-dotenv

This commit is contained in:
2022-05-15 15:41:13 +03:00
parent 6e2e41b9b7
commit aa7bb5087c
3 changed files with 16 additions and 4 deletions
+6 -3
View File
@@ -1,14 +1,17 @@
from os import environ
import os
import requests
import telebot
from dotenv import load_dotenv
bot = telebot.TeleBot(environ["TELEGRAM_TOKEN"])
load_dotenv()
bot = telebot.TeleBot(os.getenv("TELEGRAM_TOKEN"))
# configure the webhook for the bot
bot.set_webhook(
"https://{}.herokuapp.com/{}".format(
environ["PROJECT_NAME"], environ["TELEGRAM_TOKEN"]
os.getenv("PROJECT_NAME"), os.getenv("TELEGRAM_TOKEN")
)
)