Commit 60283f81 authored by nanahira's avatar nanahira

catchup and possibly locale updates

parent a8b2f202
......@@ -10,7 +10,7 @@
"license": "MIT",
"dependencies": {
"class-transformer": "^0.5.1",
"koishi-thirdeye": "^9.1.1",
"koishi-thirdeye": "^9.2.4",
"league-tabulator": "^1.0.0",
"lodash": "^4.17.21",
"moment": "^2.29.1",
......@@ -42,7 +42,7 @@
"ws": "^8.3.0"
},
"peerDependencies": {
"koishi": "^4.4.0"
"koishi": "^4.4.1"
}
},
"node_modules/@ampproject/remapping": {
......@@ -1063,9 +1063,9 @@
}
},
"node_modules/@koishijs/core": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.4.0.tgz",
"integrity": "sha512-MmKVlCx89M5icof92+U8U5QnywQ7dIjkGGUnzGlcBr59OrylHdRMKqZIIrtnqZo5EONehqh3k1Zbxr5V/6X5Eg==",
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.4.1.tgz",
"integrity": "sha512-nd/QAm9ejk4KQP8BjnyuDCxg4rpyq4fyYtTvFOuafj9G/vN6gHL11YLF5R7g2WimnN1S2sN1txB7WNx8dnGI1A==",
"peer": true,
"dependencies": {
"@koishijs/utils": "^5.2.0",
......@@ -1515,9 +1515,9 @@
"dev": true
},
"node_modules/@types/ws": {
"version": "8.2.2",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.2.tgz",
"integrity": "sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg==",
"version": "8.5.2",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.2.tgz",
"integrity": "sha512-VXI82ykONr5tacHEojnErTQk+KQSoYbW1NB6iz6wUwrNd+BqfkfggQNoNdCqhJSzbNumShPERbM+Pc5zpfhlbw==",
"peer": true,
"dependencies": {
"@types/node": "*"
......@@ -5141,17 +5141,17 @@
}
},
"node_modules/koishi": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.4.0.tgz",
"integrity": "sha512-ar4V0oBJ2by9gT0Hey3w/japL80ddtF2A48jP+UrPZ17Z3ha505lB79sQyPVyFdM78BY7wRkFw/qMc8eKZG3+g==",
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.4.1.tgz",
"integrity": "sha512-yTJlAwsbF7ecjqRGUX5l2LT8HROusAZj1UjzxEevXGWklRrzABWTifIXDEKd9H+oC5xq4hJQeXRCQCogiPe+SQ==",
"peer": true,
"dependencies": {
"@koa/router": "^10.1.1",
"@koishijs/core": "^4.4.0",
"@koishijs/core": "^4.4.1",
"@koishijs/utils": "^5.2.0",
"@types/koa": "*",
"@types/koa__router": "*",
"@types/ws": "^8.2.2",
"@types/ws": "^8.5.2",
"axios": "^0.24.0",
"file-type": "^16.5.3",
"koa": "^2.13.4",
......@@ -5159,16 +5159,16 @@
"parseurl": "^1.3.3",
"path-to-regexp": "^6.2.0",
"proxy-agent": "^5.0.0",
"ws": "^8.4.2"
"ws": "^8.5.0"
},
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/koishi-decorators": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-1.1.1.tgz",
"integrity": "sha512-AaumjnVTT8N7jJ67w16blSez9z+Pi+duuJusheIq3Hmkvx+iRxkpp3w0IvlU69gHqdQRK3Z4qNNC+KrMPDORUg==",
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-1.2.5.tgz",
"integrity": "sha512-PYVXFNdSCbifr12L0JSiIZGQsax1cENyxzWg0LTRemgTp5iZgj/QPXqgh4p3IWZ8YIPYQ53vSS6lBG2PnhKOWA==",
"dependencies": {
"@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11",
......@@ -5177,24 +5177,24 @@
"typed-reflector": "^1.0.9"
},
"peerDependencies": {
"koishi": "^4.2.1"
"koishi": "^4.4.1"
}
},
"node_modules/koishi-thirdeye": {
"version": "9.1.1",
"resolved": "https://registry.npmjs.org/koishi-thirdeye/-/koishi-thirdeye-9.1.1.tgz",
"integrity": "sha512-Oy5Y36Jq9ZnJJLRKmbEx0yFP7lqazBXMxjBLdfl5+5Oyx1JdiYWlPLVQ8ggbmLTKmDXZ87s3c5nfxAN/4iBA8A==",
"version": "9.2.4",
"resolved": "https://registry.npmjs.org/koishi-thirdeye/-/koishi-thirdeye-9.2.4.tgz",
"integrity": "sha512-maJkIivNEjDZaTDeOa2GSDxUX4pjie0zzjk7VxPnt/RONS9UHGUJ2A6CkcqYdz4CY6OKoWyhX0wzDnJkk/rUOg==",
"dependencies": {
"@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11",
"koishi-decorators": "^1.1.1",
"koishi-decorators": "^1.2.5",
"lodash": "^4.17.21",
"reflect-metadata": "^0.1.13",
"schemastery-gen": "^3.1.2",
"typed-reflector": "^1.0.9"
},
"peerDependencies": {
"koishi": "^4.4.0",
"koishi": "^4.4.1",
"schemastery": "^3.1.0"
}
},
......@@ -7532,9 +7532,9 @@
}
},
"node_modules/ws": {
"version": "8.4.2",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.4.2.tgz",
"integrity": "sha512-Kbk4Nxyq7/ZWqr/tarI9yIt/+iNNFOjBXEWgTb4ydaNHBNGgvf2QHbS9fdfsndfjFlFwEd4Al+mw83YkaD10ZA==",
"version": "8.5.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz",
"integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==",
"engines": {
"node": ">=10.0.0"
},
......@@ -8429,9 +8429,9 @@
}
},
"@koishijs/core": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.4.0.tgz",
"integrity": "sha512-MmKVlCx89M5icof92+U8U5QnywQ7dIjkGGUnzGlcBr59OrylHdRMKqZIIrtnqZo5EONehqh3k1Zbxr5V/6X5Eg==",
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.4.1.tgz",
"integrity": "sha512-nd/QAm9ejk4KQP8BjnyuDCxg4rpyq4fyYtTvFOuafj9G/vN6gHL11YLF5R7g2WimnN1S2sN1txB7WNx8dnGI1A==",
"peer": true,
"requires": {
"@koishijs/utils": "^5.2.0",
......@@ -8849,9 +8849,9 @@
"dev": true
},
"@types/ws": {
"version": "8.2.2",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.2.tgz",
"integrity": "sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg==",
"version": "8.5.2",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.2.tgz",
"integrity": "sha512-VXI82ykONr5tacHEojnErTQk+KQSoYbW1NB6iz6wUwrNd+BqfkfggQNoNdCqhJSzbNumShPERbM+Pc5zpfhlbw==",
"peer": true,
"requires": {
"@types/node": "*"
......@@ -11596,17 +11596,17 @@
}
},
"koishi": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.4.0.tgz",
"integrity": "sha512-ar4V0oBJ2by9gT0Hey3w/japL80ddtF2A48jP+UrPZ17Z3ha505lB79sQyPVyFdM78BY7wRkFw/qMc8eKZG3+g==",
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.4.1.tgz",
"integrity": "sha512-yTJlAwsbF7ecjqRGUX5l2LT8HROusAZj1UjzxEevXGWklRrzABWTifIXDEKd9H+oC5xq4hJQeXRCQCogiPe+SQ==",
"peer": true,
"requires": {
"@koa/router": "^10.1.1",
"@koishijs/core": "^4.4.0",
"@koishijs/core": "^4.4.1",
"@koishijs/utils": "^5.2.0",
"@types/koa": "*",
"@types/koa__router": "*",
"@types/ws": "^8.2.2",
"@types/ws": "^8.5.2",
"axios": "^0.24.0",
"file-type": "^16.5.3",
"koa": "^2.13.4",
......@@ -11614,13 +11614,13 @@
"parseurl": "^1.3.3",
"path-to-regexp": "^6.2.0",
"proxy-agent": "^5.0.0",
"ws": "^8.4.2"
"ws": "^8.5.0"
}
},
"koishi-decorators": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-1.1.1.tgz",
"integrity": "sha512-AaumjnVTT8N7jJ67w16blSez9z+Pi+duuJusheIq3Hmkvx+iRxkpp3w0IvlU69gHqdQRK3Z4qNNC+KrMPDORUg==",
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-1.2.5.tgz",
"integrity": "sha512-PYVXFNdSCbifr12L0JSiIZGQsax1cENyxzWg0LTRemgTp5iZgj/QPXqgh4p3IWZ8YIPYQ53vSS6lBG2PnhKOWA==",
"requires": {
"@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11",
......@@ -11630,13 +11630,13 @@
}
},
"koishi-thirdeye": {
"version": "9.1.1",
"resolved": "https://registry.npmjs.org/koishi-thirdeye/-/koishi-thirdeye-9.1.1.tgz",
"integrity": "sha512-Oy5Y36Jq9ZnJJLRKmbEx0yFP7lqazBXMxjBLdfl5+5Oyx1JdiYWlPLVQ8ggbmLTKmDXZ87s3c5nfxAN/4iBA8A==",
"version": "9.2.4",
"resolved": "https://registry.npmjs.org/koishi-thirdeye/-/koishi-thirdeye-9.2.4.tgz",
"integrity": "sha512-maJkIivNEjDZaTDeOa2GSDxUX4pjie0zzjk7VxPnt/RONS9UHGUJ2A6CkcqYdz4CY6OKoWyhX0wzDnJkk/rUOg==",
"requires": {
"@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11",
"koishi-decorators": "^1.1.1",
"koishi-decorators": "^1.2.5",
"lodash": "^4.17.21",
"reflect-metadata": "^0.1.13",
"schemastery-gen": "^3.1.2",
......@@ -13332,9 +13332,9 @@
}
},
"ws": {
"version": "8.4.2",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.4.2.tgz",
"integrity": "sha512-Kbk4Nxyq7/ZWqr/tarI9yIt/+iNNFOjBXEWgTb4ydaNHBNGgvf2QHbS9fdfsndfjFlFwEd4Al+mw83YkaD10ZA==",
"version": "8.5.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz",
"integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==",
"requires": {}
},
"xml-name-validator": {
......
{
"name": "koishi-plugin-tabulate",
"description": "YGOCore 战队联盟排表姬的 Koishi 插件",
"description": "YGOCore League tabulator.",
"version": "8.4.1",
"main": "dist/index.js",
"types": "dist/src/index.d.ts",
......@@ -32,7 +32,7 @@
"homepage": "https://code.mycard.moe/3rdeye/koishi-plugin-tabulate",
"dependencies": {
"class-transformer": "^0.5.1",
"koishi-thirdeye": "^9.1.1",
"koishi-thirdeye": "^9.2.4",
"league-tabulator": "^1.0.0",
"lodash": "^4.17.21",
"moment": "^2.29.1",
......@@ -64,7 +64,7 @@
"ws": "^8.3.0"
},
"peerDependencies": {
"koishi": "^4.4.0"
"koishi": "^4.4.1"
},
"jest": {
"moduleFileExtensions": [
......
......@@ -12,6 +12,7 @@ import {
PutSession,
PutOption,
PutArg,
CommandDescription,
} from 'koishi-thirdeye';
import { Game, ReportScoreResult } from 'league-tabulator';
import { classToPlain, plainToClass } from 'class-transformer';
......@@ -63,29 +64,48 @@ export default class TabulatePlugin implements OnApply {
}
@UseCommand('tabulate', '排表')
@CommandDescription({ en: 'Tabulate' })
@CommandUsage('创建一个新的比赛,并进行排表操作。')
@CommandExample(
'tabulate --kof --teama AA --teamb BB --playera "Nanahira,Momobako,Miko" --playerb "Yuzurisa,Senya,Maika" 进行一个 KOF 对局的排表',
)
async onTabulate(
@PutSession() session: Session,
@PutOption('location', '-p <location:string> 比赛地点,默认为群内。')
@PutOption('location', '-p <location:string> 比赛地点,默认为群内。', {
description: { en: 'Match location, defaults to current group.' },
})
location: string,
@PutOption('rule', '-r <rule:string> 比赛模式', { fallback: '2/3【KOF】' })
@PutOption('rule', '-r <rule:string> 比赛模式', {
fallback: '2/3【KOF】',
description: { en: 'Match rule.' },
})
rule: string,
@PutOption('kof', '--kof 使用 KOF 赛制')
@PutOption('kof', '--kof 使用 KOF 赛制', {
description: { en: 'Use KOF rule.' },
})
useKof: boolean,
@PutOption('head', '--head 使用 人头 赛制')
@PutOption('head', '--head 使用 人头 赛制', {
description: { en: 'Use single match rule.' },
})
useHead: boolean,
@PutOption('teama', '--teama <teama:string> A 队队名', { fallback: 'A' })
@PutOption('teama', '--teama <teama:string> A 队队名', {
fallback: 'A',
description: { en: 'Name for team A' },
})
teama: string,
@PutOption('teamb', '--teamb <teamb:string> B 队队名', { fallback: 'B' })
@PutOption('teamb', '--teamb <teamb:string> B 队队名', {
fallback: 'B',
description: { en: 'Name for team B' },
})
teamb: string,
@PutOption(
'playera',
'--playera <playera:string> A 队队员名称,逗号分隔',
{
fallback: 'a1,a2,a3',
description: {
en: 'Names for members of team A, separated by commas.',
},
},
)
playera: string,
......@@ -94,6 +114,9 @@ export default class TabulatePlugin implements OnApply {
'--playerb <playera:string> B 队队员名称,逗号分隔',
{
fallback: 'b1,b2,b3',
description: {
en: 'Names for members of team B, separated by commas.',
},
},
)
playerb: string,
......@@ -126,6 +149,7 @@ export default class TabulatePlugin implements OnApply {
}
@UseCommand('tabulate/score <self:integer> <oppo:integer>', '上报比分')
@CommandDescription({ en: 'Report score for tabulated game' })
@CommandUsage('进行比分的更新操作,并视情况进行下一轮或结束比赛。')
@CommandExample('score -n Nanahira 2 0 标记当局中 Nanahira 以 2:0 战胜对方。')
async updateScore(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment