mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-16 04:35:49 +00:00
🎨 Add Handle 1034 Error Raised by Public Query
This commit is contained in:
parent
98db3fe755
commit
24ce0dac92
@ -7,7 +7,7 @@ from typing import Any, Coroutine, List, Match, Optional, Tuple, Union
|
|||||||
|
|
||||||
import ujson as json
|
import ujson as json
|
||||||
from arkowrapper import ArkoWrapper
|
from arkowrapper import ArkoWrapper
|
||||||
from genshin import Client
|
from genshin import Client, GenshinException
|
||||||
from pytz import timezone
|
from pytz import timezone
|
||||||
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Message, Update
|
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Message, Update
|
||||||
from telegram.constants import ChatAction, ParseMode
|
from telegram.constants import ChatAction, ParseMode
|
||||||
@ -169,6 +169,12 @@ class Abyss(Plugin, BasePlugin):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
images = await self.get_rendered_pic(client, uid, floor, total, previous)
|
images = await self.get_rendered_pic(client, uid, floor, total, previous)
|
||||||
|
except GenshinException as exc:
|
||||||
|
if exc.retcode == 1034:
|
||||||
|
if client.uid != uid:
|
||||||
|
await message.reply_text("出错了呜呜呜 ~ 请稍后重试")
|
||||||
|
return
|
||||||
|
raise exc
|
||||||
except AbyssUnlocked: # 若深渊未解锁
|
except AbyssUnlocked: # 若深渊未解锁
|
||||||
await reply_message_func("还未解锁深渊哦~")
|
await reply_message_func("还未解锁深渊哦~")
|
||||||
return
|
return
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import random
|
import random
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from genshin import Client
|
from genshin import Client, GenshinException
|
||||||
from genshin.models import GenshinUserStats
|
from genshin.models import GenshinUserStats
|
||||||
from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup
|
from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup
|
||||||
from telegram.constants import ChatAction
|
from telegram.constants import ChatAction
|
||||||
@ -66,6 +66,12 @@ class UserStatsPlugins(Plugin, BasePlugin):
|
|||||||
else:
|
else:
|
||||||
await message.reply_text("未查询到您所绑定的账号信息,请先绑定账号", reply_markup=InlineKeyboardMarkup(buttons))
|
await message.reply_text("未查询到您所绑定的账号信息,请先绑定账号", reply_markup=InlineKeyboardMarkup(buttons))
|
||||||
return
|
return
|
||||||
|
except GenshinException as exc:
|
||||||
|
if exc.retcode == 1034:
|
||||||
|
if uid:
|
||||||
|
await message.reply_text("出错了呜呜呜 ~ 请稍后重试")
|
||||||
|
return
|
||||||
|
raise exc
|
||||||
except TooManyRequestPublicCookies:
|
except TooManyRequestPublicCookies:
|
||||||
await message.reply_text("用户查询次数过多 请稍后重试")
|
await message.reply_text("用户查询次数过多 请稍后重试")
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user