L
L
lleballex2020-06-17 18:07:08
Python
lleballex, 2020-06-17 18:07:08

How to change keyboard in aiogram (telegram bot) without answer?

I have a telegram bot and this function

@dp.message_handler(commands = ['start'], state = '*')
async def start(message: Message):
  buttons = InlineKeyboardMarkup()
  button = InlineKeyboardButton('callback', callback_data = 'callback')
  buttons.add(button)
  await message.answer('Hello world!', reply_markup = buttons)

Here I specify inline keyboard. And how can you add a regular keyboard (so that there are two of them: a regular one and a button one)? I can only do this by sending a response:
await message.answer('Something', reply_markup = keyboard)

But I need nothing to be sent. How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
robprane, 2020-06-17
@lleballex

In any case, you need to write a message to the user. And this is not a problem for a simple reason: the user starts using the bot by pressing the Start button and sending the /start command, and the norm for telegram bots (and I think for any bots) is to send a welcome message.
Well, the usual keyboard in the presence of InlineKeyboard does not disappear anywhere.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question