diff --git a/packages/discord.js/src/managers/PollAnswerVoterManager.js b/packages/discord.js/src/managers/PollAnswerVoterManager.js index f904dd7a5..7282878dd 100644 --- a/packages/discord.js/src/managers/PollAnswerVoterManager.js +++ b/packages/discord.js/src/managers/PollAnswerVoterManager.js @@ -30,6 +30,14 @@ class PollAnswerVoterManager extends CachedManager { * @name PollAnswerVoterManager#cache */ + /** + * Options used for fetching voters of a poll answer. + * + * @typedef {Object} BaseFetchPollAnswerVotersOptions + * @property {number} [limit] The maximum number of voters to fetch + * @property {Snowflake} [after] The user id to fetch voters after + */ + /** * Fetches the users that voted on this poll answer. Resolves with a collection of users, mapped by their ids. * diff --git a/packages/discord.js/src/structures/PollAnswer.js b/packages/discord.js/src/structures/PollAnswer.js index 1e9633e44..f6e736c9c 100644 --- a/packages/discord.js/src/structures/PollAnswer.js +++ b/packages/discord.js/src/structures/PollAnswer.js @@ -93,25 +93,6 @@ class PollAnswer extends Base { get partial() { return this.poll.partial || (this.text === null && this.emoji === null); } - - /** - * Options used for fetching voters of a poll answer. - * - * @typedef {Object} BaseFetchPollAnswerVotersOptions - * @property {number} [limit] The maximum number of voters to fetch - * @property {Snowflake} [after] The user id to fetch voters after - */ - - /** - * Fetches the users that voted for this answer. - * - * @param {BaseFetchPollAnswerVotersOptions} [options={}] The options for fetching voters - * @returns {Promise>} - * @deprecated Use {@link PollAnswerVoterManager#fetch} instead - */ - async fetchVoters({ after, limit } = {}) { - return this.voters.fetch({ after, limit }); - } } exports.PollAnswer = PollAnswer; diff --git a/packages/discord.js/test/polls.js b/packages/discord.js/test/polls.js index 71d2b2f3e..4939c381a 100644 --- a/packages/discord.js/test/polls.js +++ b/packages/discord.js/test/polls.js @@ -16,7 +16,7 @@ client.on(Events.ClientReady, async () => { // console.dir(message.poll, { depth: Infinity }); // const answer = message.poll.answers.first(); - // const voters = await answer.fetchVoters(); + // const voters = await answer.voters.fetch(); // console.dir(voters); const message = await channel.send({ diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 7e8554823..0d59e50db 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -2753,6 +2753,11 @@ export interface PollQuestionMedia { text: string | null; } +export interface BaseFetchPollAnswerVotersOptions { + after?: Snowflake; + limit?: number; +} + export class PollAnswerVoterManager extends CachedManager { private constructor(answer: PollAnswer); public answer: PollAnswer; @@ -2777,11 +2782,6 @@ export class Poll extends Base { public end(): Promise; } -export interface BaseFetchPollAnswerVotersOptions { - after?: Snowflake; - limit?: number; -} - export class PollAnswer extends Base { private constructor(client: Client, data: APIPollAnswer & { count?: number }, poll: Poll); private readonly _emoji: APIPartialEmoji | null; @@ -2792,10 +2792,6 @@ export class PollAnswer extends Base { public voters: PollAnswerVoterManager; public get emoji(): Emoji | GuildEmoji | null; public get partial(): false; - /** - * @deprecated Use {@link PollAnswerVoterManager.fetch} instead - */ - public fetchVoters(options?: BaseFetchPollAnswerVotersOptions): Promise>; } export interface ReactionCollectorEventTypes extends CollectorEventTypes {