aiogram library telegram bot with python


from aiogram import Bot, Dispatcher, executor, types
from aiogram.types import ReplyKeyboardMarkup, ReplyKeyboardRemove, KeyboardButton
# token API
bot = Bot(token='token')
dp = Dispatcher(bot)
#
button1 = KeyboardButton('Hello')
keyboard1 = ReplyKeyboardMarkup(resize_keyboard=True, one_time_keyboard=True).add(button1)

# start command
@dp.message_handlers(commands=['start'])
async def welcome(message: types.Message):
await message.reply("Vampir koylu oyununa hos geldiniz!", reply_markup=keyboard1)

executor.start_polling(dp)

当我试图运行代码时,我得到一个错误第14行'Handler'对象不可调用我找不到解决办法,你能帮帮我吗?

尝试将开始命令更改为(不带s)

@dp.message_handler(commands=['start'])

最新更新