discord

command
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 20 Imported by: 0

README

Discord Bridge Provider

extensions/bridges/discord is the production Discord bridge provider for AGH. It runs as a provider-scoped subprocess on top of internal/bridgesdk and multiplexes one or more owned BridgeInstance records inside a single Discord runtime.

It implements:

  • provider-scoped Host API ownership through bridges/instances/list, bridges/instances/get, bridges/instances/report_state, and bridges/messages/ingest
  • hardened webhook ingress with method/content-type/body-size/rate-limit/in-flight checks plus Discord signing-secret verification
  • Discord Events API messages plus typed bridge command, action, and reaction ingest flows
  • outbound chat.postMessage, chat.update, and chat.delete behavior for bridge delivery requests
  • restart-safe resume handling through the shared bridge delivery broker

Build

From the repository root:

go build -o ./extensions/bridges/discord/bin/discord ./extensions/bridges/discord

Install

Build the binary first, then install the extension directory:

agh extension install ./extensions/bridges/discord

Provider Config

The bridge instance provider_config JSON object currently supports:

{
  "api_base_url": "https://discord.com/api",
  "webhook": {
    "listen_addr": "127.0.0.1:8080",
    "path": "/discord/brg-main"
  },
  "dm": {
    "allow_user_ids": ["U12345"],
    "allow_usernames": ["alice"],
    "paired_user_ids": ["U12345"],
    "paired_usernames": ["alice"]
  },
  "batching": {
    "delay_ms": 0,
    "split_delay_ms": 0,
    "split_threshold": 0
  }
}

Notes:

  • bot_token and signing_secret are required through bridge secret bindings.
  • AGH_BRIDGE_DISCORD_LISTEN_ADDR and AGH_BRIDGE_DISCORD_API_BASE_URL can provide process-level defaults for local development and integration tests.
  • Direct-message enforcement uses the bridge instance dm_policy plus the provider-config allowlist or paired-user fields.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL