fix and feat
54
README.md
@ -4,14 +4,10 @@
|
||||
|
||||
注意:本插件不包含本体,您应该配合[Mrs4s](https://github.com/Mrs4s) / [go-cqhttp](https://github.com/Mrs4s/go-cqhttp) 和 [HoshinoBot](https://github.com/Ice-Cirno/HoshinoBot) 使用,本插件的作用是利用米游社API查询指定原神UID信息(Cookies获取可前往[YuanShen_User_Info](https://github.com/Womsxd/YuanShen_User_Info)查看教程)
|
||||
|
||||
已完成:角色排序(星级>等级>好感),背景图自定义(通过传参形式)
|
||||
|
||||
未完成:深渊数据导出,角色详细信息列表(包括武器信息,和全角色)
|
||||
已完成:角色排序(星级>等级>好感),mysid/uid查询,mysid/uid绑定qq号,cookies池,每日自动记录uid查询使用的cookies,下次再查询时仍然调用该cookies(防止浪费),mysid/uid查询深渊单独层数,以上所有输出图片均可支持背景图片自定义。
|
||||
|
||||
示例: 
|
||||
|
||||

|
||||
|
||||
- [安装](#安装)
|
||||
- [更新记录](#更新记录)
|
||||
- [指令](#指令)
|
||||
@ -34,12 +30,30 @@ $ git clone https://github.com/KimigaiiWuyi/GenshinUID.git
|
||||
$ pip3 install -r requirements.txt
|
||||
```
|
||||
|
||||
3、在GenshinUID的文件夹下打开getData.py,添加自己的cookies到函数cache_Cookie()中的cookie_list中。
|
||||
3、在hoshino/config的`__bot__.py`文件中,添加GenshinUID
|
||||
|
||||
4、在hoshino/config的`__bot__.py`文件中,添加GenshinUID
|
||||
4、启动HoshinoBot后,私聊机器人,发送
|
||||
|
||||
```sh
|
||||
添加 cookies
|
||||
```
|
||||
|
||||
注意事项:可以添加多条,但一次只能添加一条,添加两个字的之后必须带有空格,cookies填入你自己的,并且不要泄露给任何人,如果添加了错误的cookies,会导致一系列问题,如果想删除错误的cookies,请操作sqlite数据库完成。
|
||||
|
||||
5、进入机器人在的群聊,即可正常使用本插件。
|
||||
|
||||
## 更新记录
|
||||
|
||||
#### 2021-9-27
|
||||
|
||||
新增:Cookies次数防浪费机制(查过的mysid/uid会锁定使用过的cookies,当天再查时会使用同样的cookies防止次数浪费,每日零点清空。)
|
||||
|
||||
优化:Cookies填入现在需要私聊bot,可以设置多条,并且不会随着git pull而需要重新设置。
|
||||
|
||||
优化:白色底图现在的透明度会更高。
|
||||
|
||||
修复:使用心海刷新深渊记录时,尝试查询深渊时无法输出正确的结果。
|
||||
|
||||
#### 2021-9-20
|
||||
|
||||
新增:米游社id查询(指令示例:mys123456789),该方法同样支持深渊查询,(指令示例:mys123456789深渊12).
|
||||
@ -116,19 +130,37 @@ $ pip3 install -r requirements.txt
|
||||
|
||||
## 指令
|
||||
|
||||
1、触发词uid后面跟九位uid即可。
|
||||
1、仅私聊状态下生效,触发词添加 后跟cookies即可添加Cookies(添加两字后需要带空格)
|
||||
|
||||

|
||||
|
||||
2、群聊状态下生效,绑定uid/绑定mys后跟uid/mysid即可完成绑定
|
||||
|
||||

|
||||
|
||||
3、群聊状态下生效,而且必须绑定过uid/mysid才可生效,输出查询可以获取角色图
|
||||
|
||||

|
||||
|
||||
4、群聊状态下生效,而且必须绑定过uid/mysid才可生效,输出查询深渊xx可以获取当期深渊层数图
|
||||
|
||||

|
||||
|
||||
5、群聊状态下生效,触发词uid后面跟九位uid即可/触发词mys后面跟米游社通行证即可。
|
||||
|
||||

|
||||
|
||||
2、触发词后跟九位uid后跟一张任意大小的图片(不能是GIF),可以自定义背景
|
||||
6、群聊状态下生效,mysid/uid后跟相应数字后跟深渊后跟相应层数即可。
|
||||
|
||||

|
||||
|
||||
7、以上所有可输出图片的触发词后跟一张任意大小的图片(不能是GIF),可以自定义背景
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
3、触发词后跟九位uid后跟角色,可以输出一张全角色+武器的信息图(beta)
|
||||
|
||||

|
||||
|
||||
## 相关仓库
|
||||
|
||||
|
19
__init__.py
@ -5,7 +5,7 @@ import re
|
||||
|
||||
from .getImg import draw_pic,draw_abyss_pic
|
||||
from .getData import GetMysInfo
|
||||
from .getDB import connectDB,selectDB
|
||||
from .getDB import connectDB,selectDB,cookiesDB,cacheDB,deletecache
|
||||
|
||||
from nonebot import *
|
||||
import json
|
||||
@ -17,6 +17,7 @@ from hoshino.util import FreqLimiter,pic2b64
|
||||
import hoshino
|
||||
import asyncio
|
||||
import time
|
||||
import datetime
|
||||
import string
|
||||
import random
|
||||
import hashlib
|
||||
@ -35,6 +36,22 @@ FILE_PATH = os.path.dirname(__file__)
|
||||
FILE2_PATH = os.path.join(FILE_PATH,'mys')
|
||||
Texture_PATH = os.path.join(FILE2_PATH,'texture2d')
|
||||
|
||||
|
||||
@sv.scheduled_job('cron', hour='0')
|
||||
async def delete():
|
||||
deletecache()
|
||||
|
||||
@bot.on_message('private')
|
||||
async def setting(ctx):
|
||||
message = ctx['raw_message']
|
||||
sid=int(ctx["self_id"])
|
||||
uid=int(ctx["sender"]["user_id"])
|
||||
gid=0
|
||||
if '添加 ' in message:
|
||||
mes = message.replace('添加 ','')
|
||||
await cookiesDB(mes)
|
||||
await bot.send_msg(self_id=sid, user_id=uid, group_id=gid, message=f'添加cookies成功!')
|
||||
|
||||
@sv.on_prefix('uid')
|
||||
async def _(bot:HoshinoBot, ev: CQEvent):
|
||||
image = re.search(r"\[CQ:image,file=(.*),url=(.*)\]", str(ev.message))
|
||||
|
66
getDB.py
@ -1,7 +1,9 @@
|
||||
import sqlite3
|
||||
import os
|
||||
import yaml
|
||||
import random
|
||||
|
||||
FILE_PATH = os.path.abspath(os.path.join(os.getcwd(), "../.."))
|
||||
FILE_PATH = os.path.abspath(os.path.join(os.getcwd(), "hoshino"))
|
||||
DATA_PATH = os.path.join(FILE_PATH,'config')
|
||||
|
||||
async def connectDB(userid,uid = None,mys = None):
|
||||
@ -36,4 +38,64 @@ async def selectDB(userid):
|
||||
else:
|
||||
return None
|
||||
else:
|
||||
return None
|
||||
return None
|
||||
|
||||
def deletecache():
|
||||
conn = sqlite3.connect('ID_DATA.db')
|
||||
c = conn.cursor()
|
||||
c.execute("DROP TABLE CookiesCache")
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
||||
async def cacheDB(uid,mode = 1,mys = None):
|
||||
use = ''
|
||||
conn = sqlite3.connect('ID_DATA.db')
|
||||
c = conn.cursor()
|
||||
c.execute('''CREATE TABLE IF NOT EXISTS CookiesCache
|
||||
(UID TEXT PRIMARY KEY,
|
||||
MYSID TEXT,
|
||||
Cookies TEXT);''')
|
||||
|
||||
if mode == 1:
|
||||
if mys:
|
||||
cursor = c.execute("SELECT * FROM CookiesCache WHERE MYSID = ?",(mys,))
|
||||
c_data = cursor.fetchall()
|
||||
else:
|
||||
cursor = c.execute("SELECT * FROM CookiesCache WHERE UID = ?",(uid,))
|
||||
c_data = cursor.fetchall()
|
||||
elif mode == 2:
|
||||
cursor = c.execute("SELECT * FROM CookiesCache WHERE MYSID = ?",(uid,))
|
||||
c_data = cursor.fetchall()
|
||||
|
||||
if len(c_data)==0:
|
||||
cookiesrow = c.execute("SELECT * FROM CookiesTable ORDER BY RANDOM() limit 1")
|
||||
#r = cookiesrow.fetchall()
|
||||
#random.randint(0,len(r))
|
||||
for row2 in cookiesrow:
|
||||
if mode == 1:
|
||||
c.execute("INSERT OR IGNORE INTO CookiesCache (Cookies,UID) \
|
||||
VALUES (?, ?)",(row2[0],uid))
|
||||
if mode == 2:
|
||||
c.execute("INSERT OR IGNORE INTO CookiesCache (Cookies,MYSID) \
|
||||
VALUES (?, ?)",(row2[0],uid))
|
||||
use = row2[0]
|
||||
else:
|
||||
use = c_data[0][2]
|
||||
if mys:
|
||||
c.execute("UPDATE CookiesCache SET UID = ? WHERE MYSID=?",(uid,mys))
|
||||
|
||||
conn.commit()
|
||||
conn.close()
|
||||
return use
|
||||
|
||||
async def cookiesDB(Cookies):
|
||||
conn = sqlite3.connect('ID_DATA.db')
|
||||
c = conn.cursor()
|
||||
c.execute('''CREATE TABLE IF NOT EXISTS CookiesTable
|
||||
(Cookies TEXT PRIMARY KEY NOT NULL);''')
|
||||
|
||||
c.execute("INSERT OR IGNORE INTO CookiesTable (Cookies) \
|
||||
VALUES (?)",(Cookies,))
|
||||
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
33
getData.py
@ -1,8 +1,15 @@
|
||||
# https://github.com/Womsxd/YuanShen_User_Info
|
||||
#import hashlib
|
||||
#import json
|
||||
#import random
|
||||
#import string
|
||||
import sys
|
||||
#import time
|
||||
|
||||
from httpx import AsyncClient
|
||||
|
||||
from .getDB import cookiesDB,cacheDB
|
||||
|
||||
from nonebot import *
|
||||
import json
|
||||
from random import randint
|
||||
@ -24,12 +31,6 @@ import base64
|
||||
|
||||
mhyVersion = "2.11.1"
|
||||
|
||||
|
||||
def cache_Cookie():
|
||||
cookie_list = ['']
|
||||
return random.choice(cookie_list)
|
||||
|
||||
|
||||
def md5(text):
|
||||
md5 = hashlib.md5()
|
||||
md5.update(text.encode())
|
||||
@ -40,13 +41,13 @@ def DSGet(q = "",b = None):
|
||||
br = json.dumps(b)
|
||||
else:
|
||||
br = ""
|
||||
s = "xV8v4Qu54lUKrEYFZkJhB8cuOh9Asafs" #@Azure99
|
||||
s = "xV8v4Qu54lUKrEYFZkJhB8cuOh9Asafs"
|
||||
t = str(int(time.time()))
|
||||
r = str(random.randint(100000, 200000))
|
||||
c = md5("salt=" + s + "&t=" + t + "&r=" + r + "&b=" + br + "&q=" + q) #@lulu666lulu
|
||||
c = md5("salt=" + s + "&t=" + t + "&r=" + r + "&b=" + br + "&q=" + q)
|
||||
return t + "," + r + "," + c
|
||||
|
||||
async def GetInfo(Uid, ServerID="cn_gf01",Schedule_type="1"):
|
||||
async def GetInfo(Uid,ServerID="cn_gf01",Schedule_type="1",mysid = None):
|
||||
if Uid[0] == '5':
|
||||
ServerID = "cn_qd01"
|
||||
try:
|
||||
@ -64,14 +65,14 @@ async def GetInfo(Uid, ServerID="cn_gf01",Schedule_type="1"):
|
||||
#'Accept-Encoding': 'gzip, deflate',
|
||||
#'Accept-Language': 'zh-CN,en-US;q=0.8',
|
||||
#'X-Requested-With': 'com.mihoyo.hyperion',
|
||||
"Cookie": cache_Cookie()})
|
||||
"Cookie": await cacheDB(Uid,1,mysid)})
|
||||
data = json.loads(req.text)
|
||||
return data
|
||||
except:
|
||||
print("访问失败,请重试!")
|
||||
sys.exit(1)
|
||||
|
||||
async def GetSpiralAbyssInfo(Uid, ServerID="cn_gf01",Schedule_type="1"):
|
||||
async def GetSpiralAbyssInfo(Uid, ServerID="cn_gf01",Schedule_type="1",mysid = None):
|
||||
if Uid[0] == '5':
|
||||
ServerID = "cn_qd01"
|
||||
try:
|
||||
@ -82,7 +83,7 @@ async def GetSpiralAbyssInfo(Uid, ServerID="cn_gf01",Schedule_type="1"):
|
||||
'Accept': 'application/json, text/plain, */*',
|
||||
'DS': DSGet("role_id=" + Uid + "&schedule_type=" + Schedule_type + "&server="+ ServerID),
|
||||
'Origin': 'https://webstatic.mihoyo.com',
|
||||
'Cookie': cache_Cookie(),
|
||||
'Cookie': await cacheDB(Uid,1,mysid),
|
||||
'x-rpc-app_version': mhyVersion,
|
||||
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) miHoYoBBS/2.11.1',
|
||||
'x-rpc-client_type': '5',
|
||||
@ -99,7 +100,7 @@ async def GetSpiralAbyssInfo(Uid, ServerID="cn_gf01",Schedule_type="1"):
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
async def GetCharacter(Uid,Character_ids, ServerID="cn_gf01"):
|
||||
async def GetCharacter(Uid,Character_ids, ServerID="cn_gf01",mysid = None):
|
||||
if Uid[0] == '5':
|
||||
ServerID = "cn_qd01"
|
||||
try:
|
||||
@ -109,7 +110,7 @@ async def GetCharacter(Uid,Character_ids, ServerID="cn_gf01"):
|
||||
'Accept': 'application/json, text/plain, */*',
|
||||
'DS': DSGet('',{"character_ids": Character_ids ,"role_id": Uid ,"server": ServerID}),
|
||||
'Origin': 'https://webstatic.mihoyo.com',
|
||||
'Cookie': cache_Cookie(),
|
||||
'Cookie': await cacheDB(Uid,1,mysid),
|
||||
'x-rpc-app_version': mhyVersion,
|
||||
'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) miHoYoBBS/2.11.1',
|
||||
'x-rpc-client_type': '5',
|
||||
@ -142,9 +143,9 @@ async def GetMysInfo(mysid):
|
||||
#'Accept-Encoding': 'gzip, deflate',
|
||||
#'Accept-Language': 'zh-CN,en-US;q=0.8',
|
||||
#'X-Requested-With': 'com.mihoyo.hyperion',
|
||||
"Cookie": cache_Cookie()})
|
||||
"Cookie": await cacheDB(mysid,2)})
|
||||
data = json.loads(req.text)
|
||||
return data
|
||||
return [data,mysid]
|
||||
except:
|
||||
print ("访问失败,请重试!")
|
||||
return
|
62
getImg.py
@ -30,7 +30,10 @@ def get_char_pic(id,url):
|
||||
|
||||
def get_chardone_pic(id,url,star):
|
||||
urllib.request.urlretrieve(f'{url}', os.path.join(CHAR_DONE_PATH,f'{id}.png'))
|
||||
char_path = os.path.join(CHAR_DONE_PATH,f'{id}.png')
|
||||
if star == 4:
|
||||
star4_1_path = os.path.join(TEXT_PATH,'4star_1.png')
|
||||
star4_2_path = os.path.join(TEXT_PATH,'4star_2.png')
|
||||
star4_1 = Image.open(star4_1_path)
|
||||
star4_2 = Image.open(star4_2_path)
|
||||
char_path = os.path.join(CHAR_DONE_PATH,str(id) + '.png')
|
||||
@ -40,6 +43,8 @@ def get_chardone_pic(id,url,star):
|
||||
star4_1.paste(star4_2,(0,0),star4_2)
|
||||
star4_1.save(os.path.join(CHAR_DONE_PATH,str(id) + '.png'))
|
||||
else:
|
||||
star5_1_path = os.path.join(TEXT_PATH,'5star_1.png')
|
||||
star5_2_path = os.path.join(TEXT_PATH,'5star_2.png')
|
||||
star5_1 = Image.open(star5_1_path)
|
||||
star5_2 = Image.open(star5_2_path)
|
||||
char_path = os.path.join(CHAR_DONE_PATH,str(id) + '.png')
|
||||
@ -62,13 +67,17 @@ async def draw_abyss_pic(uid,nickname,floor_num,image = None,mode = 2):
|
||||
|
||||
if mode == 3:
|
||||
mys_data = await GetMysInfo(uid)
|
||||
mysid_data = mys_data[1]
|
||||
mys_data = mys_data[0]
|
||||
uid = mys_data['data']['list'][0]['game_role_id']
|
||||
nickname = mys_data['data']['list'][0]['nickname']
|
||||
#role_region = mys_data['data']['list'][0]['region']
|
||||
#role_level = mys_data['data']['list'][0]['level']
|
||||
|
||||
raw_data = await GetSpiralAbyssInfo(uid)
|
||||
raw_char_data = await GetInfo(uid)
|
||||
role_level = mys_data['data']['list'][0]['level']
|
||||
raw_data = await GetSpiralAbyssInfo(uid,"cn_gf01","1",mysid_data)
|
||||
raw_char_data = await GetInfo(uid,"cn_gf01","1",mysid_data)
|
||||
else:
|
||||
raw_data = await GetSpiralAbyssInfo(uid)
|
||||
raw_char_data = await GetInfo(uid)
|
||||
|
||||
if (raw_data["retcode"] != 0):
|
||||
if (raw_data["retcode"] == 10001):
|
||||
@ -158,7 +167,7 @@ async def draw_abyss_pic(uid,nickname,floor_num,image = None,mode = 2):
|
||||
avatars = based_data['levels'][j]['battles'][0]['avatars'] + based_data['levels'][j]['battles'][1]['avatars']
|
||||
for i in based_data['levels'][j]['battles'][0]['avatars']:
|
||||
if not os.path.exists(os.path.join(CHAR_DONE_PATH,str(i['id']) + ".png")):
|
||||
get_chardone_pic(char_data[num_1]['id'],char_data[num_1]['image'],char_data[num_1]['rarity'])
|
||||
get_chardone_pic(i['id'],i['icon'],i['rarity'])
|
||||
char = os.path.join(CHAR_DONE_PATH,str(i['id']) + ".png")
|
||||
char_img = Image.open(char)
|
||||
char_draw = ImageDraw.Draw(char_img)
|
||||
@ -166,8 +175,8 @@ async def draw_abyss_pic(uid,nickname,floor_num,image = None,mode = 2):
|
||||
if k['id'] == i['id']:
|
||||
char_draw.text((40,108),f'Lv.{str(k["level"])}',(21,21,21),ys_font(18))
|
||||
char_draw.text((95.3,19),f'{str(k["actived_constellation_num"])}','white',ys_font(18))
|
||||
if str(k["fetter"]) == "10":
|
||||
char_draw.text((95.3,40.5),"F",(21,21,21),ys_font(17))
|
||||
if str(k["fetter"]) == "10" or str(k["name"]) == "旅行者":
|
||||
char_draw.text((93,41.5),"♥",(21,21,21),ys_font(15))
|
||||
else:
|
||||
char_draw.text((95.3,40.5),f'{str(k["fetter"])}',(21,21,21),ys_font(18))
|
||||
char_crop = (41 + 125*(num_1%4),46)
|
||||
@ -176,7 +185,7 @@ async def draw_abyss_pic(uid,nickname,floor_num,image = None,mode = 2):
|
||||
num_2 = 0
|
||||
for i in based_data['levels'][j]['battles'][1]['avatars']:
|
||||
if not os.path.exists(os.path.join(CHAR_DONE_PATH,str(i['id']) + ".png")):
|
||||
get_chardone_pic(char_data[num_2]['id'],char_data[num_2]['image'],char_data[num_2]['rarity'])
|
||||
get_chardone_pic(i['id'],i['icon'],i['rarity'])
|
||||
char = os.path.join(CHAR_DONE_PATH,str(i['id']) + ".png")
|
||||
char_img = Image.open(char)
|
||||
char_draw = ImageDraw.Draw(char_img)
|
||||
@ -184,8 +193,8 @@ async def draw_abyss_pic(uid,nickname,floor_num,image = None,mode = 2):
|
||||
if k['id'] == i['id']:
|
||||
char_draw.text((40,108),f'Lv.{str(k["level"])}',(21,21,21),ys_font(18))
|
||||
char_draw.text((95.3,19),f'{str(k["actived_constellation_num"])}','white',ys_font(18))
|
||||
if str(k["fetter"]) == "10":
|
||||
char_draw.text((95.3,40.5),"F",(21,21,21),ys_font(17))
|
||||
if str(k["fetter"]) == "10" or str(k["name"]) == "旅行者":
|
||||
char_draw.text((93,41.5),"♥",(21,21,21),ys_font(15))
|
||||
else:
|
||||
char_draw.text((95.3,40.5),f'{str(k["fetter"])}',(21,21,21),ys_font(18))
|
||||
char_crop = (41 + 125*(num_2%4),180)
|
||||
@ -225,10 +234,10 @@ async def draw_abyss_pic(uid,nickname,floor_num,image = None,mode = 2):
|
||||
|
||||
text_draw.text((171.6,89.3), f"{nickname}", (217,217,217), ys_font(32))
|
||||
text_draw.text((189.6, 126.3), 'UID ' + f"{uid}", (217,217,217), ys_font(14))
|
||||
if floor_num == 9:
|
||||
text_draw.text((642, 78), f"{floor_num}", (29,30,63), ys_font(60))
|
||||
if floor_num == "9":
|
||||
text_draw.text((650, 79), f"{floor_num}", (29,30,63), ys_font(50))
|
||||
else:
|
||||
text_draw.text((623.3, 76), f"{floor_num}", (29,30,63), ys_font(60))
|
||||
text_draw.text((630, 79), f"{floor_num}", (29,30,63), ys_font(50))
|
||||
|
||||
bg_img = bg_img.convert('RGB')
|
||||
result_buffer = BytesIO()
|
||||
@ -248,12 +257,15 @@ async def draw_pic(uid,nickname,image = None,mode = 2,role_level = None):
|
||||
|
||||
if mode == 3:
|
||||
mys_data = await GetMysInfo(uid)
|
||||
mysid_data = mys_data[1]
|
||||
mys_data = mys_data[0]
|
||||
uid = mys_data['data']['list'][0]['game_role_id']
|
||||
nickname = mys_data['data']['list'][0]['nickname']
|
||||
#role_region = mys_data['data']['list'][0]['region']
|
||||
role_level = mys_data['data']['list'][0]['level']
|
||||
|
||||
raw_data = await GetInfo(uid)
|
||||
raw_data = await GetInfo(uid,"cn_gf01","1",mysid_data)
|
||||
else:
|
||||
raw_data = await GetInfo(uid)
|
||||
|
||||
if (raw_data["retcode"] != 0):
|
||||
if (raw_data["retcode"] == 10001):
|
||||
@ -284,7 +296,7 @@ async def draw_pic(uid,nickname,image = None,mode = 2,role_level = None):
|
||||
raw_data = raw_data['data']
|
||||
char_data = raw_data["avatars"]
|
||||
char_num = len(raw_data["avatars"])
|
||||
if mode == 2 or mode == 3:
|
||||
if mode == 2:
|
||||
char_ids = []
|
||||
char_rawdata = []
|
||||
|
||||
@ -293,6 +305,16 @@ async def draw_pic(uid,nickname,image = None,mode = 2,role_level = None):
|
||||
|
||||
char_rawdata = await GetCharacter(uid,char_ids)
|
||||
char_datas = char_rawdata["data"]["avatars"]
|
||||
|
||||
elif mode == 3:
|
||||
char_ids = []
|
||||
char_rawdata = []
|
||||
|
||||
for i in char_data:
|
||||
char_ids.append(i["id"])
|
||||
|
||||
char_rawdata = await GetCharacter(uid,char_ids,"cn_gf01",mysid_data)
|
||||
char_datas = char_rawdata["data"]["avatars"]
|
||||
|
||||
char_hang = 1 + (char_num-1)//6
|
||||
char_lie = char_num%6
|
||||
@ -393,8 +415,8 @@ async def draw_pic(uid,nickname,image = None,mode = 2,role_level = None):
|
||||
char_draw = ImageDraw.Draw(char_img)
|
||||
char_draw.text((40,108),f'Lv.{str(char_data[num]["level"])}',(21,21,21),ys_font(18))
|
||||
char_draw.text((95.3,19),f'{str(char_data[num]["actived_constellation_num"])}','white',ys_font(18))
|
||||
if str(char_data[num]["fetter"]) == "10":
|
||||
char_draw.text((95.3,40.5),"F",(21,21,21),ys_font(17))
|
||||
if str(char_data[num]["fetter"]) == "10" or str(char_data[num]["name"]) == "旅行者":
|
||||
char_draw.text((93,41.5),"♥",(21,21,21),ys_font(15))
|
||||
else:
|
||||
char_draw.text((95.3,40.5),f'{str(char_data[num]["fetter"])}',(21,21,21),ys_font(18))
|
||||
|
||||
@ -440,6 +462,8 @@ async def draw_pic(uid,nickname,image = None,mode = 2,role_level = None):
|
||||
for k in i['constellations']:
|
||||
if k['is_actived'] == True:
|
||||
char_mingzuo += 1
|
||||
|
||||
char_name = i["name"]
|
||||
char_id = i["id"]
|
||||
char_level = i["level"]
|
||||
char_fetter = i['fetter']
|
||||
@ -513,7 +537,7 @@ async def draw_pic(uid,nickname,image = None,mode = 2,role_level = None):
|
||||
char_draw.text((38,106),f'Lv.{str(char_level)}',(21,21,21),ys_font(18))
|
||||
char_draw.text((104.5,91.5),f'{str(char_weapon_jinglian)}','white',ys_font(10))
|
||||
char_draw.text((99,19.5),f'{str(char_mingzuo)}','white',ys_font(18))
|
||||
if str(i["fetter"]) == "10":
|
||||
if str(i["fetter"]) == "10" or str(char_name) == "旅行者":
|
||||
char_draw.text((98,42),"♥",(21,21,21),ys_font(14))
|
||||
else:
|
||||
char_draw.text((100,41),f'{str(char_fetter)}',(21,21,21),ys_font(16))
|
||||
|
BIN
mys/bg/2.png
Normal file
After Width: | Height: | Size: 252 KiB |
BIN
mys/bg/4.png
Before Width: | Height: | Size: 297 KiB |
BIN
mys/bg/6.jpg
Before Width: | Height: | Size: 337 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 7.0 KiB |
Before Width: | Height: | Size: 378 KiB After Width: | Height: | Size: 184 KiB |
Before Width: | Height: | Size: 376 KiB After Width: | Height: | Size: 182 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 890 B |
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 9.0 KiB |
BIN
readme/1.PNG
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 400 KiB |
BIN
readme/10.png
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
readme/11.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
readme/12.png
Normal file
After Width: | Height: | Size: 131 KiB |
BIN
readme/13.png
Normal file
After Width: | Height: | Size: 126 KiB |
BIN
readme/14.png
Normal file
After Width: | Height: | Size: 132 KiB |