#discord.js

1 messages · Page 13 of 1

white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
#

Which application or package is this feature request for?

discord.js

Feature

"Manage Permission" permission is missing on PermissionFlagsBits for channels.

ManageRoles doesn't seem to handle it since it throws:

DiscordAPIError[50013]: Missing Permissions

Ideal solution or implementation

A new enum for Manage Permissions (even if it is same number as ManageRoles) for making it clear for developers.

Alternative solutions or implementations

No response

O...

white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
#

Please describe the changes this PR makes and why it should be merged:

Adds new fields for modifying the current guild member.

Adding these into the existing edit method is problematic as this implies one may use these on any guild member. The method has been split up into 2: one for you, one for others!

This also means if you want to change your nickname without needing manage nicknames, editCurrent() should be used.

Upstream:

white prawnBOT
white prawnBOT
white prawnBOT
#

While this is not problematic currently, it could potentially be if discord adds a property to available tags that has 2 words. Since transformGuildForumTag expects a discord.js object (aka camel cased) and we're passing the snake cased version here.

Might be worth doing something along the lines of options.availableTags?.map(x => toSnakeCase(blah...)) ?? options.available_tags instead to prevent future headaches.

white prawnBOT
#

Which application or package is this feature request for?

discord.js

Feature

Hello, I think it would be interesting to add a search bar for StringSelectMenuBuilders, like RoleSelectMenuBuilders or ChannelSelectMenuBuilders.

This would allow us to avoid being limited to 25 options, as the first 25 would be displayed, and the others would have to be searched for ourselves. This could be useful when StringSelectMenuBuilders are used to display information via identifiers or simply to...

white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
#

Please describe the changes this PR makes and why it should be merged:
Resolves #11084
Requires:

  • #11081

BREAKING CHANGE: ModalSubmitFields is no longer exported
BREAKING CHANGE: ModalSubmitInteraction#fields is removed
BREAKING CHANGE: ModalSubmitInteraction#components is now ModalOptionResolver
BREAKING CHANGE: DjsErrorCodes#ModalSubmitInteractionFieldNotFound & DjsErrorCodes#ModalSubmitInteractionFieldType are now renamed to `DjsErrorCodes#ModalSubmitInteraction...

white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
#

