Problem with buttons

I have this code, and most of the time (about 99%) it works without any problems. However, just a moment ago, the bot updated a message, and for some reason, there were no buttons. There is no error. [email protected] NodeJS v18.20.4
const guild = interaction.guild;

await interaction.deferReply({ ephemeral: true });

const memberId = interaction.options.getUser("użytkownik");

let member;

try {
member = await guild.members.fetch(memberId);
} catch (err) {
return interaction.reply({
embeds: [
new discord.EmbedBuilder()
.setTitle("Głosowanie")
.setDescription(`${settings.emoji_wrong} Nie znaleziono użytkownika :(`)
.setColor(settings.color_fail)
]
})
}

let poolMessage = await interaction.channel.send({
embeds: [
new discord.EmbedBuilder()
.setTitle("Głosowanie")
.setDescription(`${settings.emoji_exclamation} Tworzenie głosowania...`)
.setColor(settings.color_orange)
]
});

await new poolSchema({ guildId: guild.id, channelId: interaction.channel.id, messageId: poolMessage.id, hostId: interaction.member.id, memberId: member.id, endTimestamp: Date.now() + 1000 * 60 * 2 }).save();

const firstActionRow = new discord.ActionRowBuilder();
const secondActionRow = new discord.ActionRowBuilder();

for (let i = 1; i < 6; i++) {
firstActionRow.addComponents(
new discord.ButtonBuilder()
.setCustomId(`glosowanie-${i}`)
.setLabel(`${i}`)
.setStyle(discord.ButtonStyle.Primary),
)
}

for (let i = 6; i < 11; i++) {
secondActionRow.addComponents(
new discord.ButtonBuilder()
.setCustomId(`glosowanie-${i}`)
.setLabel(`${i}`)
.setStyle(discord.ButtonStyle.Primary),
)
}

await poolMessage.edit({
embeds: [
new discord.EmbedBuilder()
.setTitle("Głosowanie")
.setDescription(`${settings.emoji_correct} Głosowanie stworzone!\n\n` +
`Aby oddać swój głos na użytkownika <@${member.id}> wybierz poniższy przycisk z odpowiednią notą!\n\n` +
`Zebrane głosy: **0**\n` +
`Koniec głosowania <t:${((Date.now() + 1000 * 60 * 2) / 1000).toFixed(0)}:R>`
)
.setColor(settings.color_success)
],
components: [
firstActionRow, secondActionRow
]
});

await interaction.editReply({
content: `${settings.emoji_correct} Głosowanie stworzone!`
});
const guild = interaction.guild;

await interaction.deferReply({ ephemeral: true });

const memberId = interaction.options.getUser("użytkownik");

let member;

try {
member = await guild.members.fetch(memberId);
} catch (err) {
return interaction.reply({
embeds: [
new discord.EmbedBuilder()
.setTitle("Głosowanie")
.setDescription(`${settings.emoji_wrong} Nie znaleziono użytkownika :(`)
.setColor(settings.color_fail)
]
})
}

let poolMessage = await interaction.channel.send({
embeds: [
new discord.EmbedBuilder()
.setTitle("Głosowanie")
.setDescription(`${settings.emoji_exclamation} Tworzenie głosowania...`)
.setColor(settings.color_orange)
]
});

await new poolSchema({ guildId: guild.id, channelId: interaction.channel.id, messageId: poolMessage.id, hostId: interaction.member.id, memberId: member.id, endTimestamp: Date.now() + 1000 * 60 * 2 }).save();

const firstActionRow = new discord.ActionRowBuilder();
const secondActionRow = new discord.ActionRowBuilder();

for (let i = 1; i < 6; i++) {
firstActionRow.addComponents(
new discord.ButtonBuilder()
.setCustomId(`glosowanie-${i}`)
.setLabel(`${i}`)
.setStyle(discord.ButtonStyle.Primary),
)
}

for (let i = 6; i < 11; i++) {
secondActionRow.addComponents(
new discord.ButtonBuilder()
.setCustomId(`glosowanie-${i}`)
.setLabel(`${i}`)
.setStyle(discord.ButtonStyle.Primary),
)
}

await poolMessage.edit({
embeds: [
new discord.EmbedBuilder()
.setTitle("Głosowanie")
.setDescription(`${settings.emoji_correct} Głosowanie stworzone!\n\n` +
`Aby oddać swój głos na użytkownika <@${member.id}> wybierz poniższy przycisk z odpowiednią notą!\n\n` +
`Zebrane głosy: **0**\n` +
`Koniec głosowania <t:${((Date.now() + 1000 * 60 * 2) / 1000).toFixed(0)}:R>`
)
.setColor(settings.color_success)
],
components: [
firstActionRow, secondActionRow
]
});

await interaction.editReply({
content: `${settings.emoji_correct} Głosowanie stworzone!`
});
No description
No description
7 Replies
d.js toolkit
d.js toolkit2mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
Paskal
PaskalOP2mo ago
yea sorry that was missclick
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
Paskal
PaskalOP2mo ago
the message embed has changed but the components haven't changed, the buttons should have appeared when the message was edited but they didn't appear for some reason i uploaded 2 images, the first shows how the message should looks
d.js docs
d.js docs2mo ago
If you aren't getting any errors, try to place console.log checkpoints throughout your code to find out where execution stops. - Once you do, log relevant values and if-conditions - More sophisticated debugging methods are breakpoints and runtime inspections: learn more
Paskal
PaskalOP2mo ago
okay i will make console.log there
Want results from more Discord servers?
Add your server