Skip to content

Member timeout integer invalid form body #11119

@QuietWindUponTheMoor

Description

@QuietWindUponTheMoor

Which package is this bug report for?

discord.js

Issue description

  1. Inside any interaction with a valid member object:
  2. Attempt to timeout a user using a number in milliseconds
  3. Some numbers work fine?
  4. But others such as the specified max (28 days converted to ms) give "INVALID_COMMUNICATION_DISABLED_TIMESTAMP" w/ invalid form body error
[2025-09-28T02:33:14.051Z] [Guild Interaction Error] Error executing mute: DiscordAPIError[50035]: Invalid Form Body
communication_disabled_until[INVALID_COMMUNICATION_DISABLED_TIMESTAMP]: Invalid communication disabled timestamp
    at handleErrors (F:\0 - DEVELOPMENT\NODE-SERVERS\Marble-Foxxo\node_modules\@discordjs\rest\src\lib\handlers\Shared.ts:148:10)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async SequentialHandler.runRequest (F:\0 - DEVELOPMENT\NODE-SERVERS\Marble-Foxxo\node_modules\@discordjs\rest\src\lib\handlers\SequentialHandler.ts:417:20)
    at async SequentialHandler.queueRequest (F:\0 - DEVELOPMENT\NODE-SERVERS\Marble-Foxxo\node_modules\@discordjs\rest\src\lib\handlers\SequentialHandler.ts:169:11)
    at async _REST.request (F:\0 - DEVELOPMENT\NODE-SERVERS\Marble-Foxxo\node_modules\@discordjs\rest\src\lib\REST.ts:210:20)
    at async GuildMemberManager.edit (F:\0 - DEVELOPMENT\NODE-SERVERS\Marble-Foxxo\node_modules\discord.js\src\managers\GuildMemberManager.js:382:15)
    at async Object.execute (F:\0 - DEVELOPMENT\NODE-SERVERS\Marble-Foxxo\src\MarbleFoxxo\Discord\Commands\Moderation\MuteMember.ts:96:9)
    at async Client.<anonymous> (F:\0 - DEVELOPMENT\NODE-SERVERS\Marble-Foxxo\src\MarbleFoxxo\MarbleFoxxo.ts:192:9) {
  requestBody: {
    files: undefined,
    json: {
      communicationDisabledUntil: 1761445993936,
      communication_disabled_until: '2025-10-26T02:33:13.936Z'
    }
  },
  rawError: {
    message: 'Invalid Form Body',
    code: 50035,
    errors: { communication_disabled_until: [Object] }
  },
  code: 50035,
  status: 400,
  method: 'PATCH',
  url: 'https://discord.com/api/v10/guilds/1391519617125715968/members/1054097351536558261'
}

The docs here only mention that member.timeout() takes a number in milliseconds with the max allowed timeout time being 28 days. The number I'm inputting IS 28 days directly converted to milliseconds, so this should work. I've noticed there are other numbers that give this result, and others that don't--it'd be difficult to give specific numbers because it seems completely arbitrary which numbers it accepts and which ones it does not.

Perhaps it's something with the way the date is internally calculated, and if so, this NEEDS to be mentioned on the docs. This should be a boring task, not something that needs a GitHub issue created for it.

Note: My example is an extremely dumbed-down version of what I actually have going on, for the sake of reproducibility, but I've tested the code sample below and YES it does reproduce the issue exactly as-is.

Code sample

client.on(Events.InteractionCreate, async (interaction: Interaction) => {
    if (!interaction.isChatInputCommand()) return;

    await interaction.member.timeout(2419200000 /* 28 Days in ms */, "No Reason Given");
});

Versions

  • discord.js v14.22.1
  • Node.js v22.16.0
  • TypeScript v^5

Issue priority

Medium (should be fixed soon)

Which partials do you have configured?

Not applicable

Which gateway intents are you subscribing to?

Not applicable

I have tested this issue on a development release

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions