How can I implement transparent choice buttons in my Telegram bot?

I want to learn how to create and send transparent choice buttons using a Telegram Bot, similar to those shown in the attached image. I have checked the official documentation but found only instructions on creating custom keyboard buttons that open the Android keyboard for user selection. The buttons displayed in the image (like the ‘<<’, ‘’, and ‘>>’ buttons) would allow users to vote or navigate more intuitively without triggering the custom keyboard. What code should I use to send these buttons, and how can I manage user selections once they are pressed? I’m developing this with Python on a Linux system. Any guidance would be greatly appreciated.

To implement these transparent choice buttons in your Telegram bot, you should use inline keyboards provided by the Telegram Bot API. Inline keyboards allow you to attach buttons directly under the message bubble, which are perfect for navigation or voting options. You need to use the InlineKeyboardButton and InlineKeyboardMarkup classes from the Python python-telegram-bot library. Here’s a basic example:

from telegram import InlineKeyboardButton, InlineKeyboardMarkup

keyboard = [[InlineKeyboardButton("<<", callback_data='prev'),
             InlineKeyboardButton("", callback_data='no_op'),
             InlineKeyboardButton(">>", callback_data='next')]]

reply_markup = InlineKeyboardMarkup(keyboard)

update.message.reply_text('Make your choice:', reply_markup=reply_markup)

For capturing button presses, you need to handle the CallbackQuery using a callback function that gets triggered when a button is pressed. Ensure your bot is set up to respond to these callback queries to handle the navigation logic or voting counts as needed.

you can also try the aiogram library. it’s quite powerfull and supports inline keyboards very well. Once you got it set up, creating buttons can be intuitive & less boilerplate code. Their docs and community is pretty helpful too if u get stuck. good luck on ur bot!