补充2.7资源

This commit is contained in:
CMHopeSunshine 2022-06-06 17:09:51 +08:00
parent 5965db4ca6
commit 0f2eb864ce
14 changed files with 33 additions and 33 deletions

View File

@ -47,7 +47,9 @@ character_alias={
10000062:['埃洛伊'], 10000062:['埃洛伊'],
10000063:['申鹤','小姨','小姨妈'], 10000063:['申鹤','小姨','小姨妈'],
10000064:['云堇','云先生'], 10000064:['云堇','云先生'],
10000066:['神里绫人','0人','大舅子','小舅子','绫人','神里哥'] 10000066:['神里绫人','0人','大舅子','小舅子','绫人','神里哥'],
10000060:["夜兰", "夜阑", "叶兰"],
10000065: ["久岐忍", "忍者", "阿卡丽"]
} }
short_name={ short_name={
'胡桃': '胡桃', '胡桃': '胡桃',

View File

@ -1,6 +1,6 @@
import hoshino,os import hoshino, os
from PIL import Image from PIL import Image
from hoshino import R,MessageSegment,aiorequests,logger,Service from hoshino import R, MessageSegment, aiorequests, logger, Service
from hoshino.typing import CQEvent, Message from hoshino.typing import CQEvent, Message
from ..character_alias import get_id_by_alias from ..character_alias import get_id_by_alias
from .blue import get_blue_pic from .blue import get_blue_pic
@ -9,7 +9,7 @@ from hoshino.util import filt_message
import re import re
import time import time
help_msg=''' help_msg = '''
1.[xx角色攻略]查看西风驿站出品的角色一图流攻略 1.[xx角色攻略]查看西风驿站出品的角色一图流攻略
2.[xx角色材料]查看惜月出品的角色材料统计 2.[xx角色材料]查看惜月出品的角色材料统计
3.[xx参考面板]查看blue菌hehe出品的参考面板攻略 3.[xx参考面板]查看blue菌hehe出品的参考面板攻略
@ -19,47 +19,42 @@ help_msg='''
''' '''
sv = Service('派蒙WIKI', bundle='派蒙', help_=help_msg) sv = Service('派蒙WIKI', bundle='派蒙', help_=help_msg)
res_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'res') res_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'res')
@sv.on_prefix('角色攻略') @sv.on_prefix('角色攻略')
@sv.on_suffix('角色攻略') @sv.on_suffix('角色攻略')
async def genshinguide(bot,ev): async def genshinguide(bot, ev):
name = ev.message.extract_plain_text().strip() name = ev.message.extract_plain_text().strip()
realname = get_id_by_alias(name) realname = get_id_by_alias(name)
if not realname: if not realname:
await bot.send(ev,f'没有找到{filt_message(name)}的攻略',at_sender=True) await bot.send(ev, f'没有找到{filt_message(name)}的攻略', at_sender=True)
elif realname[1][0] in ['八重神子', '神里绫华', '神里绫人', '温迪', '七七', '雷电将军']:
path = os.path.join(res_path, 'role_guide',f'{realname[1][0]}.png')
cq_img = f'[CQ:image,file=file:///{path}]'
await bot.send(ev,cq_img,at_sender=True)
else: else:
img = f'[CQ:image,file=https://cherishmoon.oss-cn-shenzhen.aliyuncs.com/LittlePaimon/XFGuide/{realname[1][0]}.png]' img = f'[CQ:image,file=https://static.cherishmoon.fun/LittlePaimon/XFGuide/{realname[1][0]}.jpg]'
await bot.send(ev,img) await bot.send(ev, img)
@sv.on_prefix('角色材料') @sv.on_prefix('角色材料')
@sv.on_suffix('角色材料') @sv.on_suffix('角色材料')
async def genshinmaterial(bot,ev): async def genshinmaterial(bot, ev):
name = ev.message.extract_plain_text().strip() name = ev.message.extract_plain_text().strip()
realname = get_id_by_alias(name) realname = get_id_by_alias(name)
if name in ['夜兰', '久岐忍']: if not realname:
cq_img = f'[CQ:image,file=file:///{os.path.join(res_path, "role_material",f"{name}材料.png")}]' await bot.send(ev, f'没有找到{filt_message(name)}的材料', at_sender=True)
await bot.send(ev,cq_img,at_sender=True)
elif not realname:
await bot.send(ev,f'没有找到{filt_message(name)}的材料',at_sender=True)
else: else:
path = os.path.join(res_path, 'role_material',f'{realname[1][0]}材料.png') path = os.path.join(res_path, 'role_material', f'{realname[1][0]}材料.png')
cq_img = f'[CQ:image,file=file:///{path}]' cq_img = f'[CQ:image,file=file:///{path}]'
await bot.send(ev,cq_img,at_sender=True) await bot.send(ev, cq_img, at_sender=True)
@sv.on_prefix('参考面板') @sv.on_prefix('参考面板')
@sv.on_suffix('参考面板') @sv.on_suffix('参考面板')
async def genshinAttribute(bot,ev): async def genshinAttribute(bot, ev):
name = ev.message.extract_plain_text().strip() name = ev.message.extract_plain_text().strip()
if name not in ['风主', '岩主', '雷主']: if name not in ['风主', '岩主', '雷主']:
realname = get_id_by_alias(name) realname = get_id_by_alias(name)
if not realname: if not realname:
await bot.send(ev,f'没有找到{filt_message(name)}的参考面板',at_sender=True) await bot.send(ev, f'没有找到{filt_message(name)}的参考面板', at_sender=True)
return return
realname = realname[1][0] realname = realname[1][0]
else: else:
@ -69,17 +64,17 @@ async def genshinAttribute(bot,ev):
pic = pic.crop((0, pic_data[1][0], 1080, pic_data[1][1])) pic = pic.crop((0, pic_data[1][0], 1080, pic_data[1][1]))
pic = pil2b64(pic, 85) pic = pil2b64(pic, 85)
pic = MessageSegment.image(pic) pic = MessageSegment.image(pic)
await bot.send(ev,pic,at_sender=True) await bot.send(ev, pic, at_sender=True)
@sv.on_prefix('收益曲线') @sv.on_prefix('收益曲线')
@sv.on_suffix('收益曲线') @sv.on_suffix('收益曲线')
async def genshinAttribute2(bot,ev): async def genshinAttribute2(bot, ev):
name = ev.message.extract_plain_text().strip() name = ev.message.extract_plain_text().strip()
if name not in ['风主', '岩主', '雷主']: if name not in ['风主', '岩主', '雷主']:
realname = get_id_by_alias(name) realname = get_id_by_alias(name)
if not realname: if not realname:
await bot.send(ev,f'没有找到{filt_message(name)}的参考面板',at_sender=True) await bot.send(ev, f'没有找到{filt_message(name)}的参考面板', at_sender=True)
return return
realname = realname[1][0] realname = realname[1][0]
else: else:
@ -87,7 +82,8 @@ async def genshinAttribute2(bot,ev):
pic = Image.open(os.path.join(res_path, 'blue', f'{realname}.png')) pic = Image.open(os.path.join(res_path, 'blue', f'{realname}.png'))
pic = pil2b64(pic, 85) pic = pil2b64(pic, 85)
pic = MessageSegment.image(pic) pic = MessageSegment.image(pic)
await bot.send(ev,pic,at_sender=True) await bot.send(ev, pic, at_sender=True)
@sv.on_suffix(('材料', '天赋材料', '角色天赋材料', '突破材料', '武器突破材料')) @sv.on_suffix(('材料', '天赋材料', '角色天赋材料', '突破材料', '武器突破材料'))
async def daily_material(bot, ev): async def daily_material(bot, ev):
@ -113,11 +109,13 @@ async def daily_material(bot, ev):
else: else:
week = '0' week = '0'
if week == "0": if week == "0":
await bot.send(ev, '周日所有材料都可以刷哦!', at_sender = True) await bot.send(ev, '周日所有材料都可以刷哦!', at_sender=True)
elif week in ['1', '4']: elif week in ['1', '4']:
await bot.send(ev,f'[CQ:image,file=file:///{os.path.join(res_path, "daily_material","周一周四.jpg")}]',at_sender=True) await bot.send(ev, f'[CQ:image,file=file:///{os.path.join(res_path, "daily_material", "周一周四.jpg")}]',
at_sender=True)
elif week in ['2', '5']: elif week in ['2', '5']:
await bot.send(ev,f'[CQ:image,file=file:///{os.path.join(res_path, "daily_material","周二周五.jpg")}]',at_sender=True) await bot.send(ev, f'[CQ:image,file=file:///{os.path.join(res_path, "daily_material", "周二周五.jpg")}]',
at_sender=True)
else: else:
await bot.send(ev,f'[CQ:image,file=file:///{os.path.join(res_path, "daily_material","周三周六.jpg")}]',at_sender=True) await bot.send(ev, f'[CQ:image,file=file:///{os.path.join(res_path, "daily_material", "周三周六.jpg")}]',
at_sender=True)

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 481 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB