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
|
const users = data.map(user => this.#manager.client.users.update(user)); |
I think it should be changed to this due to response body being an object with an array of users inside
const users = data.users.map(user => this.#manager.client.users.update(user));
Thanks for reading
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
Oceanic/lib/routes/Channels.ts
Line 825 in f5123ca
I think it should be changed to this due to response body being an object with an array of
usersinsideThanks for reading