mirror of
https://github.com/KimigaiiWuyi/GenshinUID.git
synced 2025-05-31 12:40:38 +08:00
修复:原神wiki相关功能
This commit is contained in:
commit
2c7148410f
25
__init__.py
25
__init__.py
@ -519,22 +519,27 @@ async def _(bot:HoshinoBot, ev: CQEvent):
|
||||
#签到函数
|
||||
async def sign(uid):
|
||||
try:
|
||||
sign_data = await MysSign(uid)
|
||||
sign_data = await MysSign(uid)
|
||||
status = sign_data['message']
|
||||
im = "\n"
|
||||
sign_info = await GetSignInfo(uid)
|
||||
sign_info = sign_info['data']
|
||||
sign_list = await GetSignList()
|
||||
status = sign_data['message']
|
||||
getitem = sign_list['data']['awards'][int(sign_info['total_sign_day'])-1]['name']
|
||||
getnum = sign_list['data']['awards'][int(sign_info['total_sign_day'])-1]['cnt']
|
||||
get_im = f"本次签到获得{getitem}x{getnum}"
|
||||
if status == "OK" and sign_info['is_sign'] == True:
|
||||
sign_info_data = sign_info['data']
|
||||
if status == "OK" and sign_info_data['is_sign'] == True:
|
||||
mes_im = "签到成功"
|
||||
else:
|
||||
mes_im = status
|
||||
sign_missed = sign_info['sign_cnt_missed']
|
||||
im = im + mes_im +"!" + "\n"
|
||||
|
||||
sign_missed = sign_info_data['sign_cnt_missed']
|
||||
sign_list = await GetSignList()
|
||||
getitem = sign_list['data']['awards'][int(sign_info_data['total_sign_day'])-1]['name']
|
||||
getnum = sign_list['data']['awards'][int(sign_info_data['total_sign_day'])-1]['cnt']
|
||||
get_im = f"本次签到获得{getitem}x{getnum}"
|
||||
im = "\n" + mes_im +"!" + "\n" + get_im + "\n" + f"本月漏签次数:{sign_missed}"
|
||||
#im = im + "\n" + "本次签到获取物品请求失败"
|
||||
|
||||
except:
|
||||
im = "\n签到失败,请检查Cookies是否失效。"
|
||||
im = im + "签到失败,请检查Cookies是否失效。"
|
||||
return im
|
||||
|
||||
#统计状态函数
|
||||
|
34
getDB.py
34
getDB.py
@ -326,14 +326,6 @@ async def OwnerCookies(uid):
|
||||
return cookies
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def random_hex(length):
|
||||
result = hex(random.randint(0,16**length)).replace('0x','').upper()
|
||||
if len(result)<length:
|
||||
@ -380,7 +372,7 @@ async def GetDaily(Uid,ServerID="cn_gf01"):
|
||||
data = json.loads(req.text)
|
||||
return data
|
||||
except:
|
||||
print("访问失败,请重试!")
|
||||
print("访问每日信息失败,请重试!")
|
||||
sys.exit(1)
|
||||
|
||||
async def GetSignList():
|
||||
@ -396,7 +388,8 @@ async def GetSignList():
|
||||
data = json.loads(req.text)
|
||||
return data
|
||||
except:
|
||||
print("访问失败,请重试!")
|
||||
im = "获取签到奖励列表失败,请重试"
|
||||
print(im)
|
||||
|
||||
async def GetSignInfo(Uid,ServerID="cn_gf01"):
|
||||
if Uid[0] == '5':
|
||||
@ -414,7 +407,8 @@ async def GetSignInfo(Uid,ServerID="cn_gf01"):
|
||||
data = json.loads(req.text)
|
||||
return data
|
||||
except:
|
||||
print("访问失败,请重试!")
|
||||
im = "获取签到信息失败,请重试"
|
||||
print(im)
|
||||
|
||||
async def MysSign(Uid,ServerID="cn_gf01"):
|
||||
if Uid[0] == '5':
|
||||
@ -438,7 +432,8 @@ async def MysSign(Uid,ServerID="cn_gf01"):
|
||||
data2 = json.loads(req.text)
|
||||
return data2
|
||||
except:
|
||||
print("访问失败,请重试!")
|
||||
im = { 'message' : '签到失败,请重试'}
|
||||
return im
|
||||
|
||||
async def GetAward(Uid,ServerID="cn_gf01"):
|
||||
if Uid[0] == '5':
|
||||
@ -458,7 +453,9 @@ async def GetAward(Uid,ServerID="cn_gf01"):
|
||||
data = json.loads(req.text)
|
||||
return data
|
||||
except:
|
||||
print("访问失败,请重试!")
|
||||
im = "访问每月统计失败,请重试!"
|
||||
print(im)
|
||||
return im
|
||||
#sys.exit(1)
|
||||
|
||||
async def GetInfo(Uid,ck,ServerID="cn_gf01"):
|
||||
@ -478,7 +475,7 @@ async def GetInfo(Uid,ck,ServerID="cn_gf01"):
|
||||
data = json.loads(req.text)
|
||||
return data
|
||||
except:
|
||||
print("访问失败,请重试!")
|
||||
print("获取信息失败,请重试!")
|
||||
#sys.exit(1)
|
||||
|
||||
async def GetSpiralAbyssInfo(Uid, ck,Schedule_type="1",ServerID="cn_gf01"):
|
||||
@ -501,7 +498,7 @@ async def GetSpiralAbyssInfo(Uid, ck,Schedule_type="1",ServerID="cn_gf01"):
|
||||
data = json.loads(req.text)
|
||||
return data
|
||||
except:
|
||||
print("1访问失败,请重试!")
|
||||
print("1获取深渊信息失败,请重试!")
|
||||
#sys.exit(1)
|
||||
|
||||
|
||||
@ -525,7 +522,7 @@ def GetCharacter(Uid,Character_ids, ck,ServerID="cn_gf01"):
|
||||
data2 = json.loads(req.text)
|
||||
return data2
|
||||
except:
|
||||
print("访问失败,请重试!")
|
||||
print("获取人物信息失败,请重试!")
|
||||
#sys.exit(1)
|
||||
|
||||
async def GetMysInfo(mysid,ck):
|
||||
@ -543,7 +540,8 @@ async def GetMysInfo(mysid,ck):
|
||||
data = json.loads(req.text)
|
||||
return data
|
||||
except:
|
||||
im = "err"
|
||||
im = "err,获取米游社信息失败,请重试!"
|
||||
print(im)
|
||||
return im
|
||||
|
||||
async def GetWeaponInfo(name):
|
||||
@ -576,4 +574,4 @@ async def GetCharInfo(name,mode = 0):
|
||||
soup = BeautifulSoup(req.text, "lxml")
|
||||
item = soup.select_one("pre").text
|
||||
data = json.loads(item)
|
||||
return data
|
||||
return data
|
||||
|
BIN
mys/char_done/10000054.png
Normal file
BIN
mys/char_done/10000054.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
BIN
mys/chars/10000054.png
Normal file
BIN
mys/chars/10000054.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 81 KiB |
Loading…
x
Reference in New Issue
Block a user