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.