diff --git a/package.json b/package.json index d7d4cfb..bc5546e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "siriusbot2", - "version": "3.5.0", + "version": "3.5.1", "description": "qqGroup bot for fun", "main": "index.js", "scripts": { diff --git a/plugins/dida-list/index.js b/plugins/dida-list/index.js index efee1b7..81ca9a6 100644 --- a/plugins/dida-list/index.js +++ b/plugins/dida-list/index.js @@ -45,7 +45,12 @@ function apply(hook) { if (e.args[arg] == "current") { time = getCurrentTimeStr(); } else { - time = e.args[arg]; + if (Number.isInteger(Number(e.args[arg])) && e.args[arg].length == 4) + time = e.args[arg]; + else { + e.data.reply(["设定的时间应为四位数字,如8:05应设置为0805"]); + break; + } } e.data.reply(await addDida(e.data.group_id, time, e.data, e.args["_"])); subCmd = true; diff --git a/plugins/dida-list/test.js b/plugins/dida-list/test.js deleted file mode 100644 index c90fb24..0000000 --- a/plugins/dida-list/test.js +++ /dev/null @@ -1,13 +0,0 @@ -let a = "aseinvi"; -let b = "asdwew vse 0210 asdf as" -console.log(getCurrentIdStr()) - - -function getCurrentIdStr() { - return (PrefixInteger(new Date().getFullYear(), 2) - + PrefixInteger(new Date().getMonth() + 1, 2) + PrefixInteger(new Date().getDate(), 2) - + PrefixInteger(new Date().getHours(), 2) + PrefixInteger(new Date().getMinutes(), 2)); - function PrefixInteger(num, m) { - return (Array(m).join(0) + num).slice(-m); - } -} \ No newline at end of file