mrkeyoor.com_
Tue 22 Sept 06:44 UTC
Dev Toolsevaluationupdated 22 Sept 2026

discord.js review

discord.js is a TypeScript and JavaScript library for building Discord bots and applications on Node.js. It wraps Discord's gateway and REST APIs with clients, events, caches, builders, sharding tools, and a separate voice package, so developers can work with typed objects instead of raw payloads and WebSocket messages.

Verdict

Our Discord.js run installed 2,157 packages and used 2,305 MB, then passed its 159-second build and all 3 available Vitest tests. Use the stable library for a serious Node bot when its documentation, typed object model, and sharding path save more time than a lower-level API wrapper would. Keep independent shard health checks, treat cache policy as application logic, and avoid cloning the entire monorepo unless you plan to contribute.

We ran it

Lab card: what happened when we ran discord.jsScreenshot of discord.js (discord.js.org)
Install✓ · 68s2157 packages · 2305 MB
Build✓ · 159s
Tests✓ · 53s3 passed · 0 failed of 3 (vitest)
Repo1820 files~142,401 lines of source · 14.8 MB · 15 CI workflows

Answers from our run

Does discord.js build from source?

Dependencies installed in 68 seconds (2157 packages), and the build succeeded in 159 seconds. We cloned commit 8802121 into a clean Debian container with 3 CPUs and no project-specific setup.

Do discord.js's tests pass?

Yes: 3 of 3 passed when we ran the project's own test command (vitest). Some failures need services or credentials a bare container does not have.

Who should not use discord.js?

Deno, browser, or edge-only projects: the assembled client is documented as a Node.js module, while Discordeno supports Node and Deno.

What are the alternatives to discord.js?

Discordeno, Sapphire Framework, Serenity. Our Discord.

Setup4/5Package use is simple; the source workspace occupies 2,305 MB
Docs5/5The guide covers intents, caches, sharding, voice, and migration
Community5/526,830 stars with active September 2026 issue and PR work
Maturity4/5Long-lived v14 line; reconnect and cache reports remain open

Discussed on

  1. hnBuilding a Discord Bot Using Discord.js19 points

Who it’s for

Node.js teams building event-driven Discord bots with commands, interactions, messages, or moderation features.
TypeScript developers who want typed Discord objects and a guide that covers application setup through sharding.
Bots that need configurable caches and a supported path from one process to multiple shards.
Library authors who can use the smaller REST, WebSocket, builders, core, or voice packages from the same monorepo.

Who it’s NOT for

Deno, browser, or edge-only projects: the assembled client is documented as a Node.js module, while Discordeno supports Node and Deno.
A script that only sends webhooks or occasional REST calls: the full gateway client and its caches are unnecessary, and the monorepo publishes @discordjs/rest separately.
Contributors with tight disk budgets: our checkout installed 2,157 packages and occupied 2,305 MB before any bot dependencies.
Operators who plan to use client.isReady() as their only health probe: open issue 11626 reports that it stayed true through a failed shard reconnect loop in 14.27.0.
Multi-machine bots expecting built-in orchestration: the sharding guide says operators manage cross-machine shards and shared information themselves.
Voice bots unwilling to manage media dependencies: the guide calls for @discordjs/voice, assumes FFmpeg in its examples, and may need Opus or encryption packages.

Setup reality

Our sandbox installed 2,157 pnpm packages in 68 seconds and used 2,305 MB. The build passed in 159 seconds. Tests passed in 53 seconds, with Vitest reporting 3 passed and 0 failed out of 3.

A real bot needs a Discord application token and explicit gateway intents; privileged intents may need portal enablement or Discord approval. Stable release 14.27.0 declares Node 18 or newer. The measured main commit declares Node 24.17.0 or newer even though our lab-node:22 image completed the checks.

Voice is a separate package and broader media input usually adds FFmpeg and an Opus library. The 14.8 MB checkout is a workspace monorepo with 15 CI workflow files and no root Dockerfile or tests directory. Cache limits, sweepers, and sharding become application design work as a bot grows.

Discord.js 14 gives Node bots a complete client

Discord.js 14.27.0 wraps Discord's gateway and HTTP APIs in a Node client with typed events, structures, permission helpers, interaction responses, and caches. The main package suits bots that must stay connected and react to commands, messages, member changes, or voice state. Its object model saves application code from decoding raw gateway payloads and maintaining every related entity by hand.

That convenience creates state. The v14 guide explains that intents decide which events arrive, and those events keep internal caches current. Omitting an intent can leave a message or interaction with only guild and channel IDs instead of full objects. The library works best when you want that managed client model. If a job sends one webhook or makes a few HTTP calls, a persistent gateway connection and object cache solve a problem you do not have.

Fourteen packages let you choose a narrower layer

The README lists 14 packages, including the assembled discord.js client and smaller pieces for REST, WebSocket, builders, collections, formatting, core structures, RPC, and voice. That split is useful architecture rather than catalog padding. A service that only registers commands can use @discordjs/rest; an infrastructure team can build around @discordjs/core and @discordjs/ws without accepting every behavior of the high-level client.

