Skip to content

Commit

Permalink
refactor: rename OB11BaseEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
MliKiowa committed Nov 19, 2024
1 parent 9ffaab1 commit 12cb500
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/onebot/api/msg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
import faceConfig from '@/core/external/face_config.json';
import { NapCatOneBot11Adapter, OB11Message, OB11MessageData, OB11MessageDataType, OB11MessageFileBase, } from '@/onebot';
import { OB11Entities } from '@/onebot/entities';
import { EventType } from '@/onebot/event/OB11BaseEvent';
import { EventType } from '@/onebot/event/OneBotEvent';
import { encodeCQCode } from '@/onebot/cqcode';
import { uri2local } from '@/common/file';
import { RequestUtil } from '@/common/request';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export enum EventType {
MESSAGE_SENT = 'message_sent',
}

export abstract class OB11BaseEvent {
export abstract class OneBotEvent {
time = Math.floor(Date.now() / 1000);
self_id: number;
abstract post_type: EventType;
Expand Down
4 changes: 2 additions & 2 deletions src/onebot/event/message/OB11BaseMessageEvent.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EventType, OB11BaseEvent } from '../OB11BaseEvent';
import { EventType, OneBotEvent } from '../OneBotEvent';

export abstract class OB11BaseMessageEvent extends OB11BaseEvent {
export abstract class OB11BaseMessageEvent extends OneBotEvent {
post_type = EventType.MESSAGE;
}
4 changes: 2 additions & 2 deletions src/onebot/event/meta/OB11BaseMetaEvent.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EventType, OB11BaseEvent } from '../OB11BaseEvent';
import { EventType, OneBotEvent } from '@/onebot/event/OneBotEvent';

export abstract class OB11BaseMetaEvent extends OB11BaseEvent {
export abstract class OB11BaseMetaEvent extends OneBotEvent {
post_type = EventType.META;
abstract meta_event_type: string;
}
4 changes: 2 additions & 2 deletions src/onebot/event/notice/OB11BaseNoticeEvent.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EventType, OB11BaseEvent } from '../OB11BaseEvent';
import { EventType, OneBotEvent } from '@/onebot/event/OneBotEvent';

export abstract class OB11BaseNoticeEvent extends OB11BaseEvent {
export abstract class OB11BaseNoticeEvent extends OneBotEvent {
post_type = EventType.NOTICE;
}
2 changes: 1 addition & 1 deletion src/onebot/event/request/OB11FriendRequest.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OB11BaseNoticeEvent } from '../notice/OB11BaseNoticeEvent';
import { EventType } from '../OB11BaseEvent';
import { EventType } from '../OneBotEvent';
import { NapCatCore } from '@/core';

export class OB11FriendRequestEvent extends OB11BaseNoticeEvent {
Expand Down
2 changes: 1 addition & 1 deletion src/onebot/event/request/OB11GroupRequest.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OB11GroupNoticeEvent } from '../notice/OB11GroupNoticeEvent';
import { EventType } from '../OB11BaseEvent';
import { EventType } from '../OneBotEvent';
import { NapCatCore } from '@/core';

export class OB11GroupRequestEvent extends OB11GroupNoticeEvent {
Expand Down
6 changes: 3 additions & 3 deletions src/onebot/network/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { OB11BaseEvent } from '@/onebot/event/OB11BaseEvent';
import { OneBotEvent } from '@/onebot/event/OneBotEvent';
import { OB11Message } from '@/onebot';
import { ActionMap } from '@/onebot/action';
import { NetworkConfigAdapter } from '../config/config';

export type OB11EmitEventContent = OB11BaseEvent | OB11Message;
export type OB11EmitEventContent = OneBotEvent | OB11Message;
export enum OB11NetworkReloadType {
Normal = 0,
ConfigChange = 1,
Expand All @@ -16,7 +16,7 @@ export interface IOB11NetworkAdapter {
name: string;
isEnable: boolean;
config: NetworkConfigAdapter;

onEvent<T extends OB11EmitEventContent>(event: T): void;

open(): void | Promise<void>;
Expand Down
2 changes: 1 addition & 1 deletion src/onebot/types/message.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OB11Sender } from './entity';
import { EventType } from '@/onebot/event/OB11BaseEvent';
import { EventType } from '@/onebot/event/OneBotEvent';
import { CustomMusicSignPostData, IdMusicSignPostData, PicSubType, RawMessage } from '@/core';

export enum OB11MessageType {
Expand Down

0 comments on commit 12cb500

Please sign in to comment.