[Feature]: Use .fetch() instead of .resolve() for simple command args
See original GitHub issueFeature?
When using a simple command arg for a channel or user, the library internally uses .resolve()
which will attempt to pull the target from the client’s cache. This means if the target is not cached, null
will be returned.
Unfortunately moving to use .fetch()
would require async and some error handling logic. The other option would be to explicitly document the behaviour and ensure that where appropriate users handle the null
case.
Package
discordx
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
fetch() - Web APIs | MDN
A fetch() promise only rejects when a network error is encountered (which is usually when there's a permissions issue or similar). A fetch()...
Read more >Introduction to fetch() - web.dev
fetch() allows you to make network requests similar to XMLHttpRequest (XHR). The main difference is that the Fetch API uses Promises, ...
Read more >Fetch - The Modern JavaScript Tutorial
JavaScript can send network requests to the server and load new information whenever it's needed. For example, we can use a network request...
Read more >JavaScript | fetch() Method - GeeksforGeeks
The fetch() method in JavaScript is used to request data from a server. The request can be of any type of API that...
Read more >Consuming REST APIs In React With Fetch And Axios
Instead, it will resolve the request normally, if the response status code is a 400 or 500 type ... Basic Syntax for Using...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
sure thanks for reporting, This issue will be resolved very soon.
Was a little busy today so didn’t get around to a review, but all looks good!
Thanks for working on this 😄