You agree to license any contribution to this library under the Apache License 2.0.
Pull requests must follow the code specification and work with all test cases.
The domain of Disgo in providing an API for HTTP/WebSocket requests. The program uses provided structures (from the Discord API) to provide simple abstractions for end users (developers).
The repository contains a README, Examples, Code Generator, Cache, Shard Manager, API Tools, and API Wrapper.
Package | Description |
---|---|
wrapper | API Wrapper. |
cache | Cache. |
shard | Shard Manager. |
tools | Utility Tools. |
A bundler is used to package the API into a disgo
package (disgo.go
).
Structs are sourced from Dasgo.
disgo.User
disgo.GetUser
Resource GET, DELETE, POST, PUT, BULK (GET, ...) Send()
functions are generated from the respective requests object. For more information, read the requests README.
Disgo uses generators to easily update and maintain over 10,000 lines of code. For more information, read gen.
Comments follow Effective Go and explain why more than what (unless the "what" isn't intuitive).
Disgo uses golangci-lint in order to statically analyze code. You can install golangci-lint with go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.3
.
Directory | Command | Description | GOWORK |
---|---|---|---|
disgo |
golangci-lint run ./wrapper/... |
Perform static code analysis on the API Wrapper. | default |
./_examples |
golangci-lint run ./... |
Perform static code analysis on the examples. | default |
./_gen |
golangci-lint run ./... |
Perform static code analysis on the generator. | off |
disgo |
golangci-lint run ./cache/... |
Perform static code analysis on the Disgo Cache. | default |
disgo |
golangci-lint run ./shard/... |
Perform static code analysis on the Shard Manager. | default |
disgo |
golangci-lint run ./tools/... |
Perform static code analysis on the Tools package. | default |
- If you receive a
diff
error, add adiff
tool in your PATH: There is one located in theGit/bin
directory. - If you receive
File is not ... with -...
, usegolangci-lint run --disable-all --no-config -Egofmt --fix
or ignore it. - If you receive
main module ... does not contain package ...
, setGOWORK=off
.
Disgo fieldaligns bundled code to save memory.
Unit tests are used to test logic.
Integration tests are used to ensure functionality between the API Wrapper and Discord.
Use go test
to run the tests in the current directory. Use go test ./<dir>
to run tests in a given directory (from the current directory). Use Github Action Workflow Files to find the correct test command and environment variables for a module.
Disgo is STABLE.
The following additional features are being implemented:
- Voice Connections (UDP Decision, Audio Processing using Opus)
- Cache