implement auto repeating events
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@ -6,7 +6,7 @@ import { config } from "../configuration";
|
||||
export class ExtendedClient extends Client {
|
||||
private eventFilePath = `${__dirname}/../events`
|
||||
private commandFilePath = `${__dirname}/../commands`
|
||||
private commands: Collection<string, CommandType> = new Collection()
|
||||
public commands: Collection<string, CommandType> = new Collection()
|
||||
public constructor() {
|
||||
super({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_SCHEDULED_EVENTS] })
|
||||
}
|
||||
@ -50,7 +50,7 @@ export class ExtendedClient extends Client {
|
||||
slashCommands.push(command)
|
||||
}
|
||||
this.on("ready", (client: Client) => {
|
||||
console.log(`Ready processing ${client}`)
|
||||
console.log(`Ready processing ${JSON.stringify(client)}`)
|
||||
console.log(`SlashCommands: ${JSON.stringify(slashCommands)}`)
|
||||
const guilds = client.guilds.cache
|
||||
this.registerCommands(slashCommands, guilds)
|
||||
|
8
server/structures/event.ts
Normal file
8
server/structures/event.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import { ClientEvents } from "discord.js";
|
||||
|
||||
export class Event<Key extends keyof ClientEvents>{
|
||||
constructor(
|
||||
public event: Key,
|
||||
public run: (...args: ClientEvents[Key]) => any
|
||||
) { }
|
||||
}
|
Reference in New Issue
Block a user