You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The change in #10045 made it so that if you have a variable typed as one of the interfaces affected by the PR (will use BaseMessageOptions as an example) you will not be able to perform operations like push to your components, embeds, files and stickers arrays, even if you declare those arrays yourself and know they're not readonly. The goal of this change was to allow both readonly and mutable arrays to be passed, which does happen but only if you pass an array directly to the property, after that it is treated as readonly regardless. This was also discussed in https://discord.com/channels/222078108977594368/1249001503742758984
I don't think we're gaining anything from this change and would like to propose reverting the change on interfaces (while keeping it on methods)
Code sample
constres: InteractionReplyOptions={}res.embeds=[]res.embeds.push(newEmbedBuilder({description: "Test"}))//This errors because you cannot .push on a readonly array// This is a simplified code sample
Versions
14.15.3
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
The text was updated successfully, but these errors were encountered:
Which package is this bug report for?
discord.js
Issue description
The change in #10045 made it so that if you have a variable typed as one of the interfaces affected by the PR (will use BaseMessageOptions as an example) you will not be able to perform operations like push to your components, embeds, files and stickers arrays, even if you declare those arrays yourself and know they're not readonly. The goal of this change was to allow both readonly and mutable arrays to be passed, which does happen but only if you pass an array directly to the property, after that it is treated as readonly regardless. This was also discussed in https://discord.com/channels/222078108977594368/1249001503742758984
I don't think we're gaining anything from this change and would like to propose reverting the change on interfaces (while keeping it on methods)
Code sample
Versions
14.15.3
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
The text was updated successfully, but these errors were encountered: