# @purrkit/rest fully typesafe discord rest client ```ts import { RESTClient } from "../src"; const client = RESTClient({ token: "..." }); const user = await client.users.me.get(); if (user.ok) { console.log(user.data.username); // (property) data: UserPIIResponse } else { console.error(user.data.message); // (property) data: RatelimitedResponse | ErrorResponse } const guild = await client.guilds("1359315933797285948").channels.get(); if (guild.status === 200) { console.log(guild.data); // (property) data: (GuildChannelResponse | PrivateChannelResponse | PrivateGroupChannelResponse | ThreadResponse)[] | null } else if (guild.status === 429) { console.log(guild.data.retry_after); // (property) data: RatelimitedResponse } else if (!guild.ok) { console.log(guild.data.message); // (property) data: ErrorResponse } ``` ## 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. [LISC]: ./LICENSE [EU]: https://interoperable-europe.ec.europa.eu/collection/eupl/eupl-text-eupl-12