-
Notifications
You must be signed in to change notification settings - Fork 0
docs: polish README and fix stale rest.go retry comment #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,7 +6,7 @@ | |||||||||||
| [](https://github.com/hilleywyn/godiscord/actions/workflows/ci.yml) | ||||||||||||
| [](LICENSE) | ||||||||||||
|
|
||||||||||||
| GoDiscord implements [Discord Gateway v10](https://discord.com/developers/docs/topics/gateway) and the Discord REST API v10 using only the Go standard library — no `github.com/gorilla/websocket`, no `github.com/bwmarrin/discordgo`, no external packages at all. | ||||||||||||
| GoDiscord implements [Discord Gateway v10](https://discord.com/developers/docs/topics/gateway) and the Discord REST API v10 using only the Go standard library — no `github.com/gorilla/websocket`, no `github.com/bwmarrin/discordgo`, no external packages at all. It ships its own RFC 6455 WebSocket client and a typed event dispatcher, and every handler runs under panic recovery so one misbehaving callback can't take the bot down. | ||||||||||||
|
|
||||||||||||
| --- | ||||||||||||
|
|
||||||||||||
|
|
@@ -64,7 +64,22 @@ See [`example/basic/`](example/basic/) for a runnable starter bot and [`example/ | |||||||||||
| go get github.com/hilleywyn/godiscord | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| GoDiscord requires **Go 1.21 or later**. | ||||||||||||
| GoDiscord requires **Go 1.21 or later**. There are no transitive | ||||||||||||
| dependencies: after `go get`, `go.sum` lists only GoDiscord itself. | ||||||||||||
|
|
||||||||||||
| ### Vendored builds | ||||||||||||
|
|
||||||||||||
| For self-contained deployments (e.g. scratch Docker images), vendor | ||||||||||||
| the module and build with `-mod=vendor`: | ||||||||||||
|
|
||||||||||||
| ```bash | ||||||||||||
| GOWORK=off go mod tidy | ||||||||||||
| GOWORK=off go mod vendor | ||||||||||||
| go build -mod=vendor ./... | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| The `GOWORK=off` disables workspace mode so a sibling `go.work` file | ||||||||||||
| doesn't pull in live-dev paths during vendoring. | ||||||||||||
|
|
||||||||||||
| --- | ||||||||||||
|
|
||||||||||||
|
|
@@ -258,8 +273,9 @@ modPerms := discord.Permission(0).Add( | |||||||||||
| GoDiscord handles `429 Too Many Requests` responses automatically. When Discord | ||||||||||||
| returns a rate-limit response the client reads the `Retry-After` header, sleeps | ||||||||||||
| for the indicated duration, and retries the request. Retries are capped at | ||||||||||||
| **3 attempts per call**; if the budget is exhausted a `*APIError` with | ||||||||||||
| `StatusCode == 429` is returned so you can decide how to proceed. | ||||||||||||
| **3 attempts per call** (`maxRateLimitRetries`); if the budget is exhausted a | ||||||||||||
|
||||||||||||
| **3 attempts per call** (`maxRateLimitRetries`); if the budget is exhausted a | |
| **up to 3 retries per call** (`maxRateLimitRetries`), for **up to 4 total | |
| attempts** (1 initial request + 3 retries); if the budget is exhausted a |
Copilot
AI
Apr 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This claims “GoDiscord surfaces the 4014 close code in the gateway log”, but the current WebSocket client treats close frames as io.EOF without parsing/logging the close code, and the gateway logs only a generic disconnect message. Either adjust the statement to reflect current logging, or update the gateway/websocket close handling to record the close code and reason.
| intents your bot requests. GoDiscord surfaces the 4014 close code in the | |
| gateway log so it's straightforward to recognise in traces. | |
| intents your bot requests. If the bot connects and then immediately | |
| disconnects after requesting one of these intents, verify that the matching | |
| privileged intent is enabled in the portal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new “Vendored builds” subsection duplicates the later “Vendoring” section (both show the same
GOWORK=off … go mod vendorworkflow). To avoid the two sections drifting over time, consider consolidating into a single section or having one link to the other.