Finalizing applications
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
module.exports = {
|
||||
name: 'applicationdelete',
|
||||
description: 'Delete an application channel.',
|
||||
@@ -6,11 +9,17 @@ module.exports = {
|
||||
async execute(interaction) {
|
||||
|
||||
const channel = interaction.channel;
|
||||
const applicantId = await channel.topic;
|
||||
|
||||
await interaction.reply('Application channel will be deleted in 5 seconds');
|
||||
|
||||
setTimeout(async () => {
|
||||
|
||||
const filePath = path.join(__dirname, `../../applications/${applicantId}`);
|
||||
fs.rmSync(filePath, { force: true });
|
||||
|
||||
await channel.delete();
|
||||
|
||||
}, 5000);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user