mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-22 15:36:44 +00:00
🎨 Improve the error message when account_id does not exist
This commit is contained in:
parent
cf478b3b49
commit
c5416d7b3d
@ -184,7 +184,7 @@ class AccountCookiesPlugin(Plugin.Conversation):
|
|||||||
if e.ret_code == -106:
|
if e.ret_code == -106:
|
||||||
break
|
break
|
||||||
raise e
|
raise e
|
||||||
await message.reply_markdown_v2("可能是验证码已过期或者你没有同意授权,请重新发送命令进行绑定。")
|
await message.reply_text("可能是验证码已过期或者你没有同意授权,请重新发送命令进行绑定。")
|
||||||
return ConversationHandler.END
|
return ConversationHandler.END
|
||||||
|
|
||||||
@conversation.state(state=CHECK_SERVER)
|
@conversation.state(state=CHECK_SERVER)
|
||||||
@ -294,6 +294,11 @@ class AccountCookiesPlugin(Plugin.Conversation):
|
|||||||
logger.warning("用户 %s[%s] 获取账号信息发生错误 [%s]%s", user.full_name, user.id, exc.ret_code, exc.original)
|
logger.warning("用户 %s[%s] 获取账号信息发生错误 [%s]%s", user.full_name, user.id, exc.ret_code, exc.original)
|
||||||
await message.reply_text("Stoken 无效,请重新绑定。", reply_markup=ReplyKeyboardRemove())
|
await message.reply_text("Stoken 无效,请重新绑定。", reply_markup=ReplyKeyboardRemove())
|
||||||
return ConversationHandler.END
|
return ConversationHandler.END
|
||||||
|
except ValueError as e:
|
||||||
|
if "account_id" in str(e):
|
||||||
|
await message.reply_text("account_id 未找到,请检查输入是否有误。")
|
||||||
|
return ConversationHandler.END
|
||||||
|
raise e
|
||||||
except UnicodeEncodeError:
|
except UnicodeEncodeError:
|
||||||
await message.reply_text("Stoken 非法,请重新绑定。", reply_markup=ReplyKeyboardRemove())
|
await message.reply_text("Stoken 非法,请重新绑定。", reply_markup=ReplyKeyboardRemove())
|
||||||
return ConversationHandler.END
|
return ConversationHandler.END
|
||||||
|
Loading…
Reference in New Issue
Block a user