I'm working on removing all any in my code and the last one I can't figure is this one
import {ClientEvents} from 'discord.js';
export class Event<Key extends keyof ClientEvents> {
constructor(
public event: Key,
public run: (...args: ClientEvents[Key]) => any,
) {}
}
...
const eventFiles = await globPromise(`${__dirname}/../events/*{.ts,.js}`);
for (const filePath of eventFiles) {
const event: Event<keyof ClientEvents> = await DiscordClient.importFile(filePath);
this.on(event.event, event.run);
}
I tried never/unkown or Awaitable<void> but this throw error on runtime?