Calling an API inside of module.exports

I am trying to make an api call inside a module.exports and keep on getting a unknown insteraction error see screenshot below. Is it not possible to call api inside of the code here since discord.js thinks it is discord call?
No description
10 Replies
d.js toolkit
d.js toolkit2mo ago
Amgelo
Amgelo2mo ago
is the data logging in the first place
Plasmatic
PlasmaticOP2mo ago
No description
Amgelo
Amgelo2mo ago
since discord.js thinks it is discord call
and no, djs doesn't control what axios does
Plasmatic
PlasmaticOP2mo ago
the data is logging correctly
Amgelo
Amgelo2mo ago
sounds like it's taking more than 3s then unreplied interactions only live for that amount of time
Plasmatic
PlasmaticOP2mo ago
ah I see I will use the other call type then
Amgelo
Amgelo2mo ago
yeah you should defer, then call your api, and then editReply with the response
Plasmatic
PlasmaticOP2mo ago
I will give that a shot thank you, I forgot about the other response type
d.js toolkit
d.js toolkit2mo ago
The thread owner has marked this issue as solved.

Did you find this page helpful?