🔥 Burn Fat Fast. Discover How! 💪

Code for creating telegram bot that generate random cute dog i | Happy_coding01

Code for creating telegram bot that generate random cute dog images

from telegram.ext import Updater, InlineQueryHandler, CommandHandler
import requests
import re

def get_url():
contents = requests.get('https://random.dog/woof.json').json()
url = contents['url']
return url

def bop(bot, update):
url = get_url()
chat_id = update.message.chat_id
bot.send_photo(chat_id=chat_id, photo=url)

def main():
updater = Updater('YOUR_TOKEN')
dp = updater.dispatcher
dp.add_handler(CommandHandler('bop',bop))
updater.start_polling()
updater.idle()

if name == 'main':
main()

Post reference: https://www.instagram.com/p/CYlU6X1l3ZA/?utm_medium=copy_link

Enjoy