koishi-plugin-teach
Advanced tools
Comparing version 1.0.0-beta.10 to 1.0.0-beta.11
@@ -34,3 +34,3 @@ "use strict"; | ||
return; | ||
const now = Date.now(), includeTime = koishi_utils_1.parseTime(includeLast), excludeTime = koishi_utils_1.parseTime(excludeLast); | ||
const now = Date.now(), includeTime = koishi_utils_1.Time.parseTime(includeLast), excludeTime = koishi_utils_1.Time.parseTime(excludeLast); | ||
const dialogues = Object.values(utils_1.Dialogue.history).filter((dialogue) => { | ||
@@ -63,3 +63,3 @@ if (dialogue._operator !== session.userId) | ||
if (_type) { | ||
output.unshift(`${_type}-${formatTimeShort(Date.now() - _timestamp)}`); | ||
output.unshift(`${_type}-${koishi_utils_1.Time.formatTimeShort(Date.now() - _timestamp)}`); | ||
} | ||
@@ -76,3 +76,3 @@ }); | ||
if (_type) { | ||
output.push(`最后一次${_type}于:${koishi_utils_1.formatTime(Date.now() - _timestamp)}前`); | ||
output.push(`最后一次${_type}于:${koishi_utils_1.Time.formatTime(Date.now() - _timestamp)}前`); | ||
} | ||
@@ -84,20 +84,4 @@ }); | ||
const n = +value; | ||
return n * 0 === 0 ? !koishi_utils_1.isInteger(n) || n <= 0 : !koishi_utils_1.parseTime(value); | ||
return n * 0 === 0 ? !koishi_utils_1.isInteger(n) || n <= 0 : !koishi_utils_1.Time.parseTime(value); | ||
} | ||
const second = 1000; | ||
const minute = second * 60; | ||
function formatTimeShort(ms) { | ||
let result; | ||
if (ms >= minute - second / 2) { | ||
ms += second / 2; | ||
result = Math.floor(ms / minute) + 'm'; | ||
if (ms % minute > second) { | ||
result += Math.floor(ms % minute / second) + 's'; | ||
} | ||
} | ||
else { | ||
result = Math.round(ms / second) + 's'; | ||
} | ||
return result; | ||
} | ||
function review(dialogues, argv) { | ||
@@ -104,0 +88,0 @@ const { session } = argv; |
{ | ||
"name": "koishi-plugin-teach", | ||
"description": "Teach plugin for Koishi", | ||
"version": "1.0.0-beta.10", | ||
"version": "1.0.0-beta.11", | ||
"main": "dist/index.js", | ||
@@ -43,8 +43,8 @@ "typings": "dist/index.d.ts", | ||
"koishi-plugin-mysql": "^2.0.0-beta.5", | ||
"koishi-test-utils": "^4.0.0-beta.3" | ||
"koishi-test-utils": "^4.0.0-beta.4" | ||
}, | ||
"dependencies": { | ||
"escape-string-regexp": "^4.0.0", | ||
"koishi-core": "^2.0.0-beta.10", | ||
"koishi-utils": "^2.2.0", | ||
"koishi-core": "^2.0.0-beta.11", | ||
"koishi-utils": "^3.0.0", | ||
"leven": "^3.1.0", | ||
@@ -51,0 +51,0 @@ "regexpp": "^3.1.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
202011
2658
- Removedkoishi-utils@2.2.0(transitive)
- Removedsupports-color@7.2.0(transitive)
Updatedkoishi-core@^2.0.0-beta.11
Updatedkoishi-utils@^3.0.0