mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-12-23 16:30:07 +08:00
feat: Reboot Api(未经测试)
This commit is contained in:
parent
25b39cb39a
commit
c2b4dd2afd
@ -54,10 +54,12 @@ import { GetGroupEssence } from './group/GetGroupEssence';
|
|||||||
import { ForwardFriendSingleMsg, ForwardGroupSingleMsg } from '@/onebot11/action/msg/ForwardSingleMsg';
|
import { ForwardFriendSingleMsg, ForwardGroupSingleMsg } from '@/onebot11/action/msg/ForwardSingleMsg';
|
||||||
import { GetFriendWithCategory } from './extends/GetFriendWithCategory';
|
import { GetFriendWithCategory } from './extends/GetFriendWithCategory';
|
||||||
import { SendGroupNotice } from './go-cqhttp/SendGroupNotice';
|
import { SendGroupNotice } from './go-cqhttp/SendGroupNotice';
|
||||||
|
import Reboot from './system/Reboot';
|
||||||
|
|
||||||
export const actionHandlers = [
|
export const actionHandlers = [
|
||||||
new GetFile(),
|
new GetFile(),
|
||||||
new Debug(),
|
new Debug(),
|
||||||
|
new Reboot(),
|
||||||
// new GetConfigAction(),
|
// new GetConfigAction(),
|
||||||
// new SetConfigAction(),
|
// new SetConfigAction(),
|
||||||
// new GetGroupAddRequest(),
|
// new GetGroupAddRequest(),
|
||||||
|
|||||||
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -27,6 +27,7 @@ export enum ActionName {
|
|||||||
ForwardFriendSingleMsg = 'forward_friend_single_msg',
|
ForwardFriendSingleMsg = 'forward_friend_single_msg',
|
||||||
ForwardGroupSingleMsg = 'forward_group_single_msg',
|
ForwardGroupSingleMsg = 'forward_group_single_msg',
|
||||||
// onebot 11
|
// onebot 11
|
||||||
|
Reboot = 'set_restart',
|
||||||
SendLike = 'send_like',
|
SendLike = 'send_like',
|
||||||
GetLoginInfo = 'get_login_info',
|
GetLoginInfo = 'get_login_info',
|
||||||
GetFriendList = 'get_friend_list',
|
GetFriendList = 'get_friend_list',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user