problem with timestamp

when I type the command unmute the console reply DiscordAPIError[50035]: Invalid Form Body communication_disabled_until[INVALID_COMMUNICATION_DISABLED_TIMESTAMP]: Invalid communication disabled timestamp unmute.js
const { Client, Interaction, ApplicationCommandOptionType, PermissionFlagsBits } = require('discord.js');

module.exports = {
/**
*
* @param {Client} client
* @param {Interaction} interaction
*/

callback: async (client, interaction) => {
const mentionable = interaction.options.get('user').value;

await interaction.deferReply();

const targetUser = await interaction.guild.members.fetch(mentionable);
if (!targetUser) {
await interaction.editReply("Cet utilisateur n'existe pas dans ce serveur.");
return;
}

// Remove the timeout
try {
await targetUser.timeout(0);
await interaction.editReply(`${targetUser} a été untimeout.`);
} catch (error) {
console.log(`Une erreur s'est produite lors de l'untimeout: ${error}`);
await interaction.editReply("Une erreur s'est produite lors de l'unmute.");
}
},

name: 'unmute',
description: 'Enlève le timeout d\'un utilisateur.',
options: [
{
name: 'user',
description: "L'utilisateur que tu veux unmute",
type: ApplicationCommandOptionType.Mentionable,
required: true,
},
],
permissionsRequired: [PermissionFlagsBits.MuteMembers],
botPermissions: [PermissionFlagsBits.MuteMembers],
};
const { Client, Interaction, ApplicationCommandOptionType, PermissionFlagsBits } = require('discord.js');

module.exports = {
/**
*
* @param {Client} client
* @param {Interaction} interaction
*/

callback: async (client, interaction) => {
const mentionable = interaction.options.get('user').value;

await interaction.deferReply();

const targetUser = await interaction.guild.members.fetch(mentionable);
if (!targetUser) {
await interaction.editReply("Cet utilisateur n'existe pas dans ce serveur.");
return;
}

// Remove the timeout
try {
await targetUser.timeout(0);
await interaction.editReply(`${targetUser} a été untimeout.`);
} catch (error) {
console.log(`Une erreur s'est produite lors de l'untimeout: ${error}`);
await interaction.editReply("Une erreur s'est produite lors de l'unmute.");
}
},

name: 'unmute',
description: 'Enlève le timeout d\'un utilisateur.',
options: [
{
name: 'user',
description: "L'utilisateur que tu veux unmute",
type: ApplicationCommandOptionType.Mentionable,
required: true,
},
],
permissionsRequired: [PermissionFlagsBits.MuteMembers],
botPermissions: [PermissionFlagsBits.MuteMembers],
};
2 Replies
d.js toolkit
d.js toolkit11mo 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!
Edr0b0t
Edr0b0tOP11mo ago
thank you 😁
Want results from more Discord servers?
Add your server