mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-12 16:00:27 +00:00
feat: Reboot Api(未经测试)
This commit is contained in:
23
src/onebot11/action/system/Reboot.ts
Normal file
23
src/onebot11/action/system/Reboot.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { rebootWithQuickLogin } from '@/common/utils/reboot';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { selfInfo } from '@/core/data';
|
||||
|
||||
interface Payload {
|
||||
delay: number
|
||||
}
|
||||
|
||||
export default class Reboot extends BaseAction<Payload, null> {
|
||||
actionName = ActionName.Reboot;
|
||||
|
||||
protected async _handle(payload: Payload): Promise<null> {
|
||||
if (payload.delay) {
|
||||
setTimeout(() => {
|
||||
rebootWithQuickLogin(selfInfo.uin);
|
||||
}, payload.delay);
|
||||
} else {
|
||||
rebootWithQuickLogin(selfInfo.uin);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user