# discordjs/discord.js

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/discordjs-discord-js).**

26,741 stars · 4,086 forks · TypeScript · Apache-2.0

## Links

- GitHub: https://github.com/discordjs/discord.js
- Homepage: https://discord.js.org
- awesome-repositories: https://awesome-repositories.com/repository/discordjs-discord-js.md

## Topics

`bot` `discord` `discord-api` `discord-bot` `discord-server` `discordjs` `hacktoberfest` `nodejs` `voice-support`

## Description

Discord.js is a Node.js library and framework for interacting with the Discord API. It provides a comprehensive set of wrappers for REST and WebSocket connections, enabling the development of automated server accounts and real-time chat applications.

The project distinguishes itself through a distributed bot sharding system that splits a single bot instance across multiple processes to handle high server counts and large-scale workloads. It also includes a specialized voice API wrapper for managing audio streams and voice channel connectivity.

The library covers broad capability areas including server moderation automation, real-time event handling via a WebSocket gateway, and network traffic management using token-bucket rate limiting. It provides utilities for data collection management through map-based caching and tools for chat string formatting.

A command line tool is provided for project scaffolding and initial configuration.

## Tags

### Networking & Communication

- [Discord Integrations](https://awesome-repositories.com/f/networking-communication/discord-integrations.md) — Provides a comprehensive wrapper for the Discord API, managing both REST interfaces and persistent WebSocket connections. ([source](https://github.com/discordjs/discord.js/blob/main/package.json))
- [Bot Frameworks](https://awesome-repositories.com/f/networking-communication/bot-frameworks.md) — Offers a complete framework for building automated server accounts to manage moderation and user interactions.
- [Websocket Connection Managers](https://awesome-repositories.com/f/networking-communication/connection-management/websocket-connection-managers.md) — Maintains a persistent WebSocket connection to the Discord gateway to receive real-time events and push data. ([source](https://github.com/discordjs/discord.js/tree/main/packages/ws))
- [WebSocket Event Systems](https://awesome-repositories.com/f/networking-communication/distributed-systems-p2p/distributed-computing/communication-protocols/websocket-implementations/websocket-event-systems.md) — Provides a bidirectional WebSocket gateway for receiving real-time server events and pushing updates.
- [Rate Limiters](https://awesome-repositories.com/f/networking-communication/rate-limiters.md) — Manages an outgoing request queue using token-bucket rate limiting to adhere to strict API frequency constraints.
- [Real-Time Messaging](https://awesome-repositories.com/f/networking-communication/real-time-messaging.md) — Implements a persistent, bidirectional connection to the Discord Gateway for real-time event handling and messaging.
- [REST Client Executions](https://awesome-repositories.com/f/networking-communication/rest-client-executions.md) — Executes HTTP requests to perform discrete actions such as sending messages or creating threads. ([source](https://github.com/discordjs/discord.js/tree/main/packages/rest))
- [Bot Interaction Orchestration](https://awesome-repositories.com/f/networking-communication/bot-interaction-orchestration.md) — Orchestrates bot-driven interactions and automates tasks through a server-side environment. ([source](https://github.com/discordjs/discord.js/blob/main/README.md))
- [Chat Moderation Tools](https://awesome-repositories.com/f/networking-communication/communication-platforms-services/communication-platforms/messaging-middleware/chat-moderation-tools.md) — Automates server moderation, message responses, and administrative tasks via the chat API. ([source](https://github.com/discordjs/discord.js#readme))
- [Voice](https://awesome-repositories.com/f/networking-communication/state-synchronization/voice.md) — Coordinates audio stream connectivity by interacting with a dedicated voice API and managing channel states.
- [Voice Platform Integrations](https://awesome-repositories.com/f/networking-communication/voice-platform-integrations.md) — Implements audio streaming and voice channel management by interfacing with the specialized voice API.

### Part of an Awesome List

- [Scaling Strategies](https://awesome-repositories.com/f/awesome-lists/ai/bot/scaling-strategies.md) — Provides a distributed sharding system to split bot instances across multiple processes for large-scale server workloads.
- [Workload Sharding](https://awesome-repositories.com/f/awesome-lists/media/workload-sharding.md) — Implements a distributed sharding system that splits a single bot across multiple processes to handle large server counts.
- [Voice API Connections](https://awesome-repositories.com/f/awesome-lists/media/voice-and-media/voice-api-connections.md) — Handles audio streaming and channel communication by interacting with a dedicated voice service API. ([source](https://github.com/discordjs/discord.js/blob/main/README.md))
- [Channel Management](https://awesome-repositories.com/f/awesome-lists/media/voice-and-media/voice-api-connections/channel-management.md) — Connects to and manages audio streams within voice channels using a dedicated voice API. ([source](https://github.com/discordjs/discord.js#readme))
- [Voice API Wrappers](https://awesome-repositories.com/f/awesome-lists/media/voice-and-media/voice-api-connections/voice-api-wrappers.md) — Includes a specialized wrapper for managing audio streams and connecting to voice channels.

### Data & Databases

- [Process Sharding](https://awesome-repositories.com/f/data-databases/distributed-sharding-architectures/process-sharding.md) — Splits a single bot instance across multiple processes to handle high server counts and large-scale workloads.
- [Object Caching](https://awesome-repositories.com/f/data-databases/map-data-structure-manipulation/object-caching.md) — Stores API objects in custom map structures for fast retrieval and organized manipulation of grouped data.

### DevOps & Infrastructure

- [Bot Building](https://awesome-repositories.com/f/devops-infrastructure/automation-orchestration/task-execution-frameworks/bot-building.md) — Provides a framework for building automated tools and interactive bots within a JavaScript environment.
- [Process Scaling](https://awesome-repositories.com/f/devops-infrastructure/process-scaling/thread-scaling/process-scaling.md) — Distributes connection loads across multiple processes to increase the total number of active bots. ([source](https://github.com/discordjs/discord.js/tree/main/packages/ws))

### Web Development

- [API Request Handling](https://awesome-repositories.com/f/web-development/api-management-tools/api-request-handling.md) — Coordinates the flow of outgoing network requests to ensure a controlled sequence and adherence to rate limits. ([source](https://github.com/discordjs/discord.js/tree/main/packages/brokers))

### Graphics & Multimedia

- [Audio Streaming Engines](https://awesome-repositories.com/f/graphics-multimedia/audio-music/audio-streaming-engines.md) — Provides a system for sending and receiving audio data within communication channels. ([source](https://github.com/discordjs/discord.js/tree/main/packages/voice))

### Programming Languages & Runtimes

- [Object Collection Management](https://awesome-repositories.com/f/programming-languages-runtimes/collection-data-structures/object-collection-management.md) — Stores and organizes sets of objects using a map-like structure to simplify retrieval and manipulation. ([source](https://github.com/discordjs/discord.js/tree/main/packages/collection))
