Added deferreply to lessen the bugs.

This commit is contained in:
2023-03-16 17:20:07 +01:00
parent 679dfdeb2e
commit 091d36c67f
7 changed files with 16 additions and 30 deletions

View File

@@ -10,6 +10,8 @@ module.exports = {
type: 'button',
async execute(interaction) {
await interaction.deferReply();
const channel = interaction.channel;
const applicantId = await channel.topic

View File

@@ -8,6 +8,8 @@ module.exports = {
async execute(interaction) {
await interaction.deferReply();
const user = interaction.user;
const channel = interaction.channel;
const guild = interaction.guild;

View File

@@ -1,27 +0,0 @@
const { color } = require('../../config/options.json');
module.exports = {
name: 'guildapplycancel',
description: 'Guild application cancel button.',
type: 'button',
async execute(interaction) {
const user = interaction.user;
const guild = interaction.guild;
const embedColor = Number(color.replace("#", "0x"));
if (interaction.customId === 'guildapplycancel') {
const channel = interaction.channel;
await interaction.reply({ content: 'Application channel will be deleted in 5 seconds', ephemeral: true });
setTimeout(async () => {
await channel.delete();
}, 5000);
}
}
}