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
30 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
BeneOP2y 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
BeneOP2y ago
The original interaction What I don't wanna edit the reply The interaction message isn't a reply
pat
pat2y ago
do you want followUp?
Bene
BeneOP2y ago
Nah
pat
pat2y ago
if you do update first, it edits the message, followUp with your ping and it will do that in a separate message
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
pat
pat2y ago
you wont get help until you explain then
Bene
BeneOP2y 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
pat
pat2y ago
why do you need to use reply then
Bene
BeneOP2y 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
BeneOP2y ago
Yea
pat
pat2y ago
update is a reply
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP2y 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
BeneOP2y ago
Nothing It only replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP2y ago
Yea
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP2y 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
BeneOP2y 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
BeneOP2y 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
BeneOP2y 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