home / skills / dtinth / agent-skills / discord

discord skill

/discord

This skill sends a message to a Discord user via a webhook using a simple curl wrapper, enabling automated alerts and updates.

npx playbooks add skill dtinth/agent-skills --skill discord

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
561 B
---
name: discord
description: Use this skill to send a message over Discord to the operator
---

To send a message over Discord to the user, there is a script at `~/.local/bin/discord-curl` that can be invoked to send a Discord message via a webhook.

The script is essentially implemented this way:

```sh
#!/bin/bash -e
curl -X POST "$@" <webhook_url>
```

Here are some examples:

```sh
# Send a message
~/.local/bin/discord-curl -F 'content=hello'

# Send a message with file
~/.local/bin/discord-curl -F 'content=hello' -F 'files[0]=@/etc/os-release'
```

Overview

This skill sends messages to the operator over Discord using a local helper script that posts to a configured webhook. It wraps a simple curl-based command so agents can deliver text and file attachments to a Discord channel. The skill is lightweight and designed for quick notifications and file delivery.

How this skill works

The skill invokes a local script (~/.local/bin/discord-curl) which forwards provided curl arguments to a preset Discord webhook URL. You pass form fields such as content for message text and files[...] for attachments; the script executes curl -X POST with the given arguments and the webhook URL. No Discord OAuth or bot setup is required beyond the webhook already configured in the environment.

When to use it

  • Send short notifications or alerts to the operator's Discord channel.
  • Deliver command output or logs as a file attachment for troubleshooting.
  • Notify about long-running task completion or failures.
  • Share configuration snippets or diagnostic files securely to the webhook channel.
  • Quickly relay messages when other communication channels are unavailable.

Best practices

  • Keep messages concise and include context identifiers (task ID, timestamp).
  • Avoid sending large binary files; compress or trim logs before attaching.
  • Sanitize sensitive data before sending to a shared Discord channel.
  • Use the files[...] form field for attachments and content for plain text.
  • Ensure the webhook URL is securely stored and the script is executable by the agent user.

Example use cases

  • Post a text alert: ~/.local/bin/discord-curl -F 'content=Backup completed for host-1'.
  • Send a log file: ~/.local/bin/discord-curl -F 'content=Deployment logs' -F 'files[0]=@/var/log/deploy.log'.
  • Report an error with context: include task ID and small stack trace in content.
  • Notify operator of CI status changes or manual intervention requests.
  • Share system info snapshot as an attached file for remote debugging.

FAQ

Do I need to supply the webhook URL each time?

No. The helper script embeds the webhook URL; you only pass curl-style arguments like -F 'content=...'.

How do I attach multiple files?

Use multiple files[...] form fields, e.g. -F 'files[0]=@/path/one' -F 'files[1]=@/path/two'.