llama-3.1-8b-instant model, then posts the result to a Discord channel via a webhook. By the end you will have a working agent you can start from the Dolphinclaw dashboard with a custom topic.
What this agent does
When started, the agent accepts an optionaltopic input (defaulting to "crypto market"). It sends a prompt to Groq asking for a three-sentence update on that topic, then posts the response to a Discord channel using a webhook URL. The agent returns a success status and exits.
Prerequisites
Before you begin, make sure you have:- A Groq API key from console.groq.com
- A Discord webhook URL for the channel you want to post to
Agent code
Create a file nameddolphinclaw.agent.ts (or index.js if you prefer plain JavaScript) at the root of your project.
Dependencies
Add the following packages to yourpackage.json:
Environment variables
This agent requires two environment variables to be set in the Dolphinclaw dashboard before you start it:| Variable | Description |
|---|---|
OPENAI_API_KEY | Your Groq API key. Despite the name, this is your Groq key — the openai package uses it to authenticate with Groq’s compatible endpoint. |
DISCORD_WEBHOOK_URL | The full webhook URL for the Discord channel to post into. |
You can pass a custom
topic value when starting the agent from the dashboard. Open the Run panel, add a JSON input object such as {"topic": "AI news"}, and the agent will generate an update on that topic instead of the default "crypto market". If no input is provided, the agent falls back to "crypto market" automatically.