Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/revoltio_rest/src/lib.ts>REST

REST module for revolt.io
Latest
class REST
import { REST } from "https://deno.land/x/revoltio_rest@v1.1.3/src/lib.ts";

Constructors

new
REST(options?: DeepPartial<RESTOptions>)

Properties

private
readonly
headers
protected
readonly
options: RESTOptions
readonly
cdn: CDN

Methods

private
generateRequest(path: string, opts?: Partial<APIRequest>): APIRequest
private
request(request: APIRequest): Promise<any>
debug(_msg: string)
delete<Path extends DeleteRoutes["path"], Route extends Extract<DeleteRoutes, { path: Path; parts: Count<Path, "/">; method: "DELETE"; }>>(path: Path, options?: Partial<APIRequest>): Promise<Route["response"]>
get<Path extends GetRoutes["path"], Route extends Extract<GetRoutes, { path: Path; parts: Count<Path, "/">; method: "GET"; }>>(path: Path, options?: Partial<APIRequest>): Promise<Route["response"]>
patch<Path extends PatchRoutes["path"], Route extends Extract<PatchRoutes, { path: Path; parts: Count<Path, "/">; method: "PATCH"; }>>(path: Path, options?: Partial<APIRequest>): Promise<Route["response"]>
post<Path extends PostRoutes["path"], Route extends Extract<PostRoutes, { path: Path; parts: Count<Path, "/">; method: "POST"; }>>(path: Path, options?: Partial<APIRequest>): Promise<Route["response"]>
put<Path extends PutRoutes["path"], Route extends Extract<PutRoutes, { path: Path; parts: Count<Path, "/">; method: "PUT"; }>>(path: Path, options?: Partial<APIRequest>): Promise<Route["response"]>
setToken(token: string | null, bot?): this