hehebrd !!
hehebrd !!
DIAdiscord.js - Imagine an app
Created by hehebrd !! on 8/7/2023 in #djs-questions
fix pagination
Hh ok
83 replies
DIAdiscord.js - Imagine an app
Created by hehebrd !! on 8/12/2023 in #djs-questions
how to this type of advanced help menu
<@371759410009341952>
14 replies
DIAdiscord.js - Imagine an app
Created by hehebrd !! on 8/12/2023 in #djs-questions
how to this type of advanced help menu
Like this want to do?
14 replies
DIAdiscord.js - Imagine an app
Created by hehebrd !! on 8/12/2023 in #djs-questions
how to this type of advanced help menu
const Discord = require('discord.js');

module.exports = async (client, interaction, args) => {

const menu = new Discord.ActionRowBuilder()
.addComponents(
new Discord.StringSelectMenuBuilder()
.setCustomId('help-menu')
.setPlaceholder('Select Something')
.addOptions([
{
label: `Afk`,
value: "afk",
},
{ label: `announcement`,
value: "announcement",

},
]),
);

const embed = new Discord.EmbedBuilder()
.setDecsription(`afk`)

const afk = interaction.values; //select the first item in the array
await interaction.update({ embeds: [embed], components: [menu] })
const Discord = require('discord.js');

module.exports = async (client, interaction, args) => {

const menu = new Discord.ActionRowBuilder()
.addComponents(
new Discord.StringSelectMenuBuilder()
.setCustomId('help-menu')
.setPlaceholder('Select Something')
.addOptions([
{
label: `Afk`,
value: "afk",
},
{ label: `announcement`,
value: "announcement",

},
]),
);

const embed = new Discord.EmbedBuilder()
.setDecsription(`afk`)

const afk = interaction.values; //select the first item in the array
await interaction.update({ embeds: [embed], components: [menu] })
14 replies
DIAdiscord.js - Imagine an app
Created by hehebrd !! on 8/12/2023 in #djs-questions
how to this type of advanced help menu
Ok
14 replies
DIAdiscord.js - Imagine an app
Created by hehebrd !! on 8/12/2023 in #djs-questions
how to this type of advanced help menu
What i want to do 1st?
14 replies
DIAdiscord.js - Imagine an app
Created by hehebrd !! on 8/12/2023 in #djs-questions
how to this type of advanced help menu
Bro but how to get the afk commands it will give that?
14 replies
DIAdiscord.js - Imagine an app
Created by hehebrd !! on 8/12/2023 in #djs-questions
how to this type of advanced help menu
Heey anyone here
14 replies
DIAdiscord.js - Imagine an app
Created by hehebrd !! on 8/12/2023 in #djs-questions
how to this type of advanced help menu
Discord.js 14.12 Node 17.9.1
14 replies
DIAdiscord.js - Imagine an app
Created by hehebrd !! on 8/7/2023 in #djs-questions
fix pagination
The is fixed by this but prev buttons not coming why
83 replies
DIAdiscord.js - Imagine an app
Created by hehebrd !! on 8/7/2023 in #djs-questions
fix pagination
const newEmbed = generatePageEmbed(currentPage, choice);
msg.edit({ embeds: [newEmbed] });

// return await sendEmbed(currentPage, choice);
i.update()
});
const newEmbed = generatePageEmbed(currentPage, choice);
msg.edit({ embeds: [newEmbed] });

// return await sendEmbed(currentPage, choice);
i.update()
});
83 replies
DIAdiscord.js - Imagine an app
Created by hehebrd !! on 8/7/2023 in #djs-questions
fix pagination
83 replies
DIAdiscord.js - Imagine an app
Created by hehebrd !! on 8/7/2023 in #djs-questions
fix pagination
So i want to do the console.log(currentPage)
83 replies
DIAdiscord.js - Imagine an app
Created by hehebrd !! on 8/7/2023 in #djs-questions
fix pagination
No errors exist
83 replies
DIAdiscord.js - Imagine an app
Created by hehebrd !! on 8/7/2023 in #djs-questions
fix pagination
Bro it is already updated using i.update();
83 replies
DIAdiscord.js - Imagine an app
Created by hehebrd !! on 8/7/2023 in #djs-questions
fix pagination
This is my problem
83 replies
DIAdiscord.js - Imagine an app
Created by hehebrd !! on 8/7/2023 in #djs-questions
fix pagination
83 replies
DIAdiscord.js - Imagine an app
Created by hehebrd !! on 8/7/2023 in #djs-questions
fix pagination
Here is buttons interactiom
83 replies
DIAdiscord.js - Imagine an app
Created by hehebrd !! on 8/7/2023 in #djs-questions
fix pagination
const sendEmbed = async (page, status) => {
const embed = generatePageEmbed(page, status);

const row = new Discord.ActionRowBuilder()
.addComponents(
new Discord.ButtonBuilder()
.setCustomId('prev_page')
.setEmoji(':arrow_left:')
.setStyle(Discord.ButtonStyle.Danger)
.setDisabled(page === 1),
new Discord.ButtonBuilder()
.setCustomId('next_page')
.setEmoji(':arrow_right:')
.setStyle(Discord.ButtonStyle.Success)
.setDisabled(page === totalPages)
);

return await interaction.reply({ embeds: [embed], components: [row] });
};

const msg = await sendEmbed(currentPage, choice);

const filter = (i) => i.user.id === interaction.user.id && (i.customId === 'prev_page' || i.customId === 'next_page');
const collector = msg.createMessageComponentCollector({ filter, time: 60000 });

collector.on('collect', async (i) => {
if (i.customId === 'prev_page' && currentPage > 1) {
currentPage--;
} else if (i.customId === 'next_page' && currentPage < totalPages) {
currentPage++;
}

// return await sendEmbed(currentPage, choice);
i.update()
const sendEmbed = async (page, status) => {
const embed = generatePageEmbed(page, status);

const row = new Discord.ActionRowBuilder()
.addComponents(
new Discord.ButtonBuilder()
.setCustomId('prev_page')
.setEmoji(':arrow_left:')
.setStyle(Discord.ButtonStyle.Danger)
.setDisabled(page === 1),
new Discord.ButtonBuilder()
.setCustomId('next_page')
.setEmoji(':arrow_right:')
.setStyle(Discord.ButtonStyle.Success)
.setDisabled(page === totalPages)
);

return await interaction.reply({ embeds: [embed], components: [row] });
};

const msg = await sendEmbed(currentPage, choice);

const filter = (i) => i.user.id === interaction.user.id && (i.customId === 'prev_page' || i.customId === 'next_page');
const collector = msg.createMessageComponentCollector({ filter, time: 60000 });

collector.on('collect', async (i) => {
if (i.customId === 'prev_page' && currentPage > 1) {
currentPage--;
} else if (i.customId === 'next_page' && currentPage < totalPages) {
currentPage++;
}

// return await sendEmbed(currentPage, choice);
i.update()
83 replies
DIAdiscord.js - Imagine an app
Created by hehebrd !! on 8/7/2023 in #djs-questions
fix pagination
Where is problem exists
83 replies