Skip to content
This repository has been archived by the owner on Aug 9, 2020. It is now read-only.

Request stuck #10

Open
anna-rmrf opened this issue Jul 7, 2020 · 2 comments
Open

Request stuck #10

anna-rmrf opened this issue Jul 7, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@anna-rmrf
Copy link

Hello, I liked this package so i started using it. It works great except for one issue I have been facing with the guilds/${guildID}/channels endpoint and not with all guilds

const { Rest } = require('@spectacles/rest');
const rest = new Rest(config.token);
const fetch = require('node-fetch');

async function restJS(guildID) {
const res = await rest.get(`/guilds/${guildID}/channels`)
return res;
}


async function nodeFETCH(guildID) {
const res = await (await fetch(`https://discordapp.com/api/v7/guilds/${guildID}/channels`, {
 method: 'GET',
 headers: { Authorization: `Bot ${config.token}` }
 })).json();
 return res
}

const guild = "id"
await nodeFETCH(guild) // [ Objects ]
await restJS(guild) //STUCK and never resolves

Any idea? Is there any timeout option available to abort
Thanks

@appellation appellation added the bug Something isn't working label Jul 8, 2020
@appellation
Copy link
Member

Thanks for bringing this up. We've had some issues with this in the past, but I thought they were all resolved. Unfortunately, it doesn't look like we've implemented timeout controls so I'll have to look into that as well.

This should be addressed once spec-tacles/spec#11 is resolved.

@anna-rmrf
Copy link
Author

@appellation Ahhh understandable. looking forward to the issue being resolved. Thanks again :D

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants