Me and my friend have been trying to do this for 3 hourse and nothing. ChatGPT also didnt helped.
How to insert web app into inline answer?
import telebot
from telebot import types
bot = telebot.TeleBot("")
@bot.inline_handler(lambda query: query.query == "lobby")
def inline_query_response(inline_query):
markup_inline = types.InlineKeyboardMarkup()
web_url = types.WebAppInfo("https://dishdash.ru")
game_button = types.InlineKeyboardButton("Join lobby", web_app=web_url)
markup_inline.add(game_button)
gif_url = "https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExNWdzeDJnOTN0b3E1bXc1dmNmNWttNzJ5bjkyN2N1MGk0aDhiaWV4bCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/FlWgXEtj5aM5G/giphy.gif"
thumbnail_url = (
"https://i.imgur.com/NBEIFBz.png"
)
result = types.InlineQueryResultGif(
id="1",
gif_url=gif_url,
thumbnail_url=thumbnail_url,
title="???? DishDash! ????",
caption="<b>???? DishDash! ????</b>",
input_message_content=types.InputTextMessageContent(
"<b>???? DishDash! ????</b",
parse_mode="HTML",
),
reply_markup=markup_inline,
)
bot.answer_inline_query(inline_query.id, [result], cache_time=300)
bot.polling(none_stop=True)
Could not find solution. I will be very grateful for your help
Tried to remove images/captions/titles. Rebooted and so on. Very common things
New contributor
MrUssy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.