mirror of
https://github.com/PaiGramTeam/PamGram.git
synced 2024-11-16 03:55:26 +00:00
🐛 stats ledger month info skip oversea user
This commit is contained in:
parent
0f1cb5ec69
commit
35e32227b1
@ -1,5 +1,7 @@
|
||||
import contextlib
|
||||
from typing import Optional, List, TYPE_CHECKING
|
||||
|
||||
from simnet import Region
|
||||
from simnet.errors import BadRequest as SimnetBadRequest
|
||||
from telegram import Update, Message
|
||||
from telegram.constants import ChatAction
|
||||
@ -19,7 +21,6 @@ from utils.uid import mask_number
|
||||
if TYPE_CHECKING:
|
||||
from simnet import StarRailClient
|
||||
|
||||
|
||||
__all__ = ("PlayerStatsPlugins",)
|
||||
|
||||
|
||||
@ -93,10 +94,10 @@ class PlayerStatsPlugins(Plugin):
|
||||
rogue = await client.get_starrail_rogue(uid)
|
||||
except SimnetBadRequest:
|
||||
rogue = None
|
||||
try:
|
||||
ledger = await client.get_starrail_ledger_month_info(uid)
|
||||
except SimnetBadRequest:
|
||||
ledger = None
|
||||
ledger = None
|
||||
if (not client.public) and client.region != Region.OVERSEAS:
|
||||
with contextlib.suppress(SimnetBadRequest):
|
||||
ledger = await client.get_starrail_ledger_month_info(uid)
|
||||
logger.debug(user_info)
|
||||
await self.set_name_card(uid, user_info.phone_background_image_url)
|
||||
data = {
|
||||
|
Loading…
Reference in New Issue
Block a user