🎨 Rename de_cookie to parse_cookie

This commit is contained in:
洛水居室 2022-12-01 18:41:27 +08:00
parent 7f1bad08da
commit 7e12832239
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -45,7 +45,7 @@ class SetUserCookies(Plugin.Conversation, BasePlugin.Conversation):
self.user_service = user_service self.user_service = user_service
@staticmethod @staticmethod
def de_cookie(cookie: SimpleCookie) -> Dict[str, str]: def parse_cookie(cookie: SimpleCookie) -> Dict[str, str]:
cookies = {} cookies = {}
ltoken = cookie.get("ltoken") ltoken = cookie.get("ltoken")
if ltoken: if ltoken:
@ -289,7 +289,7 @@ class SetUserCookies(Plugin.Conversation, BasePlugin.Conversation):
await message.reply_text("Cookies格式有误请检查", reply_markup=ReplyKeyboardRemove()) await message.reply_text("Cookies格式有误请检查", reply_markup=ReplyKeyboardRemove())
return ConversationHandler.END return ConversationHandler.END
try: try:
cookies = self.de_cookie(cookie) cookies = self.parse_cookie(cookie)
except (AttributeError, ValueError) as exc: except (AttributeError, ValueError) as exc:
logger.info("用户 %s[%s] Cookies解析出现错误", user.full_name, user.id) logger.info("用户 %s[%s] Cookies解析出现错误", user.full_name, user.id)
logger.debug("解析Cookies出现错误", exc_info=exc) logger.debug("解析Cookies出现错误", exc_info=exc)