Home>

useforwardfor forwarding messages /photos, but everything destroysKeyboardButton, because this is in fact a message and it is also sent, is it possible to make the message of the buttons not be detected?

if message.text== ("/send")
    bot.forward_message(TO_CHAT_ID, message.chat.id, message.message_id)
        bot.send_message(TO_CHAT_ID, "@" + message.chat.username)
        bot.send_message(message.chat.id, '%s, message was sent to ????'%message.chat.username)
bot.polling(none_stop=True)

here I tried to do it by type: /send text or: /send and a message

  • Answer # 1

    You can usecallbackbuttons. Or cut out a keyword from your message:

    message= 'send Our message consisting of words'
    words= message.split(' ') # Split words into list by space
    index= words.index('send')
    words.pop(index)
    message= ' '.join(words) # Putting the list back into text
    # P.S I haven't tested the code, but I think the principle is clear (there are better solutions)

    But I'll call it a crutch, IMHO