Files
ShaiBot/buttons/profile/close.js
T
2026-08-22 22:46:40 +02:00

61 lines
1.0 KiB
JavaScript

const {
EmbedBuilder
} = require(
"discord.js"
);
const {
requireProfileOwner
} = require(
"../../utils/profileSystem"
);
function delay(
ms
) {
return new Promise(
resolve =>
setTimeout(
resolve,
ms
)
);
}
module.exports = {
name:
"profileClose",
async execute(
interaction
) {
const context =
await requireProfileOwner(
interaction
);
if (!context) {
return;
}
await interaction.update({
embeds: [
new EmbedBuilder()
.setTitle(
"Profile Closed"
)
.setDescription(
"Closing profile..."
)
],
components: []
});
await delay(1200);
try {
await interaction.deleteReply();
} catch {}
}
};