mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-12 07:50:25 +00:00
refactor: Action
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import BaseAction from '../BaseAction';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '../types';
|
||||
|
||||
interface ReturnType {
|
||||
yes: boolean;
|
||||
}
|
||||
|
||||
export default class CanSendRecord extends BaseAction<any, ReturnType> {
|
||||
export default class CanSendRecord extends OneBotAction<any, ReturnType> {
|
||||
actionName = ActionName.CanSendRecord;
|
||||
|
||||
async _handle(_payload: void): Promise<ReturnType> {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import BaseAction from '../BaseAction';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '../types';
|
||||
|
||||
export class GetCSRF extends BaseAction<any, any> {
|
||||
export class GetCSRF extends OneBotAction<any, any> {
|
||||
actionName = ActionName.GetCSRF;
|
||||
|
||||
async _handle(payload: any) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import BaseAction from '../BaseAction';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
|
||||
@@ -17,7 +17,7 @@ const SchemaData = {
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export class GetCredentials extends BaseAction<Payload, Response> {
|
||||
export class GetCredentials extends OneBotAction<Payload, Response> {
|
||||
actionName = ActionName.GetCredentials;
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { OB11User } from '@/onebot';
|
||||
import { OB11Entities } from '@/onebot/entities';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '../types';
|
||||
|
||||
class GetLoginInfo extends BaseAction<null, OB11User> {
|
||||
class GetLoginInfo extends OneBotAction<null, OB11User> {
|
||||
actionName = ActionName.GetLoginInfo;
|
||||
|
||||
async _handle(payload: null) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import BaseAction from '../BaseAction';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '../types';
|
||||
|
||||
export default class GetStatus extends BaseAction<any, any> {
|
||||
export default class GetStatus extends OneBotAction<any, any> {
|
||||
actionName = ActionName.GetStatus;
|
||||
|
||||
async _handle(payload: any): Promise<any> {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { GroupNotifyMsgStatus } from '@/core';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
|
||||
@@ -12,7 +12,7 @@ const SchemaData = {
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export class GetGroupSystemMsg extends BaseAction<void, any> {
|
||||
export class GetGroupSystemMsg extends OneBotAction<void, any> {
|
||||
actionName = ActionName.GetGroupSystemMsg;
|
||||
|
||||
async _handle(payload: void) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import BaseAction from '../BaseAction';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '../types';
|
||||
|
||||
import { napCatVersion } from '@/common/version';
|
||||
|
||||
export default class GetVersionInfo extends BaseAction<any, any> {
|
||||
export default class GetVersionInfo extends OneBotAction<any, any> {
|
||||
actionName = ActionName.GetVersionInfo;
|
||||
|
||||
async _handle(payload: any): Promise<any> {
|
||||
|
||||
Reference in New Issue
Block a user