@sjtdev/koishi-plugin-dota2tracker 1.2.3 → 1.2.4
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/changelog.md +5 -1
- package/lib/index.js +8 -8
- package/package.json +1 -1
package/changelog.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
### 1.2.4
|
|
2
|
+
**修复**:修正调用help指令时本插件某些指令的说明错误
|
|
3
|
+
**修复**:修复`取消订阅`指令失效的问题
|
|
4
|
+
|
|
1
5
|
### 1.2.3
|
|
2
6
|
**修复**:修复了比赛战报图片中称号`摸`判定不正确的问题
|
|
3
|
-
|
|
7
|
+
**改进**:微调了比赛战报图片模板`match_2`中称号的显示样式
|
|
4
8
|
|
|
5
9
|
### 1.2.2
|
|
6
10
|
**移除**:取消`查询英雄`的缓存功能,原因为valve的API返回的数据可能包含未本地化的字段(例如这次的7.36b更新后获取到的很多改动后技能说明暂时都是英文),这些数据无法根据版本判断是否需要更新缓存。
|
package/lib/index.js
CHANGED
|
@@ -1232,14 +1232,14 @@ async function apply(ctx, config) {
|
|
|
1232
1232
|
if (session.guild) {
|
|
1233
1233
|
let cancelingGuild = (await ctx.database.get("dt_subscribed_guilds", { guildId: session.event.channel.id, platform: session.event.platform }))[0];
|
|
1234
1234
|
if (cancelingGuild) {
|
|
1235
|
-
ctx.database.remove("dt_subscribed_guilds", session.event.channel.id);
|
|
1235
|
+
ctx.database.remove("dt_subscribed_guilds", { guildId: session.event.channel.id, platform: session.event.platform });
|
|
1236
1236
|
session.send("取消订阅成功。");
|
|
1237
1237
|
return;
|
|
1238
1238
|
}
|
|
1239
1239
|
} else
|
|
1240
1240
|
session.send("本群尚未订阅,无需取消订阅。");
|
|
1241
1241
|
});
|
|
1242
|
-
ctx.command("绑定 <steam_id> [nick_name]", "绑定SteamID,并起一个别名(也可以不起)").usage("将你的SteamID与你的账号绑定,若本群已订阅将会实时获取你的新比赛数据发布至群中。").example("
|
|
1242
|
+
ctx.command("绑定 <steam_id> [nick_name]", "绑定SteamID,并起一个别名(也可以不起)").usage("将你的SteamID与你的账号绑定,若本群已订阅将会实时获取你的新比赛数据发布至群中。").example("绑定 123456789").example("绑定 123456789 张三").action(async ({ session }, steam_id, nick_name) => {
|
|
1243
1243
|
if (session.guild) {
|
|
1244
1244
|
if (!steam_id || !/^\d{1,11}$/.test(steam_id)) {
|
|
1245
1245
|
session.send("SteamID无效。");
|
|
@@ -1286,7 +1286,7 @@ async function apply(ctx, config) {
|
|
|
1286
1286
|
session.send("尚未绑定,无需取消绑定。");
|
|
1287
1287
|
}
|
|
1288
1288
|
});
|
|
1289
|
-
ctx.command("改名 <nick_name>", "修改绑定时设定的别名").example("
|
|
1289
|
+
ctx.command("改名 <nick_name>", "修改绑定时设定的别名").example("改名 李四").action(async ({ session }, nick_name) => {
|
|
1290
1290
|
if (session.guild) {
|
|
1291
1291
|
let sessionPlayer = (await ctx.database.get("dt_subscribed_players", { guildId: session.event.channel.id, platform: session.event.platform, userId: session.event.user.id }))[0];
|
|
1292
1292
|
if (sessionPlayer) {
|
|
@@ -1363,7 +1363,7 @@ async function apply(ctx, config) {
|
|
|
1363
1363
|
}
|
|
1364
1364
|
}
|
|
1365
1365
|
__name(queryAndDisplayMatch, "queryAndDisplayMatch");
|
|
1366
|
-
ctx.command("查询比赛 <match_id>", "查询比赛ID").usage("查询指定比赛ID的比赛数据,生成图片发布。").example("
|
|
1366
|
+
ctx.command("查询比赛 <match_id>", "查询比赛ID").usage("查询指定比赛ID的比赛数据,生成图片发布。").example("查询比赛 1234567890").action(async ({ session }, match_id) => {
|
|
1367
1367
|
if (!match_id) {
|
|
1368
1368
|
session.send("请输入比赛ID。");
|
|
1369
1369
|
return;
|
|
@@ -1376,7 +1376,7 @@ async function apply(ctx, config) {
|
|
|
1376
1376
|
session.send("正在搜索对局详情,请稍后...");
|
|
1377
1377
|
queryAndDisplayMatch(session, match_id);
|
|
1378
1378
|
});
|
|
1379
|
-
ctx.command("查询最近比赛 [input_data]", "查询玩家的最近比赛").usage("查询指定玩家的最近一场比赛的比赛数据,生成图片发布。\n参数可输入该玩家的SteamID或已在本群绑定玩家的别名,无参数时尝试查询调用指令玩家的SteamID").example("
|
|
1379
|
+
ctx.command("查询最近比赛 [input_data]", "查询玩家的最近比赛").usage("查询指定玩家的最近一场比赛的比赛数据,生成图片发布。\n参数可输入该玩家的SteamID或已在本群绑定玩家的别名,无参数时尝试查询调用指令玩家的SteamID").example("查询最近比赛 123456789").example("查询最近比赛 张三").action(async ({ session }, input_data) => {
|
|
1380
1380
|
if (session.guild) {
|
|
1381
1381
|
let sessionPlayer;
|
|
1382
1382
|
if (!input_data) {
|
|
@@ -1402,7 +1402,7 @@ async function apply(ctx, config) {
|
|
|
1402
1402
|
queryAndDisplayMatch(session, lastMatchId);
|
|
1403
1403
|
}
|
|
1404
1404
|
});
|
|
1405
|
-
ctx.command("查询玩家 <input_data>", "查询玩家信息,可指定英雄").usage("查询指定玩家的个人信息与最近战绩,生成图片发布。\n参数可输入该玩家的SteamID或已在本群绑定玩家的别名,无参数时尝试查询调用指令玩家的SteamID").option("hero", "-o <value:string> 查询玩家指定英雄使用情况(同其他英雄查询,可用简称与ID)").example("
|
|
1405
|
+
ctx.command("查询玩家 <input_data>", "查询玩家信息,可指定英雄").usage("查询指定玩家的个人信息与最近战绩,生成图片发布。\n参数可输入该玩家的SteamID或已在本群绑定玩家的别名,无参数时尝试查询调用指令玩家的SteamID").option("hero", "-o <value:string> 查询玩家指定英雄使用情况(同其他英雄查询,可用简称与ID)").example("查询玩家 123456789").example("查询玩家 张三").example("查询玩家 张三 hero 敌法师").action(async ({ session, options }, input_data) => {
|
|
1406
1406
|
if (session.guild) {
|
|
1407
1407
|
let sessionPlayer;
|
|
1408
1408
|
if (!input_data) {
|
|
@@ -1469,7 +1469,7 @@ async function apply(ctx, config) {
|
|
|
1469
1469
|
}
|
|
1470
1470
|
}
|
|
1471
1471
|
});
|
|
1472
|
-
ctx.command("查询英雄 <input_data>", "查询英雄技能/面板信息").usage("查询英雄的技能说明与各项数据,生成图片发布。\n参数可输入英雄ID、英雄名、英雄常用别名").option("random", "-r 随机选择英雄").example("
|
|
1472
|
+
ctx.command("查询英雄 <input_data>", "查询英雄技能/面板信息").usage("查询英雄的技能说明与各项数据,生成图片发布。\n参数可输入英雄ID、英雄名、英雄常用别名").option("random", "-r 随机选择英雄").example("查询英雄 15").example("查询英雄 雷泽").example("查询英雄 电魂").action(async ({ session, options }, input_data) => {
|
|
1473
1473
|
if (options.random)
|
|
1474
1474
|
input_data = random.pick(Object.keys(HEROES_CHINESE));
|
|
1475
1475
|
if (input_data) {
|
|
@@ -1558,7 +1558,7 @@ async function apply(ctx, config) {
|
|
|
1558
1558
|
session.send("请输入参数。");
|
|
1559
1559
|
}
|
|
1560
1560
|
});
|
|
1561
|
-
ctx.command("查询英雄对战 <input_data:string>", "查询英雄近一周的最佳搭档与最佳克星英雄").usage("根据输入英雄查询最近一周比赛数据(传奇~万古分段)中与该英雄组合胜率最高英雄和与该英雄对抗胜率最低英雄。\n参数可输入英雄ID、英雄名、英雄常用别名").option("limit", "-l <value:number> 返回英雄个数(默认值 5)", { fallback: 5 }).option("filter", "-f <value:number> 过滤场数过低的组合(单位:%,默认值0.75)", { fallback: 0.5 }).example("
|
|
1561
|
+
ctx.command("查询英雄对战 <input_data:string>", "查询英雄近一周的最佳搭档与最佳克星英雄").usage("根据输入英雄查询最近一周比赛数据(传奇~万古分段)中与该英雄组合胜率最高英雄和与该英雄对抗胜率最低英雄。\n参数可输入英雄ID、英雄名、英雄常用别名").option("limit", "-l <value:number> 返回英雄个数(默认值 5)", { fallback: 5 }).option("filter", "-f <value:number> 过滤场数过低的组合(单位:%,默认值0.75)", { fallback: 0.5 }).example("查询英雄对战 敌法师 (无额外参数默认返回5个英雄,过滤舍弃场次占比0.75%以下)").example("查询英雄对战 敌法师 -l=10 -f=1 (返回10个英雄,过滤舍弃场次占比1%以下)").example("查询英雄对战 敌法师 -l 10 -f 1 (等同于上例,参数接空格也可使用)").action(async ({ session, options }, input_data) => {
|
|
1562
1562
|
if (input_data) {
|
|
1563
1563
|
let hero = findingHero(input_data);
|
|
1564
1564
|
if (!hero) {
|