whatisgithub

What is discordgo?

bwmarrin/discordgo — explained in plain English

Analysis updated 2026-06-26

5,913GoAudience · developerComplexity · 2/5Setup · easy

In one sentence

A Go library for building Discord bots and integrations that covers the full Discord API, sending messages, handling real-time events, and streaming audio in voice channels.

Mindmap

mindmap
  root((repo))
    What it does
      Discord API in Go
      Bot building
      Event handling
    Features
      REST API
      WebSocket events
      Voice channels
    Tech
      Go
      WebSocket
      Discord API
    Audience
      Go developers
      Bot builders
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Build a Discord bot in Go that responds to commands and sends messages to specific channels

USE CASE 2

Create a music bot that joins voice channels and streams audio using the dgVoice companion package

USE CASE 3

Listen to real-time Discord events like user joins, reactions, or message edits in a Go service

USE CASE 4

Add Discord notifications to an existing Go application using the REST API

What is it built with?

GoWebSocketDiscord API

How does it compare?

bwmarrin/discordgoweaveworks/scopegorgonia/gorgonia
Stars5,9135,9135,914
LanguageGoGoGo
Setup difficultyeasyeasyhard
Complexity2/53/54/5
Audiencedeveloperops devopsdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Requires a Discord bot token from the Discord Developer Portal before you can connect.

License not specified in the explanation.

So what is it?

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.

Copy-paste prompts

Prompt 1
Show me how to build a basic Discord bot in Go with DiscordGo that responds to a hello command
Prompt 2
How do I listen for incoming messages in DiscordGo and filter responses to a specific channel?
Prompt 3
Set up a DiscordGo bot that joins a voice channel and plays an audio file using dgVoice
Prompt 4
How do I register and handle slash command interactions in DiscordGo with proper callback setup?
Prompt 5
Deploy a DiscordGo bot to a Linux server so it keeps running after I disconnect

Frequently asked questions

What is discordgo?

A Go library for building Discord bots and integrations that covers the full Discord API, sending messages, handling real-time events, and streaming audio in voice channels.

What language is discordgo written in?

Mainly Go. The stack also includes Go, WebSocket, Discord API.

What license does discordgo use?

License not specified in the explanation.

How hard is discordgo to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is discordgo for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.