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 User3y ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs3y ago
Documentation suggestion for @Bene:class Interaction (extends Base) Represents an interaction.
Bene
BeneOP3y 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 User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
The original interaction What I don't wanna edit the reply The interaction message isn't a reply
pat
pat3y ago
do you want followUp?
Bene
BeneOP3y ago
Nah
pat
pat3y 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 User3y ago
Message Not Public
Sign In & Join Server To View
pat
pat3y ago
you wont get help until you explain then
Bene
BeneOP3y 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
pat3y ago
why do you need to use reply then
Bene
BeneOP3y ago
ok then ill use followUp its still not working
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
Yea
pat
pat3y ago
update is a reply
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
No I try not working What should I do now? @vunsh ?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
Nothing It only replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
Yea
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y 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 User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
I awaited the update It says await interaction.update
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
::( Mannnnnnn Bc I need It like that Bc These are two different things
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Bene
BeneOP3y ago
bro ik the problem now i didin't defined the actionrow before the update ah man so thanks its now fixxed

Did you find this page helpful?