The repository still develops all 14 packages together. Contributors install a pnpm workspace, build through Turbo, and run shared checks. The measured checkout contained 1,820 files and about 142,401 source lines before dependencies. That is appropriate for maintainers changing API types, documentation, voice, and transport code in one revision. It is needless weight for an ordinary bot, which should install the published package rather than clone the monorepo.

What happened when we ran it

In our run, we measured a 68-second install for 2,157 pnpm packages. Dependencies occupied 2,305 MB, compared with a 14.8 MB checkout. The build completed successfully in 159 seconds, and the test command finished in 53 seconds. Vitest reported 3 passed and 0 failed out of 3. Our measurement setup used commit 8802121 in an unprivileged lab-node:22 container with 3 CPUs, 8 GB of RAM, and no secrets.

The run proves that the supplied workspace installed, built, and passed its available test target in our container. It does not measure gateway latency, reconnect behavior, cache memory, REST throughput, voice quality, or a production bot. The repository had 15 CI workflow files, no root Dockerfile, and no tests directory even though the test command ran Vitest workspaces. We found no failed step to explain, and the lab block supplied no dependency audit result.

The source workspace costs 2,305 MB before bot code

A normal user does not need the 2,305 MB contributor environment. Stable release 14.27.0 declares Node 18 or newer and installs from a package manager. By contrast, the measured main commit requests Node 24.17.0 or newer and pnpm 11.25.0. Our lab-node:22 image completed install, build, and tests, which shows pnpm did not turn that engine mismatch into a failed step in this run. It does not erase the manifest requirement.

Runtime setup also needs a Discord application and token. The client refuses to start without gateway intents, and the guide names 3 privileged groups: presences, message content, and guild members. Smaller unverified bots can enable them in the developer portal under the documented conditions; verified bots may need approval. Enable only the events the product uses, because extra traffic increases bandwidth and memory while sensitive intents expand the data your process receives.

Cache controls can save memory and break behavior

Discord.js 14.27.0 offers cache size limits and scheduled sweepers, but its guide labels this an advanced topic. Several managers, including guilds, channels, roles, and permission overwrites, cannot be customized safely. Even supported reductions need care: removing reactions or old messages can change what later event handlers find. A cache policy belongs in load tests and feature tests, not in a copied configuration block.

Open issue 11546 gives that warning a concrete edge case. The reporter found that a guild left during a sharding disconnect could remain cached after the session resumed. Issue 11626 reports a separate 14.27.0 readiness problem: isReady() stayed true during a 38-minute reconnect loop with 3,651 shard errors and 0 successful reconnects. Both reports remain open, so production health should include actual shard state and useful Discord operations instead of one boolean.

Sharding works on one machine before it becomes infrastructure

The v14 guide says Discord requires sharding at 2,500 guilds and suggests preparing around 2,000. Discord.js can launch separate processes or worker threads through ShardingManager, while internal sharding opens several connections in one process. The guide warns that internal sharding can consume too much memory for larger bots. Statistics and caches become shard-local, so even a server count must collect values across processes.

Cross-machine deployment is less packaged. The guide says you can pass shard choices to each client, but distributing processes and sharing information are the operator's job. At that size, plan a coordinator, durable state, deploy sequencing, rate-limit behavior, and shard-aware health checks. Discord.js supplies protocol clients and useful process helpers. It does not supply a cluster control plane.

Release 14.27.0 is maintained, with live operational bugs

Release 14.27.0 shipped on July 15, 2026, and added voice messages alongside API and typing fixes. The repository was pushed on September 21, while issues and pull requests were updated through that date. GitHub reported 163 open issues and pull requests. That combined number includes proposals and patches, so it is evidence of a busy queue rather than a count of confirmed defects.

For most Node teams, Discord.js remains the practical first library to try because the guide follows the same problems a bot meets as it grows. Our 68-second install and passing build make the source credible for contributors, while the 2,305 MB footprint argues for published packages in application work. Use its higher-level client when you need the state it manages. Choose REST, Discordeno, or another language library when you do not.

Alternatives

ProjectWhat it isPick it when
DiscordenoA Discord API library designed for both Node and Deno runtimes.pick this instead when Deno support or a more modular runtime design matters more than the discord.js guide and object model.
Sapphire FrameworkAn application framework built on discord.js with stronger structure for bot projects.pick this instead when you want an opinionated command and plugin architecture on top of discord.js rather than assembling one yourself.
SerenityA Rust library for Discord's API with gateway and HTTP support.pick this instead when your service is already in Rust or you prefer Rust's type and deployment model over Node.js.

What people are saying

  1. [velocity-scout] discordjs/discord.js

Sources

  1. discord.js repository and package list
  2. discord.js 14.27.0 release
  3. Gateway intents guide
  4. Cache customization guide
  5. Application sharding guide
  6. Voice installation guide
  7. Open readiness and reconnect issue 11626
  8. Open stale guild cache issue 11546

More dev tools reviews

asdf · h4cker · bend · 100-exercises-to-learn-rust · PhotoGIMP · mvt · the whole board →