🐛 Fix account ID being 0

This commit is contained in:
洛水居室 2023-03-14 12:43:23 +08:00
parent 56cf315747
commit df8d36da3c
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -232,10 +232,13 @@ class AccountCookiesPlugin(Plugin.Conversation):
if client.region == types.Region.CHINESE: if client.region == types.Region.CHINESE:
account_info = await client.get_hoyolab_user() account_info = await client.get_hoyolab_user()
account_id = account_info.hoyolab_id account_id = account_info.hoyolab_id
account_cookies_plugin_data.account_id = account_id
cookies.set_v2_uid(account_id) cookies.set_v2_uid(account_id)
logger.success("获取用户 %s[%s] account_id[%s] 成功", user.full_name, user.id, account_id) logger.success("获取用户 %s[%s] account_id[%s] 成功", user.full_name, user.id, account_id)
else: else:
logger.warning("用户 %s[%s] region[%s] 也许是不正确的", user.full_name, user.id, client.region.name) logger.warning("用户 %s[%s] region[%s] 也许是不正确的", user.full_name, user.id, client.region.name)
else:
account_cookies_plugin_data.account_id = client.cookie_manager.user_id
genshin_accounts = await client.genshin_accounts() genshin_accounts = await client.genshin_accounts()
except DataNotPublic: except DataNotPublic:
logger.info("用户 %s[%s] 账号疑似被注销", user.full_name, user.id) logger.info("用户 %s[%s] 账号疑似被注销", user.full_name, user.id)