Commit 25b6d8e8 authored by nanahira's avatar nanahira

catchup and possibly locale updates

parent be185073
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
"version": "3.4.1", "version": "3.4.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"koishi-thirdeye": "^9.1.1", "koishi-thirdeye": "^9.2.4",
"source-map-support": "^0.5.21" "source-map-support": "^0.5.21"
}, },
"devDependencies": { "devDependencies": {
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
"ws": "^8.4.0" "ws": "^8.4.0"
}, },
"peerDependencies": { "peerDependencies": {
"koishi": "^4.4.0" "koishi": "^4.4.1"
} }
}, },
"node_modules/@ampproject/remapping": { "node_modules/@ampproject/remapping": {
...@@ -1058,9 +1058,9 @@ ...@@ -1058,9 +1058,9 @@
} }
}, },
"node_modules/@koishijs/core": { "node_modules/@koishijs/core": {
"version": "4.4.0", "version": "4.4.1",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.4.0.tgz", "resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.4.1.tgz",
"integrity": "sha512-MmKVlCx89M5icof92+U8U5QnywQ7dIjkGGUnzGlcBr59OrylHdRMKqZIIrtnqZo5EONehqh3k1Zbxr5V/6X5Eg==", "integrity": "sha512-nd/QAm9ejk4KQP8BjnyuDCxg4rpyq4fyYtTvFOuafj9G/vN6gHL11YLF5R7g2WimnN1S2sN1txB7WNx8dnGI1A==",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"@koishijs/utils": "^5.2.0", "@koishijs/utils": "^5.2.0",
...@@ -1532,9 +1532,9 @@ ...@@ -1532,9 +1532,9 @@
"dev": true "dev": true
}, },
"node_modules/@types/ws": { "node_modules/@types/ws": {
"version": "8.2.2", "version": "8.5.2",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.2.tgz", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.2.tgz",
"integrity": "sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg==", "integrity": "sha512-VXI82ykONr5tacHEojnErTQk+KQSoYbW1NB6iz6wUwrNd+BqfkfggQNoNdCqhJSzbNumShPERbM+Pc5zpfhlbw==",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"@types/node": "*" "@types/node": "*"
...@@ -5162,17 +5162,17 @@ ...@@ -5162,17 +5162,17 @@
} }
}, },
"node_modules/koishi": { "node_modules/koishi": {
"version": "4.4.0", "version": "4.4.1",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.4.0.tgz", "resolved": "https://registry.npmjs.org/koishi/-/koishi-4.4.1.tgz",
"integrity": "sha512-ar4V0oBJ2by9gT0Hey3w/japL80ddtF2A48jP+UrPZ17Z3ha505lB79sQyPVyFdM78BY7wRkFw/qMc8eKZG3+g==", "integrity": "sha512-yTJlAwsbF7ecjqRGUX5l2LT8HROusAZj1UjzxEevXGWklRrzABWTifIXDEKd9H+oC5xq4hJQeXRCQCogiPe+SQ==",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"@koa/router": "^10.1.1", "@koa/router": "^10.1.1",
"@koishijs/core": "^4.4.0", "@koishijs/core": "^4.4.1",
"@koishijs/utils": "^5.2.0", "@koishijs/utils": "^5.2.0",
"@types/koa": "*", "@types/koa": "*",
"@types/koa__router": "*", "@types/koa__router": "*",
"@types/ws": "^8.2.2", "@types/ws": "^8.5.2",
"axios": "^0.24.0", "axios": "^0.24.0",
"file-type": "^16.5.3", "file-type": "^16.5.3",
"koa": "^2.13.4", "koa": "^2.13.4",
...@@ -5180,16 +5180,16 @@ ...@@ -5180,16 +5180,16 @@
"parseurl": "^1.3.3", "parseurl": "^1.3.3",
"path-to-regexp": "^6.2.0", "path-to-regexp": "^6.2.0",
"proxy-agent": "^5.0.0", "proxy-agent": "^5.0.0",
"ws": "^8.4.2" "ws": "^8.5.0"
}, },
"engines": { "engines": {
"node": ">=12.0.0" "node": ">=12.0.0"
} }
}, },
"node_modules/koishi-decorators": { "node_modules/koishi-decorators": {
"version": "1.1.1", "version": "1.2.5",
"resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-1.1.1.tgz", "resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-1.2.5.tgz",
"integrity": "sha512-AaumjnVTT8N7jJ67w16blSez9z+Pi+duuJusheIq3Hmkvx+iRxkpp3w0IvlU69gHqdQRK3Z4qNNC+KrMPDORUg==", "integrity": "sha512-PYVXFNdSCbifr12L0JSiIZGQsax1cENyxzWg0LTRemgTp5iZgj/QPXqgh4p3IWZ8YIPYQ53vSS6lBG2PnhKOWA==",
"dependencies": { "dependencies": {
"@types/koa": "^2.13.4", "@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11", "@types/koa__router": "^8.0.11",
...@@ -5198,24 +5198,24 @@ ...@@ -5198,24 +5198,24 @@
"typed-reflector": "^1.0.9" "typed-reflector": "^1.0.9"
}, },
"peerDependencies": { "peerDependencies": {
"koishi": "^4.2.1" "koishi": "^4.4.1"
} }
}, },
"node_modules/koishi-thirdeye": { "node_modules/koishi-thirdeye": {
"version": "9.1.1", "version": "9.2.4",
"resolved": "https://registry.npmjs.org/koishi-thirdeye/-/koishi-thirdeye-9.1.1.tgz", "resolved": "https://registry.npmjs.org/koishi-thirdeye/-/koishi-thirdeye-9.2.4.tgz",
"integrity": "sha512-Oy5Y36Jq9ZnJJLRKmbEx0yFP7lqazBXMxjBLdfl5+5Oyx1JdiYWlPLVQ8ggbmLTKmDXZ87s3c5nfxAN/4iBA8A==", "integrity": "sha512-maJkIivNEjDZaTDeOa2GSDxUX4pjie0zzjk7VxPnt/RONS9UHGUJ2A6CkcqYdz4CY6OKoWyhX0wzDnJkk/rUOg==",
"dependencies": { "dependencies": {
"@types/koa": "^2.13.4", "@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11", "@types/koa__router": "^8.0.11",
"koishi-decorators": "^1.1.1", "koishi-decorators": "^1.2.5",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"schemastery-gen": "^3.1.2", "schemastery-gen": "^3.1.2",
"typed-reflector": "^1.0.9" "typed-reflector": "^1.0.9"
}, },
"peerDependencies": { "peerDependencies": {
"koishi": "^4.4.0", "koishi": "^4.4.1",
"schemastery": "^3.1.0" "schemastery": "^3.1.0"
} }
}, },
...@@ -7523,9 +7523,9 @@ ...@@ -7523,9 +7523,9 @@
} }
}, },
"node_modules/ws": { "node_modules/ws": {
"version": "8.4.2", "version": "8.5.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.4.2.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz",
"integrity": "sha512-Kbk4Nxyq7/ZWqr/tarI9yIt/+iNNFOjBXEWgTb4ydaNHBNGgvf2QHbS9fdfsndfjFlFwEd4Al+mw83YkaD10ZA==", "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==",
"engines": { "engines": {
"node": ">=10.0.0" "node": ">=10.0.0"
}, },
...@@ -8420,9 +8420,9 @@ ...@@ -8420,9 +8420,9 @@
} }
}, },
"@koishijs/core": { "@koishijs/core": {
"version": "4.4.0", "version": "4.4.1",
"resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.4.0.tgz", "resolved": "https://registry.npmjs.org/@koishijs/core/-/core-4.4.1.tgz",
"integrity": "sha512-MmKVlCx89M5icof92+U8U5QnywQ7dIjkGGUnzGlcBr59OrylHdRMKqZIIrtnqZo5EONehqh3k1Zbxr5V/6X5Eg==", "integrity": "sha512-nd/QAm9ejk4KQP8BjnyuDCxg4rpyq4fyYtTvFOuafj9G/vN6gHL11YLF5R7g2WimnN1S2sN1txB7WNx8dnGI1A==",
"peer": true, "peer": true,
"requires": { "requires": {
"@koishijs/utils": "^5.2.0", "@koishijs/utils": "^5.2.0",
...@@ -8858,9 +8858,9 @@ ...@@ -8858,9 +8858,9 @@
"dev": true "dev": true
}, },
"@types/ws": { "@types/ws": {
"version": "8.2.2", "version": "8.5.2",
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.2.tgz", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.2.tgz",
"integrity": "sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg==", "integrity": "sha512-VXI82ykONr5tacHEojnErTQk+KQSoYbW1NB6iz6wUwrNd+BqfkfggQNoNdCqhJSzbNumShPERbM+Pc5zpfhlbw==",
"peer": true, "peer": true,
"requires": { "requires": {
"@types/node": "*" "@types/node": "*"
...@@ -11606,17 +11606,17 @@ ...@@ -11606,17 +11606,17 @@
} }
}, },
"koishi": { "koishi": {
"version": "4.4.0", "version": "4.4.1",
"resolved": "https://registry.npmjs.org/koishi/-/koishi-4.4.0.tgz", "resolved": "https://registry.npmjs.org/koishi/-/koishi-4.4.1.tgz",
"integrity": "sha512-ar4V0oBJ2by9gT0Hey3w/japL80ddtF2A48jP+UrPZ17Z3ha505lB79sQyPVyFdM78BY7wRkFw/qMc8eKZG3+g==", "integrity": "sha512-yTJlAwsbF7ecjqRGUX5l2LT8HROusAZj1UjzxEevXGWklRrzABWTifIXDEKd9H+oC5xq4hJQeXRCQCogiPe+SQ==",
"peer": true, "peer": true,
"requires": { "requires": {
"@koa/router": "^10.1.1", "@koa/router": "^10.1.1",
"@koishijs/core": "^4.4.0", "@koishijs/core": "^4.4.1",
"@koishijs/utils": "^5.2.0", "@koishijs/utils": "^5.2.0",
"@types/koa": "*", "@types/koa": "*",
"@types/koa__router": "*", "@types/koa__router": "*",
"@types/ws": "^8.2.2", "@types/ws": "^8.5.2",
"axios": "^0.24.0", "axios": "^0.24.0",
"file-type": "^16.5.3", "file-type": "^16.5.3",
"koa": "^2.13.4", "koa": "^2.13.4",
...@@ -11624,13 +11624,13 @@ ...@@ -11624,13 +11624,13 @@
"parseurl": "^1.3.3", "parseurl": "^1.3.3",
"path-to-regexp": "^6.2.0", "path-to-regexp": "^6.2.0",
"proxy-agent": "^5.0.0", "proxy-agent": "^5.0.0",
"ws": "^8.4.2" "ws": "^8.5.0"
} }
}, },
"koishi-decorators": { "koishi-decorators": {
"version": "1.1.1", "version": "1.2.5",
"resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-1.1.1.tgz", "resolved": "https://registry.npmjs.org/koishi-decorators/-/koishi-decorators-1.2.5.tgz",
"integrity": "sha512-AaumjnVTT8N7jJ67w16blSez9z+Pi+duuJusheIq3Hmkvx+iRxkpp3w0IvlU69gHqdQRK3Z4qNNC+KrMPDORUg==", "integrity": "sha512-PYVXFNdSCbifr12L0JSiIZGQsax1cENyxzWg0LTRemgTp5iZgj/QPXqgh4p3IWZ8YIPYQ53vSS6lBG2PnhKOWA==",
"requires": { "requires": {
"@types/koa": "^2.13.4", "@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11", "@types/koa__router": "^8.0.11",
...@@ -11640,13 +11640,13 @@ ...@@ -11640,13 +11640,13 @@
} }
}, },
"koishi-thirdeye": { "koishi-thirdeye": {
"version": "9.1.1", "version": "9.2.4",
"resolved": "https://registry.npmjs.org/koishi-thirdeye/-/koishi-thirdeye-9.1.1.tgz", "resolved": "https://registry.npmjs.org/koishi-thirdeye/-/koishi-thirdeye-9.2.4.tgz",
"integrity": "sha512-Oy5Y36Jq9ZnJJLRKmbEx0yFP7lqazBXMxjBLdfl5+5Oyx1JdiYWlPLVQ8ggbmLTKmDXZ87s3c5nfxAN/4iBA8A==", "integrity": "sha512-maJkIivNEjDZaTDeOa2GSDxUX4pjie0zzjk7VxPnt/RONS9UHGUJ2A6CkcqYdz4CY6OKoWyhX0wzDnJkk/rUOg==",
"requires": { "requires": {
"@types/koa": "^2.13.4", "@types/koa": "^2.13.4",
"@types/koa__router": "^8.0.11", "@types/koa__router": "^8.0.11",
"koishi-decorators": "^1.1.1", "koishi-decorators": "^1.2.5",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"reflect-metadata": "^0.1.13", "reflect-metadata": "^0.1.13",
"schemastery-gen": "^3.1.2", "schemastery-gen": "^3.1.2",
...@@ -13309,9 +13309,9 @@ ...@@ -13309,9 +13309,9 @@
} }
}, },
"ws": { "ws": {
"version": "8.4.2", "version": "8.5.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.4.2.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz",
"integrity": "sha512-Kbk4Nxyq7/ZWqr/tarI9yIt/+iNNFOjBXEWgTb4ydaNHBNGgvf2QHbS9fdfsndfjFlFwEd4Al+mw83YkaD10ZA==", "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==",
"requires": {} "requires": {}
}, },
"xml-name-validator": { "xml-name-validator": {
......
{ {
"name": "koishi-plugin-dicex", "name": "koishi-plugin-dicex",
"description": "Koishi 骰娘插件 +1", "description": "Another Koishi dicebot.",
"version": "3.4.1", "version": "3.4.1",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/src/index.d.ts", "types": "dist/src/index.d.ts",
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
}, },
"homepage": "https://code.mycard.moe/3rdeye/koishi-plugin-dicex", "homepage": "https://code.mycard.moe/3rdeye/koishi-plugin-dicex",
"dependencies": { "dependencies": {
"koishi-thirdeye": "^9.1.1", "koishi-thirdeye": "^9.2.4",
"source-map-support": "^0.5.21" "source-map-support": "^0.5.21"
}, },
"devDependencies": { "devDependencies": {
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
"ws": "^8.4.0" "ws": "^8.4.0"
}, },
"peerDependencies": { "peerDependencies": {
"koishi": "^4.4.0" "koishi": "^4.4.1"
}, },
"jest": { "jest": {
"moduleFileExtensions": [ "moduleFileExtensions": [
......
import 'source-map-support/register'; import 'source-map-support/register';
import { DicePluginConfig } from './config'; import { DicePluginConfig } from './config';
import { DefinePlugin, OnApply, UseCommand } from 'koishi-thirdeye'; import {
CommandDescription,
DefinePlugin,
OnApply,
UseCommand,
} from 'koishi-thirdeye';
import { DbModule } from './modules/db'; import { DbModule } from './modules/db';
import { BaseModule } from './utility/base-module'; import { BaseModule } from './utility/base-module';
import { RollModule } from './modules/roll'; import { RollModule } from './modules/roll';
...@@ -20,7 +25,8 @@ declare module 'koishi' { ...@@ -20,7 +25,8 @@ declare module 'koishi' {
@DefinePlugin({ name: 'dicex', schema: DicePluginConfig }) @DefinePlugin({ name: 'dicex', schema: DicePluginConfig })
export default class DicePlugin extends BaseModule implements OnApply { export default class DicePlugin extends BaseModule implements OnApply {
@UseCommand('dice', '骰子指令', { empty: true }) @UseCommand('dice', { empty: true })
@CommandDescription({ zh: '骰子指令', en: 'Dice command' })
// eslint-disable-next-line @typescript-eslint/no-empty-function // eslint-disable-next-line @typescript-eslint/no-empty-function
diceCommand() {} diceCommand() {}
......
import { import {
CommandAlias, CommandAlias,
CommandDescription,
CommandExample, CommandExample,
CommandUsage, CommandUsage,
Inject, Inject,
...@@ -58,7 +59,8 @@ export class DbModule extends BaseModule implements OnApply { ...@@ -58,7 +59,8 @@ export class DbModule extends BaseModule implements OnApply {
return isGlobal ? '频道' : '用户'; return isGlobal ? '频道' : '用户';
} }
@UseCommand('dice/rcmode', '设置检点规则') @UseCommand('dice/rcmode')
@CommandDescription({ zh: '设置检点规则', en: 'Set RC rule' })
@CommandUsage( @CommandUsage(
`默认规则为0,规则序号如下:\n\n${RcRuleList.map( `默认规则为0,规则序号如下:\n\n${RcRuleList.map(
(rule, index) => `${index}\n${rule.text}\n`, (rule, index) => `${index}\n${rule.text}\n`,
...@@ -68,7 +70,10 @@ export class DbModule extends BaseModule implements OnApply { ...@@ -68,7 +70,10 @@ export class DbModule extends BaseModule implements OnApply {
setRcMode( setRcMode(
@PutUser(['diceRcMode']) user: User, @PutUser(['diceRcMode']) user: User,
@PutChannel(['diceRcMode']) channel: Channel, @PutChannel(['diceRcMode']) channel: Channel,
@PutOption('set', '-s <rule:integer> 设置规则') setRule: number, @PutOption('set', '-s <rule:integer> 设置规则', {
description: { en: 'Set rule' },
})
setRule: number,
@PutIsGlobal() isGlobal: boolean, @PutIsGlobal() isGlobal: boolean,
) { ) {
if (isGlobal && !channel) { if (isGlobal && !channel) {
...@@ -88,7 +93,8 @@ export class DbModule extends BaseModule implements OnApply { ...@@ -88,7 +93,8 @@ export class DbModule extends BaseModule implements OnApply {
)}的检点规则为 ${setRule} 。`; )}的检点规则为 ${setRule} 。`;
} }
@UseCommand('dice/faces [faces:number]', '设置默认面数') @UseCommand('dice/faces [faces:number]')
@CommandDescription({ zh: '设置默认面数', en: 'Set default face count' })
@CommandAlias('set') @CommandAlias('set')
@CommandUsage('默认面数为 6 。') @CommandUsage('默认面数为 6 。')
@CommandExample('faces -s 10 设置当前频道的默认面数为10。') @CommandExample('faces -s 10 设置当前频道的默认面数为10。')
...@@ -96,7 +102,10 @@ export class DbModule extends BaseModule implements OnApply { ...@@ -96,7 +102,10 @@ export class DbModule extends BaseModule implements OnApply {
@PutUser(['diceDefaultRollFaces']) user: User, @PutUser(['diceDefaultRollFaces']) user: User,
@PutChannel(['diceDefaultRollFaces']) channel: Channel, @PutChannel(['diceDefaultRollFaces']) channel: Channel,
@PutArg(0) setFaceInArg: number, @PutArg(0) setFaceInArg: number,
@PutOption('set', '-s <rule:integer> 设置面数') setFaceInOpt: number, @PutOption('set', '-s <rule:integer> 设置面数', {
description: { en: 'Set face count' },
})
setFaceInOpt: number,
@PutIsGlobal() isGlobal: boolean, @PutIsGlobal() isGlobal: boolean,
) { ) {
if (isGlobal && !channel) { if (isGlobal && !channel) {
......
import { import {
CommandAlias, CommandAlias,
CommandDescription,
CommandExample, CommandExample,
CommandShortcut, CommandShortcut,
PutArg, PutArg,
...@@ -20,7 +21,8 @@ export class RcModule extends BaseModule { ...@@ -20,7 +21,8 @@ export class RcModule extends BaseModule {
return RcRuleList[index]; return RcRuleList[index];
} }
@UseCommand('dice/rc <rate:integer> [reason:string]', '检定') @UseCommand('dice/rc <rate:integer> [reason:string]')
@CommandDescription({ zh: '检定', en: 'Roll check' })
@CommandAlias('ra') @CommandAlias('ra')
@CommandShortcut('检定', { fuzzy: true }) @CommandShortcut('检定', { fuzzy: true })
@CommandExample('rc 20 潜行') @CommandExample('rc 20 潜行')
......
import { import {
CommandAlias, CommandAlias,
CommandDescription,
CommandExample, CommandExample,
CommandShortcut, CommandShortcut,
PutArg, PutArg,
...@@ -18,6 +19,7 @@ export class RollModule extends BaseModule { ...@@ -18,6 +19,7 @@ export class RollModule extends BaseModule {
private getDefaultFaces(user: User, channel: Channel) {} private getDefaultFaces(user: User, channel: Channel) {}
@UseCommand('dice/roll [expr:string]', '掷骰') @UseCommand('dice/roll [expr:string]', '掷骰')
@CommandDescription({ en: 'Roll dice' })
@CommandAlias('rd') @CommandAlias('rd')
@CommandShortcut('掷骰', { fuzzy: true }) @CommandShortcut('掷骰', { fuzzy: true })
@CommandExample('roll 2d6+d10') @CommandExample('roll 2d6+d10')
......
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