Documentation
¶
Index ¶
Constants ¶
View Source
const (
RepositoryURL = "https://github.com/streame-gg/go-discord-wrapper"
)
Variables ¶
View Source
var RepositoryVersion = resolveVersion()
RepositoryVersion is the library version advertised to Discord in the REST User-Agent header and the gateway IDENTIFY properties. It is resolved once at startup from the build's module version so it cannot drift out of sync with the published tag; it falls back to repositoryVersionFallback for local (untagged) builds.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package api implements the Discord REST API client with proactive rate limiting, configurable retry logic, and full coverage of Discord API v10 endpoints.
|
Package api implements the Discord REST API client with proactive rate limiting, configurable retry logic, and full coverage of Discord API v10 endpoints. |
|
Package builder provides fluent constructors for Discord UI components: embeds, buttons, select menus, modals, action rows, and text inputs.
|
Package builder provides fluent constructors for Discord UI components: embeds, buttons, select menus, modals, action rows, and text inputs. |
|
Package cache defines the caching interface for Discord entities and provides an in-process implementation via NewMemoryCache.
|
Package cache defines the caching interface for Discord entities and provides an in-process implementation via NewMemoryCache. |
|
mongocache
Package mongocache provides a MongoDB-backed implementation of cache.Cache.
|
Package mongocache provides a MongoDB-backed implementation of cache.Cache. |
|
rediscache
Package rediscache provides a Redis-backed implementation of cache.Cache.
|
Package rediscache provides a Redis-backed implementation of cache.Cache. |
|
stores
Package stores provides the generic BaseStore foundation and all option types used by the cache package.
|
Package stores provides the generic BaseStore foundation and all option types used by the cache package. |
|
Package collection provides a generic Collection[K, V] type — a map with insertion-order iteration and ~30 utility methods, inspired by @discordjs/collection.
|
Package collection provides a generic Collection[K, V] type — a map with insertion-order iteration and ~30 utility methods, inspired by @discordjs/collection. |
|
Package connection — cache update helpers.
|
Package connection — cache update helpers. |
|
example
|
|
|
caching
command
caching demonstrates how to attach a cache to the client and read entities back out of it without hitting the REST API.
|
caching demonstrates how to attach a cache to the client and read entities back out of it without hitting the REST API. |
|
commands
command
commands demonstrates the full slash-command lifecycle:
|
commands demonstrates the full slash-command lifecycle: |
|
error_handling
command
error_handling demonstrates how to inspect Discord REST errors with strong typing: matching a specific JSON error code (e.g.
|
error_handling demonstrates how to inspect Discord REST errors with strong typing: matching a specific JSON error code (e.g. |
|
sharding
command
sharding demonstrates running multiple gateway connections in one process with a ShardManager and a local in-process coordinator.
|
sharding demonstrates running multiple gateway connections in one process with a ShardManager and a local in-process coordinator. |
|
slash_with_defer
command
slash_with_defer demonstrates three patterns:
|
slash_with_defer demonstrates three patterns: |
|
template
command
Command template is a batteries-included starter bot you can copy as the skeleton for a real project.
|
Command template is a batteries-included starter bot you can copy as the skeleton for a real project. |
|
template/pkg/bot
Package bot wires the client, cache, command registry, event handlers, and component handlers together.
|
Package bot wires the client, cache, command registry, event handlers, and component handlers together. |
|
template/pkg/commands
Package commands holds every slash command the bot exposes, plus a small self-registering registry that auto-loads them.
|
Package commands holds every slash command the bot exposes, plus a small self-registering registry that auto-loads them. |
|
template/pkg/components
Package components provides the shared core for handling message-component and modal interactions: a Handler interface and a reloadable Registry keyed by custom ID.
|
Package components provides the shared core for handling message-component and modal interactions: a Handler interface and a reloadable Registry keyed by custom ID. |
|
template/pkg/components/buttons
Package buttons holds button interaction handlers, matched by custom ID.
|
Package buttons holds button interaction handlers, matched by custom ID. |
|
template/pkg/components/modals
Package modals holds modal-submit handlers, matched by the modal's custom ID.
|
Package modals holds modal-submit handlers, matched by the modal's custom ID. |
|
template/pkg/components/selectmenus
Package selectmenus holds select-menu interaction handlers, matched by custom ID.
|
Package selectmenus holds select-menu interaction handlers, matched by custom ID. |
|
template/pkg/config
Package config holds the template's compile-time settings.
|
Package config holds the template's compile-time settings. |
|
template/pkg/events
Package events holds the bot's gateway event handlers plus a small registry that makes them reloadable at runtime.
|
Package events holds the bot's gateway event handlers plus a small registry that makes them reloadable at runtime. |
|
internal
|
|
|
Package options provides functional options for configuring the Discord client and REST client.
|
Package options provides functional options for configuring the Discord client and REST client. |
|
Package sharding provides multi-shard orchestration for Discord bots.
|
Package sharding provides multi-shard orchestration for Discord bots. |
|
types
|
|
|
discord
Package discord contains Discord data types shared across the gateway, REST API, interactions, and cache packages.
|
Package discord contains Discord data types shared across the gateway, REST API, interactions, and cache packages. |
Click to show internal directories.
Click to hide internal directories.