mirror of
https://github.com/PaiGramTeam/PamGram.git
synced 2024-11-16 03:55:26 +00:00
🐛 Fix setuid bind account
This commit is contained in:
parent
065817960f
commit
35671604dd
@ -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):
|
||||
|
@ -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)
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user