Registry / messaging / detritus-client-rest

detritus-client-rest

JSON →
library0.10.5jsnpmunverified

A minimalistic TypeScript-first library for interacting with all of Discord's REST API endpoints. Version 0.10.5 is current but still pre-1.0, with frequent commits. Unlike discord.js, it focuses solely on REST without Gateway, making it lightweight. Written in TypeScript, publishes declarations. Release cadence is irregular; breaking changes can occur between minor versions.

npm install detritus-client-rest
INSTALL
IMPORT
SIG · DETRITUS-CLIENT-RE
D
detritus-client-rest
messagingjavascriptv0.10.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Client
import { Client } from 'detritus-client-rest'
const Client = require('detritus-client-rest')
ESM-only. CommonJS require will fail. Use dynamic import if needed.
RequestTypes
import { RequestTypes } from 'detritus-client-rest'
import { RequestType } from 'detritus-client-rest'
Exported as plurals. Check API docs for exact type names.

Initializes a client with a bot token and fetches the list of guilds the bot is in.

import { Client } from 'detritus-client-rest'; const client = new Client({ token: process.env.DISCORD_TOKEN ?? '' }); async function main() { const guilds = await client.guilds.fetch(); console.log(`Fetched ${guilds.length} guilds`); } main().catch(console.error);
Debug
Known issues
breakingClass structure changed between 0.8.x and 0.10.x; constructors and method signatures differ.
fix
Refer to changelog; likely need to update import paths and method calls.
affects: >=0.9.0
deprecatedSome endpoints (e.g., audit log endpoints) are deprecated in Discord API and may be removed in future versions.
fix
Check Discord API changelog and migrate to alternatives.
affects: >=0.10.0
gotchaClient constructor does not auto-login; you must either pass token or call login() explicitly.
fix
Always provide a token in the constructor or call client.login({ token: '...' }) before making requests.
affects: >=0.10.0
Errors
Common errors & fixes
Cannot find module 'detritus-client-rest'
Not installed or ESM-only require attempt.
fix
npm install detritus-client-rest; use ESM import syntax.
TypeError: client.guilds is undefined
Client not fully initialized because token missing.
fix
Pass token in constructor: new Client({ token: 'YOUR_TOKEN' })
Upgrade
Version history
0.10.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
21 hits · last 30 days
node
18
Amazon
1
OpenAI (training)
1
Resources