diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..e69de29 diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..b185d16 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: python src/server.py \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..3e1784e Binary files /dev/null and b/requirements.txt differ diff --git a/src/bot.py b/src/bot.py index bb19c9b..6d52e6a 100644 --- a/src/bot.py +++ b/src/bot.py @@ -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)