Closed LonelyDeathVGX closed 7 months ago
Hello 👋 While I was testing the version 1.10.0 to see which users voted the answers from a poll, I used this code
const data = await client.rest.channels.getPollAnswerUsers( "CHANNEL_ID", "MESSAGE_ID", 1 );
But when I was executing that code, I saw this error
TypeError: data.map is not a function
I did a custom request to see what was the response, so I used this code
const data = await client.rest.authRequest({ method: "GET", path: "/channels/CHANNEL_ID/polls/MESSAGE_ID/answers/1", });
{ users: [ // Discord API User Objects ] }
So, from this line
https://github.com/OceanicJS/Oceanic/blob/f5123cae148553a0c7113afb3adc85ae2a73f0da/lib/routes/Channels.ts#L825
I think it should be changed to this due to response body being an object with an array of users inside
users
const users = data.users.map(user => this.#manager.client.users.update(user));
Thanks for reading
Fixed in 1.10.1-polls.4f7666b2
1.10.1-polls.4f7666b2
Hello 👋 While I was testing the version 1.10.0 to see which users voted the answers from a poll, I used this code
But when I was executing that code, I saw this error
I did a custom request to see what was the response, so I used this code
So, from this line
https://github.com/OceanicJS/Oceanic/blob/f5123cae148553a0c7113afb3adc85ae2a73f0da/lib/routes/Channels.ts#L825
I think it should be changed to this due to response body being an object with an array of
users
insideThanks for reading