Skip to content
TORNLIFE More

Api Question - two different replies...

Started by Leadore [2166792] on in API Development.

4 replies · 96 views · thread synced · 6 days ago · View on torn.com
About this thread

Posts archived: 5 / 5 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
5
Discussion span
→
People posting
2
Likes on archived posts
0
Authority score
50 / 100
Historical score
16 / 100
Story score
23 / 100
Engagement score
42 / 100
Leadore [2166792]
Hey all,

We are developing a discord bot using discord.js, I wrote a function to pull information from the API using snekfetch, when I do it, my reply contains many lines, and is a full ClientRequest, but when he does it when the same script, he gets back an undefined response. There seems to be no difference in our setups, both using Node.js, both using discord.js, is there any reason that an API call would come back undefined?

Thanks!
Pi77Bull [2082618]
I don't think I have come across an API call returning undefined.
Post the functions that you and your friend are using to make the request with just a console.log of the returned value inside it.
Leadore [2166792]
Yeah it is strange,

Here is a pastbin of the call and the two replies....

https://pastebin.com/qAU4Tym5



It is really strange since it is the same call to the same API, but two different replies.
Pi77Bull [2082618]
I tried snekfetch and I get the same undefined response. Maybe it's because the snekfetch npm module is deprecated.
When I do the same API call with the request npm module it works without a problem.