So, im trying to create a button that will redirect me to one of my other bots.
Not really sure how to do that.
for now, this is the sample, this does add the button, but it just echos, instead of actually doing something.
from aiogram.types import ReplyKeyboardMarkup, KeyboardButton, InlineKeyboardButton
studyboi = InlineKeyboardButton('https://t.me/studyboiibot', url='https://t.me/studyboiibot')
start_keyboard = ReplyKeyboardMarkup(resize_keyboard=True).add(studyboi)
This is the documentation page – https://aiogram.2038.io/api/types/inline_keyboard_button/
Not sure what I’m doing wrong.
3
Answers
You have to use InlineKeyboardMarkup for
InlinekeyboardButtons
.Buttons should be in the format of
List[List[InlineKeyboardButton]]
ReplyKeyboardMarkup
replaces the client-side keyboard, whereasInlineKeyboardMarkup
adds buttons in the messageTry this:
You can use my template. In this piece of code, I am creating two buttons. In the first one, you just go to another bot, pass the link in the implementation of the handler. And the second button is cancel, for it you will also need to create a separate handler