cmd.user.untimeout

Removes an active timeout from a guild member, restoring their ability to send messages and join voice channels.

JavaScript
const { cmd } = require("syntx.js");

await cmd.user.untimeout({ user, reason }, message);

Parameters

ParameterTypeRequiredDescription
userstringYesThe ID of the member to remove the timeout from.
reasonstringNoAudit log reason for removing the timeout.
messagediscord.js Message | InteractionYesA guild message or interaction, used to access the guild.

Returns

This function does not return a value.

Example

JavaScript
client.command({
  name: "untimeout",
  content: async (message) => {
    const id = cmd.message.mentioned(message, 1);
    if (!id) return message.reply("Please mention a user.");

    await cmd.user.untimeout(
      {
        user: id,
        reason: "Timeout removed by moderator",
      },
      message
    );

    message.reply(`<@${id}>'s timeout has been removed.`);
  },
});

Warning

The bot must have the Moderate Members permission, and its highest role must be above the target's highest role. If the member is not found in the guild, a SyntxError is thrown.