Open Zer0-Access opened 1 year ago
Yes
collector.on("end", async () => {
try {
if (deleteAtEnd) {
if (type === 'message') {
await initialMessage.delete();
} else {
await interaction.deleteReply();
}
} else {
// If deleteAtEnd is false, just remove the buttons
if (type === 'message') {
await initialMessage.edit({
components: disableB ? components(true) : []
});
} else {
await interaction.editReply({
components: disableB ? components(true) : []
});
}
}
} catch (error) {
console.error('Error deleting or editing message:', error);
}
});
I think this will work
const {SlashCommandBuilder, EmbedBuilder, ButtonBuilder, ActionRowBuilder, ButtonStyle, CommandInteraction} = require('discord.js');
const {pagination, ButtonTypes, ButtonStyles} = require('@devraelfreeze/discordjs-pagination');
module.exports = { data: new SlashCommandBuilder() .setName("pagetest") .setDescription("Simple command testing pagnation."), async execute(interaction) {
}
However, when the time expires the embed does not delete.