mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-01-18 06:20:29 +00:00
feat: api Extend RebootNormol
This commit is contained in:
parent
58291b7156
commit
1c965ef515
@ -54,9 +54,10 @@ 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';
|
import { Reboot, RebootNormol } from './system/Reboot';
|
||||||
|
|
||||||
export const actionHandlers = [
|
export const actionHandlers = [
|
||||||
|
new RebootNormol(),
|
||||||
new GetFile(),
|
new GetFile(),
|
||||||
new Debug(),
|
new Debug(),
|
||||||
new Reboot(),
|
new Reboot(),
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { rebootWithQuickLogin } from '@/common/utils/reboot';
|
import { rebootWithNormolLogin, rebootWithQuickLogin } from '@/common/utils/reboot';
|
||||||
import BaseAction from '../BaseAction';
|
import BaseAction from '../BaseAction';
|
||||||
import { ActionName } from '../types';
|
import { ActionName } from '../types';
|
||||||
import { selfInfo } from '@/core/data';
|
import { selfInfo } from '@/core/data';
|
||||||
@ -7,7 +7,7 @@ interface Payload {
|
|||||||
delay: number
|
delay: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class Reboot extends BaseAction<Payload, null> {
|
export class Reboot extends BaseAction<Payload, null> {
|
||||||
actionName = ActionName.Reboot;
|
actionName = ActionName.Reboot;
|
||||||
|
|
||||||
protected async _handle(payload: Payload): Promise<null> {
|
protected async _handle(payload: Payload): Promise<null> {
|
||||||
@ -21,3 +21,17 @@ export default class Reboot extends BaseAction<Payload, null> {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
export class RebootNormol extends BaseAction<Payload, null> {
|
||||||
|
actionName = ActionName.Reboot;
|
||||||
|
|
||||||
|
protected async _handle(payload: Payload): Promise<null> {
|
||||||
|
if (payload.delay) {
|
||||||
|
setTimeout(() => {
|
||||||
|
rebootWithNormolLogin();
|
||||||
|
}, payload.delay);
|
||||||
|
} else {
|
||||||
|
rebootWithNormolLogin();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -15,6 +15,7 @@ export interface InvalidCheckResult {
|
|||||||
|
|
||||||
export enum ActionName {
|
export enum ActionName {
|
||||||
// 以下为扩展napcat扩展
|
// 以下为扩展napcat扩展
|
||||||
|
RebootNormol = 'reboot_normol',//无快速登录重新启动
|
||||||
GetRobotUinRange = 'get_robot_uin_range',
|
GetRobotUinRange = 'get_robot_uin_range',
|
||||||
SetOnlineStatus = 'set_online_status',
|
SetOnlineStatus = 'set_online_status',
|
||||||
GetFriendsWithCategory = 'get_friends_with_category',
|
GetFriendsWithCategory = 'get_friends_with_category',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user