MCPcopy Index your code
hub / github.com/disgoorg/disgo

github.com/disgoorg/disgo @v0.19.6

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.19.6 ↗ · + Follow
4,866 symbols 9,527 edges 298 files 1,518 documented · 31% 2 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Go Reference Go Report Go Version License DisGo Version DisGo Discord

discord gopher

DisGo

DisGo is a Discord API wrapper written in Golang aimed to be consistent, modular, customizable and higher level than other Discord API wrappers.

Summary

  1. Stability
  2. Features
  3. Missing Features
  4. Getting Started
  5. Documentation
  6. Examples
  7. Other interesting Projects to look at
  8. Other Golang Discord Libraries
  9. Troubleshooting
  10. Contributing
  11. License

Stability

The public API of DisGo is mostly stable at this point in time. Smaller breaking changes can happen before the v1 is released.

After v1 is released breaking changes may only happen if the Discord API requires them. They tend to break their released API versions now and then. In general for every new Discord API version the major version of DisGo should be increased and with that breaking changes between non-major versions should be held to a minimum.

Features

Missing Features

  • RPC (https://github.com/disgoorg/disgo/pull/170)

Getting Started

Installing

$ go get github.com/disgoorg/disgo

Building a DisGo Instance

Build a bot client to interact with the Discord API

package main

import (
    "context"
    "os"
    "os/signal"
    "syscall"

    "github.com/disgoorg/disgo"
    "github.com/disgoorg/disgo/bot"
    "github.com/disgoorg/disgo/events"
    "github.com/disgoorg/disgo/gateway"
)

func main() {
    client, err := disgo.New("token",
        // set gateway options
        bot.WithGatewayConfigOpts(
            // set enabled intents
            gateway.WithIntents(
                gateway.IntentGuilds,
                gateway.IntentGuildMessages,
                gateway.IntentDirectMessages,
            ),
        ),
        // add event listeners
        bot.WithEventListenerFunc(func(e *events.MessageCreate) {
            // event code here
        }),
    )
    if err != nil {
        panic(err)
    }
    // connect to the gateway
    if err = client.OpenGateway(context.TODO()); err != nil {
        panic(err)
    }

    s := make(chan os.Signal, 1)
    signal.Notify(s, syscall.SIGINT, syscall.SIGTERM)
    <-s
}

Full Ping Pong Example

A full Ping Pong example can also be found here

Logging

DisGo uses slog for logging.

Documentation

Documentation is wip and can be found under

  • Go Reference
  • Discord Documentation

GitHub Wiki is currently under construction. We appreciate help here.

Examples

You can find examples here

There is also a bot template with commands & db here

or in these projects:

Libraries for DisGo

  • disgomd is a command utility library that uses struct based approach

Other interesting Projects to look at

Lavalink

Is a standalone audio sending node based on Lavaplayer and JDA-Audio. Which allows for sending audio without it ever reaching any of your shards. Lavalink can be used in combination with DisGolink for music Bots

Being used in production by FredBoat, Dyno, LewdBot, and more.

DisGolink

Is a Lavalink-Client which can be used to communicate with Lavalink to play/search tracks

Other Golang Discord Libraries

Troubleshooting

For help feel free to open an issue or reach out on Discord

Contributing

Contributions are welcomed but for bigger changes we recommend first reaching out via Discord or create an issue to discuss your problems, intentions and ideas.

License

Distributed under the License. See LICENSE for more information.

Supported by Jetbrains

Jetbrain Open Source Community Support

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 3,070
Struct 775
Function 619
TypeAlias 228
Interface 115
FuncType 59

Languages

Go100%

Modules by API surface

cache/caches.go308 symbols
discord/component.go287 symbols
gateway/gateway_events.go274 symbols
discord/channel.go241 symbols
discord/select_menu.go127 symbols
discord/application_command_option.go98 symbols
discord/interaction_application_command.go95 symbols
discord/application_command.go93 symbols
discord/interaction_component.go74 symbols
rest/guilds.go71 symbols
voice/gateway_messages.go66 symbols
rest/applications.go65 symbols

Used by 2 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add disgo \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page