B
B
bubaley2019-02-01 02:58:48
Python
bubaley, 2019-02-01 02:58:48

Telegram bot. How to delete Inline messages?

Hello, I really need your help.
5c538a61223d9711440627.png
The bot sends an Inline message to any of the chats.
5c538a6be7a0a402047595.png
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)

Keyboard Assembly
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

The result of pressing the button
5c538b70be555607766740.pngHow can I still refer to this message?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sound901, 2019-02-02
@saund901

And what is it?
https://groosha.gitbooks.io/telegram-bot-lessons/c...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question