From 2d4dae6eb093f7ce1e20bae467ab3d8ba1b6dcc0 Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 22 Aug 2024 16:34:31 -0400 Subject: [PATCH] refactor: update Event class handle method signature Updated the `handle` method signature in the `Event` class to return `void` or `Promise`. It ensures that the method can handle asynchronous operations and return the correct types for Discord interactions --- src/structures/Event.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/structures/Event.ts b/src/structures/Event.ts index 7f35a7d..ce28cbe 100644 --- a/src/structures/Event.ts +++ b/src/structures/Event.ts @@ -1,3 +1,5 @@ +import type { InteractionResponse, Message } from 'discord.js'; + /** * @class Event * @description This class represents an event in the application based on Discord bot client events. @@ -34,7 +36,7 @@ export class Event { * @throws {Error} Throws an error if the method is not overridden in a subclass. */ // eslint-disable-next-line @typescript-eslint/no-unused-vars - handle(...args: any[]) { + handle(...args: any[]): void | Promise { throw new Error(`${this.name} doesn't have an handle() method.`) } }