mirror of
https://github.com/andwati/unsplash-bot.git
synced 2026-10-18 10:42:53 +00:00
refactored to use python-dotenv
This commit is contained in:
@@ -6,6 +6,7 @@ name = "pypi"
|
||||
[packages]
|
||||
flask = "*"
|
||||
pytelegrambotapi = "*"
|
||||
python-dotenv = "*"
|
||||
|
||||
[dev-packages]
|
||||
black = "*"
|
||||
|
||||
Generated
+9
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"_meta": {
|
||||
"hash": {
|
||||
"sha256": "cfe1776842e1b6d668d14da0cafb880fee01d3e063bb59e87600b71e8aa8762f"
|
||||
"sha256": "cbb3e6170d64d57e8b7b6902b88c292dff7241868ddc303f01b2e1d7a50e817d"
|
||||
},
|
||||
"pipfile-spec": 6,
|
||||
"requires": {
|
||||
@@ -132,6 +132,14 @@
|
||||
"index": "pypi",
|
||||
"version": "==4.5.1"
|
||||
},
|
||||
"python-dotenv": {
|
||||
"hashes": [
|
||||
"sha256:b7e3b04a59693c42c36f9ab1cc2acc46fa5df8c78e178fc33a8d4cd05c8d498f",
|
||||
"sha256:d92a187be61fe482e4fd675b6d52200e7be63a12b724abbf931a40ce4fa92938"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==0.20.0"
|
||||
},
|
||||
"requests": {
|
||||
"hashes": [
|
||||
"sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61",
|
||||
|
||||
+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