Skip to content
This repository has been archived by the owner on Oct 12, 2024. It is now read-only.

Commit

Permalink
Interaction: Call initialize if a interaction has them implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
RealEthanPlayzDev committed Apr 25, 2024
1 parent 593f0dd commit c6adce9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/interactions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ export default class MeteoriumInteractionManager {
if (this.client.config.DontRegisterTestInteractions && Name.toLowerCase().startsWith("test")) continue;
regChatInputNS.verbose(`Registering -> ${Name} (${Command.interactionData.name})`);
this.chatInputInteractions.set(Name, Command);
if (Command.initialize) {
regChatInputNS.verbose(`Init -> ${Name} (${Command.interactionData.name})`);
Command.initialize(this.client);
}
}

return;
Expand All @@ -94,6 +98,10 @@ export default class MeteoriumInteractionManager {
`invalid context menu action type for ${Name} (expected User, got ${UserContextMenuAction.interactionData.type})`,
);
this.userContextMenuActionInteractions.set(Name, UserContextMenuAction);
if (UserContextMenuAction.initialize) {
regUserContextMenuActionNS.verbose(`Init -> ${Name} (${UserContextMenuAction.interactionData.name})`);
UserContextMenuAction.initialize(this.client);
}
}

return;
Expand All @@ -115,6 +123,12 @@ export default class MeteoriumInteractionManager {
`invalid context menu action type for ${Name} (expected Message, got ${MessageContextMenuAction.interactionData.type})`,
);
this.messageContextMenuActionInteractions.set(Name, MessageContextMenuAction);
if (MessageContextMenuAction.initialize) {
regMessageContextMenuActionNS.verbose(
`Init -> ${Name} (${MessageContextMenuAction.interactionData.name})`,
);
MessageContextMenuAction.initialize(this.client);
}
}

return;
Expand Down

0 comments on commit c6adce9

Please sign in to comment.