HERE IS AN IMPLEMENTATION OF OUR API TO A TELEGRAM BOTimport requests
import telebot
from telebot import types
bot = telebot.TeleBot("BOT TOKEN HERE")
@bot.message_handler(commands=['start'])
def send_welcome(message):
bot.send_message(message.chat.id, "Welcome to wallpaper downloader bot")
@bot.message_handler(commands=['wallpaper'])
def send_wallpaper(message):
category = message.text.split(" ")[-1]
url = f"https://fourkwallpapers-api.onrender.com/get?category={category}"
datat = requests.get(url)
data = datat.json()
media_group = []
for item in data[:10]:
image_url = item["image_url"]
title = item["title"]
media_group.append(types.InputMediaPhoto(media=image_url, caption=title))
media_group[0].caption = f"#{category}"
bot.send_media_group(message.chat.id", media=media_group)
bot.infinity_polling()
THE BOT SENDS 10 PHOTOS ONCE YOU REQUEST THEM USI G THE /wallpaper command
Enjoy.
@TheInfinityHackers @InfinityBotsHub @EscaliBud