命名卡池名称

This commit is contained in:
xtaodada 2022-05-18 23:35:02 +08:00 committed by 洛水.山岭居室
parent edf6abea19
commit 2264816221
3 changed files with 19 additions and 9 deletions

13
.gitignore vendored
View File

@ -1,2 +1,13 @@
/config/config.json
**_test.html
**_test.html
.vscode/
.idea/
venv/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
*.pyo
*.pyc

View File

@ -30,13 +30,13 @@ class Gacha(BasePlugins):
user = update.effective_user
Log.info(f"用户 {user.full_name}[{user.id}] 抽卡模拟器命令请求")
args = message.text.split(" ")
if len(args) == 1:
gacha_info = await self.service.gacha.gacha_info()
else:
gacha_info = await self.service.gacha.gacha_info(args[1])
gacha_name = "角色活动"
if len(args) > 1:
gacha_name = args[1]
gacha_info = await self.service.gacha.gacha_info(gacha_name)
# 用户数据储存和处理
if gacha_info.get("gacha_id") is None:
await message.reply_text(f"没有找到 {args[1]} 卡池名称")
await message.reply_text(f"没有找到名为 {gacha_name} 的卡池")
return ConversationHandler.END
gacha_id: str = gacha_info["gacha_id"]
user_gacha: dict[str, WishCountInfo] = context.user_data.get("gacha")
@ -50,10 +50,9 @@ class Gacha(BasePlugins):
data = {
"_res_path": f"file://{self.resources_dir}",
"name": f"{user.full_name}",
"info": "卡池测试",
"info": gacha_name,
"poolName": gacha_info["title"],
"items": [],
}
for a in range(10):
item = get_one(user_gacha_count, gacha_info)

View File

@ -19,4 +19,4 @@ class GachaService:
return {}
gacha_info = await self.gacha.get_gacha_info(gacha_id)
gacha_info["gacha_id"] = gacha_id
return gacha_info
return gacha_info