Repository: discordjs/discord.js
File: packages/discord.js/src/structures/interfaces/TextBasedChannel.js (JavaScript)

Code before:
   *
   * @typedef {Object} PollAnswerData
   * @property {string} text The text for the poll answer
   * @property {EmojiIdentifierResolvable} [emoji] The emoji for the poll answer
   */

  /**
   * Represents the data for a poll.
   *
   * @typedef {Object} PollData
   * @property {PollQuestionMedia} question The question for the poll
   * @property {PollAnswerData[]} answers The answers for the poll
   * @property {number} duration The duration in hours for the poll
   * @property {boolean} allowMultiselect Whether the poll allows multiple answers
   * @property {PollLayoutType} [layoutType] The layout type for the poll
   */

  /**
   * The base message options for messages.
   *
   * @typedef {Object} BaseMessageOptions
   * @property {?string} [content=''] The content for the message. This can only be `null` when editing a message.
   * @property {Array<(EmbedBuilder|Embed|APIEmbed)>} [embeds] The embeds for the message
   * @property {MessageMentionOptions} [allowedMentions] Which mentions should be parsed from the message content
   * (see {@link https://discord.com/developers/docs/resources/message#allowed-mentions-object here} for more details)
   * @property {Array<(Attachment|AttachmentPayload|BufferResolvable)>} [files]
   * The files to send with the message.
   * @property {Array<(ActionRowBuilder|MessageTopLevelComponent|APIMessageTopLevelComponent)>} [components]
   * Action rows containing interactive components for the message (buttons, select menus) and other
   * top-level components.
   * <info>When using components v2, the flag {@link MessageFlags.IsComponentsV2} needs to be set
   * and `content`, `embeds`, `stickers`, and `poll` cannot be used.</info>
   */

  /**
   * The base message options for messages including a poll.
   *
   * @typedef {BaseMessageOptions} BaseMessageOptionsWithPoll
   * @property {PollData} [poll] The poll to send with the message
   */

  /**
   * The options for sending a message.
   *
   * @typedef {BaseMessageOptionsWithPoll} BaseMessageCreateOptions
   * @property {boolean} [tts=false] Whether the message should be spoken aloud
   * @property {string} [nonce] The nonce for the message
   * <info>This property is required if `enforceNonce` set to `true`.</info>
   * @property {boolean} [enforceNonce] Whether the nonce should be checked for uniqueness in the past few minutes.
   * If another message was created by the same author with the same nonce,
   * that message will be returned and no new message will be created

Review comment (refactor):
I'd prefer if there was still a way to pass an AttachmentBuilder into here, albeit not sure what type would make sense to put for that here. 

Another helper type like `RawFileEncodable` which extends `JSONEncodable` with the additional `getRawFile()` method? Seems clunky but 🤷‍♂️

Code after:
   *
   * @typedef {Object} PollAnswerData
   * @property {string} text The text for the poll answer
   * @property {EmojiIdentifierResolvable} [emoji] The emoji for the poll answer
   */

  /**
   * Represents the data for a poll.
   *
   * @typedef {Object} PollData
   * @property {PollQuestionMedia} question The question for the poll
   * @property {PollAnswerData[]} answers The answers for the poll
   * @property {number} duration The duration in hours for the poll
   * @property {boolean} allowMultiselect Whether the poll allows multiple answers
   * @property {PollLayoutType} [layoutType] The layout type for the poll
   */

  /**
   * The base message options for messages.
   *
   * @typedef {Object} BaseMessageOptions
   * @property {?string} [content=''] The content for the message. This can only be `null` when editing a message.
   * @property {Array<(EmbedBuilder|Embed|APIEmbed)>} [embeds] The embeds for the message
   * @property {MessageMentionOptions} [allowedMentions] Which mentions should be parsed from the message content
   * (see {@link https://discord.com/developers/docs/resources/message#allowed-mentions-object here} for more details)
   * @property {Array<(Attachment|AttachmentPayload|BufferResolvable|FileBodyEncodable<APIAttachment>|Stream)>} [files]
   * The files to send with the message.
   * @property {Array<(ActionRowBuilder|MessageTopLevelComponent|APIMessageTopLevelComponent)>} [components]
   * Action rows containing interactive components for the message (buttons, select menus) and other
   * top-level components.
   * <info>When using components v2, the flag {@link MessageFlags.IsComponentsV2} needs to be set
   * and `content`, `embeds`, `stickers`, and `poll` cannot be used.</info>
   */

  /**
   * The base message options for messages including a poll.
   *
   * @typedef {BaseMessageOptions} BaseMessageOptionsWithPoll
   * @property {PollData} [poll] The poll to send with the message
   */

  /**
   * The options for sending a message.
   *
   * @typedef {BaseMessageOptionsWithPoll} BaseMessageCreateOptions
   * @property {boolean} [tts=false] Whether the message should be spoken aloud
   * @property {string} [nonce] The nonce for the message
   * <info>This property is required if `enforceNonce` set to `true`.</info>
   * @property {boolean} [enforceNonce] Whether the nonce should be checked for uniqueness in the past few minutes.
   * If another message was created by the same author with the same nonce,
   * that message will be returned and no new message will be created