mirror of
https://github.com/andwati/unsplash-bot.git
synced 2026-10-30 16:12:15 +00:00
refactored to use python-dotenv
This commit is contained in:
+6
-3
@@ -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")
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user