koishi-plugin-esostatus
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -17,4 +17,5 @@ "use strict"; | ||
let status; | ||
var switcher; | ||
function apply(ctx, config) { | ||
setInterval(async () => { | ||
switcher = setInterval(async () => { | ||
const statusNow = await fetchServerStatus(); | ||
@@ -44,3 +45,4 @@ if (status != statusNow) { | ||
ctx.command('服务器状态') | ||
.action(async ({ session }) => { | ||
.action(async () => { | ||
console.info(switcher); | ||
console.info(status); | ||
@@ -65,2 +67,16 @@ const statusPic = await ctx.canvas.render(512, 50, (ctx) => { | ||
}); | ||
ctx.command('关闭服务器查询') | ||
.action(async ({ session }) => { | ||
if (config.管理id != session.userId) | ||
return '你没有权限'; | ||
console.info(switcher); | ||
if (switcher) { | ||
clearInterval(switcher); | ||
switcher = null; | ||
return '关闭成功'; | ||
} | ||
else { | ||
return '计时器未运行'; | ||
} | ||
}); | ||
} | ||
@@ -67,0 +83,0 @@ exports.apply = apply; |
{ | ||
"name": "koishi-plugin-esostatus", | ||
"description": "eso服务器状态查询", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "typings": "lib/index.d.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
423046
6820