others unable to see slash commands

well i want so when someone execute a slash commands other can also see it but in this case only i am able to see it
await interaction.reply({
content: `Removed timeout for ${member.user.tag}.`,
});
await interaction.reply({
content: `Removed timeout for ${member.user.tag}.`,
});
15 Replies
d.js toolkit
d.js toolkit2mo 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! - Marked as resolved by OP
treble/luna
treble/luna2mo ago
what do you mean by only you can see ity
Auth
AuthOP2mo ago
No description
treble/luna
treble/luna2mo ago
is it a user app
Auth
AuthOP2mo ago
async function handleApproveCommand(interaction) {
const user = interaction.options.getUser("user");
if (!user) {
await interaction.editReply({
content: "Please provide a valid user to remove their timeout.",
ephemeral: true,
});
return;
}

try {
const member = await interaction.guild.members.fetch(user.id);

if (!member) {
await interaction.editReply({
content: "User not found in the guild.",
ephemeral: true,
});
return;
}

if (!member.communicationDisabledUntil) {
await interaction.editReply({
content: `${member.user.tag} is not currently timed out.`,
ephemeral: true,
});
return;
}

console.log(`Removing timeout for ${member.user.tag}`);
await member.timeout(null, "Timeout removed by command.");

// Remove timeout data from the database
await removeTimeout(member.id);

await interaction.reply({
content: `Removed timeout for ${member.user.tag}.`,
});
console.log(`Successfully removed timeout for ${member.user.tag}`);

try {
await member.send(`Your timeout has been removed.`);
} catch (dmError) {
console.error(`Failed to send DM to ${member.user.tag}:`, dmError);
await interaction.followUp({
content: `Timeout removed, but couldn't send a DM to the user.`,
ephemeral: true,
});
}

//meow
} catch (error) {
console.error(
`Failed to process approve command for user ${user.tag}:`,
error,
);
await interaction.editReply({
content:
"Failed to remove timeout. An error occurred while processing the command.",
ephemeral: true,
});
}
}
async function handleApproveCommand(interaction) {
const user = interaction.options.getUser("user");
if (!user) {
await interaction.editReply({
content: "Please provide a valid user to remove their timeout.",
ephemeral: true,
});
return;
}

try {
const member = await interaction.guild.members.fetch(user.id);

if (!member) {
await interaction.editReply({
content: "User not found in the guild.",
ephemeral: true,
});
return;
}

if (!member.communicationDisabledUntil) {
await interaction.editReply({
content: `${member.user.tag} is not currently timed out.`,
ephemeral: true,
});
return;
}

console.log(`Removing timeout for ${member.user.tag}`);
await member.timeout(null, "Timeout removed by command.");

// Remove timeout data from the database
await removeTimeout(member.id);

await interaction.reply({
content: `Removed timeout for ${member.user.tag}.`,
});
console.log(`Successfully removed timeout for ${member.user.tag}`);

try {
await member.send(`Your timeout has been removed.`);
} catch (dmError) {
console.error(`Failed to send DM to ${member.user.tag}:`, dmError);
await interaction.followUp({
content: `Timeout removed, but couldn't send a DM to the user.`,
ephemeral: true,
});
}

//meow
} catch (error) {
console.error(
`Failed to process approve command for user ${user.tag}:`,
error,
);
await interaction.editReply({
content:
"Failed to remove timeout. An error occurred while processing the command.",
ephemeral: true,
});
}
}
treble/luna
treble/luna2mo ago
well
Auth
AuthOP2mo ago
....the bot is added to guild using a proper invite
treble/luna
treble/luna2mo ago
.reply isnt the same as editReply, dont see why you provided that code but you cannot change the ephemeral state even though you still set it to true you have to defer either ephemerally or not
Auth
AuthOP2mo ago
i see lemme just try it real quick
async function handleApproveCommand(interaction) {
const user = interaction.options.getUser("user");
if (!user) {
await interaction.reply({
content: "Please provide a valid user to remove their timeout.",
});
return;
}

try {
const member = await interaction.guild.members.fetch(user.id);

if (!member) {
await interaction.reply({
content: "User not found in the guild.",
});
return;
}

if (!member.communicationDisabledUntil) {
await interaction.reply({
content: `${member.user.tag} is not currently timed out.`,
});
return;
}

console.log(`Removing timeout for ${member.user.tag}`);
await member.timeout(null, "Timeout removed by command.");

// Remove timeout data from the database
await removeTimeout(member.id);

await interaction.reply({
content: `Removed timeout for ${member.user.tag}.`,
});
console.log(`Successfully removed timeout for ${member.user.tag}`);

try {
await member.send(`Your timeout has been removed.`);
} catch (dmError) {
console.error(`Failed to send DM to ${member.user.tag}:`, dmError);
await interaction.followUp({
content: `Timeout removed, but couldn't send a DM to the user.`,
ephemeral: true,
});
}

//meow
} catch (error) {
console.error(
`Failed to process approve command for user ${user.tag}:`,
error,
);
await interaction.reply({
content:
"Failed to remove timeout. An error occurred while processing the command.",
ephemeral: true,
});
}
}
async function handleApproveCommand(interaction) {
const user = interaction.options.getUser("user");
if (!user) {
await interaction.reply({
content: "Please provide a valid user to remove their timeout.",
});
return;
}

try {
const member = await interaction.guild.members.fetch(user.id);

if (!member) {
await interaction.reply({
content: "User not found in the guild.",
});
return;
}

if (!member.communicationDisabledUntil) {
await interaction.reply({
content: `${member.user.tag} is not currently timed out.`,
});
return;
}

console.log(`Removing timeout for ${member.user.tag}`);
await member.timeout(null, "Timeout removed by command.");

// Remove timeout data from the database
await removeTimeout(member.id);

await interaction.reply({
content: `Removed timeout for ${member.user.tag}.`,
});
console.log(`Successfully removed timeout for ${member.user.tag}`);

try {
await member.send(`Your timeout has been removed.`);
} catch (dmError) {
console.error(`Failed to send DM to ${member.user.tag}:`, dmError);
await interaction.followUp({
content: `Timeout removed, but couldn't send a DM to the user.`,
ephemeral: true,
});
}

//meow
} catch (error) {
console.error(
`Failed to process approve command for user ${user.tag}:`,
error,
);
await interaction.reply({
content:
"Failed to remove timeout. An error occurred while processing the command.",
ephemeral: true,
});
}
}
call me dumb but this should work right?
treble/luna
treble/luna2mo ago
why did you change your editReply to reply you can defer non-ephemerally
Auth
AuthOP2mo ago
oh- wait lmao
await interaction.deferReply({ ephemeral: false });
await interaction.deferReply({ ephemeral: false });
i just have to add this right?
treble/luna
treble/luna2mo ago
or just omit it in general its public by default
Auth
AuthOP2mo ago
Error handling command approve: Error [InteractionAlreadyReplied]: The reply to this interaction has already been sent or deferred.
at ChatInputCommandInteraction.deferReply (/home/authtbh/mirai/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:69:46)
at handleApproveCommand (/home/authtbh/mirai/libs/messageHandler.js:365:21)
at Client.handleInteraction (/home/authtbh/mirai/libs/messageHandler.js:177:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'InteractionAlreadyReplied'
}
Error handling command approve: Error [InteractionAlreadyReplied]: The reply to this interaction has already been sent or deferred.
at ChatInputCommandInteraction.deferReply (/home/authtbh/mirai/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:69:46)
at handleApproveCommand (/home/authtbh/mirai/libs/messageHandler.js:365:21)
at Client.handleInteraction (/home/authtbh/mirai/libs/messageHandler.js:177:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'InteractionAlreadyReplied'
}
ugh
treble/luna
treble/luna2mo ago
you have replied before apparently
Auth
AuthOP2mo ago
async function handleApproveCommand(interaction) {
await interaction.deferReply();

const user = interaction.options.getUser("user");
if (!user) {
await interaction.editReply({
content: "Please provide a valid user to remove their timeout.",
});
return;
}

try {
const member = await interaction.guild.members.fetch(user.id);

if (!member) {
await interaction.editReply({
content: "User not found in the guild.",
});
return;
}

if (!member.communicationDisabledUntil) {
await interaction.editReply({
content: `${member.user.tag} is not currently timed out.`,
});
return;
}

console.log(`Removing timeout for ${member.user.tag}`);
await member.timeout(null, "Timeout removed by command.");

// Remove timeout data from the database
await removeTimeout(member.id);

await interaction.editReply({
content: `Removed timeout for ${member.user.tag}.`,
});
console.log(`Successfully removed timeout for ${member.user.tag}`);

try {
await member.send(`Your timeout has been removed.`);
} catch (dmError) {
console.error(`Failed to send DM to ${member.user.tag}:`, dmError);
await interaction.followUp({
content: `Timeout removed, but couldn't send a DM to the user.`,
ephemeral: true,
});
}
} catch (error) {
console.error(
`Failed to process approve command for user ${user.tag}:`,
error,
);
await interaction.editReply({
content:
"Failed to remove timeout. An error occurred while processing the command.",
});
}
}
async function handleApproveCommand(interaction) {
await interaction.deferReply();

const user = interaction.options.getUser("user");
if (!user) {
await interaction.editReply({
content: "Please provide a valid user to remove their timeout.",
});
return;
}

try {
const member = await interaction.guild.members.fetch(user.id);

if (!member) {
await interaction.editReply({
content: "User not found in the guild.",
});
return;
}

if (!member.communicationDisabledUntil) {
await interaction.editReply({
content: `${member.user.tag} is not currently timed out.`,
});
return;
}

console.log(`Removing timeout for ${member.user.tag}`);
await member.timeout(null, "Timeout removed by command.");

// Remove timeout data from the database
await removeTimeout(member.id);

await interaction.editReply({
content: `Removed timeout for ${member.user.tag}.`,
});
console.log(`Successfully removed timeout for ${member.user.tag}`);

try {
await member.send(`Your timeout has been removed.`);
} catch (dmError) {
console.error(`Failed to send DM to ${member.user.tag}:`, dmError);
await interaction.followUp({
content: `Timeout removed, but couldn't send a DM to the user.`,
ephemeral: true,
});
}
} catch (error) {
console.error(
`Failed to process approve command for user ${user.tag}:`,
error,
);
await interaction.editReply({
content:
"Failed to remove timeout. An error occurred while processing the command.",
});
}
}
@treble/luna THHSANKSKS FIGURED OUT
Want results from more Discord servers?
Add your server