created heroku Procfile

This commit is contained in:
2022-05-08 01:10:12 +03:00
parent 7d516104b5
commit 6e2e41b9b7
4 changed files with 8 additions and 1 deletions
View File
+1
View File
@@ -0,0 +1 @@
web: python src/server.py
BIN
View File
Binary file not shown.
+7 -1
View File
@@ -42,6 +42,9 @@ def send_random_4k_pic(message):
@bot.message_handler(commands=["topic"])
def handle_text(message):
"""
request the user to send the topics
"""
chat_id = message.chat.id
message_topics = bot.send_message(
chat_id, "Type the topic(s) separated with commas"
@@ -50,7 +53,10 @@ def handle_text(message):
def step_set_topics(message):
"""
get images according to topics
"""
chat_id = message.chat.id
topics = message.text
response = requests.get("https://source.unsplash.com/random?{0}".format(topics))
bot.send_photo(message.chat.id, response.content)
bot.send_photo(chat_id, response.content)