diff --git a/src/structures/Poll.js b/src/structures/Poll.js index 10392416..809d0d8e 100644 --- a/src/structures/Poll.js +++ b/src/structures/Poll.js @@ -112,7 +112,7 @@ class Poll { * @public */ get question() { - return this.#question; + return `${this.#question.emoji ? `${Emoji.getMention(this.#question.emoji.name, this.#question.emoji.id, this.#question.emoji.animated)} ` : ""}${this.#question.text ? this.#question.text : ""}`; } /** @@ -211,7 +211,7 @@ class Poll { case TO_JSON_TYPES_ENUM.CACHE_FORMAT: case TO_JSON_TYPES_ENUM.STORAGE_FORMAT: { return { - question: this.question, + question: this.#question, answers: this.#answers, expiry: this.expiry ? this.expiry * 1000 : null, allow_multiselect: this.allowMultiselect, @@ -222,7 +222,7 @@ class Poll { case TO_JSON_TYPES_ENUM.DISCORD_FORMAT: default: { return { - question: this.question, + question: this.#question, answers: this.#answers, expiry: this.expiry ? new Date(this.expiry * 1000).toISOString() diff --git a/src/testData.js b/src/testData.js index c18684b2..90d4e492 100644 --- a/src/testData.js +++ b/src/testData.js @@ -1019,7 +1019,9 @@ export const TEST_DATA = { image: "000000000000000000000000deadbeef", }, POLL: { - question: "test poll", + question: { + text: "test poll", + }, answers: [ { answer_id: 1, diff --git a/test/structures/Poll.js b/test/structures/Poll.js index 1f08e824..cd0c3d24 100644 --- a/test/structures/Poll.js +++ b/test/structures/Poll.js @@ -37,7 +37,7 @@ describe("Poll", function () { const poll = new Poll(client, TEST_DATA.POLL, { guildId: TEST_DATA.GUILD_ID, }); - expect(poll.question).to.equal(TEST_DATA.POLL.question); + expect(poll.question).to.equal(TEST_DATA.POLL.question.text); }); });