3
0

v0.2.1 添加资源文件

This commit is contained in:
xtaodada 2022-01-26 14:37:52 +08:00
parent b314a6e69b
commit 6f78fa4a68
No known key found for this signature in database
GPG Key ID: EE4DC37B55E24736
15 changed files with 34 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 806 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 KiB

After

Width:  |  Height:  |  Size: 838 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 788 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

After

Width:  |  Height:  |  Size: 806 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

After

Width:  |  Height:  |  Size: 838 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

After

Width:  |  Height:  |  Size: 788 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 KiB

After

Width:  |  Height:  |  Size: 630 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 KiB

After

Width:  |  Height:  |  Size: 671 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 253 KiB

After

Width:  |  Height:  |  Size: 628 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 630 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 KiB

After

Width:  |  Height:  |  Size: 671 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 KiB

After

Width:  |  Height:  |  Size: 628 KiB

View File

@ -74,6 +74,9 @@ async def download_icon(url):
async def download_json(url):
# 获取资源数据,返回 JSON
if url == POINT_LIST_URL:
with open(f"assets{os.sep}data{os.sep}list.json", "rb") as f:
return json.loads(f.read())
async with httpx.AsyncClient() as client:
resp = await client.get(url=url)
if resp.status_code != 200:

View File

@ -1,4 +1,5 @@
import requests
from secrets import choice
from pyrogram import Client
from pyrogram.types import Message
from defs.artifact_rate import *
@ -13,6 +14,27 @@ def get_format_sub_item(artifact_attr):
return msg
def get_yiyan(get_yiyan_num):
data = {"1": ["破玩意谁能用啊,谁都用不了吧", "喂了吧,这东西做狗粮还能有点用", "抽卡有保底,圣遗物没有下限",
"未来可期呢(笑)", "你出门一定很安全", "你是不是得罪米哈游了?", "……宁就是班尼特本特?",
"丢人!你给我退出提瓦特(", "不能说很糟糕,只能说特别不好"],
"2": ["淡如清泉镇的圣水,莫得提升", "你怎么不强化啊?", "嗯嗯嗯好好好可以可以可以挺好挺好(敷衍)",
"这就是日常,下一个", "洗洗还能吃bushi", "下次一定行……?", "派蒙平静地点了个赞",
"不知道该说什么,就当留个纪念吧"],
"3": ["不能说有质变,只能说有提升", "过渡用的话没啥问题,大概", "再努努力吧", "嗯,差不多能用",
"这很合理", "达成成就“合格圣遗物”", "嗯,及格了,过渡用挺好的", "中规中矩,有待提升"],
"4": ["以普遍理性而论,很好", "算是个很不戳的圣遗物了!", "很好,很有精神!", "再努努力,超越一下自己",
"感觉可以戴着它大杀四方了", "这就是大佬背包里的平均水平吧", "先锁上呗,这波不亏", "达成成就“高分圣遗物”",
"这波对输出有很大提升啊(认真)", "我也想拥有这种分数的圣遗物(切实)"],
"5": ["多吃点好的,出门注意安全", "晒吧,欧不可耻,只是可恨", "没啥好说的,让我自闭一会", "达成成就“高分圣遗物”",
"怕不是以后开宝箱只能开出卷心菜", "吃了吗?没吃的话,吃我一拳", "我觉得这个游戏有问题", "这合理吗",
"这东西没啥用,给我吧(柠檬)", " "]}
data_ = int(float(get_yiyan_num))
if data_ == 100:
return choice(data["5"])
return choice(data[str(data_ // 20 + 1)])
async def artifact_rate_msg(client: Client, message: Message):
if not message.photo:
return await message.reply("图呢?\n*请命令将与截图一起发送", quote=True)
@ -35,10 +57,12 @@ async def artifact_rate_msg(client: Client, message: Message):
return await msg.edit(f"发生了点小错误:\n{err_msg}")
format_result = f'圣遗物评分结果:\n' \
f'主属性:{artifact_attr["main_item"]["name"]}\n' \
f'{get_format_sub_item(artifact_attr)}'\
f'{get_format_sub_item(artifact_attr)}' \
f'`------------------------------`\n' \
f'总分:{rate_result["total_percent"]}\n'\
f'总分:{rate_result["total_percent"]}\n' \
f'主词条:{rate_result["main_percent"]}\n' \
f'副词条:{rate_result["sub_percent"]}\n' \
f'`------------------------------`\n' \
f'{get_yiyan(rate_result["total_percent"])}\n' \
f'评分、识图均来自 genshin.pub'
await msg.edit(format_result)

View File

@ -1,4 +1,5 @@
from pyrogram import Client
from pyrogram.errors import PhotoInvalidDimensions
from pyrogram.types import Message
from os import sep
from defs.query_resource_points import get_resource_map_mes, get_resource_list_mes, init_point_list_and_map
@ -17,7 +18,10 @@ async def inquire_resource_points(client: Client, message: Message):
text = await get_resource_map_mes(resource_name)
if text.find("没有") != -1:
return await message.reply(text, quote=True)
await message.reply_photo(f"temp{sep}map.jpg", caption=text, quote=True)
try:
await message.reply_photo(f"temp{sep}map.jpg", caption=text, quote=True)
except PhotoInvalidDimensions:
await message.reply_document(f"temp{sep}map.jpg", caption=text, quote=True)
async def inquire_resource_list(client: Client, message: Message):