mirror of
https://github.com/KimigaiiWuyi/GenshinUID.git
synced 2025-06-01 13:09:56 +08:00
commit
64915421eb
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
|
||||
|
||||
#统计状态函数
|
||||
|
65
getDB.py
65
getDB.py
@ -325,14 +325,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:
|
||||
@ -379,7 +371,7 @@ async def GetDaily(Uid,ServerID="cn_gf01"):
|
||||
data = json.loads(req.text)
|
||||
return data
|
||||
except:
|
||||
print("访问失败,请重试!")
|
||||
print("访问每日信息失败,请重试!")
|
||||
sys.exit(1)
|
||||
|
||||
async def GetSignList():
|
||||
@ -395,7 +387,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':
|
||||
@ -413,7 +406,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':
|
||||
@ -437,7 +431,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':
|
||||
@ -457,7 +452,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"):
|
||||
@ -477,7 +474,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"):
|
||||
@ -500,7 +497,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)
|
||||
|
||||
|
||||
@ -524,7 +521,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):
|
||||
@ -542,7 +539,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):
|
||||
@ -556,17 +554,22 @@ async def GetWeaponInfo(name):
|
||||
return data
|
||||
|
||||
async def GetCharInfo(name,mode = 0):
|
||||
str = ""
|
||||
if mode == 1:
|
||||
str = "&talents=1"
|
||||
elif mode == 2:
|
||||
str = "&constellations=1"
|
||||
|
||||
async with AsyncClient() as client:
|
||||
req = await client.get(
|
||||
url="https://genshin.minigg.cn/?char=" + name + str,
|
||||
headers={
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36',
|
||||
'Referer': 'https://genshin.minigg.cn/index.html'})
|
||||
data = json.loads(req.text)
|
||||
return data
|
||||
try:
|
||||
str = ""
|
||||
if mode == 1:
|
||||
str = "&talents=1"
|
||||
elif mode == 2:
|
||||
str = "&constellations=1"
|
||||
|
||||
async with AsyncClient() as client:
|
||||
req = await client.get(
|
||||
url="https://genshin.minigg.cn/?char=" + name + str,
|
||||
headers={
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36',
|
||||
'Referer': 'https://genshin.minigg.cn/index.html'})
|
||||
data = json.loads(req.text)
|
||||
return data
|
||||
except:
|
||||
im = "获取人物信息失败,请重试!"
|
||||
print(im)
|
||||
return im
|
||||
|
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