pkgs/rest/README.md (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# @purrkit/rest
fully typesafe discord rest client
```ts
import { RESTClient } from "@purrkit/rest";
const client = RESTClient({ token: "..." });
const response = await client.users.me.get();
if (response.ok)
console.log(response.data.username); // strongly typed User
else console.error(response.error); // strongly typed DiscordError
```
## copying
this project is licensed under the european union public license (eupl) v1.2.
you can find the full license text either [here][LISC] or on the official
[eupl website][EU], which also contains translations of the license in various
languages.
<!-- links -->
[LISC]: ./LICENSE
[EU]: https://interoperable-europe.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|