Answer the question
In order to leave comments, you need to log in
Telegram bot. How to delete Inline messages?
Hello, I really need your help.
The bot sends an Inline message to any of the chats.
By clicking on the button, I have to change / delete this message. Everything would be fine, but I can't catch chat.id and message id. If everything is clear in a chat with a bot, then in Inline mode it doesn’t work at all.
Sending a message
hint = "Тест"
try:
r = types.InlineQueryResultArticle(
id='1',
title="Тест",
description=hint,
input_message_content=types.InputTextMessageContent(
message_text="Еще один тест"),
reply_markup=main_menu(),
)
print(query)
bot.answer_inline_query(query.id, [r])
except Exception as e:
print(e)
user_markup = telebot.types.InlineKeyboardMarkup()
dept = json.dumps({"command": 1, "type": "dept"})
dept_button = telebot.types.InlineKeyboardButton("Тест", callback_data=dept)
user_markup.add(dept_button)
return user_markup
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question