🐛 Fix signed error
This commit is contained in:
parent
bc8118dd20
commit
334d62b8f4
@ -39,6 +39,8 @@ Bot 实例: [@Genshin_All_Info_Bot](https://t.me/Genshin_All_Info_Bot)
|
|||||||
|
|
||||||
## 特别感谢
|
## 特别感谢
|
||||||
|
|
||||||
|
[genshinstats](https://github.com/thesadru/genshinstats/)
|
||||||
|
|
||||||
[GenshinUID](https://github.com/KimigaiiWuyi/GenshinUID)
|
[GenshinUID](https://github.com/KimigaiiWuyi/GenshinUID)
|
||||||
|
|
||||||
[Genshin_Impact_bot](https://github.com/H-K-Y/Genshin_Impact_bot)
|
[Genshin_Impact_bot](https://github.com/H-K-Y/Genshin_Impact_bot)
|
||||||
|
@ -135,7 +135,11 @@ async def OwnerCookies(uid):
|
|||||||
async def MysSign(Uid):
|
async def MysSign(Uid):
|
||||||
try:
|
try:
|
||||||
gs.set_cookie(await OwnerCookies(Uid))
|
gs.set_cookie(await OwnerCookies(Uid))
|
||||||
return gs.claim_daily_reward(Uid, lang='zh-cn')
|
data = gs.claim_daily_reward(Uid, lang='zh-cn')
|
||||||
|
if data:
|
||||||
|
return data
|
||||||
|
else:
|
||||||
|
return gs.get_daily_reward_info()
|
||||||
except:
|
except:
|
||||||
print("签到失败,请重试")
|
print("签到失败,请重试")
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ from pyrogram.types import Message
|
|||||||
|
|
||||||
from defs.db2 import MysSign, GetDaily, cacheDB, GetMysInfo, errorDB, GetInfo, GetSpiralAbyssInfo
|
from defs.db2 import MysSign, GetDaily, cacheDB, GetMysInfo, errorDB, GetInfo, GetSpiralAbyssInfo
|
||||||
from defs.event import ys_font
|
from defs.event import ys_font
|
||||||
|
from genshinstats.daily import DailyRewardInfo
|
||||||
|
|
||||||
WEAPON_PATH = os.path.join("assets", 'weapon')
|
WEAPON_PATH = os.path.join("assets", 'weapon')
|
||||||
BG_PATH = os.path.join("assets", "bg")
|
BG_PATH = os.path.join("assets", "bg")
|
||||||
@ -80,9 +81,13 @@ daily_im = '''
|
|||||||
async def sign(uid):
|
async def sign(uid):
|
||||||
try:
|
try:
|
||||||
sign_data = await MysSign(uid)
|
sign_data = await MysSign(uid)
|
||||||
if sign_data is not None:
|
if sign_data:
|
||||||
mes_im = "签到成功"
|
if isinstance(sign_data, DailyRewardInfo):
|
||||||
get_im = f"本次签到获得{sign_data['name']}x{sign_data['cnt']}"
|
mes_im = "已经签到过了!"
|
||||||
|
get_im = f"本月已经签到了 {sign_data.claimed_rewards} 天"
|
||||||
|
else:
|
||||||
|
mes_im = "签到成功"
|
||||||
|
get_im = f"本次签到获得{sign_data['name']}x{sign_data['cnt']}"
|
||||||
im = mes_im + "!" + "\n" + get_im
|
im = mes_im + "!" + "\n" + get_im
|
||||||
else:
|
else:
|
||||||
im = "签到失败,请检查Cookies是否失效。"
|
im = "签到失败,请检查Cookies是否失效。"
|
||||||
@ -125,7 +130,7 @@ async def daily(mode="push", uid=None):
|
|||||||
finished_expedition_num = 0
|
finished_expedition_num = 0
|
||||||
expedition_info: List[str] = []
|
expedition_info: List[str] = []
|
||||||
for expedition in dailydata['expeditions']:
|
for expedition in dailydata['expeditions']:
|
||||||
avatar: str = expedition['icon'][89:-4]
|
avatar: str = expedition['icon'][92:-4]
|
||||||
try:
|
try:
|
||||||
avatar_name: str = avatar_json[avatar]
|
avatar_name: str = avatar_json[avatar]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
Loading…
Reference in New Issue
Block a user