import logging
from aiogram import Bot, Dispatcher, types, executor
logging.basicConfig(level=logging.INFO)
bot = Bot(token="token")
dp = Dispatcher(bot)
@dp.message_handler(commands=["start"])
async def cmd_start(message: types.Message):
user_full_name = message.from_user.full_name
await message.answer(f"Привет {user_full_name}!)
@dp.message_handler(commands=["Buttons"], commands_prefix="!")
async def cmd_buttons(message: types.Message):
keyboard = types.InlineKeyboardMarkup()
buttons = [
types.InlineKeyboardButton(text="Инлайн кнопка 1", url="url"),
types.InlineKeyboardButton(text="Инлайн кнопка 2", url="url"),
]
keyboard.add(*buttons)
keyboard_2 = types.ReplyKeyboardMarkup(resize_keyboard=True)
buttons_new = ["Кнопка 1", "Кнопка 2"]
keyboard_2.add(*buttons_new)
await message.answer(text="Я умею играть в:", reply_markup=keyboard, keyboard_2)
if __name__ == "__main__":
executor.start_polling(dp, skip_updates=True)
Приведённый выше код даёт ошибку:
SyntaxError: positional argument follows keyword argument