mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
fix: #797
This commit is contained in:
10
src/onebot/action/extends/BotExit.ts
Normal file
10
src/onebot/action/extends/BotExit.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import { ActionName } from '@/onebot/action/router';
|
||||||
|
import { OneBotAction } from '../OneBotAction';
|
||||||
|
|
||||||
|
export class BotExit extends OneBotAction<void, void> {
|
||||||
|
override actionName = ActionName.Exit;
|
||||||
|
|
||||||
|
async _handle() {
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
}
|
@@ -104,6 +104,7 @@ import { GetClientkey } from './extends/GetClientkey';
|
|||||||
import { SendPacket } from './extends/SendPacket';
|
import { SendPacket } from './extends/SendPacket';
|
||||||
import { SendPoke } from '@/onebot/action/packet/SendPoke';
|
import { SendPoke } from '@/onebot/action/packet/SendPoke';
|
||||||
import { SetDiyOnlineStatus } from './extends/SetDiyOnlineStatus';
|
import { SetDiyOnlineStatus } from './extends/SetDiyOnlineStatus';
|
||||||
|
import { BotExit } from './extends/BotExit';
|
||||||
|
|
||||||
export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCore) {
|
export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCore) {
|
||||||
|
|
||||||
@@ -221,6 +222,7 @@ export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCo
|
|||||||
new SendPacket(obContext, core),
|
new SendPacket(obContext, core),
|
||||||
new SendPoke(obContext, core),
|
new SendPoke(obContext, core),
|
||||||
new GetGroupSystemMsg(obContext, core),
|
new GetGroupSystemMsg(obContext, core),
|
||||||
|
new BotExit(obContext, core),
|
||||||
];
|
];
|
||||||
|
|
||||||
type HandlerUnion = typeof actionHandlers[number];
|
type HandlerUnion = typeof actionHandlers[number];
|
||||||
|
@@ -49,7 +49,7 @@ export const ActionName = {
|
|||||||
GetVersionInfo: 'get_version_info',
|
GetVersionInfo: 'get_version_info',
|
||||||
// Reboot : 'set_restart',
|
// Reboot : 'set_restart',
|
||||||
// CleanCache : 'clean_cache',
|
// CleanCache : 'clean_cache',
|
||||||
|
Exit: 'bot_exit',
|
||||||
// go-cqhttp
|
// go-cqhttp
|
||||||
SetQQProfile: 'set_qq_profile',
|
SetQQProfile: 'set_qq_profile',
|
||||||
// QidianGetAccountInfo : 'qidian_get_account_info',
|
// QidianGetAccountInfo : 'qidian_get_account_info',
|
||||||
|
Reference in New Issue
Block a user