mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-06 21:10:23 +00:00
refactor: Action
This commit is contained in:
@@ -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';
|
||||
import { MessageUnique } from '@/common/message-unique';
|
||||
@@ -13,7 +13,7 @@ const SchemaData = {
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export default class DelEssenceMsg extends BaseAction<Payload, any> {
|
||||
export default class DelEssenceMsg extends OneBotAction<Payload, any> {
|
||||
actionName = ActionName.DelEssenceMsg;
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -14,7 +14,7 @@ const SchemaData = {
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export class DelGroupNotice extends BaseAction<Payload, any> {
|
||||
export class DelGroupNotice extends OneBotAction<Payload, any> {
|
||||
actionName = ActionName.DelGroupNotice;
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ChatType, Peer } from '@/core';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { MessageUnique } from '@/common/message-unique';
|
||||
@@ -16,7 +16,7 @@ const SchemaData = {
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export class GetGroupEssence extends BaseAction<Payload, any> {
|
||||
export class GetGroupEssence extends OneBotAction<Payload, any> {
|
||||
actionName = ActionName.GoCQHTTP_GetEssenceMsg;
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
|
||||
@@ -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 GetGroupIgnoredNotifies extends BaseAction<void, any> {
|
||||
export class GetGroupIgnoredNotifies extends OneBotAction<void, any> {
|
||||
actionName = ActionName.GetGroupIgnoredNotifies;
|
||||
|
||||
async _handle(payload: void) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { OB11Group } from '@/onebot';
|
||||
import { OB11Entities } from '@/onebot/entities';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
|
||||
@@ -14,7 +14,7 @@ const SchemaData = {
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
class GetGroupInfo extends BaseAction<Payload, OB11Group> {
|
||||
class GetGroupInfo extends OneBotAction<Payload, OB11Group> {
|
||||
actionName = ActionName.GetGroupInfo;
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { OB11Group } from '@/onebot';
|
||||
import { OB11Entities } from '@/onebot/entities';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
// no_cache get时传字符串
|
||||
@@ -13,7 +13,7 @@ const SchemaData = {
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
class GetGroupList extends BaseAction<Payload, OB11Group[]> {
|
||||
class GetGroupList extends OneBotAction<Payload, OB11Group[]> {
|
||||
actionName = ActionName.GetGroupList;
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { OB11GroupMember } from '@/onebot';
|
||||
import { OB11Entities } from '@/onebot/entities';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
|
||||
@@ -16,7 +16,7 @@ const SchemaData = {
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
class GetGroupMemberInfo extends BaseAction<Payload, OB11GroupMember> {
|
||||
class GetGroupMemberInfo extends OneBotAction<Payload, OB11GroupMember> {
|
||||
actionName = ActionName.GetGroupMemberInfo;
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { OB11GroupMember } from '@/onebot';
|
||||
import { OB11Entities } from '@/onebot/entities';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
|
||||
@@ -15,7 +15,7 @@ const SchemaData = {
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export class GetGroupMemberList extends BaseAction<Payload, OB11GroupMember[]> {
|
||||
export class GetGroupMemberList extends OneBotAction<Payload, OB11GroupMember[]> {
|
||||
actionName = ActionName.GetGroupMemberList;
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { WebApiGroupNoticeFeed } from '@/core';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
|
||||
@@ -29,7 +29,7 @@ type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
type ApiGroupNotice = GroupNotice & WebApiGroupNoticeFeed;
|
||||
|
||||
export class GetGroupNotice extends BaseAction<Payload, GroupNotice[]> {
|
||||
export class GetGroupNotice extends OneBotAction<Payload, GroupNotice[]> {
|
||||
actionName = ActionName.GoCQHTTP_GetGroupNotice;
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -12,7 +12,7 @@ const SchemaData = {
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export class GetGroupShutList extends BaseAction<Payload, any> {
|
||||
export class GetGroupShutList extends OneBotAction<Payload, any> {
|
||||
actionName = ActionName.GetGroupShutList;
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
|
||||
@@ -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';
|
||||
import { MessageUnique } from '@/common/message-unique';
|
||||
@@ -13,7 +13,7 @@ const SchemaData = {
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export default class SetEssenceMsg extends BaseAction<Payload, any> {
|
||||
export default class SetEssenceMsg extends OneBotAction<Payload, any> {
|
||||
actionName = ActionName.SetEssenceMsg;
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import BaseAction from '../BaseAction';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { GroupRequestOperateTypes } from '@/core/entities';
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
@@ -15,7 +15,7 @@ const SchemaData = {
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export default class SetGroupAddRequest extends BaseAction<Payload, null> {
|
||||
export default class SetGroupAddRequest extends OneBotAction<Payload, null> {
|
||||
actionName = ActionName.SetGroupAddRequest;
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import BaseAction from '../BaseAction';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { GroupMemberRole } from '@/core/entities';
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
@@ -15,7 +15,7 @@ const SchemaData = {
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export default class SetGroupAdmin extends BaseAction<Payload, null> {
|
||||
export default class SetGroupAdmin extends OneBotAction<Payload, null> {
|
||||
actionName = ActionName.SetGroupAdmin;
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -14,7 +14,7 @@ const SchemaData = {
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export default class SetGroupBan extends BaseAction<Payload, null> {
|
||||
export default class SetGroupBan extends OneBotAction<Payload, null> {
|
||||
actionName = ActionName.SetGroupBan;
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -14,7 +14,7 @@ const SchemaData = {
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export default class SetGroupCard extends BaseAction<Payload, null> {
|
||||
export default class SetGroupCard extends OneBotAction<Payload, null> {
|
||||
actionName = ActionName.SetGroupCard;
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -15,7 +15,7 @@ const SchemaData = {
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export default class SetGroupKick extends BaseAction<Payload, null> {
|
||||
export default class SetGroupKick extends OneBotAction<Payload, null> {
|
||||
actionName = ActionName.SetGroupKick;
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -12,7 +12,7 @@ const SchemaData = {
|
||||
} as const satisfies JSONSchema;
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
export default class SetGroupLeave extends BaseAction<Payload, any> {
|
||||
export default class SetGroupLeave extends OneBotAction<Payload, any> {
|
||||
actionName = ActionName.SetGroupLeave;
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '../types';
|
||||
|
||||
const SchemaData = {
|
||||
@@ -12,7 +12,7 @@ const SchemaData = {
|
||||
} as const satisfies JSONSchema;
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
export default class SetGroupName extends BaseAction<Payload, null> {
|
||||
export default class SetGroupName extends OneBotAction<Payload, null> {
|
||||
actionName = ActionName.SetGroupName;
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { OneBotAction } from '@/onebot/action/OneBotAction';
|
||||
import { ActionName } from '../types';
|
||||
|
||||
const SchemaData = {
|
||||
@@ -13,7 +13,7 @@ const SchemaData = {
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export default class SetGroupWholeBan extends BaseAction<Payload, null> {
|
||||
export default class SetGroupWholeBan extends OneBotAction<Payload, null> {
|
||||
actionName = ActionName.SetGroupWholeBan;
|
||||
payloadSchema = SchemaData;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user