B
B
Barl2022-04-15 12:31:02
Telegram
Barl, 2022-04-15 12:31:02

How to implement sending a file when clicking on the aiogram button?

How to implement sending a file when clicking on the Inline aiogram button?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Barl, 2022-04-15
@justbarl

I answer the question. I already found the answer myself.

@dp.callback_query_handler(text="moreinf")
async def moreinf(call: types.CallbackQuery):
    await call.message.reply_document(open('users.txt', 'rb'))

What have we done? When you click on the button, the bot sends a pre-prepared file to the user.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question