Skip to main content
Module

x/revoltio/deps.ts>REST

No-nonsense Revolt library for nodejs and deno.
Latest
class REST
import { REST } from "https://deno.land/x/revoltio@v1.0.0/deps.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