Added removal of cache when not needed

Signed-off-by: Taken <taken@mairimashita.org>
This commit is contained in:
2024-02-07 18:01:02 +01:00
parent 477b60da26
commit aaffac735c
7 changed files with 7 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ export default function loadAutocompleteEvents(client: Client, ft: FileType) {
) )
) )
} }
delete require.cache[require.resolve(filePath)]
} }
client.on(Events.InteractionCreate, async interaction => { client.on(Events.InteractionCreate, async interaction => {

View File

@@ -26,6 +26,7 @@ export default function loadButtonEvents(client: Client, ft: FileType) {
) )
) )
} }
delete require.cache[require.resolve(filePath)]
} }
client.on(Events.InteractionCreate, async interaction => { client.on(Events.InteractionCreate, async interaction => {

View File

@@ -26,6 +26,7 @@ export default function loadSlashCommandsEvents(client: Client, ft: FileType) {
) )
) )
} }
delete require.cache[require.resolve(filePath)]
} }
//! command handler //! command handler

View File

@@ -26,6 +26,7 @@ export default function loadContextMenuEvents(client: Client, ft: FileType) {
) )
) )
} }
delete require.cache[require.resolve(filePath)]
} }
//! context menu command handler //! context menu command handler

View File

@@ -20,5 +20,6 @@ export default function loadCronEvents() {
cron.time.dayOfWeek cron.time.dayOfWeek
new CronJob(time, cron.execute, cron.onComplete, cron.start, cron.timeZone).start() new CronJob(time, cron.execute, cron.onComplete, cron.start, cron.timeZone).start()
delete require.cache[require.resolve(filePath)]
} }
} }

View File

@@ -14,6 +14,7 @@ export default function loadEvents(client: Client) {
if (!event.disabled) { if (!event.disabled) {
client.on(event.event, event.execute) client.on(event.event, event.execute)
} }
delete require.cache[require.resolve(eventPath)]
} }
} }
} }

View File

@@ -26,6 +26,7 @@ export default function loadModalEvents(client: Client, ft: FileType) {
) )
) )
} }
delete require.cache[require.resolve(filePath)]
} }
client.on(Events.InteractionCreate, async interaction => { client.on(Events.InteractionCreate, async interaction => {