🐛 Fix setuid bind account

This commit is contained in:
omg-xtao 2023-05-12 20:25:19 +08:00 committed by GitHub
parent 065817960f
commit 35671604dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 13 deletions

View File

@ -86,10 +86,10 @@ class PublicCookiesService(BaseService):
await self._cache.delete_public_cookies(public_id, region)
continue
if region == RegionEnum.HYPERION:
client = genshin.Client(cookies=cookies.data, game=types.Game.GENSHIN, region=types.Region.CHINESE)
client = genshin.Client(cookies=cookies.data, game=types.Game.STARRAIL, region=types.Region.CHINESE)
elif region == RegionEnum.HOYOLAB:
client = genshin.Client(
cookies=cookies.data, game=types.Game.GENSHIN, region=types.Region.OVERSEAS, lang="zh-cn"
cookies=cookies.data, game=types.Game.STARRAIL, region=types.Region.OVERSEAS, lang="zh-cn"
)
else:
raise CookieServiceError
@ -98,14 +98,14 @@ class PublicCookiesService(BaseService):
raise RuntimeError("account_id not found")
record_cards = await client.get_record_cards()
for record_card in record_cards:
if record_card.game == Game.GENSHIN:
await client.get_partial_genshin_user(record_card.uid)
if record_card.game == Game.STARRAIL:
await client.get_starrail_user(record_card.uid)
break
else:
accounts = await client.get_game_accounts()
for account in accounts:
if account.game == Game.GENSHIN:
await client.get_partial_genshin_user(account.uid)
if account.game == Game.STARRAIL:
await client.get_starrail_user(account.uid)
break
except InvalidCookies as exc:
if exc.retcode in (10001, -100):

View File

@ -104,9 +104,9 @@ class BindAccountPlugin(Plugin.Conversation):
await message.reply_text("退出任务", reply_markup=ReplyKeyboardRemove())
return ConversationHandler.END
if message.text == "通过玩家ID":
await message.reply_text("请输入你的玩家ID非通行证ID", reply_markup=ReplyKeyboardRemove())
await message.reply_text("请输入你的游戏ID非通行证ID", reply_markup=ReplyKeyboardRemove())
return CHECK_PLAYER_ID
if message.text == "过账号ID":
if message.text == "过账号ID":
await message.reply_text("请输入你的通行证ID非玩家ID", reply_markup=ReplyKeyboardRemove())
return CHECK_ACCOUNT_ID
await message.reply_text("选择错误,请重新选择")
@ -210,7 +210,7 @@ class BindAccountPlugin(Plugin.Conversation):
else:
return ConversationHandler.END
try:
player_stats = await client.get_genshin_user(player_id)
player_stats = await client.get_starrail_user(player_id)
except AccountNotFound:
await message.reply_text("找不到用户uid可能无效", reply_markup=ReplyKeyboardRemove())
logger.warning("获取账号信息发生错误 %s 找不到用户 uid可能无效", player_id)

View File

@ -208,10 +208,10 @@
<!-- <div class="command-description">删除充值记录</div>-->
<!-- </div>-->
<!-- ! user 相关-->
<!-- <div class="command">-->
<!-- <div class="command-name">/setuid</div>-->
<!-- <div class="command-description">添加/重设UID请私聊BOT</div>-->
<!-- </div>-->
<div class="command">
<div class="command-name">/setuid</div>
<div class="command-description">添加/重设UID请私聊BOT</div>
</div>
<div class="command">
<div class="command-name">/setcookie</div>
<div class="command-description">添加/重设Cookie请私聊BOT</div>