https://github.com/zombiezen/go-discord
Go library for interacting with the Discord API (work-in-progress)
https://github.com/zombiezen/go-discord
client-library discord discord-api library
Last synced: 2 months ago
JSON representation
Go library for interacting with the Discord API (work-in-progress)
- Host: GitHub
- URL: https://github.com/zombiezen/go-discord
- Owner: zombiezen
- License: apache-2.0
- Created: 2021-12-08T18:48:43.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-09T00:04:45.000Z (over 4 years ago)
- Last Synced: 2025-10-21T12:02:08.291Z (9 months ago)
- Topics: client-library, discord, discord-api, library
- Language: Go
- Homepage:
- Size: 43.9 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# zombiezen Go Client for Discord
`zombiezen.com/go/discord` is a WIP Go library
for interacting with the [Discord API][].
It differs from [DiscordGo][] by providing a [`Context`][]-aware API.
[Discord API]: https://discord.com/developers/docs/intro
[DiscordGo]: https://github.com/bwmarrin/discordgo
[`Context`]: https://pkg.go.dev/context
## Installation
```shell
go get zombiezen.com/go/discord
```
## Basic Usage
```go
auth := discord.BotAuthorization("xyzzy")
client := discord.NewClient(auth, nil)
dmChannel, err := client.CreateDM(ctx, userID)
if err != nil {
return err
}
_, err = client.CreateMessage(ctx, &discord.CreateMessageParams{
ChannelID: dmChannel.ID,
Content: "Hello, World!",
})
if err != nil {
return err
}
```
See pkg.go.dev for
[more examples](https://pkg.go.dev/zombiezen.com/go/discord#pkg-examples).
## Contributing
We'd love to accept your patches and contributions to this project.
See [CONTRIBUTING.md](CONTRIBUTING.md) for more details.
## Links
- [Discord Developer Documentation](https://discord.com/developers/docs/intro)
- [Release Notes](https://github.com/zombiezen/go-discord/blob/main/CHANGELOG.md)
## License
[Apache 2.0](LICENSE)