Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in getting votes - Top.gg #174

Closed
AnukFD opened this issue Mar 19, 2021 · 10 comments · Fixed by #180
Closed

Issue in getting votes - Top.gg #174

AnukFD opened this issue Mar 19, 2021 · 10 comments · Fixed by #180
Assignees
Labels
type: bug Verified problems that need to be worked on

Comments

@AnukFD
Copy link

AnukFD commented Mar 19, 2021

const dbots = require('dbots');
const DBots = new dbots.serviceClasses.TopGG(config.TopGG_token);
const gStats = await DBots.userVoted(`678558479841230859`, message.author.id);
(node:23) UnhandledPromiseRejectionWarning: TypeError: Util_1.assert is not a function
    at TopGG.Service._request (/home/container/node_modules/dbots/lib/Interface/Service.js:100:16)
    at TopGG.userVoted (/home/container/node_modules/dbots/lib/Interface/Lists/TopGG.js:131:21)
    at Object.execute (/home/container/commands/Utility/vote.js:25:32)
    at module.exports (/home/container/events/message.js:111:9)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
EndBug added a commit that referenced this issue Mar 20, 2021
This should fix the error reported in issue #174
The error is probably caused by the fact that TS still compiles the function call, even if it's only declared. Using an empty function should resolve the issue.
@EndBug EndBug self-assigned this Mar 20, 2021
@EndBug EndBug added the type: bug Verified problems that need to be worked on label Mar 20, 2021
@EndBug
Copy link
Member

EndBug commented Mar 20, 2021

Hi, I've just pushed a fix that should resolve your issue: I've been able to reproduce it and the fix seems to solve it.
Please, try to install this patch and test if the error still shows up. If the problem is fixed I'll publish this in a patch version update.

npm install dbots-pkg/dbots.js#master

@AnukFD
Copy link
Author

AnukFD commented Mar 20, 2021

New error
(node:24) UnhandledPromiseRejectionWarning: Error: Request failed with status code 401

@EndBug
Copy link
Member

EndBug commented Mar 20, 2021

Uhm, you sure? The exact same error and stack trace? Sure you installed dbots from this branch?

@AnukFD
Copy link
Author

AnukFD commented Mar 20, 2021

New error - (node:24) UnhandledPromiseRejectionWarning: Error: Request failed with status code 401

@AnukFD
Copy link
Author

AnukFD commented Mar 20, 2021

Full error;
(node:24) UnhandledPromiseRejectionWarning: Error: Request failed with status code 401
at createError (/home/container/node_modules/axios/lib/core/createError.js:16:15)
at settle (/home/container/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/home/container/node_modules/axios/lib/adapters/http.js:260:11)
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (_stream_readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)

@EndBug
Copy link
Member

EndBug commented Mar 20, 2021

That's a http 401 error: it means you're not authorized to access that endpoint

Anyway, that means that the problem reported in the issue has been solved!
Let me know if there's anything else we can do!

@AnukFD
Copy link
Author

AnukFD commented Mar 20, 2021

Nope nothing else

@AnukFD AnukFD closed this as completed Mar 20, 2021
@AnukFD AnukFD reopened this Mar 20, 2021
@EndBug
Copy link
Member

EndBug commented Mar 21, 2021

Ok, regarding the issue with Top.gg: their API has been updated, so we need to update our package too.
I've added it to our to-do list, I'll keep you posted for when it'll be done 👍🏻

@AnukFD
Copy link
Author

AnukFD commented Mar 21, 2021

Ok thank you

EndBug added a commit that referenced this issue Mar 22, 2021
I've added authorization to every method, since it seems to solve the 401 error reported in issue #174
EndBug added a commit that referenced this issue Mar 23, 2021
* fix(TopGG): update API

I've added authorization to every method, since it seems to solve the 401 error reported in issue #174

* [auto] docs: update docs

* docs(TopGG): update API docs URL

* chore(docs): fix line breaks in services file

* [auto] docs: update docs
@EndBug
Copy link
Member

EndBug commented Mar 23, 2021

Fixed in v8.0.2 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Verified problems that need to be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants