aiogram.utils.exceptions.ValidationError:令牌无效!它必须是 'str' 类型而不是 <class 'NoneType'> 类型。
from aiogram import Bot, Dispatcher, executor, types
import os
TOKEN = "token"
bot = Bot(token=os.getenv(TOKEN), parse_mode=types.ParseMode.HTML)
dp = Dispatcher(bot)
@dp.message_handler(commands='start')
async def start(message: types.Message):
start_buttons = ['Старт']
keyboard = types.ReplyKeyboardMarkup(resize_keyboard=True)
keyboard.add(*start_buttons)
await message.answer('Search?', reply_markup=keyboard)
def main():
executor.start_polling(dp)
if __name__ == '__main__':
main()