Adding staff apply

This commit is contained in:
2023-03-19 14:57:50 +01:00
parent 9dd175dd82
commit 839b98e5e8
8 changed files with 212 additions and 28 deletions

View File

@@ -0,0 +1,28 @@
const fs = require('fs');
const path = require('path');
module.exports = {
name: 'staffapplicationdelete',
description: 'Delete an application channel.',
type: 'button',
async execute(interaction) {
await interaction.deferReply();
const channel = interaction.channel;
const applicantId = await channel.topic;
await interaction.editReply('Application channel will be deleted in 5 seconds');
setTimeout(async () => {
const filePath = path.join(__dirname, `../../apps/staff/${applicantId}`);
fs.rmSync(filePath, { force: true });
await channel.delete();
}, 5000);
}
};