The HTTP REST API client for foxogram.js
Install with npm / yarn / pnpm:
npm install @foxogram/rest
yarn add @foxogram/rest
pnpm add @foxogram/rest
import REST from "@foxogram/rest";
import { APIRoutes, RouteUrlsMap } from "@foxogram/api-types";
const rest = new REST({
baseURL: RouteUrlsMap.production.api,
})
rest.token = TOKEN;
try {
await rest.post(APIRoutes.messages(CHANNEL_ID), {
body: {
content: "floof by coof",
},
});
} catch (error) {
console.error(error);
}