mirror of
https://github.com/andwati/unsplash-bot.git
synced 2026-11-20 01:28:47 +00:00
created heroku Procfile
This commit is contained in:
Binary file not shown.
+7
-1
@@ -42,6 +42,9 @@ def send_random_4k_pic(message):
|
|||||||
|
|
||||||
@bot.message_handler(commands=["topic"])
|
@bot.message_handler(commands=["topic"])
|
||||||
def handle_text(message):
|
def handle_text(message):
|
||||||
|
"""
|
||||||
|
request the user to send the topics
|
||||||
|
"""
|
||||||
chat_id = message.chat.id
|
chat_id = message.chat.id
|
||||||
message_topics = bot.send_message(
|
message_topics = bot.send_message(
|
||||||
chat_id, "Type the topic(s) separated with commas"
|
chat_id, "Type the topic(s) separated with commas"
|
||||||
@@ -50,7 +53,10 @@ def handle_text(message):
|
|||||||
|
|
||||||
|
|
||||||
def step_set_topics(message):
|
def step_set_topics(message):
|
||||||
|
"""
|
||||||
|
get images according to topics
|
||||||
|
"""
|
||||||
chat_id = message.chat.id
|
chat_id = message.chat.id
|
||||||
topics = message.text
|
topics = message.text
|
||||||
response = requests.get("https://source.unsplash.com/random?{0}".format(topics))
|
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user