.

Gocord
Gocord is a Go library forked from DisGo,
that is a Discord API wrapper written in Go.
Why fork?: This project was created for internal use within the bot
Digo, which was developed by
Nextep to study and enhance the team's knowledge of Go. For this reason, we
wanted maximum control and to ensure the library is updated as quickly as
possible with the latest Discord changes. However, we didn’t want to start
from scratch.
Stability
The public API of Gocord 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 Gocord should be
increased and with that breaking changes between non-major versions should be
held to a minimum.
Documentation
Documentation is wip and can be found under
GitHub Wiki is currently under construction. We appreciate help here.
Features
Missing Features
Getting Started
Installing
$ go get github.com/nextep-community/gocord
Building a gocord Instance
Build a bot client to interact with the Discord API
package main
import (
"context"
"os"
"os/signal"
"syscall"
"github.com/nextep-community/gocord"
"github.com/nextep-community/gocord/bot"
"github.com/nextep-community/gocord/events"
"github.com/nextep-community/gocord/gateway"
)
func main() {
client, err := gocord.New("token",
bot.WithGatewayConfigOpts(
gateway.WithIntents(
gateway.IntentGuilds,
gateway.IntentGuildMessages,
gateway.IntentDirectMessages,
),
),
bot.WithEventListenerFunc(func(e *events.MessageCreate) {
}),
)
if err != nil {
panic(err)
}
if err = client.OpenGateway(context.TODO()); err != nil {
panic(err)
}
s := make(chan os.Signal, 1)
signal.Notify(s, syscall.SIGINT, syscall.SIGTERM)
<-s
}
Logging
gocord uses slog for logging.
Examples
You can find examples
here
There is also a bot template with commands & db
here
Other interesting projects
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
Is a Lavalink-Client which can be used
to communicate with Lavalink to play/search tracks
Other Golang Discord Libraries
Troubleshooting
TODO
Contributing
TODO
Special Thanks
We would like to thank the DisGo team and
community.
License
See LICENSE for more information.
.