mirror of
https://github.com/baiqwerdvd/StarRailUID.git
synced 2025-05-06 03:33:45 +08:00
🎨删除多余的print
This commit is contained in:
parent
bb5b1658ab
commit
d0180833ab
@ -26,7 +26,6 @@ sv_get_resin_admin = SV('sr强制推送', pm=1)
|
|||||||
async def send_daily_info(bot: Bot, ev: Event):
|
async def send_daily_info(bot: Bot, ev: Event):
|
||||||
await bot.logger.info('开始执行[sr每日信息文字版]')
|
await bot.logger.info('开始执行[sr每日信息文字版]')
|
||||||
uid = await get_uid(bot, ev)
|
uid = await get_uid(bot, ev)
|
||||||
print(uid)
|
|
||||||
if uid is None:
|
if uid is None:
|
||||||
return await bot.send(UID_HINT)
|
return await bot.send(UID_HINT)
|
||||||
await bot.logger.info('[sr每日信息文字版]UID: {}'.format(uid))
|
await bot.logger.info('[sr每日信息文字版]UID: {}'.format(uid))
|
||||||
|
@ -87,32 +87,32 @@ async def _draw_task_img(
|
|||||||
|
|
||||||
|
|
||||||
async def get_resin_img(bot_id: str, user_id: str):
|
async def get_resin_img(bot_id: str, user_id: str):
|
||||||
# try:
|
try:
|
||||||
sqla = get_sqla(bot_id)
|
sqla = get_sqla(bot_id)
|
||||||
uid_list: List = await sqla.get_bind_sruid_list(user_id)
|
uid_list: List = await sqla.get_bind_sruid_list(user_id)
|
||||||
logger.info('[每日信息]UID: {}'.format(uid_list))
|
logger.info('[每日信息]UID: {}'.format(uid_list))
|
||||||
# 进行校验UID是否绑定CK
|
# 进行校验UID是否绑定CK
|
||||||
useable_uid_list = []
|
useable_uid_list = []
|
||||||
for uid in uid_list:
|
for uid in uid_list:
|
||||||
status = await sqla.get_user_cookie(uid)
|
status = await sqla.get_user_cookie(uid)
|
||||||
if status is not None:
|
if status is not None:
|
||||||
useable_uid_list.append(uid)
|
useable_uid_list.append(uid)
|
||||||
logger.info('[每日信息]可用UID: {}'.format(useable_uid_list))
|
logger.info('[每日信息]可用UID: {}'.format(useable_uid_list))
|
||||||
if len(useable_uid_list) == 0:
|
if len(useable_uid_list) == 0:
|
||||||
return '请先绑定一个可用CK & UID再来查询哦~'
|
return '请先绑定一个可用CK & UID再来查询哦~'
|
||||||
# 开始绘图任务
|
# 开始绘图任务
|
||||||
task = []
|
task = []
|
||||||
img = Image.new(
|
img = Image.new(
|
||||||
'RGBA', (based_w * len(useable_uid_list), based_h), (0, 0, 0, 0)
|
'RGBA', (based_w * len(useable_uid_list), based_h), (0, 0, 0, 0)
|
||||||
)
|
)
|
||||||
for uid_index, uid in enumerate(useable_uid_list):
|
for uid_index, uid in enumerate(useable_uid_list):
|
||||||
task.append(_draw_all_resin_img(img, uid, uid_index))
|
task.append(_draw_all_resin_img(img, uid, uid_index))
|
||||||
await asyncio.gather(*task)
|
await asyncio.gather(*task)
|
||||||
res = await convert_img(img)
|
res = await convert_img(img)
|
||||||
logger.info('[查询每日信息]绘图已完成,等待发送!')
|
logger.info('[查询每日信息]绘图已完成,等待发送!')
|
||||||
# except TypeError:
|
except TypeError:
|
||||||
# logger.exception('[查询每日信息]绘图失败!')
|
logger.exception('[查询每日信息]绘图失败!')
|
||||||
# res = '你绑定过的UID中可能存在过期CK~请重新绑定一下噢~'
|
res = '你绑定过的UID中可能存在过期CK~请重新绑定一下噢~'
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
@ -177,7 +177,6 @@ async def draw_resin_img(sr_uid: str) -> Image.Image:
|
|||||||
# 派遣
|
# 派遣
|
||||||
task_task = []
|
task_task = []
|
||||||
for index, char in enumerate(daily_data['expeditions']):
|
for index, char in enumerate(daily_data['expeditions']):
|
||||||
print(f'index: {index}, char: {char}')
|
|
||||||
task_task.append(_draw_task_img(img, img_draw, index, char))
|
task_task.append(_draw_task_img(img, img_draw, index, char))
|
||||||
await asyncio.gather(*task_task)
|
await asyncio.gather(*task_task)
|
||||||
|
|
||||||
|
@ -109,7 +109,6 @@ class _MysApi(BaseMysApi):
|
|||||||
|
|
||||||
async def get_daily_data(self, uid: str) -> Union[DailyNoteData, int]:
|
async def get_daily_data(self, uid: str) -> Union[DailyNoteData, int]:
|
||||||
data = await self.simple_mys_req('STAR_RAIL_NOTE_URL', uid)
|
data = await self.simple_mys_req('STAR_RAIL_NOTE_URL', uid)
|
||||||
print(data)
|
|
||||||
if isinstance(data, Dict):
|
if isinstance(data, Dict):
|
||||||
data = cast(DailyNoteData, data['data'])
|
data = cast(DailyNoteData, data['data'])
|
||||||
return data
|
return data
|
||||||
@ -235,7 +234,6 @@ class _MysApi(BaseMysApi):
|
|||||||
data = await self.simple_mys_req(
|
data = await self.simple_mys_req(
|
||||||
'STAR_RAIL_ROLE_BASIC_INFO_URL', sr_uid
|
'STAR_RAIL_ROLE_BASIC_INFO_URL', sr_uid
|
||||||
)
|
)
|
||||||
print(data)
|
|
||||||
if isinstance(data, Dict):
|
if isinstance(data, Dict):
|
||||||
data = cast(DailyNoteData, data['data'])
|
data = cast(DailyNoteData, data['data'])
|
||||||
return data
|
return data
|
||||||
@ -253,7 +251,6 @@ class _MysApi(BaseMysApi):
|
|||||||
use_proxy = True
|
use_proxy = True
|
||||||
else:
|
else:
|
||||||
_URL = _API[url]
|
_URL = _API[url]
|
||||||
print(_URL)
|
|
||||||
HEADER = copy.deepcopy(self._HEADER)
|
HEADER = copy.deepcopy(self._HEADER)
|
||||||
use_proxy = False
|
use_proxy = False
|
||||||
if header:
|
if header:
|
||||||
@ -288,7 +285,6 @@ class _MysApi(BaseMysApi):
|
|||||||
server_id = RECOGNIZE_SERVER.get(uid[0])
|
server_id = RECOGNIZE_SERVER.get(uid[0])
|
||||||
is_os = False if int(uid[0]) < 6 else True
|
is_os = False if int(uid[0]) < 6 else True
|
||||||
ex_params = '&'.join([f'{k}={v}' for k, v in params.items()])
|
ex_params = '&'.join([f'{k}={v}' for k, v in params.items()])
|
||||||
print(server_id, is_os, ex_params)
|
|
||||||
if is_os:
|
if is_os:
|
||||||
_URL = _API[f'{URL}_OS']
|
_URL = _API[f'{URL}_OS']
|
||||||
HEADER = copy.deepcopy(self._HEADER_OS)
|
HEADER = copy.deepcopy(self._HEADER_OS)
|
||||||
@ -300,7 +296,6 @@ class _MysApi(BaseMysApi):
|
|||||||
ex_params if ex_params else f'role_id={uid}&server={server_id}'
|
ex_params if ex_params else f'role_id={uid}&server={server_id}'
|
||||||
)
|
)
|
||||||
HEADER.update(header)
|
HEADER.update(header)
|
||||||
print(_URL)
|
|
||||||
if cookie is not None:
|
if cookie is not None:
|
||||||
HEADER['Cookie'] = cookie
|
HEADER['Cookie'] = cookie
|
||||||
elif 'Cookie' not in HEADER and isinstance(uid, str):
|
elif 'Cookie' not in HEADER and isinstance(uid, str):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user