🐛 Fix ValidationError exception thrown when WebAppData.data is None

This commit is contained in:
洛水居室 2022-11-20 23:38:05 +08:00
parent c4db39c3df
commit 84f0f4d5aa
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -1,3 +1,5 @@
from typing import Optional
from genshin import Region, GenshinException from genshin import Region, GenshinException
from pydantic import BaseModel from pydantic import BaseModel
from telegram import ReplyKeyboardRemove, Update, WebAppInfo, ReplyKeyboardMarkup, KeyboardButton from telegram import ReplyKeyboardRemove, Update, WebAppInfo, ReplyKeyboardMarkup, KeyboardButton
@ -20,7 +22,7 @@ from utils.log import logger
class WebAppData(BaseModel): class WebAppData(BaseModel):
path: str path: str
data: dict data: Optional[dict]
code: int code: int
message: str message: str