From 3495e5de0481389cc51a72e983f83ac6ef14dc2e Mon Sep 17 00:00:00 2001 From: Ian Andwati Date: Wed, 27 Sep 2023 04:08:12 +0300 Subject: [PATCH] added 4k image --- unsplashbot/bot.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/unsplashbot/bot.py b/unsplashbot/bot.py index 1bec26f..8f832fe 100644 --- a/unsplashbot/bot.py +++ b/unsplashbot/bot.py @@ -24,4 +24,12 @@ def get_random_photo(message): bot.send_photo(message.chat.id, image_content.content, caption=description) +# send random 4k unsplash picture +@bot.message_handler(commands=["4k"]) +def send_random_pic(message): + response = requests.get("https://source.unsplash.com/random/4096x2160") + bot.send_photo(message.chat.id, response.content) + bot.send_document(message.chat.id, response.content, caption="rename_to_jpeg") + + bot.infinity_polling()