Build a Discord bot in Go that responds to commands and sends messages to specific channels
Create a music bot that joins voice channels and streams audio using the dgVoice companion package
Listen to real-time Discord events like user joins, reactions, or message edits in a Go service
Add Discord notifications to an existing Go application using the REST API
Requires a Discord bot token from the Discord Developer Portal before you can connect.
DiscordGo is a Go library that lets developers interact with the Discord platform programmatically. Discord provides an API so that outside developers can build bots, integrations, and tools that connect to Discord servers, read and send messages, manage channels, and handle voice. DiscordGo wraps that API in Go code so you do not have to write raw HTTP requests yourself. The library covers nearly all of Discord's API surface: the standard REST endpoints for reading and writing data, the real-time WebSocket connection that delivers events (such as messages arriving, users joining, or reactions being added), and the voice interface for bots that play audio in voice channels. A companion package called dgVoice provides additional helper functions for working with voice, and another tool called dca handles audio encoding. To use it, you import the package into your Go project, create a client with a bot authentication token, register callback functions for the Discord events you care about, and then open the connection. Example programs and a curated list of projects built with the library are linked from the README. The library is described as a low-level binding: it maps closely to the Discord API itself rather than adding high-level abstractions on top. The maintainers intentionally keep it that way, so contributions that add behavior beyond what the Discord API directly exposes are discussed before being accepted. The Discord API itself is noted as still evolving, which means the library may also change. Documentation is available on pkg.go.dev. Community support is available in the Discord Gophers chat server.
← bwmarrin on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.