E
E
estry2021-10-21 16:58:59
Python
estry, 2021-10-21 16:58:59

Pyrogram. Publishing a post to a channel. How to transfer the keyboard correctly?

Hello. I'm writing a script in Python + Pyrogram
How to correctly send a message to a channel and place buttons under it?
I do it like this:

@app.on_message()
async def go(client: Client, message: Message):
    reply_markup = InlineKeyboardMarkup()
    await client.send_message('-1001572587412', str(message.message_id), reply_markup=reply_markup)


No errors occur. But the button does not appear.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Philip Schultz, 2021-10-22
@estry

You are not using the method

InlineKeyboardMarkup().add(InlineKeyboardButton(....)...)

That is, the buttons are passed either to the add or insert method, and the function parameter can be passed, for example, row_width = 2, this is the size of the button.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question