Is possible to trigger an ephemeral message without setting "ephemeral: true"?

I'm having some strange behaviours from my bot recently and i'm not having idea what is happening. Right now an user sent me this screenshot: https://cdn.discordapp.com/attachments/821436197745197086/1202546935957946409/Screenshot_2024-02-01-10-31-34-07_572064f74bd5f9fa804b05334aa4f912.jpg In this screenshot that second message "To open a support ticket....." is a ephemeral message to him, right? BUT WHY? Below is the snippet that generates this message, there is nothing about ephemeral. Also, if i try myself, i cannot reproduce this behavior (i've tried in many ways). The correct behavior is: when user choose something in this select menu, this message is deleted and after the deletion it shows the next message "Paste here the tbx ID.....".
if (i.customId == "startuser"){
const coupons = await client.db.query('SELECT * FROM coupons WHERE is_active = 1 AND expire_date >= NOW() ORDER BY id DESC LIMIT 1');
const Options = new ActionRowBuilder();
const selectMenuBuilder = new StringSelectMenuBuilder()
.setCustomId('select')
.setPlaceholder('➡️ Click here to select action...');

if (coupons.length > 0) {
selectMenuBuilder.addOptions([
{
label: 'Redeem Coupon',
description: 'Redeem your coupon code for ' + coupons[0].script_name,
value: 'redeemCoupon',
emoji: `💰`
},
]);
}

selectMenuBuilder.addOptions([
{
label: 'Support Ticket',
description: 'Select here if you have purchased a product',
value: 'flux1',
emoji: `☎`
},
{
label: 'Purchase Ticket',
description: 'Select here if you have questions before purchasing a script',
value: 'flux2',
emoji: `💸`
},
{
label: 'Claim Customer Role',
description: 'Select here if you want to receive the customer role',
value: 'claimrole',
emoji: `🔴`
},
]);

Options.addComponents(selectMenuBuilder);

const Embed = new EmbedBuilder()
.setColor(client.config.mainColor)
.setDescription(`To open a support ticket select one of the options below to proceed.`)
.setFooter({text: 'You have 3 minutes to choose!'})
await i.reply({embeds: [Embed], components: [Options]})
await Buttons.components[0].setDisabled(true);
await i.message.edit({components: [Buttons]})

const collectorBack = channel.createMessageComponentCollector({ componentType: ComponentType.StringSelect, max: 1, time: client.config.msTimeToInteractWithButtons });
collectorBack.on('end', (collected, reason) => {
Utils.deleteChannel(collected, reason, channel, client, member.id);
});
}
if (i.customId == "startuser"){
const coupons = await client.db.query('SELECT * FROM coupons WHERE is_active = 1 AND expire_date >= NOW() ORDER BY id DESC LIMIT 1');
const Options = new ActionRowBuilder();
const selectMenuBuilder = new StringSelectMenuBuilder()
.setCustomId('select')
.setPlaceholder('➡️ Click here to select action...');

if (coupons.length > 0) {
selectMenuBuilder.addOptions([
{
label: 'Redeem Coupon',
description: 'Redeem your coupon code for ' + coupons[0].script_name,
value: 'redeemCoupon',
emoji: `💰`
},
]);
}

selectMenuBuilder.addOptions([
{
label: 'Support Ticket',
description: 'Select here if you have purchased a product',
value: 'flux1',
emoji: `☎`
},
{
label: 'Purchase Ticket',
description: 'Select here if you have questions before purchasing a script',
value: 'flux2',
emoji: `💸`
},
{
label: 'Claim Customer Role',
description: 'Select here if you want to receive the customer role',
value: 'claimrole',
emoji: `🔴`
},
]);

Options.addComponents(selectMenuBuilder);

const Embed = new EmbedBuilder()
.setColor(client.config.mainColor)
.setDescription(`To open a support ticket select one of the options below to proceed.`)
.setFooter({text: 'You have 3 minutes to choose!'})
await i.reply({embeds: [Embed], components: [Options]})
await Buttons.components[0].setDisabled(true);
await i.message.edit({components: [Buttons]})

const collectorBack = channel.createMessageComponentCollector({ componentType: ComponentType.StringSelect, max: 1, time: client.config.msTimeToInteractWithButtons });
collectorBack.on('end', (collected, reason) => {
Utils.deleteChannel(collected, reason, channel, client, member.id);
});
}
6 Replies
d.js toolkit
d.js toolkit11mo 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!
Kevinnnn
Kevinnnn11mo ago
No idea, might be other code causing this issue could be a bug, who knows shrug
Lixeiro Charmoso
Lixeiro CharmosoOP11mo ago
But what kind of code should i look for? This is making me crazy Maybe i'll force "ephemeral: false" and pray for the best
souji
souji11mo ago
the only reason i could think of, if not setting ephemeral is that you are setting flags for the initial reply or follow-up and include the ephemeral message bit 1<<6 (https://discord.com/developers/docs/resources/channel#message-object-message-flags)
Lixeiro Charmoso
Lixeiro CharmosoOP11mo ago
Sorry, after reading the docs i didnt figure out the usage Maybe i overlooked something, idk I want to find how to use to see if there is anything similar in my code But i dont believe it'll have because i cannot reproduce that issue. Maybe it only happens in mobile and maybe in some specific mobile version, because i tried with mobile too without sucess
souji
souji11mo ago
search for flags: see what the value is and which bit flags are present in the number
Want results from more Discord servers?
Add your server