discord

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package discord provides the discord_send tool for sending messages to Discord.

Two delivery modes:

  1. Webhook (simplest — no bot account required): Create a webhook in your Discord server settings → Integrations. Set DISCORD_WEBHOOK_URL. One webhook per channel.

  2. Bot API (richer — requires a Discord application and bot token): Set DISCORD_BOT_TOKEN. The bot must be invited to the server with the "Send Messages" permission. Supports embeds, files, threads.

Implementation notes for contributors:

  • Discord webhooks accept the same payload shape as Slack webhooks (content + embeds). Start with webhooks — no OAuth flow needed.
  • Embeds are the Discord equivalent of Block Kit: title, description, color (hex int), fields (name/value pairs), footer, thumbnail.
  • Rate limits: 5 requests per 2 seconds per webhook. Add exponential backoff with Retry-After header handling.
  • Discord API docs: https://discord.com/developers/docs/resources/webhook

Env vars:

DISCORD_WEBHOOK_URL — Webhook URL (preferred for simple sends)
DISCORD_BOT_TOKEN   — Bot token for the Bot API mode

See GitHub issue for full implementation spec.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented = errors.New("discord_send: not implemented — see GitHub issue")

Functions

This section is empty.

Types

type SendTool

type SendTool struct{}

func NewSendTool

func NewSendTool() *SendTool

func (*SendTool) BackfillInput

func (t *SendTool) BackfillInput(_ context.Context, in map[string]any) map[string]any

func (*SendTool) Call

func (*SendTool) CheckPermissions

func (t *SendTool) CheckPermissions(_ context.Context, in map[string]any, _ tool.ToolUseContext) types.PermissionResult

func (*SendTool) Definition

func (t *SendTool) Definition() tool.Definition

func (*SendTool) Description

func (t *SendTool) Description(_ context.Context) (string, error)

func (*SendTool) FormatResult

func (t *SendTool) FormatResult(data any) string

func (*SendTool) IsConcurrencySafe

func (t *SendTool) IsConcurrencySafe(_ map[string]any) bool

func (*SendTool) IsEnabled

func (t *SendTool) IsEnabled() bool

func (*SendTool) IsReadOnly

func (t *SendTool) IsReadOnly(_ map[string]any) bool

func (*SendTool) ValidateInput

func (t *SendTool) ValidateInput(_ context.Context, in map[string]any) (map[string]any, error)

Jump to

Keyboard shortcuts

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