How to do two interaction

so i have a really dumb question, but i don't know what to do
client.on("interactionCreate", async interaction => {
if (interaction.isButton()) {
const btn_id = interaction.customId
const buttons = new MessageActionRow()
.addComponents(
new MessageButton()
.setLabel('Begrüßen')
.setStyle('PRIMARY')
.setCustomId(`customid`)
.setEmoji('👋')
.setDisabled('true'),
)

interaction.reply(`${interaction.user} begrüßt <@${btn_id}>`)
interaction.update({ components: [buttons] })

}
})
client.on("interactionCreate", async interaction => {
if (interaction.isButton()) {
const btn_id = interaction.customId
const buttons = new MessageActionRow()
.addComponents(
new MessageButton()
.setLabel('Begrüßen')
.setStyle('PRIMARY')
.setCustomId(`customid`)
.setEmoji('👋')
.setDisabled('true'),
)

interaction.reply(`${interaction.user} begrüßt <@${btn_id}>`)
interaction.update({ components: [buttons] })

}
})
This is my code i want to reply to the interaction and then update it but it's not working. Discordjs v13.12.0
27 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs2y ago
Documentation suggestion for @Bene:class Interaction (extends Base) Represents an interaction.
Bene
Bene2y ago
so DiscordAPIError: Interaction has already been acknowledged. is my error i only can do one the reply oder the interaction update
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Bene
Bene2y ago
The original interaction What I don't wanna edit the reply The interaction message isn't a reply
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Bene
Bene2y ago
Nah
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Bene
Bene2y ago
what should i explain, so the bot sends a msg when a user joins this message has a button if you click it then it sends a message and after sending this message the button on the welcome message should be disabled this why i use the update
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Bene
Bene2y ago
ok then ill use followUp its still not working
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Bene
Bene2y ago
Yea
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Bene
Bene2y ago
No I try not working What should I do now? @vunsh ?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Bene
Bene2y ago
Nothing It only replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Bene
Bene2y ago
Yea
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Bene
Bene2y ago
Still this I do wait
client.on("interactionCreate", async interaction => {
if (interaction.isButton()) {
const btn_id = interaction.customId
await interaction.update({ components: [buttons] })
const buttons = new MessageActionRow()
.addComponents(
new MessageButton()
.setLabel('Begrüßen')
.setStyle('PRIMARY')
.setCustomId(`customid`)
.setEmoji('👋')
.setDisabled('true'),
)

interaction.followUp(`${interaction.user} begrüßt <@${btn_id}>`)


}
})
client.on("interactionCreate", async interaction => {
if (interaction.isButton()) {
const btn_id = interaction.customId
await interaction.update({ components: [buttons] })
const buttons = new MessageActionRow()
.addComponents(
new MessageButton()
.setLabel('Begrüßen')
.setStyle('PRIMARY')
.setCustomId(`customid`)
.setEmoji('👋')
.setDisabled('true'),
)

interaction.followUp(`${interaction.user} begrüßt <@${btn_id}>`)


}
})
thats it i did this
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Bene
Bene2y ago
I awaited the update It says await interaction.update
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Bene
Bene2y ago
::( Mannnnnnn Bc I need It like that Bc These are two different things
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Bene
Bene2y ago
bro ik the problem now i didin't defined the actionrow before the update ah man so thanks its now fixxed
Want results from more Discord servers?
Add your server
More Posts