feat(events): Adds AcknowledgableEvent
This commit is contained in:
parent
6d7a0e7cfb
commit
b82ab7dbc4
18 changed files with 228 additions and 77 deletions
5
source/Events/EventClasses/CleanEvent.ts
Normal file
5
source/Events/EventClasses/CleanEvent.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import {EventType, NormalEvent} from "../EventHandler.types";
|
||||
|
||||
export class CleanEvent implements NormalEvent {
|
||||
type: EventType.Normal = EventType.Normal;
|
||||
}
|
||||
21
source/Events/EventClasses/ComponentInteractionEvent.ts
Normal file
21
source/Events/EventClasses/ComponentInteractionEvent.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import {AnySelectMenuInteraction, ButtonInteraction, InteractionCallbackResponse} from "discord.js";
|
||||
import {EventType, NormalEvent} from "../EventHandler.types";
|
||||
import {AcknowledgableEvent} from "../AcknowledgableEvent";
|
||||
|
||||
export class ComponentInteractionEvent extends AcknowledgableEvent {
|
||||
|
||||
constructor(
|
||||
public readonly interaction: AnySelectMenuInteraction | ButtonInteraction
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
public handleUnacknowledgement() {
|
||||
this.interaction.update({
|
||||
content: ":x: Interaction not longer available. Please restart the process.",
|
||||
embeds: [],
|
||||
components: []
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
13
source/Events/EventClasses/ElementCreatedEvent.ts
Normal file
13
source/Events/EventClasses/ElementCreatedEvent.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import {Model} from "../../Models/Model";
|
||||
import {EventType, NormalEvent} from "../EventHandler.types";
|
||||
|
||||
export class ElementCreatedEvent<T extends Model = Model> implements NormalEvent {
|
||||
constructor(
|
||||
public readonly tableName: string,
|
||||
public readonly instanceValues: Partial<T>,
|
||||
public readonly instanceId: number | bigint
|
||||
) {
|
||||
}
|
||||
|
||||
type: EventType.Normal = EventType.Normal;
|
||||
}
|
||||
14
source/Events/EventClasses/ModalInteractionEvent.ts
Normal file
14
source/Events/EventClasses/ModalInteractionEvent.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import {ModalSubmitInteraction} from "discord.js";
|
||||
import {EventType, NormalEvent} from "../EventHandler.types";
|
||||
|
||||
export class ModalInteractionEvent implements NormalEvent {
|
||||
|
||||
type: EventType.Normal = EventType.Normal;
|
||||
|
||||
constructor(
|
||||
public readonly interaction: ModalSubmitInteraction
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue