OpenClawSkills
GitHub

Discord Webhook

Community

Post a message to Discord via webhook.

Installation

Save as `discord.js`. Requires DISCORD_WEBHOOK_URL.

Source Code

JavaScript
Tutorial.terminal

// discord.js

module.exports = async function(context) {
    const content = context.args.join(' ');
    const url = process.env.DISCORD_WEBHOOK_URL;
    
    if (!url) return { error: "No webhook URL" };
    
    await fetch(url, {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ content })
    });
    
    return { status: "sent" };
};

Live Preview

● Live Demo
Agent Session
Starting session...

How to use

  • Ensure you have the necessary dependencies installed (if any).
  • Place the file in your OpenClaw skills folder (e.g., ~/.openclaw/skills/).
  • Restart your agent or reload configuration.
  • Invoke it using the filename (without extension) as the tool name, or through natural language if the description is clear.