# bwmarrin/discordgo

**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/bwmarrin-discordgo).**

5,786 stars · 893 forks · Go · bsd-3-clause

## Links

- GitHub: https://github.com/bwmarrin/discordgo
- awesome-repositories: https://awesome-repositories.com/repository/bwmarrin-discordgo.md

## Topics

`discord` `discord-api` `discordgo` `go` `golang`

## Description

Discordgo is a Go library for building Discord bots and integrations, providing a complete client for both the Discord REST API and the real-time Gateway WebSocket protocol. It serves as a foundational package for developers who need to connect authenticated clients to Discord servers, send messages, handle events, and manage real-time communication programmatically.

The library distinguishes itself through a comprehensive set of architectural components designed for production bot development. It includes a command routing middleware system that parses incoming messages and dispatches them to handler functions, an embed-based interactive component system for building reaction-driven UI widgets, and a gateway event dispatch model that multiplexes events to registered callbacks. For scaling, it offers a sharded WebSocket connection pool and gateway sharding support to handle large server volumes, alongside a rate-limited request queue and RESTful API client abstraction with automatic retry logic.

Additional capabilities include a platform-agnostic message relay bridge for cross-platform chat forwarding, voice state tracking for ephemeral role management based on voice channel membership, and a structured command routing system for organizing bot logic. The library also provides Discord event handling with callback registration for events such as messages and member joins.

The project is distributed as a Go package with documentation covering installation, client setup, and the full API surface for both REST and Gateway interactions.

## Tags

### Networking & Communication

- [Discord Integrations](https://awesome-repositories.com/f/networking-communication/discord-integrations.md) — A Go package for interacting with the Discord chat platform's REST and WebSocket APIs to build bots and integrations. ([source](https://cdn.jsdelivr.net/gh/bwmarrin/discordgo@master/README.md))
- [Bot Frameworks](https://awesome-repositories.com/f/networking-communication/bot-frameworks.md) — A Go framework for creating Discord bots with command routing, event handling, and sharding support.
- [Event-Driven Callbacks](https://awesome-repositories.com/f/networking-communication/discord-integrations/event-driven-callbacks.md) — Provides a gateway event dispatch model that multiplexes events to registered callbacks for real-time Discord interaction. ([source](https://cdn.jsdelivr.net/gh/bwmarrin/discordgo@master/README.md))
- [Discord Gateway Clients](https://awesome-repositories.com/f/networking-communication/websocket-services/multi-protocol-gateways/persistent-websocket-gateways/discord-gateway-clients.md) — A Go client for the Discord real-time gateway protocol that manages WebSocket connections and event dispatch.
- [Discord Chat Bridges](https://awesome-repositories.com/f/networking-communication/communication-platforms-services/communication-platforms/messaging-middleware/chat-platform-integrations/discord-chat-bridges.md) — Ships a platform-agnostic message relay bridge for forwarding messages between Discord and external chat platforms. ([source](https://github.com/bwmarrin/discordgo/wiki/Awesome-DiscordGo))
- [Sharded WebSocket Pools](https://awesome-repositories.com/f/networking-communication/connection-management/websocket-connection-managers/sharded-websocket-pools.md) — Manages multiple WebSocket connections across shards to distribute gateway load and maintain real-time event delivery.
- [Rate Limiters](https://awesome-repositories.com/f/networking-communication/rate-limiters.md) — Queues outgoing API requests with token-bucket rate limiting to comply with Discord's per-endpoint and global limits.

### Development Tools & Productivity

- [REST API Clients](https://awesome-repositories.com/f/development-tools-productivity/rest-apis/rest-api-clients.md) — Wraps Discord's HTTP API in a typed client with automatic rate limiting and retry logic for reliable request handling.
- [Discord REST Clients](https://awesome-repositories.com/f/development-tools-productivity/rest-apis/rest-api-clients/discord-rest-clients.md) — A Go wrapper around the Discord REST API for sending messages, managing guilds, and performing administrative actions.

### Software Engineering & Architecture

- [Gateway Event Dispatchers](https://awesome-repositories.com/f/software-engineering-architecture/asynchronous-event-dispatchers/reactive-event-dispatchers/gateway-event-dispatchers.md) — Dispatches Discord gateway events to registered callbacks using a multiplexed handler pattern for concurrent processing.
- [Command Routing Architectures](https://awesome-repositories.com/f/software-engineering-architecture/command-routing-architectures.md) — Provides a command routing middleware system that parses messages and dispatches them to handler functions. ([source](https://github.com/bwmarrin/discordgo/wiki/Awesome-DiscordGo))
- [Discord Command Middleware](https://awesome-repositories.com/f/software-engineering-architecture/command-routing-architectures/discord-command-middleware.md) — Ships a command routing middleware system that parses messages and dispatches them to handler functions.

### Data & Databases

- [Gateway Sharding](https://awesome-repositories.com/f/data-databases/distributed-sharding-architectures/process-sharding/gateway-sharding.md) — Scales bot connections across multiple gateway shards to handle large numbers of servers and high message volumes. ([source](https://github.com/bwmarrin/discordgo/wiki/Awesome-DiscordGo))

### User Interface & Experience

- [Discord Embed Widgets](https://awesome-repositories.com/f/user-interface-experience/media-embeds/interactive-component-embeds/discord-embed-widgets.md) — Implements embed-based interactive components with reaction buttons for user-driven navigation and actions. ([source](https://github.com/bwmarrin/discordgo/wiki/Awesome-DiscordGo))

### Part of an Awesome List

- [Programming Languages](https://awesome-repositories.com/f/awesome-lists/devtools/programming-languages.md) — Facilitates Go development and Discord API integration.
