Skip to content

Commit 1367ace

Browse files
committed
Unified event types
1 parent 7a19620 commit 1367ace

File tree

1 file changed

+8
-38
lines changed

1 file changed

+8
-38
lines changed

types/index.d.ts

Lines changed: 8 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,44 +8,14 @@ export interface LocationEvent {
88
lobby: null | number;
99
}
1010

11-
export interface GuildChatEvent {
12-
UUID: string;
13-
username: string;
14-
message: string;
15-
timestamp: number;
16-
}
17-
18-
export interface GuildOfficerChatEvent {
19-
UUID: string;
20-
username: string;
21-
message: string;
22-
timestamp: number;
23-
}
24-
25-
export interface GuildJoinEvent {
26-
UUID: string;
27-
username: string;
28-
timestamp: number;
29-
}
30-
31-
export interface GuildLeaveEvent {
11+
export interface PlayerEvent {
3212
UUID: string;
3313
username: string;
3414
timestamp: number;
3515
}
3616

37-
export interface SkyblockCoopChatEvent {
38-
UUID: string;
39-
username: string;
17+
export interface ChatEvent extends PlayerEvent {
4018
message: string;
41-
timestamp: number;
42-
}
43-
44-
export interface PrivateChatEvent {
45-
UUID: string;
46-
username: string;
47-
message: string;
48-
timestamp: number;
4919
}
5020

5121
export interface Bot extends MineflayerBot {
@@ -65,10 +35,10 @@ export interface BotEvents extends MineflayerBotEvents {
6535
"chat:hypixel_skyblock_coop_chat": (msg: string) => void;
6636
"chat:hypixel_private_chat": (msg: string) => void;
6737
HYFLAYER_LOCATION: (event: LocationEvent) => void;
68-
HYFLAYER_GUILD_CHAT: (event: GuildChatEvent) => void;
69-
HYFLAYER_GUILD_OFFICER_CHAT: (event: GuildOfficerChatEvent) => void;
70-
HYFLAYER_GUILD_JOIN: (event: GuildJoinEvent) => void;
71-
HYFLAYER_GUILD_LEAVE: (event: GuildLeaveEvent) => void;
72-
HYFLAYER_SKYBLOCK_COOP_CHAT: (event: SkyblockCoopChatEvent) => void;
73-
HYFLAYER_PRIVATE_CHAT: (event: PrivateChatEvent) => void;
38+
HYFLAYER_GUILD_CHAT: (event: ChatEvent) => void;
39+
HYFLAYER_GUILD_OFFICER_CHAT: (event: ChatEvent) => void;
40+
HYFLAYER_GUILD_JOIN: (event: PlayerEvent) => void;
41+
HYFLAYER_GUILD_LEAVE: (event: PlayerEvent) => void;
42+
HYFLAYER_SKYBLOCK_COOP_CHAT: (event: ChatEvent) => void;
43+
HYFLAYER_PRIVATE_CHAT: (event: ChatEvent) => void;
7444
}

0 commit comments

Comments
 (0)