discordjs / discord.js

A powerful JavaScript library for interacting with the Discord API
https://discord.js.org
Apache License 2.0
25.44k stars 3.97k forks source link

MessageEditOptions incorrectly includes poll #10508

Closed anandre closed 2 months ago

anandre commented 2 months ago

Which package is this bug report for?

discord.js

Issue description

MessageEditOptions should not include poll as an option - you cannot edit poll data in a regullar sent message. I'm guessing it's there (incorrectly) because WebhookEditReplyOptions and then InteractionEditReplyOptions extends it, and you can defer an interaction response and then edit the poll data in. It should be moved to InteractionEditReplyOptions instead of being included in MessageEditOptions.

I feel like this is a medium-level issue since the docs do not match the API specs and can mislead users.

Code sample

const msg = await channel.send({ content: 'creating poll, please wait' })
await msg.edit({ poll: poll_data }) // code editor will have poll as PollData | undefined

Versions

Issue priority

Medium (should be fixed soon)

Which partials do you have configured?

Not applicable, No Partials

Which gateway intents are you subscribing to?

Guilds

I have tested this issue on a development release

No response