R
R
Rasul_i2020-04-15 10:57:36
Python
Rasul_i, 2020-04-15 10:57:36

PyTelegramBotAPI bot forwards a message, but the forwarded message is from the bot and not from the user?

With simple messages it turns out, but with an inline button, can you do this?

manu = types.InlineKeyboardMarkup()
button_1 = types.InlineKeyboardButton(text='переслать', callback_data='send')
manu.add(button_1)

@bot.message_handler(content_types =['text'])
def handler(message):
    bot.send_message(message.from_user.id, 'privet', reply_markup=manu)
  
@bot.callback_query_handler(func=lambda call: True)
def calllback(call):
    if call.data == 'send':                                                     
        bot.forward_message(chat_id=my_id,                                 
                            from_chat_id=call.message.chat.id,                   #
                            message_id=call.message.message_id)


bot.polling(none_stop=True)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question