telegramtelegram-bottelegram-apinode-telegram-bot-api

create button 'copy' telegram api


I am creating a simple telegram bot. I send a message from the server: https://api.telegram.org/bot{API_KEY}/sendMessage?chat_id={CHAT_ID}&text={TEXT_MESSAGE}

I would like to attach a button to it, when clicked, a certain link would be copied to the clipboard. I've searched all over the Internet, and I just can't figure out how to create buttons. Please, help)


Solution

  • Even if you created a button in the chat with your bot, it's impossible to write a functionality that would copy given text to clipboard by clicking the button (see Is it possible in Telegram to copy to clipboard by button?).

    One option how to copy a text to clipboard by clicking on it would be to use code HTML tag, as shown here: Telegram Bot Auto Hold To Copy.