koishi-plugin-msbao 0.0.17 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +50 -18
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -127,32 +127,47 @@ async function formatCharacterInfo(api, ocid, characterName) {
|
|
|
127
127
|
const createDate = formatDateToYMD(basic.characterDateCreate);
|
|
128
128
|
const encoded = encodeURIComponent(characterName);
|
|
129
129
|
const statLines = [
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
130
|
+
`战斗力: ${formatNumber(stats["戰鬥力"] || "0")}`,
|
|
131
|
+
//🌟
|
|
132
|
+
`物攻 / 魔攻: ${stats["攻擊力"] || "0"} / ${stats["魔法攻擊力"] || "0"}`,
|
|
133
|
+
//⚔️
|
|
134
|
+
// `魔攻: ${stats['魔法攻擊力'] || '0'}`, //🔮
|
|
135
|
+
`最终伤害: ${stats["最終傷害"] || "0"}%`,
|
|
136
|
+
//🎯
|
|
137
|
+
`暴击伤害: ${stats["爆擊傷害"] || "0"}%`,
|
|
138
|
+
//🧨
|
|
139
|
+
`BOSS伤害: ${stats["BOSS怪物傷害"] || "0"}%`,
|
|
140
|
+
//👹
|
|
141
|
+
`一般伤害: ${stats["一般怪物傷害"] || "0"}%`,
|
|
142
|
+
//👾
|
|
143
|
+
`伤害: ${stats["傷害"] || "0"}%`,
|
|
144
|
+
//💥
|
|
145
|
+
`无视防御: ${stats["無視防禦率"] || "0"}%`,
|
|
146
|
+
//🛡️
|
|
147
|
+
`星力: ${stats["星力"] || "0"}`,
|
|
148
|
+
//⭐
|
|
149
|
+
`神秘力量(ARC): ${stats["神秘力量"] || "0"}`,
|
|
150
|
+
//🌀
|
|
151
|
+
`真实力量(AUT): ${stats["真實之力"] || "0"}`,
|
|
152
|
+
//✨
|
|
153
|
+
`道具掉落率: ${stats["道具掉落率"] || "0"}%`,
|
|
154
|
+
//📦
|
|
155
|
+
`枫币获得量: ${stats["楓幣獲得量"] || "0"}%`,
|
|
156
|
+
//💰
|
|
157
|
+
`冷卻减少(秒): ${stats["冷卻時間減少(秒)"] || "0"}秒`
|
|
158
|
+
//⏱️
|
|
145
159
|
].join("\n");
|
|
146
160
|
return `${basic.characterName} (${basic.worldName}@${basic.characterGuildName || "无公会"})
|
|
147
161
|
${basic.characterClass} | Lv.${basic.characterLevel} (${basic.characterExpRate}%)
|
|
148
|
-
|
|
149
162
|
建立日期: ${createDate}
|
|
150
163
|
|
|
151
164
|
详细属性:
|
|
152
165
|
${statLines}
|
|
153
|
-
|
|
154
166
|
更多详细信息:
|
|
155
|
-
https://maplescouter.com/info?name=${encoded}
|
|
167
|
+
https://maplescouter.com/info?name=${encoded}
|
|
168
|
+
|
|
169
|
+
OCID(角色ID): ${ocid}
|
|
170
|
+
(↑即使改名,OCID也不会变,可通过%ocid ocid 查询当前信息)`;
|
|
156
171
|
}
|
|
157
172
|
__name(formatCharacterInfo, "formatCharacterInfo");
|
|
158
173
|
function apply(ctx, config) {
|
|
@@ -267,6 +282,23 @@ ${i.websites.join("\n")}
|
|
|
267
282
|
return `查询失败,请稍后再试或联系开发者(布丁@2482457432 )`;
|
|
268
283
|
}
|
|
269
284
|
});
|
|
285
|
+
ctx.command("%ocid <ocid:string>", "通过OCID(角色ID)直接查询TMS角色信息").alias("%OCID").action(async ({ session }, ocid) => {
|
|
286
|
+
if (!canUse(session, config.ms)) return "";
|
|
287
|
+
if (!ocid) return "需提供OCID,用法: %ocid ocid";
|
|
288
|
+
if (!/^[0-9a-f]{32}$/.test(ocid)) {
|
|
289
|
+
return "OCID格式不正确(应为字母+数字的组合)";
|
|
290
|
+
}
|
|
291
|
+
try {
|
|
292
|
+
const basic = await api.getCharacterBasic(ocid);
|
|
293
|
+
if (!basic?.characterName) return "查询失败,请检查OCID";
|
|
294
|
+
return await formatCharacterInfo(api, ocid, basic.characterName);
|
|
295
|
+
} catch (err) {
|
|
296
|
+
if (err.constructor.name === "MapleStoryApiError") {
|
|
297
|
+
return `查询失败,请检查OCID`;
|
|
298
|
+
}
|
|
299
|
+
return `查询失败,请稍后再试或联系开发者(布丁@2482457432 )`;
|
|
300
|
+
}
|
|
301
|
+
});
|
|
270
302
|
ctx.command("%绑定 <gameId:string>", "绑定QQ号与角色名").alias("%綁定").action(async ({ session }, gameId) => {
|
|
271
303
|
if (!gameId) return "请提供角色名,用法: %绑定 角色名";
|
|
272
304
|
const qqId = session.userId;
|