From 94d9b8ce4cdbd3c156aad0e2ec2c108d75c89c83 Mon Sep 17 00:00:00 2001 From: forchannot Date: Wed, 17 Jul 2024 18:51:59 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=205.0metadata?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LittlePaimon/config/data/alias.json | 18 +- LittlePaimon/config/data/artifact.json | 235 ++++----------- LittlePaimon/config/data/genshin_info.json | 116 ++++++++ LittlePaimon/config/data/role_skill.json | 88 +++++- LittlePaimon/config/data/role_talent.json | 40 ++- LittlePaimon/config/data/roles_data.json | 15 + LittlePaimon/config/data/score.json | 5 +- LittlePaimon/config/data/weapon.json | 24 ++ LittlePaimon/config/data/类型.json | 36 ++- .../plugins/Paimon_Bind/get_cookie.py | 274 +++++++++++------- 10 files changed, 542 insertions(+), 309 deletions(-) diff --git a/LittlePaimon/config/data/alias.json b/LittlePaimon/config/data/alias.json index 0b6909b..f75b3d4 100644 --- a/LittlePaimon/config/data/alias.json +++ b/LittlePaimon/config/data/alias.json @@ -164,7 +164,10 @@ "10000096": ["阿蕾奇诺", "仆人", "父亲"], "10000097": ["赛索斯"], "10000098": ["克洛琳德", "枫丹决斗人", "决斗人"], - "10000099": ["艾梅莉埃", "调香师", "艾梅"] + "10000099": ["艾梅莉埃", "调香师", "艾梅"], + "10000100": ["卡齐娜"], + "10000101": ["基尼奇", "像素龙"], + "10000102": ["玛拉妮", "纳塔鲨", "娜塔莎"] }, "武器": { "柔灯挽歌": ["柔灯挽歌", "柔灯", "艾梅莉埃专武", "艾梅专武"], @@ -373,7 +376,14 @@ "赤月之形": ["赤月之形", "赤月", "仆人专武", "阿蕾奇诺专武"], "白雨心弦": ["白雨心弦", "白雨", "心弦", "希格雯专武"], "筑云": ["筑云"], - "赦罪": ["赦罪", "克洛琳德专武"] + "赦罪": ["赦罪", "克洛琳德专武"], + "撼地者": ["撼地者"], + "山王长牙": ["山王长牙", "基尼奇专武"], + "虹的行迹": ["虹的行迹"], + "苍纹角杯": ["苍纹角杯", "苍纹", "角杯"], + "木棉之环": ["木棉之环", "木棉"], + "冲浪时光": ["冲浪时光", "冲浪", "玛拉妮专武"], + "碎链": ["碎链"] }, "圣遗物": { "游医": ["游医"], @@ -426,7 +436,9 @@ "昔时之歌": ["昔时之歌", "昔时"], "回声之林夜话": ["回声之林夜话", "回声"], "未竟的遐思": ["未竟的遐思", "未竟"], - "谐律异想断章": ["谐律异想断章", "谐律"] + "谐律异想断章": ["谐律异想断章", "谐律"], + "黑曜秘典": ["黑曜秘典", "黑曜"], + "烬城勇者绘卷": ["烬城勇者绘卷", "烬城", "绘卷"] }, "原魔": { "草史莱姆": ["草史莱姆"], diff --git a/LittlePaimon/config/data/artifact.json b/LittlePaimon/config/data/artifact.json index ce4f6f4..9792fd0 100644 --- a/LittlePaimon/config/data/artifact.json +++ b/LittlePaimon/config/data/artifact.json @@ -498,15 +498,21 @@ "褪光的翠尾": "未竟的遐思", "失冕的宝冠": "未竟的遐思", "暗结的明花": "未竟的遐思", - "举业的识刻": "未竟的遐思" + "举业的识刻": "未竟的遐思", + "游学者的爪杯": "烬城勇者绘卷", + "巡山客的信标": "烬城勇者绘卷", + "魔战士的羽面": "烬城勇者绘卷", + "驯兽师的护符": "烬城勇者绘卷", + "秘术家的金盘": "烬城勇者绘卷", + "纷争的前宴": "黑曜秘典", + "灵髓的根脉": "黑曜秘典", + "诸圣的礼冠": "黑曜秘典", + "异种的期许": "黑曜秘典", + "夜域的迷思": "黑曜秘典" }, "Info": { "冒险家": { - "avail_rarity": [ - "1", - "2", - "3" - ], + "avail_rarity": ["1", "2", "3"], "pcs_attr": { "2": "生命值上限提高1000点。", "4": "开启各类宝箱后的5秒内,持续恢复30%生命值。" @@ -514,10 +520,7 @@ "alias": "冒险" }, "悠古的磐岩": { - "avail_rarity": [ - "4", - "5" - ], + "avail_rarity": ["4", "5"], "pcs_attr": { "2": "获得15%岩元素伤害加成。", "4": "获得结晶反应形成的晶片时,队伍中所有角色获得35%对应元素伤害加成,持续10秒。同时只能通过该效果获得一种元素伤害加成。" @@ -525,10 +528,7 @@ "alias": "磐岩" }, "战狂": { - "avail_rarity": [ - "3", - "4" - ], + "avail_rarity": ["3", "4"], "pcs_attr": { "2": "暴击率提高12%。", "4": "生命值低于70%时,暴击率额外提升24%。" @@ -536,10 +536,7 @@ "alias": "战狂" }, "冰风迷途的勇士": { - "avail_rarity": [ - "4", - "5" - ], + "avail_rarity": ["4", "5"], "pcs_attr": { "2": "获得15%冰元素伤害加成。", "4": "攻击处于冰元素影响下的敌人时,暴击率提高20%;若敌人处于冻结状态下,则暴击率额外提高20%。" @@ -547,10 +544,7 @@ "alias": "冰套" }, "染血的骑士道": { - "avail_rarity": [ - "4", - "5" - ], + "avail_rarity": ["4", "5"], "pcs_attr": { "2": "造成的物理伤害提高25%。", "4": "击败敌人后的10秒内,施放重击时不消耗体力,且重击造成的伤害提升50%。" @@ -558,10 +552,7 @@ "alias": "染血" }, "勇士之心": { - "avail_rarity": [ - "3", - "4" - ], + "avail_rarity": ["3", "4"], "pcs_attr": { "2": "攻击力提高18%。", "4": "对生命值高于50%的敌人,造成的伤害增加30%。" @@ -569,10 +560,7 @@ "alias": "勇士" }, "炽烈的炎之魔女": { - "avail_rarity": [ - "4", - "5" - ], + "avail_rarity": ["4", "5"], "pcs_attr": { "2": "获得15%火元素伤害加成。", "4": "超载、燃烧反应造成的伤害提升40%,蒸发、融化反应的加成系数提高15%。施放元素战技后的10秒内,2件套的效果提高50%,该效果最多叠加3次。" @@ -580,10 +568,7 @@ "alias": "魔女" }, "守护之心": { - "avail_rarity": [ - "3", - "4" - ], + "avail_rarity": ["3", "4"], "pcs_attr": { "2": "防御力提高30%。", "4": "队伍里每有不同一种元素类型的自己的角色,自身获得30%相应的元素抗性。" @@ -591,10 +576,7 @@ "alias": "守护" }, "来歆余响": { - "avail_rarity": [ - "4", - "5" - ], + "avail_rarity": ["4", "5"], "pcs_attr": { "2": "攻击力提高18%。", "4": "普通攻击命中敌人时,有36%概率触发「幽谷祝祀」:普通攻击造成的伤害提高,伤害提高值为攻击力的70%,该效果将在普通攻击造成伤害后的0.05秒后清除。普通攻击未触发「幽谷祝祀」时,会使下次触发概率提升20%;0.2秒内至多判定1次触发与否。" @@ -602,10 +584,7 @@ "alias": "余响" }, "绝缘之旗印": { - "avail_rarity": [ - "4", - "5" - ], + "avail_rarity": ["4", "5"], "pcs_attr": { "2": "元素充能效率提高20%。", "4": "基于元素充能效率的25%,提高元素爆发造成的伤害。至多通过这种方式获得75%提升。" @@ -613,10 +592,7 @@ "alias": "绝缘" }, "赌徒": { - "avail_rarity": [ - "3", - "4" - ], + "avail_rarity": ["3", "4"], "pcs_attr": { "2": "元素战技造成的伤害提升20%。", "4": "击败敌人时,有100%概率清除元素战技的冷却时间。该效果每15秒至多触发一次。" @@ -632,10 +608,7 @@ "alias": "冰砂" }, "角斗士的终幕礼": { - "avail_rarity": [ - "4", - "5" - ], + "avail_rarity": ["4", "5"], "pcs_attr": { "2": "攻击力提高18%。", "4": "装备该圣遗物套装的角色为单手剑、双手剑、长柄武器角色时,角色普通攻击造成的伤害提高35%。" @@ -643,10 +616,7 @@ "alias": "角斗" }, "沉沦之心": { - "avail_rarity": [ - "4", - "5" - ], + "avail_rarity": ["4", "5"], "pcs_attr": { "2": "获得15%水元素伤害加成。", "4": "施放元素战技后的15秒内,普通攻击与重击造成的伤害提高30%。" @@ -654,10 +624,7 @@ "alias": "水套" }, "华馆梦醒形骸记": { - "avail_rarity": [ - "4", - "5" - ], + "avail_rarity": ["4", "5"], "pcs_attr": { "2": "防御力提高30%。", "4": "装备此圣遗物套装的角色在以下情况下,将获得「问答」效果:在场上用岩元素攻击命中敌人后获得一层,每0.3秒至多触发一次;在队伍后台中,每3秒获得一层。问答至多叠加4层,每层能提供6%防御力与6%岩元素伤害加成。每6秒,若未获得问答效果,将损失一层。" @@ -665,10 +632,7 @@ "alias": "华馆" }, "教官": { - "avail_rarity": [ - "3", - "4" - ], + "avail_rarity": ["3", "4"], "pcs_attr": { "2": "元素精通提高80点。", "4": "触发元素反应后,队伍中所有角色的元素精通提高120点,持续8秒。" @@ -676,10 +640,7 @@ "alias": "教官" }, "渡过烈火的贤人": { - "avail_rarity": [ - "4", - "5" - ], + "avail_rarity": ["4", "5"], "pcs_attr": { "2": "火元素抗性提高40%。", "4": "对处于火元素影响下的敌人造成的伤害提升35%。" @@ -687,11 +648,7 @@ "alias": "渡火" }, "幸运儿": { - "avail_rarity": [ - "1", - "2", - "3" - ], + "avail_rarity": ["1", "2", "3"], "pcs_attr": { "2": "防御力提高100点。", "4": "拾取摩拉时,恢复300点生命值。" @@ -699,10 +656,7 @@ "alias": "幸运" }, "被怜爱的少女": { - "avail_rarity": [ - "4", - "5" - ], + "avail_rarity": ["4", "5"], "pcs_attr": { "2": "角色造成的治疗效果提升15%。", "4": "施放元素战技或元素爆发后的10秒内,队伍中所有角色受治疗效果加成提高20%。" @@ -710,10 +664,7 @@ "alias": "少女" }, "武人": { - "avail_rarity": [ - "3", - "4" - ], + "avail_rarity": ["3", "4"], "pcs_attr": { "2": "普通攻击与重击造成的伤害提高15%;", "4": "施放元素战技后的8秒内,普通攻击和重击造成的伤害提升25%。" @@ -721,10 +672,7 @@ "alias": "武人" }, "昔日宗室之仪": { - "avail_rarity": [ - "4", - "5" - ], + "avail_rarity": ["4", "5"], "pcs_attr": { "2": "元素爆发造成的伤害提升20%。", "4": "施放元素爆发后,队伍中所有角色攻击力提升20%,持续12秒。该效果不可叠加。" @@ -732,10 +680,7 @@ "alias": "宗室" }, "海染砗磲": { - "avail_rarity": [ - "4", - "5" - ], + "avail_rarity": ["4", "5"], "pcs_attr": { "2": "治疗加成提高15%。", "4": "装备此圣遗物套装的角色对队伍中的角色进行治疗时,将产生持续3秒的海染泡沫,记录治疗的生命值回复量(包括溢出值)。持续时间结束时,海染泡沫将会爆炸,对周围的敌人造成90%累计回复量的伤害(该伤害结算方式同感电、超导等元素反应,但不受元素精通、等级或反应伤害加成效果影响)。每3.5秒至多产生一个海染泡沫;海染泡沫至多记录30000点回复量,含溢出部分的治疗量;自己的队伍中同时至多存在一个海染泡沫。装备此圣遗物套装的角色处于队伍后台时,依然能触发该效果。" @@ -743,10 +688,7 @@ "alias": "海染" }, "苍白之火": { - "avail_rarity": [ - "4", - "5" - ], + "avail_rarity": ["4", "5"], "pcs_attr": { "2": "造成的物理伤害提高25%。", "4": "元素战技命中敌人后,攻击力提升9%。该效果持续7秒,至多叠加2层,每0.3秒至多触发一次。叠满2层时,2件套的效果提升100%。" @@ -754,40 +696,28 @@ "alias": "苍白" }, "祭水之人": { - "avail_rarity": [ - "3", - "4" - ], + "avail_rarity": ["3", "4"], "pcs_attr": { "1": "受到的水元素附着效果的持续时间减少40%。" }, "alias": "祭水" }, "祭火之人": { - "avail_rarity": [ - "3", - "4" - ], + "avail_rarity": ["3", "4"], "pcs_attr": { "1": "受到的火元素附着效果的持续时间减少40%。" }, "alias": "祭火" }, "祭雷之人": { - "avail_rarity": [ - "3", - "4" - ], + "avail_rarity": ["3", "4"], "pcs_attr": { "1": "受到的雷元素附着效果的持续时间减少40%。" }, "alias": "祭雷" }, "祭冰之人": { - "avail_rarity": [ - "3", - "4" - ], + "avail_rarity": ["3", "4"], "pcs_attr": { "1": "受到的冰元素附着效果的持续时间减少40%。" }, @@ -801,10 +731,7 @@ "alias": "祭风" }, "行者之心": { - "avail_rarity": [ - "3", - "4" - ], + "avail_rarity": ["3", "4"], "pcs_attr": { "2": "攻击力提高18%。", "4": "重击的暴击率提升30%。" @@ -812,10 +739,7 @@ "alias": "行者" }, "逆飞的流星": { - "avail_rarity": [ - "4", - "5" - ], + "avail_rarity": ["4", "5"], "pcs_attr": { "2": "护盾强效提高35%。", "4": "处于护盾庇护下时,额外获得40%普通攻击和重击伤害加成。" @@ -823,10 +747,7 @@ "alias": "逆飞" }, "学士": { - "avail_rarity": [ - "3", - "4" - ], + "avail_rarity": ["3", "4"], "pcs_attr": { "2": "元素充能效率提高20%。", "4": "获得元素微粒或元素晶球时,队伍中所有弓箭和法器角色额外恢复3点元素能量。该效果每3秒只能触发一次。" @@ -834,10 +755,7 @@ "alias": "学士" }, "追忆之注连": { - "avail_rarity": [ - "4", - "5" - ], + "avail_rarity": ["4", "5"], "pcs_attr": { "2": "攻击力提高18%。", "4": "施放元素战技时,如果角色的元素能量高于或等于15点,则会流失15点元素能量,使接下来的10秒内,普通攻击、重击、下落攻击造成的伤害提高50%,持续期间内该效果不会再次触发。" @@ -845,10 +763,7 @@ "alias": "追忆" }, "千岩牢固": { - "avail_rarity": [ - "4", - "5" - ], + "avail_rarity": ["4", "5"], "pcs_attr": { "2": "生命值提升20%", "4": "元素战技命中敌人后,使队伍中附近的所有角色攻击力提升20%,护盾强效提升30%,持续3秒。该效果每0.5秒至多触发一次。装备此圣遗物套装的角色处于队伍后台时,依然能触发该效果。" @@ -856,10 +771,7 @@ "alias": "千岩" }, "流放者": { - "avail_rarity": [ - "3", - "4" - ], + "avail_rarity": ["3", "4"], "pcs_attr": { "2": "元素充能效率提高20%。", "4": "施放元素爆发后,每2秒为队伍中所有角色(不包括自己)恢复2点元素能量。该效果持续6秒,无法叠加。" @@ -867,10 +779,7 @@ "alias": "流放" }, "如雷的盛怒": { - "avail_rarity": [ - "4", - "5" - ], + "avail_rarity": ["4", "5"], "pcs_attr": { "2": "获得15%雷元素伤害加成。", "4": "超载、感电、超导反应造成的伤害提升40%。触发这些元素反应时,元素战技冷却时间减少1秒。该效果每0.8秒最多触发一次。" @@ -878,10 +787,7 @@ "alias": "如雷" }, "平息鸣雷的尊者": { - "avail_rarity": [ - "4", - "5" - ], + "avail_rarity": ["4", "5"], "pcs_attr": { "2": "雷元素抗性提高40%。", "4": "对处于雷元素影响下的敌人造成的伤害提升35%。" @@ -889,10 +795,7 @@ "alias": "平雷" }, "奇迹": { - "avail_rarity": [ - "3", - "4" - ], + "avail_rarity": ["3", "4"], "pcs_attr": { "2": "所有元素抗性提高20%。", "4": "受到某个元素类型的伤害后,相应的抗性提升30%,持续10秒。该效果每10秒只能触发一次。" @@ -900,11 +803,7 @@ "alias": "奇迹" }, "游医": { - "avail_rarity": [ - "1", - "2", - "3" - ], + "avail_rarity": ["1", "2", "3"], "pcs_attr": { "2": "角色受到的治疗效果提高20%。", "4": "施放元素爆发时,恢复20%生命值。" @@ -912,10 +811,7 @@ "alias": "游医" }, "辰砂往生录": { - "avail_rarity": [ - "4", - "5" - ], + "avail_rarity": ["4", "5"], "pcs_attr": { "2": "攻击力提高18%。", "4": "施放元素爆发后,将产生持续16秒的「潜光」效果:攻击力提升8%;并在角色的生命值降低时,攻击力进一步提升10%,至多通过这种方式提升4次,每0.8秒至多触发一次。「潜光」效果将在角色退场时消失;持续期间再次施放元素爆发,将移除原有的「潜光」。" @@ -923,10 +819,7 @@ "alias": "辰砂" }, "翠绿之影": { - "avail_rarity": [ - "4", - "5" - ], + "avail_rarity": ["4", "5"], "pcs_attr": { "2": "获得15%风元素伤害加成。", "4": "扩散反应造成的伤害提升60%。根据扩散的元素类型,降低受到影响的敌人40%的对应元素抗性,持续10秒。" @@ -934,10 +827,7 @@ "alias": "风套" }, "流浪大地的乐团": { - "avail_rarity": [ - "4", - "5" - ], + "avail_rarity": ["4", "5"], "pcs_attr": { "2": "元素精通提高80点。", "4": "装备该圣遗物套装的角色为法器、弓箭角色时,角色重击造成的伤害提高35%。" @@ -946,25 +836,10 @@ } }, "Piece": { - "1": [ - "goblet", - "空之杯" - ], - "2": [ - "plume", - "死之羽" - ], - "3": [ - "circlet", - "理之冠" - ], - "4": [ - "flower", - "生之花" - ], - "5": [ - "sands", - "时之沙" - ] + "1": ["goblet", "空之杯"], + "2": ["plume", "死之羽"], + "3": ["circlet", "理之冠"], + "4": ["flower", "生之花"], + "5": ["sands", "时之沙"] } } diff --git a/LittlePaimon/config/data/genshin_info.json b/LittlePaimon/config/data/genshin_info.json index a586129..9cdaad2 100644 --- a/LittlePaimon/config/data/genshin_info.json +++ b/LittlePaimon/config/data/genshin_info.json @@ -2585,6 +2585,122 @@ "SideIconName": "UI_AvatarIcon_Side_Emilie", "QualityType": "QUALITY_ORANGE" }, + "10000100": { + "Element": "Rock", + "Consts": [ + "UI_Talent_S_Kachina_01", + "UI_Talent_S_Kachina_02", + "UI_Talent_U_Kachina_01", + "UI_Talent_S_Kachina_03", + "UI_Talent_U_Kachina_02", + "UI_Talent_S_Kachina_04" + ], + "SkillOrder": [ + 11001, + 11002, + 11005 + ], + "Skills": { + "11001": "Skill_A_03", + "11002": "Skill_S_Kachina_01", + "11005": "Skill_E_Kachina_01" + }, + "ProudMap": { + "11001": 10031, + "11002": 10032, + "11005": 10039 + }, + "NameTextMapHash": 2531816890, + "SideIconName": "UI_AvatarIcon_Side_Kachina", + "QualityType": "QUALITY_PURPLE" + }, + "10000101": { + "Element": "Grass", + "Consts": [ + "UI_Talent_S_Kinich_01", + "UI_Talent_S_Kinich_02", + "UI_Talent_U_Kinich_01", + "UI_Talent_S_Kinich_03", + "UI_Talent_U_Kinich_02", + "UI_Talent_S_Kinich_04" + ], + "SkillOrder": [ + 11011, + 11012, + 11015 + ], + "Skills": { + "11011": "Skill_A_04", + "11012": "Skill_S_Kinich_01", + "11015": "Skill_E_Kinich_01" + }, + "ProudMap": { + "11011": 10131, + "11012": 10132, + "11015": 10139 + }, + "NameTextMapHash": 4172712634, + "SideIconName": "UI_AvatarIcon_Side_Kinich", + "QualityType": "QUALITY_ORANGE" + }, + "10000102": { + "Element": "Water", + "Consts": [ + "UI_Talent_S_Mualani_01", + "UI_Talent_S_Mualani_02", + "UI_Talent_U_Mualani_01", + "UI_Talent_S_Mualani_03", + "UI_Talent_U_Mualani_02", + "UI_Talent_S_Mualani_04" + ], + "SkillOrder": [ + 30000, + 30002, + 30007 + ], + "Skills": { + "30000": "Skill_A_Catalyst_MD", + "30002": "Skill_S_Mualani_01", + "30007": "Skill_E_Mualani_01" + }, + "ProudMap": { + "30000": 10231, + "30002": 10232, + "30007": 10239 + }, + "NameTextMapHash": 3949670506, + "SideIconName": "UI_AvatarIcon_Side_Mualani", + "QualityType": "QUALITY_ORANGE" + }, + "11000046": { + "Element": "Ice", + "Consts": [ + "UI_Talent_S_Kaeya_01", + "UI_Talent_S_Kaeya_02", + "UI_Talent_U_Kaeya_01", + "UI_Talent_S_Kaeya_03", + "UI_Talent_U_Kaeya_02", + "UI_Talent_S_Kaeya_04" + ], + "SkillOrder": [ + 10073, + 10074, + 10075 + ], + "Skills": { + "10073": "Skill_A_01", + "10074": "Skill_S_Kaeya_01", + "10075": "Skill_E_Kaeya_01" + }, + "ProudMap": { + "10073": 1531, + "10074": 1532, + "10075": 1539 + }, + "NameTextMapHash": 3986000746, + "SideIconName": "UI_AvatarIcon_Side_Qin", + "QualityType": "QUALITY_PURPLE" + }, "10000005-501": { "Element": "None", "Consts": [ diff --git a/LittlePaimon/config/data/role_skill.json b/LittlePaimon/config/data/role_skill.json index 97ed4fa..dd8e3dc 100644 --- a/LittlePaimon/config/data/role_skill.json +++ b/LittlePaimon/config/data/role_skill.json @@ -408,6 +408,45 @@ "10991": "普通攻击·逐影枪术·改", "10992": "撷萃调香", "10995": "香氛演绎", + "11001": "普通攻击·嵴之啮咬", + "11002": "出击,冲天转转!", + "11003": "卡齐娜元素战技-上陀螺", + "11004": "卡齐娜元素战技-下陀螺", + "11005": "现在,认真时间!", + "11006": "卡齐娜元素战技-震地攻击", + "11007": "卡齐娜元素战技-特殊跳跃", + "11008": "卡齐娜夜魂接力技", + "11011": "普通攻击·夜阳斗技", + "11012": "悬猎·游骋高狩", + "11013": "基尼奇元素战技终结攻击", + "11014": "基尼奇元素战技空中二段飞行", + "11016": "基尼奇元素战技吐出吞噬物", + "11017": "基尼奇龙化摆荡", + "11015": "向伟大圣龙致意", + "11018": "基尼奇吞噬或者钩锚点", + "11019": "基尼奇空中喷射", + "30000": "普通攻击·降温处理", + "30002": "踏鲨破浪", + "30003": "游猎S冲浪攻击技", + "30004": "游猎S冲浪冲刺", + "30005": "游猎S冲浪跳跃", + "30006": "游猎S冲浪退出", + "30007": "爆瀑飞弹", + "30008": "游猎S冲浪攻击技 - 空中", + "30009": "游猎S冲浪 - fromswim", + "30010": "游猎S弧光攻击技", + "30011": "游猎S弧光空中攻击技", + "30101": "猎龙少年-普通攻击", + "30102": "猎龙少年-元素战技", + "30103": "猎龙少年-猎龙状态-特殊普攻", + "30104": "猎龙少年-猎龙状态-特殊战技", + "30105": "猎龙少年-元素爆发", + "30201": "铭刻师-普通攻击", + "30202": "铭刻师-元素战技-进豹灵状态", + "30203": "铭刻师-豹灵状态-特殊普攻", + "30204": "铭刻师-豹灵状态-特殊冲刺", + "30205": "铭刻师-元素爆发", + "30206": "铭刻师-元素战技-退豹灵状态", "20001": "风魔炮", "20002": "风魔炮", "20011": "飞行挑战 - 前冲", @@ -687,7 +726,10 @@ "5096010": "阿蕾奇诺空中攻击", "5097010": "赛索斯空中攻击", "5098010": "克洛琳德空中攻击", - "5099010": "艾梅莉埃空中攻击" + "5099010": "艾梅莉埃空中攻击", + "5100010": "卡齐娜空中攻击", + "5101010": "基尼奇空中攻击", + "5102010": "玛拉妮空中攻击" }, "Icon": { "10001": "", @@ -1098,6 +1140,45 @@ "10991": "Skill_A_03", "10992": "Skill_S_Emilie_01", "10995": "Skill_E_Emilie_01", + "11001": "Skill_A_03", + "11002": "Skill_S_Kachina_01", + "11003": "Skill_S_Kachina_02", + "11004": "Skill_S_Kachina_03", + "11005": "Skill_E_Kachina_01", + "11006": "Skill_S_Kachina_04", + "11007": "Skill_S_Kachina_04", + "11008": "Skill_S_Kachina_01", + "11011": "Skill_A_04", + "11012": "Skill_S_Kinich_01", + "11013": "Skill_S_Kinich_03", + "11014": "Skill_S_Kinich_04", + "11016": "Skill_S_Kinich_06", + "11017": "Skill_S_Kinich_02", + "11015": "Skill_E_Kinich_01", + "11018": "Skill_S_Kinich_05", + "11019": "Skill_S_Kinich_07", + "30000": "Skill_A_Catalyst_MD", + "30002": "Skill_S_Mualani_01", + "30003": "Skill_S_Mualani_02", + "30004": "Skill_S_Mualani_05", + "30005": "Skill_S_Mualani_04", + "30006": "Skill_S_Mualani_01", + "30007": "Skill_E_Mualani_01", + "30008": "Skill_S_Mualani_02", + "30009": "Skill_S_Mualani_01", + "30010": "Skill_S_Mualani_02", + "30011": "Skill_S_Mualani_02", + "30101": "Skill_A_Catalyst_MD", + "30102": "", + "30103": "", + "30104": "", + "30105": "", + "30201": "Skill_A_01", + "30202": "Skill_S_Momoka_01", + "30203": "", + "30204": "", + "30205": "", + "30206": "Skill_S_Momoka_02", "20001": "Skill_A_Dvalin_AirGun", "20002": "Skill_A_Dvalin_AirGun", "20011": "Btn_FlightSprint", @@ -1377,6 +1458,9 @@ "5096010": "Skill_A_03", "5097010": "Skill_A_02", "5098010": "Skill_A_01", - "5099010": "Skill_A_03" + "5099010": "Skill_A_03", + "5100010": "Skill_A_03", + "5101010": "Skill_A_04", + "5102010": "Skill_A_Catalyst_MD" } } \ No newline at end of file diff --git a/LittlePaimon/config/data/role_talent.json b/LittlePaimon/config/data/role_talent.json index 622d679..f9fa6b4 100644 --- a/LittlePaimon/config/data/role_talent.json +++ b/LittlePaimon/config/data/role_talent.json @@ -533,7 +533,25 @@ "993": "郁馥臻萃", "994": "柔灯心韵", "995": "纯露凝芳", - "996": "茉洁香迹" + "996": "茉洁香迹", + "1001": "晶片,也是一种宝石", + "1002": "不能少了…冲天转转", + "1003": "改良型·平衡稳定器", + "1004": "敌人越多,越要小心", + "1005": "迄今为止,所有收藏", + "1006": "这一次,我一定要赢", + "1011": "七鹦之喙", + "1012": "星虎之掌", + "1013": "原鳄之爪", + "1014": "蜂鸟之羽", + "1015": "吼猴之尾", + "1016": "瑞兽之形", + "1021": "悠闲的「梅兹特利」…", + "1022": "全力以赴玛拉妮!", + "1023": "在欢乐海上冲浪", + "1024": "鲨鲨主食是豚豚。", + "1025": "同款冲浪板有售!", + "1026": "「流泉之众」的精神" }, "Icon": { "21": "UI_Talent_S_Ayaka_01", @@ -1069,6 +1087,24 @@ "993": "UI_Talent_U_Emilie_01", "994": "UI_Talent_S_Emilie_03", "995": "UI_Talent_U_Emilie_02", - "996": "UI_Talent_S_Emilie_04" + "996": "UI_Talent_S_Emilie_04", + "1001": "UI_Talent_S_Kachina_01", + "1002": "UI_Talent_S_Kachina_02", + "1003": "UI_Talent_U_Kachina_01", + "1004": "UI_Talent_S_Kachina_03", + "1005": "UI_Talent_U_Kachina_02", + "1006": "UI_Talent_S_Kachina_04", + "1011": "UI_Talent_S_Kinich_01", + "1012": "UI_Talent_S_Kinich_02", + "1013": "UI_Talent_U_Kinich_01", + "1014": "UI_Talent_S_Kinich_03", + "1015": "UI_Talent_U_Kinich_02", + "1016": "UI_Talent_S_Kinich_04", + "1021": "UI_Talent_S_Mualani_01", + "1022": "UI_Talent_S_Mualani_02", + "1023": "UI_Talent_U_Mualani_01", + "1024": "UI_Talent_S_Mualani_03", + "1025": "UI_Talent_U_Mualani_02", + "1026": "UI_Talent_S_Mualani_04" } } \ No newline at end of file diff --git a/LittlePaimon/config/data/roles_data.json b/LittlePaimon/config/data/roles_data.json index f8feeb2..db942e7 100644 --- a/LittlePaimon/config/data/roles_data.json +++ b/LittlePaimon/config/data/roles_data.json @@ -31494,5 +31494,20 @@ "region": "枫丹", "star": 5, "element": "草" + }, + "卡齐娜": { + "region": "纳塔", + "star": 4, + "element": "岩" + }, + "基尼奇": { + "region": "纳塔", + "star": 5, + "element": "草" + }, + "玛拉妮": { + "region": "纳塔", + "star": 5, + "element": "水" } } diff --git a/LittlePaimon/config/data/score.json b/LittlePaimon/config/data/score.json index b5eab2b..2761d2f 100644 --- a/LittlePaimon/config/data/score.json +++ b/LittlePaimon/config/data/score.json @@ -848,6 +848,9 @@ "赛索斯": [0, 2], "希格雯": [1, 2], "克洛琳德": [1, 2], - "艾梅莉埃": [1, 2] + "艾梅莉埃": [1, 2], + "玛拉妮": [1, 2], + "卡齐娜": [1, 2], + "基尼奇": [1, 2] } } diff --git a/LittlePaimon/config/data/weapon.json b/LittlePaimon/config/data/weapon.json index e5b0cd7..17330e7 100644 --- a/LittlePaimon/config/data/weapon.json +++ b/LittlePaimon/config/data/weapon.json @@ -35,6 +35,7 @@ "1790067483": "船坞长剑", "3016493955": "水仙十字之剑", "594850707": "水仙十字之剑", + "3434743027": "息燧之笛", "902264035": "风鹰剑", "4055003299": "天空之刃", "2949448555": "苍古自由之誓", @@ -76,6 +77,7 @@ "2077869763": "浪影阔剑", "933442195": "「究极霸王超级魔剑」", "3693117451": "便携动力锯", + "2481464075": "撼地者", "1089950259": "天空之傲", "3995710363": "狼的末路", "1075647299": "松籁响起之时", @@ -83,6 +85,7 @@ "3914951691": "赤角石溃杵", "2834063555": "苇海信标", "3812523339": "裁断", + "1183454019": "山王长牙", "2796697027": "新手长枪", "3070169307": "铁尖枪", "1390797107": "白缨枪", @@ -107,6 +110,7 @@ "4158971171": "公义的酬报", "2847771107": "沙中伟贤的对答", "882305891": "勘探钻机", + "415520051": "虹的行迹", "3235324891": "护摩之杖", "4158505619": "天空之脊", "197755235": "贯虹之槊", @@ -143,6 +147,8 @@ "2275710883": "遗祀玉珑", "2432865507": "纯水流华", "2722902043": "无垠蔚蓝之歌", + "422144187": "苍纹角杯", + "3092853059": "木棉之环", "807607555": "天空之卷", "1455107995": "四风原典", "693354267": "尘世之锁", @@ -154,6 +160,7 @@ "724881171": "金流监督", "4176923379": "万世流涌大典", "3660626387": "鹤鸣余音", + "1673987515": "冲浪时光", "3600623979": "猎弓", "2340970067": "历练的猎弓", "3975746731": "鸦羽弓", @@ -185,6 +192,7 @@ "2600875323": "静谧之曲", "4038676067": "筑云", "1055195035": "测距规", + "565052971": "碎链", "3933622347": "天空之翼", "828711395": "阿莫斯之弓", "3112679155": "终末嗟叹之诗", @@ -235,6 +243,7 @@ "灰河渡手": "单手剑", "船坞长剑": "单手剑", "水仙十字之剑": "单手剑", + "息燧之笛": "单手剑", "风鹰剑": "单手剑", "天空之刃": "单手剑", "苍古自由之誓": "单手剑", @@ -276,6 +285,7 @@ "浪影阔剑": "双手剑", "「究极霸王超级魔剑」": "双手剑", "便携动力锯": "双手剑", + "撼地者": "双手剑", "天空之傲": "双手剑", "狼的末路": "双手剑", "松籁响起之时": "双手剑", @@ -283,6 +293,7 @@ "赤角石溃杵": "双手剑", "苇海信标": "双手剑", "裁断": "双手剑", + "山王长牙": "双手剑", "新手长枪": "长柄武器", "铁尖枪": "长柄武器", "白缨枪": "长柄武器", @@ -307,6 +318,7 @@ "公义的酬报": "长柄武器", "沙中伟贤的对答": "长柄武器", "勘探钻机": "长柄武器", + "虹的行迹": "长柄武器", "护摩之杖": "长柄武器", "天空之脊": "长柄武器", "贯虹之槊": "长柄武器", @@ -343,6 +355,8 @@ "遗祀玉珑": "法器", "纯水流华": "法器", "无垠蔚蓝之歌": "法器", + "苍纹角杯": "法器", + "木棉之环": "法器", "天空之卷": "法器", "四风原典": "法器", "尘世之锁": "法器", @@ -354,6 +368,7 @@ "金流监督": "法器", "万世流涌大典": "法器", "鹤鸣余音": "法器", + "冲浪时光": "法器", "猎弓": "弓", "历练的猎弓": "弓", "鸦羽弓": "弓", @@ -385,6 +400,7 @@ "静谧之曲": "弓", "筑云": "弓", "测距规": "弓", + "碎链": "弓", "天空之翼": "弓", "阿莫斯之弓": "弓", "终末嗟叹之诗": "弓", @@ -430,6 +446,7 @@ "灰河渡手": "UI_EquipIcon_Sword_Machination", "船坞长剑": "UI_EquipIcon_Sword_Mechanic", "水仙十字之剑": "UI_EquipIcon_Sword_Purewill", + "息燧之笛": "UI_EquipIcon_Sword_Isikhulu", "风鹰剑": "UI_EquipIcon_Sword_Falcon", "天空之刃": "UI_EquipIcon_Sword_Dvalin", "苍古自由之誓": "UI_EquipIcon_Sword_Widsith", @@ -471,6 +488,7 @@ "浪影阔剑": "UI_EquipIcon_Claymore_Vorpal", "「究极霸王超级魔剑」": "UI_EquipIcon_Claymore_Champion", "便携动力锯": "UI_EquipIcon_Claymore_Mechanic", + "撼地者": "UI_EquipIcon_Claymore_Isikhulu", "天空之傲": "UI_EquipIcon_Claymore_Dvalin", "狼的末路": "UI_EquipIcon_Claymore_Wolfmound", "松籁响起之时": "UI_EquipIcon_Claymore_Widsith", @@ -478,6 +496,7 @@ "赤角石溃杵": "UI_EquipIcon_Claymore_Itadorimaru", "苇海信标": "UI_EquipIcon_Claymore_Deshret", "裁断": "UI_EquipIcon_Claymore_GoldenVerdict", + "山王长牙": "UI_EquipIcon_Claymore_EmeraldSword", "新手长枪": "UI_EquipIcon_Pole_Gewalt", "铁尖枪": "UI_EquipIcon_Pole_Rod", "白缨枪": "UI_EquipIcon_Pole_Ruby", @@ -502,6 +521,7 @@ "公义的酬报": "UI_EquipIcon_Pole_Vorpal", "沙中伟贤的对答": "UI_EquipIcon_Pole_Caduceus", "勘探钻机": "UI_EquipIcon_Pole_Mechanic", + "虹的行迹": "UI_EquipIcon_Pole_Isikhulu", "护摩之杖": "UI_EquipIcon_Pole_Homa", "天空之脊": "UI_EquipIcon_Pole_Dvalin", "贯虹之槊": "UI_EquipIcon_Pole_Kunwu", @@ -538,6 +558,8 @@ "遗祀玉珑": "UI_EquipIcon_Catalyst_Yue", "纯水流华": "UI_EquipIcon_Catalyst_Vorpal", "无垠蔚蓝之歌": "UI_EquipIcon_Catalyst_DandelionPoem", + "苍纹角杯": "UI_EquipIcon_Catalyst_ConchSprayer", + "木棉之环": "UI_EquipIcon_Catalyst_Isikhulu", "天空之卷": "UI_EquipIcon_Catalyst_Dvalin", "四风原典": "UI_EquipIcon_Catalyst_Fourwinds", "尘世之锁": "UI_EquipIcon_Catalyst_Kunwu", @@ -549,6 +571,7 @@ "金流监督": "UI_EquipIcon_Catalyst_Wheatley", "万世流涌大典": "UI_EquipIcon_Catalyst_Iudex", "鹤鸣余音": "UI_EquipIcon_Catalyst_MountainGale", + "冲浪时光": "UI_EquipIcon_Catalyst_MechaPufferfish", "猎弓": "UI_EquipIcon_Bow_Hunters", "历练的猎弓": "UI_EquipIcon_Bow_Old", "鸦羽弓": "UI_EquipIcon_Bow_Crowfeather", @@ -580,6 +603,7 @@ "静谧之曲": "UI_EquipIcon_Bow_Vorpal", "筑云": "UI_EquipIcon_Bow_Ultimatum", "测距规": "UI_EquipIcon_Bow_Mechanic", + "碎链": "UI_EquipIcon_Bow_Isikhulu", "天空之翼": "UI_EquipIcon_Bow_Dvalin", "阿莫斯之弓": "UI_EquipIcon_Bow_Amos", "终末嗟叹之诗": "UI_EquipIcon_Bow_Widsith", diff --git a/LittlePaimon/config/data/类型.json b/LittlePaimon/config/data/类型.json index 7d4c841..b3a32a5 100644 --- a/LittlePaimon/config/data/类型.json +++ b/LittlePaimon/config/data/类型.json @@ -41,7 +41,8 @@ "纳西妲", "流浪者", "夏洛蒂", - "闲云" + "闲云", + "玛拉妮" ], "双手剑": [ "迪卢克", @@ -57,7 +58,8 @@ "迪希雅", "菲米尼", "娜维娅", - "嘉明" + "嘉明", + "基尼奇" ], "弓": [ "安柏", @@ -93,7 +95,8 @@ "瑶瑶", "米卡", "夏沃蕾", - "阿蕾奇诺" + "阿蕾奇诺", + "卡齐娜" ] }, "元素类型": { @@ -154,7 +157,8 @@ "坎蒂丝", "旅行者水", "那维莱特", - "芙宁娜" + "芙宁娜", + "玛拉妮" ], "火": [ "迪卢克", @@ -182,7 +186,8 @@ "云堇", "旅行者岩", "娜维娅", - "千织" + "千织", + "卡齐娜" ], "草": [ "柯莱", @@ -192,7 +197,8 @@ "艾尔海森", "旅行者草", "绮良良", - "艾梅莉埃" + "艾梅莉埃", + "基尼奇" ] } }, @@ -240,7 +246,8 @@ "水仙十字之剑", "静水流涌之辉", "有乐御簾切", - "赦罪" + "赦罪", + "息燧之笛" ], "双手剑": [ "训练大剑", @@ -275,7 +282,9 @@ "浪影阔剑", "便携动力锯", "「究极霸王超级魔剑」", - "裁断" + "裁断", + "撼地者", + "山王长牙" ], "长柄武器": [ "新手长枪", @@ -308,7 +317,8 @@ "公义的酬报", "勘探钻机", "沙中伟贤的对答", - "柔灯挽歌" + "柔灯挽歌", + "虹的行迹" ], "法器": [ "学徒笔记", @@ -346,7 +356,10 @@ "无垠蔚蓝之歌", "金流监督", "万世流涌大典", - "鹤鸣余音" + "鹤鸣余音", + "苍纹角杯", + "木棉之环", + "冲浪时光" ], "弓": [ "猎弓", @@ -387,7 +400,8 @@ "静谧之曲", "测距规", "筑云", - "白雨心弦" + "白雨心弦", + "碎链" ] } } diff --git a/LittlePaimon/plugins/Paimon_Bind/get_cookie.py b/LittlePaimon/plugins/Paimon_Bind/get_cookie.py index 6e8696c..c2d64e9 100644 --- a/LittlePaimon/plugins/Paimon_Bind/get_cookie.py +++ b/LittlePaimon/plugins/Paimon_Bind/get_cookie.py @@ -16,7 +16,12 @@ import qrcode from fastapi import FastAPI from fastapi.responses import StreamingResponse from nonebot import on_command, get_bot, get_app -from nonebot.adapters.onebot.v11 import Bot, MessageSegment, MessageEvent, GroupMessageEvent +from nonebot.adapters.onebot.v11 import ( + Bot, + MessageSegment, + MessageEvent, + GroupMessageEvent, +) from LittlePaimon.config import config from LittlePaimon.database.models import PrivateCookie, LastQuery @@ -26,9 +31,9 @@ from LittlePaimon.utils.scheduler import scheduler from LittlePaimon.utils.api import get_bind_game_info from LittlePaimon.utils.message import fullmatch_rule -CN_DS_SALT = 'JwYDpKvLj6MrMqqYU6jTKF17KNO2PXoS' -bind_tips = '绑定方法二选一:\n1.通过米游社扫码绑定:\n请发送指令[原神扫码绑定]\n2.通过Cookie绑定:获取教程\ndocs.qq.com/doc/DQ3JLWk1vQVllZ2Z1\n获取后,使用[ysb cookie]指令绑定' -bind_tips_web = '绑定方法二选一:\n1.通过米游社扫码绑定:\n请发送指令[原神扫码绑定]\n2.通过Cookie绑定:获取教程\ndocs.qq.com/doc/DQ3JLWk1vQVllZ2Z1\n获取后,使用[ysb cookie]指令绑定或前往{cookie_web_url}网页添加绑定' +CN_DS_SALT = "JwYDpKvLj6MrMqqYU6jTKF17KNO2PXoS" +bind_tips = "绑定方法二选一:\n1.通过米游社扫码绑定:\n请发送指令[原神扫码绑定]\n2.通过Cookie绑定:获取教程\ndocs.qq.com/doc/DQ3JLWk1vQVllZ2Z1\n获取后,使用[ysb cookie]指令绑定" +bind_tips_web = "绑定方法二选一:\n1.通过米游社扫码绑定:\n请发送指令[原神扫码绑定]\n2.通过Cookie绑定:获取教程\ndocs.qq.com/doc/DQ3JLWk1vQVllZ2Z1\n获取后,使用[ysb cookie]指令绑定或前往{cookie_web_url}网页添加绑定" running_login_data = {} @@ -39,160 +44,207 @@ def md5_(self) -> str: def get_ds(body=None, query=None) -> str: t = int(time.time()) - r = ''.join(random.choices(ascii_letters, k=6)) - b = json.dumps(body) if body else '' - q = '&'.join((f"{k}={v}" for k, v in sorted(query.items()))) if query else '' + r = "".join(random.choices(ascii_letters, k=6)) + b = json.dumps(body) if body else "" + q = "&".join((f"{k}={v}" for k, v in sorted(query.items()))) if query else "" h = md5_(f"salt={CN_DS_SALT}&t={t}&r={r}&b={b}&q={q}") return f"{t},{r},{h}" -async def get_stoken(aigis: str = '', data: dict = None): +async def get_stoken(aigis: str = "", data: dict = None): if data is None: data = {} - resp = await aiorequests.post('https://passport-api.mihoyo.com/account/ma-cn-session/app/getTokenByGameToken', - headers={'x-rpc-app_version': '2.41.0', - 'DS': get_ds(data), - 'x-rpc-aigis': aigis, - 'Content-Type': 'application/json', - 'Accept': 'application/json', - 'x-rpc-game_biz': 'bbs_cn', - 'x-rpc-sys_version': '11', - 'x-rpc-device_id': uuid.uuid4().hex, - 'x-rpc-device_fp': ''.join( - random.choices((ascii_letters + digits), k=13)), - 'x-rpc-device_name': 'Chrome 108.0.0.0', - 'x-rpc-device_model': 'Windows 10 64-bit', - 'x-rpc-app_id': 'bll8iq97cem8', - 'x-rpc-client_type': '4', - 'User-Agent': 'okhttp/4.8.0'}, - json=data) + resp = await aiorequests.post( + "https://passport-api.mihoyo.com/account/ma-cn-session/app/getTokenByGameToken", + headers={ + "x-rpc-app_version": "2.41.0", + "DS": get_ds(data), + "x-rpc-aigis": aigis, + "Content-Type": "application/json", + "Accept": "application/json", + "x-rpc-game_biz": "bbs_cn", + "x-rpc-sys_version": "11", + "x-rpc-device_id": uuid.uuid4().hex, + "x-rpc-device_fp": "".join(random.choices((ascii_letters + digits), k=13)), + "x-rpc-device_name": "Chrome 108.0.0.0", + "x-rpc-device_model": "Windows 10 64-bit", + "x-rpc-app_id": "bll8iq97cem8", + "x-rpc-client_type": "4", + "User-Agent": "okhttp/4.8.0", + }, + json=data, + ) return resp.json() def generate_qrcode(url): - qr = qrcode.QRCode(version=1, - error_correction=qrcode.constants.ERROR_CORRECT_L, - box_size=10, - border=4) + qr = qrcode.QRCode( + version=1, + error_correction=qrcode.constants.ERROR_CORRECT_L, + box_size=10, + border=4, + ) qr.add_data(url) qr.make(fit=True) - img = qr.make_image(fill_color='black', back_color='white') + img = qr.make_image(fill_color="black", back_color="white") bio = BytesIO() img.save(bio) - return f'base64://{base64.b64encode(bio.getvalue()).decode()}' + return f"base64://{base64.b64encode(bio.getvalue()).decode()}" async def create_login_data(): - device_id = ''.join(random.choices((ascii_letters + digits), k=64)) - app_id = '4' - data = {'app_id': app_id, - 'device': device_id} - res = await aiorequests.post('https://hk4e-sdk.mihoyo.com/hk4e_cn/combo/panda/qrcode/fetch?', - json=data) - url = res.json()['data']['url'] - ticket = url.split('ticket=')[1] - return {'app_id': app_id, - 'ticket': ticket, - 'device': device_id, - 'url': url} + device_id = "".join(random.choices((ascii_letters + digits), k=64)) + app_id = "2" + data = {"app_id": app_id, "device": device_id} + res = await aiorequests.post( + "https://hk4e-sdk.mihoyo.com/hk4e_cn/combo/panda/qrcode/fetch?", json=data + ) + url = res.json()["data"]["url"] + ticket = url.split("ticket=")[1] + return {"app_id": app_id, "ticket": ticket, "device": device_id, "url": url} async def check_login(login_data: dict): - data = {'app_id': login_data['app_id'], - 'ticket': login_data['ticket'], - 'device': login_data['device']} - res = await aiorequests.post('https://hk4e-sdk.mihoyo.com/hk4e_cn/combo/panda/qrcode/query?', - json=data) + data = { + "app_id": login_data["app_id"], + "ticket": login_data["ticket"], + "device": login_data["device"], + } + res = await aiorequests.post( + "https://hk4e-sdk.mihoyo.com/hk4e_cn/combo/panda/qrcode/query?", json=data + ) return res.json() async def get_cookie_token(game_token: dict): res = await aiorequests.get( - f"https://api-takumi.mihoyo.com/auth/api/getCookieAccountInfoByGameToken?game_token={game_token['token']}&account_id={game_token['uid']}") + f"https://api-takumi.mihoyo.com/auth/api/getCookieAccountInfoByGameToken?game_token={game_token['token']}&account_id={game_token['uid']}" + ) return res.json() -qrcode_bind = on_command('原神扫码绑定', aliases={'原神扫码登录', '原神扫码登陆'}, priority=1, block=True, - rule=fullmatch_rule, - state={ - 'pm_name': '原神扫码绑定', - 'pm_description': '通过米游社扫码的方式绑定原神Cookie', - 'pm_usage': '原神扫码绑定', - 'pm_priority': 1 - }) +qrcode_bind = on_command( + "原神扫码绑定", + aliases={"原神扫码登录", "原神扫码登陆"}, + priority=1, + block=True, + rule=fullmatch_rule, + state={ + "pm_name": "原神扫码绑定", + "pm_description": "通过米游社扫码的方式绑定原神Cookie", + "pm_usage": "原神扫码绑定", + "pm_priority": 1, + }, +) @qrcode_bind.handle() async def _(event: MessageEvent): # sourcery skip: use-fstring-for-concatenation if str(event.user_id) in running_login_data: - await qrcode_bind.finish('你已经在绑定中了,请扫描上一次的二维码') + await qrcode_bind.finish("你已经在绑定中了,请扫描上一次的二维码") login_data = await create_login_data() running_login_data[str(event.user_id)] = login_data - img_b64 = generate_qrcode(login_data['url']) - running_login_data[str(event.user_id)]['img_b64'] = img_b64 - img = f'二维码链接:{config.CookieWeb_url}/qrcode?user_id={event.user_id}' if config.qrcode_bind_use_url else MessageSegment.image(img_b64) + img_b64 = generate_qrcode(login_data["url"]) + running_login_data[str(event.user_id)]["img_b64"] = img_b64 + img = ( + f"二维码链接:{config.CookieWeb_url}/qrcode?user_id={event.user_id}" + if config.qrcode_bind_use_url + else MessageSegment.image(img_b64) + ) msg_data = await qrcode_bind.send( - img + f'\n请在3分钟内使用米游社扫码并确认进行绑定。\n注意:1.扫码即代表你同意将Cookie信息授权给{NICKNAME}\n2.扫码时会提示登录原神,实际不会把你顶掉原神\n3.其他人请不要乱扫,否则会将你的账号绑到TA身上!', - at_sender=True) - running_login_data[str(event.user_id)]['msg_id'] = msg_data['message_id'] + img + + f"\n请在3分钟内使用米游社扫码并确认进行绑定。\n注意:1.扫码即代表你同意将Cookie信息授权给{NICKNAME}\n2.扫码时会提示登录原神,实际不会把你顶掉原神\n3.其他人请不要乱扫,否则会将你的账号绑到TA身上!", + at_sender=True, + ) + running_login_data[str(event.user_id)]["msg_id"] = msg_data["message_id"] if isinstance(event, GroupMessageEvent): - running_login_data[str(event.user_id)]['group_id'] = event.group_id - elif event.message_type == 'guild': - running_login_data[str(event.user_id)]['guild_id'] = event.guild_id - running_login_data[str(event.user_id)]['channel_id'] = event.channel_id - running_login_data[str(event.user_id)]['bot_id'] = event.self_id - running_login_data[str(event.user_id)]['nickname'] = event.sender.card or event.sender.nickname + running_login_data[str(event.user_id)]["group_id"] = event.group_id + elif event.message_type == "guild": + running_login_data[str(event.user_id)]["guild_id"] = event.guild_id + running_login_data[str(event.user_id)]["channel_id"] = event.channel_id + running_login_data[str(event.user_id)]["bot_id"] = event.self_id + running_login_data[str(event.user_id)]["nickname"] = ( + event.sender.card or event.sender.nickname + ) -@scheduler.scheduled_job('cron', second='*/10', misfire_grace_time=10) +@scheduler.scheduled_job("cron", second="*/10", misfire_grace_time=10) async def check_qrcode(): with contextlib.suppress(RuntimeError): for user_id, data in running_login_data.items(): send_msg = None status_data = await check_login(data) - if status_data['retcode'] != 0: - send_msg = '绑定二维码已过期,请重新发送扫码绑定指令' + if status_data["retcode"] != 0: + send_msg = "绑定二维码已过期,请重新发送扫码绑定指令" running_login_data.pop(user_id) - elif status_data['data']['stat'] == 'Confirmed': - game_token = json.loads(status_data['data']['payload']['raw']) + elif status_data["data"]["stat"] == "Confirmed": + game_token = json.loads(status_data["data"]["payload"]["raw"]) running_login_data.pop(user_id) cookie_token_data = await get_cookie_token(game_token) - stoken_data = await get_stoken(data={'account_id': int(game_token['uid']), - 'game_token': game_token['token']}) - mys_id = stoken_data['data']['user_info']['aid'] - mid = stoken_data['data']['user_info']['mid'] - cookie_token = cookie_token_data['data']['cookie_token'] - stoken = stoken_data['data']['token']['token'] - if game_info := await get_bind_game_info(f"account_id={mys_id};cookie_token={cookie_token}", mys_id): - if not game_info['list']: - send_msg = '该账号尚未绑定任何游戏,请确认扫码的账号无误' - elif not (genshin_games := [{'uid': game['game_role_id'], 'nickname': game['nickname']} for game in - game_info['list'] if game['game_id'] == 2]): - send_msg = '该账号尚未绑定原神,请确认扫码的账号无误' + stoken_data = await get_stoken( + data={ + "account_id": int(game_token["uid"]), + "game_token": game_token["token"], + } + ) + mys_id = stoken_data["data"]["user_info"]["aid"] + mid = stoken_data["data"]["user_info"]["mid"] + cookie_token = cookie_token_data["data"]["cookie_token"] + stoken = stoken_data["data"]["token"]["token"] + if game_info := await get_bind_game_info( + f"account_id={mys_id};cookie_token={cookie_token}", mys_id + ): + if not game_info["list"]: + send_msg = "该账号尚未绑定任何游戏,请确认扫码的账号无误" + elif not ( + genshin_games := [ + {"uid": game["game_role_id"], "nickname": game["nickname"]} + for game in game_info["list"] + if game["game_id"] == 2 + ] + ): + send_msg = "该账号尚未绑定原神,请确认扫码的账号无误" else: - send_msg = '成功绑定原神账号:' + send_msg = "成功绑定原神账号:" for info in genshin_games: send_msg += f'{info["nickname"]}({info["uid"]}) ' - await PrivateCookie.update_or_create(user_id=user_id, uid=info['uid'], mys_id=mys_id, - defaults={ - 'cookie': f"account_id={mys_id};cookie_token={cookie_token}", - 'stoken': f'stuid={mys_id};stoken={stoken};mid={mid};'}) + await PrivateCookie.update_or_create( + user_id=user_id, + uid=info["uid"], + mys_id=mys_id, + defaults={ + "cookie": f"account_id={mys_id};cookie_token={cookie_token}", + "stoken": f"stuid={mys_id};stoken={stoken};mid={mid};", + }, + ) send_msg = send_msg.strip() - await LastQuery.update_or_create(user_id=user_id, - defaults={'uid': genshin_games[0]['uid'], - 'last_time': datetime.datetime.now()}) + await LastQuery.update_or_create( + user_id=user_id, + defaults={ + "uid": genshin_games[0]["uid"], + "last_time": datetime.datetime.now(), + }, + ) if send_msg: - bot: Bot = get_bot(str(data['bot_id'])) - if 'group_id' in data: - await bot.send_group_msg(group_id=data['group_id'], - message=MessageSegment.reply(data['msg_id']) + MessageSegment.at( - int(user_id)) + send_msg) - elif 'guild_id' in data: - await bot.send_guild_channel_msg(guild_id=data['guild_id'], channel_id=data['channel_id'], - message=MessageSegment.at(int(user_id)) + send_msg) + bot: Bot = get_bot(str(data["bot_id"])) + if "group_id" in data: + await bot.send_group_msg( + group_id=data["group_id"], + message=MessageSegment.reply(data["msg_id"]) + + MessageSegment.at(int(user_id)) + + send_msg, + ) + elif "guild_id" in data: + await bot.send_guild_channel_msg( + guild_id=data["guild_id"], + channel_id=data["channel_id"], + message=MessageSegment.at(int(user_id)) + send_msg, + ) else: - await bot.send_private_msg(user_id=int(user_id), - message=MessageSegment.reply(data['msg_id']) + send_msg) + await bot.send_private_msg( + user_id=int(user_id), + message=MessageSegment.reply(data["msg_id"]) + send_msg, + ) if not running_login_data: break await asyncio.sleep(1) @@ -201,11 +253,13 @@ async def check_qrcode(): app: FastAPI = get_app() -@app.get('/LittlePaimon/cookie/qrcode') +@app.get("/LittlePaimon/cookie/qrcode") async def qrcode_img_url(user_id: str): if not config.qrcode_bind_use_url: - return {'status': 'error', 'msg': '请在QQ内查看二维码'} + return {"status": "error", "msg": "请在QQ内查看二维码"} if user_id not in running_login_data: - return {'status': 'error', 'msg': '二维码不存在'} - img_base64 = running_login_data[user_id]['img_b64'].lstrip('base64://') - return StreamingResponse(BytesIO(base64.b64decode(img_base64)), media_type='image/png') + return {"status": "error", "msg": "二维码不存在"} + img_base64 = running_login_data[user_id]["img_b64"].lstrip("base64://") + return StreamingResponse( + BytesIO(base64.b64decode(img_base64)), media_type="image/png" + )