I am confused with interactions

How I can create a script that switch the message with interaction.update there is a "edit" message I don't like to show it get another way?
11 Replies
d.js toolkit
d.js toolkit•6mo 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!
monbrey
monbrey•6mo ago
Just send a new reply and delete the old one if it matters that much
Nicolas Matheisen
Nicolas MatheisenOP•6mo ago
hmmm yeah I try that yesterday bot it reply msg1 then msg2 and delete msg2 but I want to delegate 1 and sry my way of explaining sucks ty for advice me😊 I copy my code maybe that's helpful
const {
SlashCommandBuilder,
EmbedBuilder,
StringSelectMenuBuilder, StringSelectMenuOptionBuilder,
ActionRowBuilder,
ComponentType
} = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('start')
.setDescription('Dein Abenteuer beginnt!'),
async execute(interaction) {
const exampleEmbed = new EmbedBuilder()
.setColor('#0099FF')
.setTitle('Wähle eine Berufung!')
.setDescription('Du kannst zwischen folgenden Berufungen wählen:')
.addFields(
{ name: ':warrior: Krieger',
value: '\u200b'
},
{ name: ':mage: Zauberer', value: '\u200b' },
{ name: ':martialartist: Kampfkünstler', value: '\u200b' },
{ name: ':priest: Priester', value: '\u200b' },
{ name: ':thief: Dieb', value: '\u200b' },
{ name: ':minstrel: Barde', value: '\u200b' }
);

const select = new StringSelectMenuBuilder()
.setCustomId(interaction.id)
.setPlaceholder('Wähle eine Berufung!')
.addOptions(
new StringSelectMenuOptionBuilder()
.setLabel('Krieger')
.setDescription('Mächtige Kämpfer, die ihre Gefährten furchtlos verteidigen.')
.setValue('Krieger'),
new StringSelectMenuOptionBuilder()
.setLabel('Zauberer')
.setDescription('Experten der Kampfmagie, die Hackfleisch aus Monstern machen.')
.setValue('Zauberer'),
new StringSelectMenuOptionBuilder()
.setLabel('Kampfkünstler')
.setDescription('Bei Kampfkünstlern stehen Stärke und Flinkheit an erster Stelle.')
.setValue('Kampfkünstler'),
new StringSelectMenuOptionBuilder()
.setLabel('Priester')
.setDescription('Meister der Heilmagie, die auch den Kampf nicht scheuen, wenn es die Umstände verlangen.')
.setValue('Priester'),
new StringSelectMenuOptionBuilder()
.setLabel('Dieb')
.setDescription('Vielseitige Vagabunden mit einem Riecher für Reichtümer.')
.setValue('Dieb'),
new StringSelectMenuOptionBuilder()
.setLabel('Barde')
.setDescription('Multitalente, die ihre Umgebung mit vielerlei Wunderwerken zu begeistern wissen.')
.setValue('Barde'),
);

const row = new ActionRowBuilder()
.addComponents(select);

const reply = await interaction.reply({
embeds: [exampleEmbed],
components: [row],
});

const collector = reply.createMessageComponentCollector({
componentType: ComponentType.StringSelect,
filter: (i) => i.user.id === interaction.user.id && i.customId === interaction.id,
time: 60_000,
});

collector.on('collect' ,(interaction) => {
if (!interaction.values.length) {

const ErrorEmbed = new EmbedBuilder()
.setColor('#0099FF')
.setTitle('Treffe bitte eine Auswahl')




interaction.update({embeds: [ErrorEmbed],
components: []
});
return;
}
const selectEmbed = new EmbedBuilder()
.setColor('#0099FF')
.setTitle('select')



interaction.update(
{embeds: [selectEmbed],
components: []
});

});

},
};
const {
SlashCommandBuilder,
EmbedBuilder,
StringSelectMenuBuilder, StringSelectMenuOptionBuilder,
ActionRowBuilder,
ComponentType
} = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('start')
.setDescription('Dein Abenteuer beginnt!'),
async execute(interaction) {
const exampleEmbed = new EmbedBuilder()
.setColor('#0099FF')
.setTitle('Wähle eine Berufung!')
.setDescription('Du kannst zwischen folgenden Berufungen wählen:')
.addFields(
{ name: ':warrior: Krieger',
value: '\u200b'
},
{ name: ':mage: Zauberer', value: '\u200b' },
{ name: ':martialartist: Kampfkünstler', value: '\u200b' },
{ name: ':priest: Priester', value: '\u200b' },
{ name: ':thief: Dieb', value: '\u200b' },
{ name: ':minstrel: Barde', value: '\u200b' }
);

const select = new StringSelectMenuBuilder()
.setCustomId(interaction.id)
.setPlaceholder('Wähle eine Berufung!')
.addOptions(
new StringSelectMenuOptionBuilder()
.setLabel('Krieger')
.setDescription('Mächtige Kämpfer, die ihre Gefährten furchtlos verteidigen.')
.setValue('Krieger'),
new StringSelectMenuOptionBuilder()
.setLabel('Zauberer')
.setDescription('Experten der Kampfmagie, die Hackfleisch aus Monstern machen.')
.setValue('Zauberer'),
new StringSelectMenuOptionBuilder()
.setLabel('Kampfkünstler')
.setDescription('Bei Kampfkünstlern stehen Stärke und Flinkheit an erster Stelle.')
.setValue('Kampfkünstler'),
new StringSelectMenuOptionBuilder()
.setLabel('Priester')
.setDescription('Meister der Heilmagie, die auch den Kampf nicht scheuen, wenn es die Umstände verlangen.')
.setValue('Priester'),
new StringSelectMenuOptionBuilder()
.setLabel('Dieb')
.setDescription('Vielseitige Vagabunden mit einem Riecher für Reichtümer.')
.setValue('Dieb'),
new StringSelectMenuOptionBuilder()
.setLabel('Barde')
.setDescription('Multitalente, die ihre Umgebung mit vielerlei Wunderwerken zu begeistern wissen.')
.setValue('Barde'),
);

const row = new ActionRowBuilder()
.addComponents(select);

const reply = await interaction.reply({
embeds: [exampleEmbed],
components: [row],
});

const collector = reply.createMessageComponentCollector({
componentType: ComponentType.StringSelect,
filter: (i) => i.user.id === interaction.user.id && i.customId === interaction.id,
time: 60_000,
});

collector.on('collect' ,(interaction) => {
if (!interaction.values.length) {

const ErrorEmbed = new EmbedBuilder()
.setColor('#0099FF')
.setTitle('Treffe bitte eine Auswahl')




interaction.update({embeds: [ErrorEmbed],
components: []
});
return;
}
const selectEmbed = new EmbedBuilder()
.setColor('#0099FF')
.setTitle('select')



interaction.update(
{embeds: [selectEmbed],
components: []
});

});

},
};
If I add interaction.delete() it always delete the last reply :/ but I want the one bevor last It's not look aesthetic and I see a video from another guy with buttons and if he cklick the buttons he can switch the msg too but without this "edit" mark or maybe it only work for buttons?
monbrey
monbrey•6mo ago
There is no magic way to make it not say edited except by not editing it
Nicolas Matheisen
Nicolas MatheisenOP•6mo ago
Roonie
YouTube
How to Make Embedded Buttons That Reveal Messages on Discord
JOIN MY DISCORD SERVER https://discord.gg/uPFHgngyk7 Skip all the hard work, hire me. Want me to work on your Discord server? Contact me and get a free quote! Discord: https://discord.com/users/815510349208879104 Email: [email protected] Twitter: @rooniees For more awesome, helpful, and high quality videos, consider subscribing. It's free, doe...
Nicolas Matheisen
Nicolas MatheisenOP•6mo ago
sry for the late response I spend some time with friends now Im back U see in this video if the dude klicke a button there is no edited msg and my questen is it's possibile to rebuild this just with a select menü?
monbrey
monbrey•6mo ago
Ive literally told you how to do it
monbrey
monbrey•6mo ago
It looks edited to me
No description
monbrey
monbrey•6mo ago
Give me a timestamp I dont want to watch through a 5 min video
Nicolas Matheisen
Nicolas MatheisenOP•6mo ago
:0 I am blind holy I check it again but I am blind I think sry 😦 Ty for explain sometimes I am brain dead 🥲
monbrey
monbrey•6mo ago
np
Want results from more Discord servers?
Add your server