mirror of
https://github.com/sern-handler/tools
synced 2026-06-06 01:16:59 +00:00
Poster
REST API client for managing discord application commands.
features
- Optionally typed responses
- view an example (here)[../poster/test/spec.ts]
- Typed options
- Simple!
- ClojureScript + Typescript
- I'm sorry.
usage
import poster from '@sern/poster';
const send = poster.client("token", "appid");
const req = await send("global/get-all", {
});
console.log(await req.json());
Mappings
This package is pretty simple. Create a new client and call one of the virtual routes
virtual routes
| Endpoint | Method | Path |
|---|---|---|
| global/get-all | GET | /applications/{application.id}/commands |
| global/get | GET | /applications/{application.id}/commands/{command.id} |
| global/post | POST | /applications/{application.id}/commands |
| global/edit | PATCH | /applications/{application.id}/commands/{command.id} |
| global/delete | DELETE | /applications/{application.id}/commands/{command.id} |
| global/put | PUT | /applications/{application.id}/commands |
| guild/get-all | GET | /applications/{application.id}/guilds/{guild.id}/commands |
| guild/post | POST | /applications/{application.id}/guilds/{guild.id}/commands |
| guild/get | GET | /applications/{application.id}/guilds/{guild.id}/commands/{command.id} |
| guild/edit | PATCH | /applications/{application.id}/guilds/{guild.id}/commands/{command.id} |
| guild/delete | DELETE | /applications/{application.id}/guilds/{guild.id}/commands/{command.id} |
| guild/put | PUT | /applications/{application.id}/guilds/{guild.id}/commands |