mirror of
https://github.com/KimigaiiWuyi/GenshinUID.git
synced 2025-05-07 20:45:49 +08:00
🎨 同时支持前缀触发参考攻略
和后缀触发攻略
、推荐
This commit is contained in:
parent
0423da75b2
commit
415898632f
@ -20,16 +20,18 @@ sv_char_guide = SV('查询角色攻略')
|
||||
sv_abyss_review = SV('查询深渊阵容')
|
||||
|
||||
|
||||
@sv_char_guide.on_prefix(('参考攻略'))
|
||||
@sv_char_guide.on_suffix(('攻略', '推荐'))
|
||||
async def send_guide_pic(bot: Bot, ev: Event):
|
||||
im = await get_gs_guide(ev.text)
|
||||
name = ev.text.strip()
|
||||
im = await get_gs_guide(name)
|
||||
|
||||
if im:
|
||||
await bot.logger.info('获得{}攻略成功!'.format(ev.text))
|
||||
a = Button(f'🎴参考面板{ev.text}', f'参考面板{ev.text}')
|
||||
await bot.logger.info('获得{}攻略成功!'.format(name))
|
||||
a = Button(f'🎴参考面板{name}', f'参考面板{name}')
|
||||
await bot.send_option(im, [a])
|
||||
else:
|
||||
await bot.logger.warning('未找到{}攻略图片'.format(ev.text))
|
||||
await bot.logger.warning('未找到{}攻略图片'.format(name))
|
||||
|
||||
|
||||
@sv_char_guide.on_prefix(('参考面板'))
|
||||
@ -37,7 +39,7 @@ async def send_bluekun_pic(bot: Bot, ev: Event):
|
||||
if ev.text in ['冰', '水', '火', '草', '雷', '风', '岩']:
|
||||
name = ev.text
|
||||
else:
|
||||
name = await alias_to_char_name(ev.text)
|
||||
name = await alias_to_char_name(ev.text.strip())
|
||||
img = REF_PATH / '{}.jpg'.format(name)
|
||||
if img.exists():
|
||||
img = await convert_img(img)
|
||||
|
@ -1,11 +1,14 @@
|
||||
from typing import Union
|
||||
from typing import List, Union
|
||||
|
||||
from gsuid_core.segment import MessageSegment
|
||||
from gsuid_core.utils.error_reply import get_error_img
|
||||
from gsuid_core.utils.image.convert import convert_img
|
||||
from gsuid_core.utils.image.image_tools import get_pic
|
||||
|
||||
from ..utils.mys_api import mys_api
|
||||
|
||||
|
||||
async def post_my_draw(uid: str) -> Union[str, bytes]:
|
||||
async def post_my_draw(uid: str) -> Union[List, str, bytes]:
|
||||
bs_index = await mys_api.get_bs_index(uid)
|
||||
|
||||
# 错误检查
|
||||
@ -29,7 +32,14 @@ async def post_my_draw(uid: str) -> Union[str, bytes]:
|
||||
)
|
||||
im_list.append(message)
|
||||
else:
|
||||
im_list.append(f'[留影叙佳期] UID{uid}成功获取{role["name"]}的画片!')
|
||||
image = await get_pic(role['take_picture'])
|
||||
image = await convert_img(image)
|
||||
im_list.append(
|
||||
MessageSegment.text(
|
||||
f'[留影叙佳期] UID{uid}成功获取{role["name"]}的画片!'
|
||||
)
|
||||
)
|
||||
im_list.append(MessageSegment.image(image))
|
||||
if im_list == []:
|
||||
im_list.append(f'[留影叙佳期]UID{uid}没有需要获取的画片了~')
|
||||
return '\n'.join(im_list)
|
||||
return im_list
|
||||
|
Loading…
x
Reference in New Issue
Block a user