Flight
Flight
DIAdiscord.js - Imagine an app
Created by Flight on 10/31/2023 in #djs-questions
Editing interaction message gives an error
Yea I replied when they clicked the join queue button:
client.on("interactionCreate", (interaction) => {
if (!interaction.isChatInputCommand()) return;

if (interaction.commandName === "startgame") {
if (roundInProgress) {
interaction.reply({
embeds: [
{
title: "Game in progress",
description: "Please wait for the current game to finish.",
color: 0xff0000, // Red color
},
],
ephemeral: true,
});
} else {
initialMessage = interaction;
const joinQueueButton = new ButtonBuilder()
.setCustomId("joinQueue")
.setLabel("Join Queue")
.setStyle(ButtonStyle.Primary);

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

const initialQueueMessage = "Waiting for players to join the queue...";

interaction.reply({
content: initialQueueMessage,
components: [row],
});

roundInProgress = true;
}
}
});
client.on("interactionCreate", (interaction) => {
if (!interaction.isChatInputCommand()) return;

if (interaction.commandName === "startgame") {
if (roundInProgress) {
interaction.reply({
embeds: [
{
title: "Game in progress",
description: "Please wait for the current game to finish.",
color: 0xff0000, // Red color
},
],
ephemeral: true,
});
} else {
initialMessage = interaction;
const joinQueueButton = new ButtonBuilder()
.setCustomId("joinQueue")
.setLabel("Join Queue")
.setStyle(ButtonStyle.Primary);

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

const initialQueueMessage = "Waiting for players to join the queue...";

interaction.reply({
content: initialQueueMessage,
components: [row],
});

roundInProgress = true;
}
}
});
10 replies
DIAdiscord.js - Imagine an app
Created by Flight on 10/31/2023 in #djs-questions
Editing interaction message gives an error
I did:
let initialMessage;
let initialMessage;
initialMessage = interaction;
initialMessage = interaction;
initialMessage.editReply({
content: queueMessage,
});
initialMessage.editReply({
content: queueMessage,
});
Is this solution fine?
10 replies
DIAdiscord.js - Imagine an app
Created by Flight on 10/31/2023 in #djs-questions
Editing interaction message gives an error
How would I get the original interaction? I am not trying to edit the ephemeral message, I'm trying to edit the original message.
10 replies
DIAdiscord.js - Imagine an app
Created by Flight on 10/31/2023 in #djs-questions
Editing interaction message gives an error
Versions:
$ node -v
v21.1.0
$ node -v
v21.1.0
$ npm list discord.js
[email protected] ...\ff-trivia
$ npm list discord.js
[email protected] ...\ff-trivia
10 replies