【发布时间】:2021-05-22 18:23:24
【问题描述】:
代码调用普通键盘,而且,当你点击它时,它不会转移到链接
文件'主要':
from config import BOT_TOKEN
import logging
from aiogram import Bot, Dispatcher, executor, types
import keyboards as kb
bot = Bot(token=BOT_TOKEN)
dp = Dispatcher(bot)
#some code
@dp.message_handler(commands=['inline'])
async def show_items(message: types.Message):
await message.answer('It is buttons', reply_markup=kb.start_keyboard)
if __name__ == '__main__':
executor.start_polling(dp, skip_updates=True)
文件“键盘”:
from aiogram.types import ReplyKeyboardMarkup, KeyboardButton, InlineKeyboardMarkup, InlineKeyboardButton
#some code
studyboi = InlineKeyboardButton('text', url='https://vk.com/feed')
start_keyboard = ReplyKeyboardMarkup(resize_keyboard=True).add(studyboi)
【问题讨论】:
标签: python keyboard inline telegram-bot