I think we should allow it (to better support new features that don't have real support yet), but I don't know that we should actually document it that way. It might be something we mention somewhere once, but I don't think we should specifically call it out except maybe types...my opinion will probably change once the lib is actually ts native and the underlying support for raw data is way better.

white prawnBOT
white prawnBOT
#

The normal edit function doesn't support these fields.
/guilds/:id/members/:id doesn't support avatar, bio, banner, bots can only change their own (hence why this function uses /guilds/:id/members/@me endpoint)
the /members/@me endpoint only supports what is shown in the GuildMemberEditMeOptions interface, if you want to edit the channel_id or anything else that is part of the /members/:id endpoint you would have to use the edit function. (don't know why Discord didn't add sup...

#

I don't get the purpose of this function. Doesn't the normal edit function support all these fields too? Why do you need to call editMe to edit some things and then edit for others (like wanting to change nickname and channel in one call [if that actually works])

The endpoint /guilds/{guild.id}/members/{user.id} does not have the avatar, banner, and bio fields. They are only found in /guilds/{guild.id}/members/@me
You can't change, say, avatar and channel_id in a single ...

white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
#

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_d...
white prawnBOT
#

I cannot reproduce this on v14 or main. Tried multiple times with:

import { Client, Events, GatewayIntentBits, GuildMember } from "discord.js";

const client = new Client({ intents: GatewayIntentBits.Guilds });

client.on(Events.InteractionCreate, async (interaction) => {
  if (!interaction.isChatInputCommand()) return;
  await (interaction.member as GuildMember).timeout(2419200000);
});

client.login();

My example is an extremely dumbed-down version of what I actually h...

white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
#

I cannot reproduce this on v14 or main. Tried multiple times with:

import { Client, Events, GatewayIntentBits, GuildMember } from "discord.js";

const client = new Client({ intents: GatewayIntentBits.Guilds });

client.on(Events.InteractionCreate, async (interaction) => {
if (!interaction.isChatInputCommand()) return;
await (interaction.member as GuildMember).timeout(2419200000);
});

client.login();

My example is an extremely dumbed-down version of what I act...

white prawnBOT
#

Please describe the changes this PR makes and why it should be merged:
Allow to use native Events as key for ClientEventTypes (for examle ClientEventTypes [Events] instead of ClientEventTypes[keyof ClientEventTypes])

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating
white prawnBOT
white prawnBOT
#

Please describe the changes this PR makes and why it should be merged:
messageDeleteBulk can be emitted only from guild. channel's type and discord api docs verify it.
Therefore, it's not possible to get a non-guild type of message.

Also i think no need of PartialMessage in this type and want to get feedback about it

Status and versioning classification:

  • Code changes have been tested against...
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
#

Which application or package is this feature request for?

discord.js

Feature

The SetVoiceChannelStatus permission is missing from the PermissionFlagsBits enum in discord.js, despite being available in the Discord API since 2024.

Ideal solution or implementation

PermissionFlagsBits.SetVoiceChannelStatus should be available to allow bots to programmatically manage the "Set Voice Channel Status" permission when creating or editing voice channels via permissionOverwrites.

Disco...

white prawnBOT
white prawnBOT
#

Please describe the changes this PR makes and why it should be merged:

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating
  • This PR changes the library's interface (methods or parameters added)

This adds (what I believe) is a missing flag from getTextInputValue, I noticed that other methods do have a required flag yet get...

white prawnBOT
white prawnBOT
white prawnBOT
#

The partial messages are created by this

https://github.com/discordjs/discord.js/blob/dee79efbafd7f4c4b978ce6cb065db69c8298b6f/packages/discord.js/src/client/actions/MessageDeleteBulk.js#L20-L27

This is easily testable with a simple script like

import { Client, Events, GatewayIntentBits, Partials } from 'discord.js';

const client = new Client({
	intents: GatewayIntentBits.Guilds | GatewayIntentBits.GuildMessages,
	partials: [Partials.Message, Partials.Channel],
});

clie...
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
#

Please describe the changes this PR makes and why it should be merged:

Fixes a crash related to Label component and the Invite bitfield class
Bumps builders in v14 for new modal components

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
#

Which package is this bug report for?

discord.js

Issue description

  1. Create a poll
  2. Start the client
  3. Vote on the poll
  4. You get a [PollAlreadyExpired] error like on the image

Code sample

client.on(Events.MessagePollVoteAdd, (pollAnswer, userId) => {
pollAnswer.poll.end()
});

Versions

  • discord.js v14.23.0
  • Node.js v22.18.0
  • Windows 11 24H2 (KB5065789) (26100.6725)

Issue priority

Low (slightly annoying)

Which partials do you have c...

white prawnBOT
#

Which package is this bug report for?

discord.js

Issue description

(See code sample)
The modal appears correctly with the differents selects menus. But, when I click on the button to validate, I got :

 Cannot read properties of undefined (reading 'users')
Stack:
    at  (\node_modules\.pnpm\[email protected]\node_modules\discord.js\src\structures\ModalSubmitInteraction.js:167)
    at resolveCollection (\node_modules\.pnpm\[email protected]\node_modules\discord.js\src\structur...
white prawnBOT
white prawnBOT
white prawnBOT
#

Which package is this bug report for?

discord.js

Issue description

(See code below)

  1. The modal is opened in a guild by a button
  2. The modal open properly
  3. After entering all the value and clicking on send, the bot crash:
TypeError: Cannot read properties of null (reading 'get')
    at ModalSubmitInteraction.transformComponent (N:\Documents\Github\dicelette\discord-bot\node_modules\.pnpm\[email protected]\node_modules\discord.js\src\structures\ModalSubmitInteraction.js:1...
#

Strange, I created a new fresh repo (using bun) and I can reproduce:

➜ repro-djs 196ms tsx .\index.ts         
[dotenv@17.2.3] injecting env (1) from .env -- tip: ✅ audit secrets and track compliance: https://dotenvx.com/ops
N:\Documents\Github\dicelette\repro-djs\node_modules\discord.js\src\structures\ModalSubmitInteraction.js:184
        for (const [id, member] of Object.entries(resolved.members)) {
                                          ^

TypeError: Cannot convert undefined or nu...
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
#

It seems bizarre this hasn't been implemented yet given the API endpoint has existed since Sept 2023 - over 2 years ago! Perhaps Discord haven't officially documented the endpoint yet idk but given how simple it is to implement using the REST client...

client.rest.put(/channels/${channel.id}/voice-status, { body: { status: status } });

and that other clients such as discord.py have it implemented, it seems it would be v easy to add a method to the VoiceChannel object. I don't think Discord ...

white prawnBOT
white prawnBOT
#

BREAKING CHANGE: ApplicationCommand#options is now nullable

Please describe the changes this PR makes and why it should be merged:

Options hasn't always been present for a while now, this brings us more in line.

Status and versioning classification:

  • I know how to update typings and have done so, or typings don't need updating
  • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)
white prawnBOT
white prawnBOT
#

There are already two-word properties in tags....emoji_id and emoji_name, and that's literally the entire point of the transformGuildForumTag util

No, there isn't because we didn't make it a two word property. It just so happens that specific case would work.

The problem is the input to transformGuildForumTag, not the output of it. Again... we're making that function with the assumption that a djs-like value is passed in, but now we're always passing in a snake cased value to it her...

white prawnBOT
white prawnBOT
#

BTW, seems that in toSnakeCase(), if there are conflicting keys, the last one (by key order) takes precedence. i.e., if both snake case and camel case versions of a key are passed, the later one overwrites the earlier.
This won't be the case for these ones, where camel case will take precedence. Not sure if we should do something about it (maybe tweaking toSnakeCase to prefer the camel case version?..) or just let it be

white prawnBOT
white prawnBOT
white prawnBOT
#

Which package is this bug report for?

discord.js

Issue description

An error occurs at startup:
TypeError: Cannot read properties of null (reading 'displayName')

The most important part: bot should not be on any server

Code sample

const { Client, Events } = require('discord.js')
const { token } = require('./config.json')

const client = new Client({
	intents: []
})

client.once(Events.ClientReady, (client) => console.log(`${client.user.displayName} is ready!...
#

Please show the full stack trace (and never omit it–ever).

TypeError: Cannot read properties of null (reading 'displayName')
    at Client.<anonymous> (...\index.js:8:72)
    at Object.onceWrapper (...\node_modules\@vladfrangu\async_event_emitter\dist\index.cjs:2738:26)
    at Client.emit (...\node_modules\@vladfrangu\async_event_emitter\dist\index.cjs:2504:31)       
    at Client._triggerClientReady (...\node_modules\discord.js\src\client\Client.js:421:10)        
    at Client._chec...
#

Cannot reproduce:

<img width="1510" height="610" alt="Image" src="https://github.com/user-attachments/assets/bd1fd4f9-35d5-4d35-ab10-12ad5c334992" />

<details>
<summary>Code</summary>

import { Client, Events, version } from "discord.js";

const client = new Client({ intents: [] });

client.on(Events.ClientReady, () => {
	console.log(version);
	console.log(`Logged in as ${client.user?.tag}!`);
});

void client.login();

</details>

I noticed you're using Node.js 23, which i...

#
white prawnBOT
#

Which package is this bug report for?

discord.js

Issue description

After recent updates, TextInputBuilder#setValue() now throws an error when passing an empty string (''). This behavior seems incorrect, as the Discord API itself does allow an empty string as the value for a text input component. For the time being, this can be bypassed by setting the value to a string with a space character (' ')

This change breaks previously valid code that relied on setting a value that mi...

white prawnBOT
#

Which package is this bug report for?

discord.js

Issue description

I might've found a bug but I'm not sure if it's intended, so I'm reporting for clarification.

On the new modal components, the ModalSubmitFields has a property is an array, which is expected:

public components: (ActionRowModalData | LabelModalData | TextDisplayModalData)[];

However, the LabelModalData type has a property called component which is typed as an array:

export interface LabelModal...
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
#

I'd say the better fix would be to move all the READY event handling into READY.js, not the other way around. Or at least the checkReady() call

I just noticed that the Ready event is async
None of the packet handlers are async, so calling this function won't be awaitable
While this can easily be fixed by adding "await" before "PacketHandlers[packet.t](this, packet, shardId);", but is it necessary?

#

I'd say the better fix would be to move all the READY event handling into READY.js, not the other way around. Or at least the checkReady() call

I believe this was not added to READY.js on purpose because the handler is async

Since I was the one who wrote that I can assure you that's not the reason. In v14 the checkReady check is in READY.js; this was simply an oversight when adapting to the direct use of /ws and should be reverted to check in READY.js

white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
#

Which package is this bug report for?

discord.js

Issue description

Timeout not checked:

  • GuildEmoji.deletable
  • GuildInvite.deletable
  • GuildMember.moderatable
  • GuildMember.kickable
  • GuildMember.bannable
  • Message.editable
  • Message.pinnable
  • Message.crosspostable

Timeout is not checked with additional conditions:

  • Message.bulkDeletable When the message was sent by the client
  • ThreadChannel.editable When the thread was created by the client
  • `ThreadChann...
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
#
white prawnBOT
white prawnBOT
#

Which package is this bug report for?

discord.js

Issue description

Description

Several regex patterns across the codebase restrict Discord snowflakes to 17–19 digits. Since snowflakes are 64-bit integers, they will eventually exceed 19 decimal digits. When that happens, these patterns will fail to match, causing emoji parsing failures and incorrect REST rate-limit bucket grouping.

Steps to Reproduce

  1. Create a test file with a 20-digit snowflake ID
  2. Attempt to parse an ...
#

I understand the validation concern but the REST bucketing issue is operationally critical right now, not future-theoretical. The generateRouteData function doesn't validate user input..it normalizes routes received from Discord's API for rate-limit bucketing. When this regex fails to match a 20-digit ID (whether from a future discord response, internal test environment, or epoch migration), it won't throw an error ... it will silently create per ID buckets instead of per-route buckets, bre...

#

The max snowflake value according to the Discord API is 9223372036854775807, which has 19 digits.

You can get this value by making any call to an endpoint that takes a snowflake as a URL parameter, e.g., GET /guilds/:guildId, with a number with more than 19 digits.

DiscordAPIError[50035]: Invalid Form Body
guild_id[NUMBER_TYPE_MAX]: snowflake value should be less than or equal to 9223372036854775807.
white prawnBOT
white prawnBOT
#

Please describe the changes this PR makes and why it should be merged:

When transforming a component for file uploads:

https://github.com/discordjs/discord.js/blob/c77f63492e59bb3c0a80da0d81951208bdbc1b94/packages/discord.js/src/structures/ModalSubmitInteraction.js#L138-L230

We set the type, id, customId, values, and attachments. Other fields are simply wrong.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or the...
#

Please describe the changes this PR makes and why it should be merged:

When transforming a component for file uploads:

https://github.com/discordjs/discord.js/blob/c77f63492e59bb3c0a80da0d81951208bdbc1b94/packages/discord.js/src/structures/ModalSubmitInteraction.js#L138-L230

We set the type, id, customId, values, and attachments. Other fields are simply wrong.

JSDoc properties are correct:

https://github.com/discordjs/discord.js/blob/c77f63492e59bb3c0a80da0d819512...

white prawnBOT
#

Which package is this bug report for?

discord.js

Issue description

Bug Report: Race condition in Mermaid component prevents theme re-renders

Description

The Mermaid component has a race condition that causes charts to skip re-rendering when props change during an async render. The currentChartRef is updated before the async mermaid.render() completes, causing subsequent effect runs to incorrectly skip rendering.

Impact

  • Severity: Medium
  • **User-facing...
#

This PR updates the pinnable getter in the Message class to prepare for Discord's permission split scheduled for January 12, 2026.

Changes Made:

  • Replaced ManageMessages permission check with ManageChannelMessages and ReadMessageHistory permissions
  • Updated the permission validation logic in the pinnable getter to align with Discord's upcoming API changes

Why this change is needed:

On January 12, 2026, Discord will fully split the ManageMessages permission. Af...

white prawnBOT
white prawnBOT
white prawnBOT
#

Please don't make issues out of AI.

  • This is not an issue of the discord.js package, despite you tagging it as such
  • The page you reference as example doesn't even use mermaid, so you obviously didn't test it on that site although you state that these are reproduction steps
  • The code you reference is from the guide while the page you link is from the docs website, doesn't add up either

I understand that you want hacktoberfest points, but please don't make up random stuff to achieve that.

white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
#

Please describe the changes this PR makes and why it should be merged:

In commit https://github.com/discordjs/discord.js/commit/6df36232a05e396d31461200725755745526d2ed, handling of empty permission overwrites was added, but it was not taken into account that only @everyone should be handled
Closes #11190

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so...
white prawnBOT
#

Please describe the changes this PR makes and why it should be merged:
Previously, permissionsLocked returned true for any empty overwrite, causing
channels with empty user or role overwrites to appear locked. This change limits
the "locked" behavior to only the @everyone overwrite (id === guild.id), which
matches Discord's expected permission inheritance behavior.

Status and versioning classification:

white prawnBOT
white prawnBOT
#

Which package is this bug report for?

discord.js

Issue description

The current output is the RAW data received from discord:
raw GUILD_CREATE incidents_data: {"raid_detected_at":"2025-10-25T21:33:03.211032+00:00","invites_disabled_until":null,"dms_disabled_until":"2025-10-29T09:27:55.374000+00:00","dm_spam_detected_at":null}

as you may notice, this is received on GUILD_CREATE packet

client.on('raw', (packet) => {
	if ((packet.t === 'GUILD_CREATE' || packet.t === 'G...
#

You set dmsDisabledUntil then verify a guild has it after restarting... is that all? If so, that works fine for me with your code sample. Am I misunderstanding something?

that is correct, through a crontab, we set it as lock; which works, the thing that doesn't work is getting incidentsData;

import Crontab from "@/crontab"

import { Guild } from "discord.js"

import logger from "@/globals/logger"


export default new Crontab()
	.cron("0 0 * * *")
	.listen(async (ctx) => {
...
#

You set dmsDisabledUntil then verify a guild has it after restarting... is that all? If so, that works fine for me with your code sample. Am I misunderstanding something?

that is correct, through a crontab, we set it as lock; which works, the thing that doesn't work is getting incidentsData;

import Crontab from "@/crontab"

import { Guild } from "discord.js"

import logger from "@/globals/logger"

export default new Crontab()
.cron("0 0 * * *")
.listen(asy...

white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
#

Thanks for responding. I've confirmed that I'm not overwriting the author anywhere, or manipulating the cache manually. There was actual content in the message, which I removed for privacy reasons. But it was not an empty string.

I've since implemented a workaround to check for partials and return early, so as not to spam the logs. But if needed, perhaps I can log to a channel instead so I don't print to production logs.

I'm unsure if the user being a deleted user could cause this? Obviousl...

white prawnBOT
#

While the null case now being documented is nice, it still doesn't fix the issue from my perspective. GuildMember#partial's value depends on GuildMember#joinedAt, which means that if partial is false, that then implies joinedAt and joinedTimestamp must be present, however the typings don't reflect that - they still list those two properties as possibly being null, which contradicts whether or not the object is truly a partial or not:

declare const member: GuildMember | Partial...
#

Please describe the changes this PR makes and why it should be merged:
Fixes a case where if the API sends member data with joined_at being null, Date.parse() tries to parse that resulting in joinedAt and joinedTimestsamp being NaN.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating
white prawnBOT
white prawnBOT
#

Which package is this bug report for?

discord.js

Issue description

Consider the following code:

const messages = (
    await channel.messages.fetch({
        cache: false,
        limit: 100,
    })
)

discord.js will create a request with the following query string: ?cache=false&limit=100 because of this line in _fetchMany: https://github.com/discordjs/discord.js/blob/main/packages/discord.js/src/managers/MessageManager.js#L120

This function should instead only consi...

white prawnBOT
white prawnBOT
white prawnBOT
#

Refactor stack trace capture for consistency and improve error code validation.

This pull request improves how stack traces are handled and makes error code validation safer. It does not change how the library works, only makes the internal error system more reliable and consistent across environments.

Why it should be merged:

  • Works the same as before, no breaking changes
  • Cleaner and safer internal code
  • Better stack trace handling for debugging
    Status:
  • No APi or behavior ch...
white prawnBOT
white prawnBOT
white prawnBOT
#

Pull Request Overview

This PR removes the conditional if (data) checks before calling _patch(data) in the constructors of multiple structures including Webhook, ThreadChannel, Role, PermissionOverwrites, and GuildMember. The changes standardize the initialization pattern by always calling _patch regardless of whether data is provided.

  • Removes conditional data checks before _patch() calls in constructors
  • Affects 5 structure classes: Webhook, ThreadChannel, Role, Perm...
white prawnBOT
white prawnBOT
#

The changes in GuildEmojiRoleManager#cache and GuildMemberRoleManager#cache are solid and definitely will see an improvement since it's not running a nested iteration anymore, however...

Changing GuildMember#_roles to be a Set rather than a Snowflake[], whilst it's true it'll see performance gains in large datasets, the average role count is more like 2-3 roles (tested in my bot, 3_296_963 GuildMember instances, 6_291_128 member roles excluding everyone), therefore making a negligi...

white prawnBOT
#

Which application or package is this feature request for?

discord.js

Feature

I really like djs for its compact features such as; to check if a message is deletable or if a role is editable but I cant find anything similar for threads creation. To check if if the client user can create a thread in this channel or message. I dont think this exists yet or maybe there is another easy way to check if a message is threadable that i dont know of. I now check if i have the needed permissio...

white prawnBOT
white prawnBOT
white prawnBOT
#

BREAKING CHANGE: WebhookClient has been removed, use @discordjs/core instead or fetch webhooks. Alternative solutions are in the works

Please describe the changes this PR makes and why it should be merged:

WebhookClient is an incredibly inefficient way to interact with webhooks (creates a rest instance per webhook, an entire client per webhook etc..). We are working on developing an alternative to this that will mimic the simplicity of WebhookClient. In the meantime, we recommend us...

white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
#

My thought process was that if we have a type that's unimplemented, that will lead to the request hanging (see how request guild members currently behaves right now without this PR merged), so warning at least once will make sure the user is at least aware this could be happening if they don't have a listener.

Now that you ask, I'd go even further and do !emittedWarning && !listenerCount(...). Thoughts?

white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
#

Which application or package is this feature request for?

discord.js

Feature

Getting a bit hard to track stuff in the internals channel, so I'm making a few issues

TBD with/after #11266

Ideal solution or implementation

why am I forced to use issue templates :(

Alternative solutions or implementations

No response

Other context

No response

white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
#

Please describe the changes this PR makes and why it should be merged:
A new import was added here from #11274:

https://github.com/discordjs/discord.js/blob/7349a6ee3e52cd349ccd3ef3c7aab6e37902c603/packages/discord.js/src/client/Client.js#L32

This surfaced a circular dependency:

  1. Client.js -> Util.js
  2. Util.js -> GuildChannel.js
  3. GuildChannel.js -> PermissionOverwriteManager.js
  4. PermissionOverwriteManager.js -> PermissionOverwrites.js
  5. PermissionOverwrites.js -> Bas...
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
#

Which package is this bug report for?

discord.js

Issue description

The Collector#resetTimer method does not properly update the collector's timers after changing the idle value. Even after calling resetTimer with a new idle or time, the collector continues to use the old timers. This makes the method ineffective in scenarios where the idle timeout needs to be extended dynamically.

Steps to reproduce

  1. Create a collector with an initial idle time.
  2. Wait some tim...
white prawnBOT
#

Problem

At the moment methods like GuildMemberManager:fetch that have an optional string parameter are doing a falsy check for if the parameter was omitted. But consider the following typescript code:

const id: string = ""
const member: GuildMember = await guild.members.fetch(id)

According to the typings member should be a GuildMember but its actually a Collection because the empty string is falsy.

My Suggestion

Do more exact undefined/null checks.
(I might ...

white prawnBOT
white prawnBOT
white prawnBOT
#

Following from #11294, error types are differentiated (they all became DiscordjsError):

throw new DiscordjsError(ErrorCodes.InvalidType, 'options', 'object', true);:

DiscordjsError [InvalidType]: Supplied options is not an object.
    at Object. (/Users/jiralite/Documents/GitHub/discord.js/discord.js/packages/discord.js/src/managers/GuildBanManager.js:226:7)
    at Module._compile (node:internal/modules/cjs/loader:1760:14)
    at Object..js (node:internal/modules/cjs/loader:18...
white prawnBOT
white prawnBOT
#

Which package is this bug report for?

discord.js

Issue description

Steps to reproduce:

  1. Replace Bun.env.TOKEN with your bot's token
  2. bun run sample.ts
  3. use /ping on the bot
  4. See "\ is thinking..." forever
    From my testing it either awaits deferReply forever, or throws both The reply to this interaction has not been sent or deferred. and Interaction has already been acknowledged.
    Works completely fine with node and deno

Code sample

import { Client, ...
white prawnBOT
#

Which package is this bug report for?

discord.js

Issue description

Issue Summary: When a file attachment with a Chinese or other non-ASCII filename is uploaded via a Discord.js bot command, the retrieved name property for the attachment only retains ASCII characters; any non-ASCII (e.g. Chinese) characters are lost. This affects filenames such as "测试文件.jpg" or "Test测试.png" which become "Test.png" after upload.

Root Cause: The problem appears to originate from the `basena...

white prawnBOT
#

Unfortunately, your root cause analysis is incorrect. Discord does not normalise the filenames in attachments:

<img width="301" height="181" alt="Image" src="https://github.com/user-attachments/assets/80d1f93e-4b23-451e-a48c-8126765b6bd4" />

Additionally, path.parse().name seems fine:

<img width="338" height="89" alt="Image" src="https://github.com/user-attachments/assets/1496f7bc-74c6-4ea1-a35f-8cbbd784145d" />

Disregarding this, this is not a bug. name (filename from the API) is i...

white prawnBOT
#

Please describe the changes this PR makes and why it should be merged:
This future-proofs against Discord potentially making the maximum bitrate for stage channels variable. Currently, it is always 64000. It is also just easier than the user manually typing in 64000 each time they need it.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don'...
white prawnBOT
#

Which package is this bug report for?

discord.js

Issue description

setLabel in the string select memu option builder should be 100 character length but it errors at 45. Encountered error within using it inside modal label

Code sample


Versions

Djs 14.25.1

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 thi...

white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
white prawnBOT
#

Personally, I think this is a step in the right direction. However, I don't think this change alone is enough, as it will potentially bring different issues. For instance, passing an empty string to RoleManager#fetch() will now make a request to the Get Guild Roles endpoint, but through the Get Guild Role path internally. This will mean the endpoint will return a different body than expected, which might create worse errors that are harder to pinpoint.

To fix that, we should make fur...

white prawnBOT
#

Which package is this bug report for?

discord.js

Issue description

When listening to AuditLogEvent.SoundboardSoundCreate, SoundboardSoundUpdate, SoundboardSoundDelete, the GuildAuditLogsEntry object always returns targetId = null.

For all other audit log types such as emoji, channel, role, sticker, etc., targetId correctly contains the created object’s ID.
But for Soundboard Sound Create, targetId is always null, even though Discord provides the ID inside changes.

Because of this...

#

But for Soundboard Sound Create, targetId is always null, even though Discord provides the ID inside changes.

These are different fields. I wouldn't conflate them.

This is how the target id is picked up:

https://github.com/discordjs/discord.js/blob/0aaba0305fb29d25e4caac333fbb5be8a05fb271/packages/discord.js/src/structures/GuildAuditLogsEntry.js#L302-L307

Extremely simple: if Discord gives us one, we have it. Have you verified this? If there is truly no target id, it seems this would no...

white prawnBOT
#

Which package is this bug report for?

discord.js

Issue description

UserManager.send() always sends a direct message

Code sample

public send(user: UserResolvable, options: string | MessagePayload | MessageCreateOptions): Promise;

Versions

Issue priority

Low (slightly annoying)

Which partials do you have configured?

Not applicable

Which gateway intents are you subscribing to?

No...

white prawnBOT
white prawnBOT
white prawnBOT
#

Which package is this bug report for?

discord.js

Issue description

newMember/oldMember never contains premiumSince but does include premiumSinceTimestamp. I'm just going to use the latter but your docs still mention premiumSince is always present on a full GuildMember (newMember) in 14.25.1.

Quick check shows premiumSince is not present in your Typescript definition either so maybe this is not a bug and is intended then?

Code sample

discordClient.on("gu...
#

My intents are, you can only select 1 intent in your questionaire.
const discordClient = new Client({ intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent
]});

I'm not Typing Events by myself, i'm importing discordjs types:
import { Client, GatewayIntentBits, Guild, GuildMember, PartialGuildMember } from 'discord.js';

Your TS does not include a field for premiumSince.

#

Here's a console.log of newMember:

new member
GuildMember {
guild: <ref *1> Guild {
id: '1420866197582254175',
name: 'Classic Plus Project',
icon: '9654b47f31729dd9faff60b02c8fedec',
features: [
'GUILD_ONBOARDING_EVER_ENABLED',
'BANNER',
'PIN_PERMISSION_MIGRATION_COMPLETE',
'VIDEO_QUALITY_1080_60FPS',
'TIERLESS_BOOSTING',
'AUDIO_BITRATE_384_KBPS',
'COMMUNITY',
'ANIMATED_BANNER',
'ENHANCED_ROLE_COLORS',
'ACTIVITY_FE...

#

What's with the attitude pal? I'm trying to help your team out here?

Frankly, irrelevant if I explicitly state a type in the paramaters and return. It changes nothing, the field is not there.

You may be a bit defensive here. There is no attitude.

<hr>

Your logs do not prove your issue–getters do not log. Additionally, when I asked for logs, I asked for logs from TypeScript because you keep saying TypeScript doesn't have the definition.

I am closing this until something reproducible...

white prawnBOT
white prawnBOT
#

Fixes the return type of UserManager.send() to correctly reflect that it always returns a DM message.

What changed

  • Updated return type from Promise to Promise in both TypeScript definitions and JSDoc
  • Added type test to prevent regression

Why

UserManager.send() always creates a DM channel and sends the message there, so the return type should indicate it's a non-guild message (Message). This makes the types more accurate and helps developers using TypeScript.

...