DEV Community

Cover image for OpenClaw: The AI Agent That Actually Does Stuff - Part 2 - Building a Real Bot
Shrestha Pandey
Shrestha Pandey

Posted on

OpenClaw: The AI Agent That Actually Does Stuff - Part 2 - Building a Real Bot

If you read Part 1, you know what OpenClaw is and why it matters. Now we’re going beyond theory. In this part, I’m going to build something real, and show you exactly what happened, including the challenging parts as well, and by the end, you’ll have a working bot that sends you an automated morning dev briefing on Telegram without you doing anything.

That honesty is the whole point. If you want a tutorial that hides the rough parts, there are many of those. But this is not that.

What We're Building

An automated morning briefing bot. Every day at 9am, it fetches the top dev and AI stories from web, filters what matters, and sends you a clean summary directly on Telegram. Once you set it up, it just arrives.

You don’t need any script running in a terminal, or cron job you manually configured. You just need your phone, buzzing with the briefing while you’re still chilling.

That’s the automation part. That’s what makes this different from a chatbot.

What You Need Before Starting

Before you start:

  • Node.js v22 or higher: run node --version to check. Update from nodejs.org.
  • WSL2 if you're on Windows: native Windows is not supported by OpenClaw, more on this below.
  • A Telegram account: this is how you talk to your bot.
  • An API key: I'll cover the free options below.
  • Terminal comfort: you don't need to be an expert but you should be able to run commands without panicking.

The last one is important. OpenClaw is genuinely powerful but it’s not a one-click install. If the terminal feels unfamiliar right now, bookmark this and come back when you’re more comfortable.

Windows? Set Up WSL2 First

OpenClaw doesn't work on native Windows so you need WSL2 — a Linux environment that runs inside Windows. Takes about 5 minutes.

Open PowerShell as Administrator:

wsl --install
Enter fullscreen mode Exit fullscreen mode

Restart your machine when it asks. Then open Ubuntu from the Start menu, set up your username and password, and run:

sudo apt update && sudo apt upgrade -y
Enter fullscreen mode Exit fullscreen mode

From here, run everything in this Ubuntu terminal — not PowerShell, not Command Prompt. Just WSL2 Ubuntu.

The API Key Situation

This confused me more than any other part of this build, so I want to help you avoid the same frustration.

OpenClaw needs an AI model to think, and that model needs API credits. Free tiers on OpenRouter and DeepSeek technically work but they hit limits fast, and with a weak free model the bot sometimes just explains what it would do instead of actually doing it.

If you can add even $2–5 to OpenRouter or Anthropic, do it. It's enough for weeks of real usage and everything just works properly. With Claude Sonnet, you tell the bot "send me a briefing every morning at 9am" and it saves the scheduled job itself. With a free model you might need to set that config manually — I'll show you how either way.

My advice: start free to understand how things work. Add credits when you're ready to go fully hands-off. The bot works fine in both cases. The only real difference is how much guidance it needs while you’re setting it up.

Installing OpenClaw

node --version
# Need v22.x.x or above

npm install -g openclaw@latest
openclaw --version
Enter fullscreen mode Exit fullscreen mode

Create Your Telegram Bot First

Do this before running the setup wizard so you have the token ready
Telegram → search @BotFather → send /newbot

Name it whatever you want, give it a username ending in _bot. BotFather gives you a token that looks like 123456789:ABCdef.... Copy it right away — you'll need it in the next step.

Running the Setup Wizard

openclaw onboard --install-daemon
Enter fullscreen mode Exit fullscreen mode

The --install-daemon part is important. It sets up the gateway as a proper background service that starts automatically when your machine boots. Without it you'd have to manually start everything every single time.

Here's what to choose at each screen:

Onboarding mode: Manual

Gateway setup: Local gateway. You'll see gateway.bind: loopback on the next screen — this means the gateway is only accessible from your own machine, not your network. Leave it exactly like that.

Model: OpenRouter with openrouter/deepseek/deepseek-chat if you're going free, or Anthropic with claude-sonnet-4-6 if you have credits.

Port and bind: just press Enter both times, defaults are fine

Auth mode: token. Some older guides still show auth: none as an option but that got removed after a real security issue was found. Always pick token.

Tailscale: skip it for now. It's for accessing your bot remotely from your phone over the internet. Useful later but adds complexity right now.

Messaging channel: Telegram → paste your BotFather token

DM policy → Pairing. This generates a one-time code that permanently links your Telegram account as the bot owner. Nobody else can use your bot.

Skills: skip everything → Finished

You'll see a huge list of skills — GitHub, Obsidian, Spotify, and a bunch of others. Ignore all of it for now. We're keeping this simple.

Pairing Your Telegram Account

Now:

openclaw tui
Enter fullscreen mode Exit fullscreen mode

Message your bot on Telegram. It'll reply with a pairing code like F85VDARD

Run this in terminal:

openclaw pairing approve telegram F85VDARD
Enter fullscreen mode Exit fullscreen mode

Type confirm in the TUI. Your account is linked now.

Health Check, Then First Message

openclaw doctor
Enter fullscreen mode Exit fullscreen mode

Run this every time you change config. It catches problems early. If no critical errors are showing, then go ahead.

Now go to Telegram and just send:

hello
Enter fullscreen mode Exit fullscreen mode

If it replies to you, everything's connected. Gateway, model, Telegram — all working.

Building the Bot

Send this in Telegram:

give me a morning briefing with top dev and AI news from https://news.ycombinator.com
Enter fullscreen mode Exit fullscreen mode

Here's what actually came back from my bot:

Morning Briefing — Top Dev & AI News

1. Google API keys weren't secrets, but then Gemini changed the rules
   Gemini now treats API keys as sensitive, breaking older workflows.
   240 points | 4h ago

2. OpenSwarm – Multi-Agent Claude CLI Orchestrator for Linear/GitHub
   Tool to automate dev workflows using Claude agents.
   18 points | 3h ago

3. Self-improving software won't produce Skynet
   Analysis of why self-modifying code isn't an existential risk.
   13 points | 2h ago
Enter fullscreen mode Exit fullscreen mode

It browsed Hacker News, filtered what was relevant, and formatted it. I didn't write a single line of code. I sent one message.

Setting Up the Automation

Now this is the part that actually makes it an agent.

Send this in Telegram:

every morning at 9am, fetch top dev and AI stories from [https://news.ycombinator.com](https://news.ycombinator.com/), summarize the most important ones and send me the briefing here on Telegram automatically
Enter fullscreen mode Exit fullscreen mode

If you're on a paid model, it saves the scheduled job itself. Check:

cat ~/.openclaw/cron/jobs.json
Enter fullscreen mode Exit fullscreen mode

If the jobs array is empty because you're on a free model, set it manually. First grab your exact values:

#Your username
echo $USER

#Your timezone
cat /etc/timezone
Enter fullscreen mode Exit fullscreen mode

Note both outputs. Then run this, replacing the placeholders:

node -e "
const fs = require('fs');
const jobs = {
version: 1,
jobs: [
  {
    id: 'morning-briefing',
    schedule: '0 9 * * *',
    timezone: 'YOUR_TIMEZONE_HERE',
    prompt: 'Fetch top 5 dev and AI stories from https://news.ycombinator.com, summarize them concisely and send the briefing to me on Telegram',
    channel: 'telegram',
    enabled: true
  }
 ]
};
fs.writeFileSync('/home/YOUR_USERNAME_HERE/.openclaw/cron/jobs.json', JSON.stringify(jobs, null, 2));
console.log('Done!');
"
Enter fullscreen mode Exit fullscreen mode

Replace YOUR_TIMEZONE_HERE with what cat /etc/timezone printed — something like Asia/Kolkata. Replace YOUR_USERNAME_HERE with what echo $USER printed.

Then:

openclaw gateway restart
Enter fullscreen mode Exit fullscreen mode

Done. Every morning at 9am the gateway runs the briefing and sends it to your Telegram. You're not doing anything. It just happens.

Do You Need the Terminal Open for This?

No. That's the whole point of --install-daemon.

The gateway is a system service now. macOS runs it via launchd, Linux via systemd. It starts when your machine boots, runs silently in the background, and executes the cron job at 9am whether you're at your desk or not. Close the terminal. Restart your laptop. It doesn't matter.

The terminal was only for setup. The automation runs without it.

What I Actually Learned

Most tutorials don't include this part. I'm including it because it's the most useful thing I can tell you.

Which model you use matters a lot. With a free model, the bot gets what you're asking for but sometimes it just explains what it would do instead of doing it. With Claude Sonnet it actually does it. OpenClaw being model agnostic is genuinely useful — but that also means the experience is only as good as the model you give it.

The first Telegram reply is when it clicks. Not because it's technically impressive — it's a message, not exactly magic. But because you realize everything is connected and running on your own machine. Your data, your gateway, your agent. That hits different than using some cloud tool.

It's challenging at first and that's okay. The setup has rough edges. The free model has real limits. But once you get through it and see how the pieces fit together, you start thinking about what else you could build. That's always a good sign.

What You Can Build Next

Once you've got this working, the system is easy to extend.

Add more sources — dev.to, GitHub release feeds, whatever RSS you follow. Add a Friday evening digest instead of just mornings. Connect the Obsidian skill so summaries go straight into your notes vault. Add weather via wttr.in — no API key needed.

The skill system is what makes all this composable. Each skill is a SKILL.md file — readable, auditable, nothing hidden. And because OpenClaw uses the same AgentSkills spec as Claude Code, Cursor, and GitHub Copilot, there's a much bigger ecosystem available than just what's on ClawHub.

To Wrap Up

OpenClaw is worth the effort. It's not easy to set up and the free model has real limitations. But once it's running, it's genuinely different from everything else out there.

Start with one workflow, one source, one schedule. Get comfortable with how it behaves. Then expand from there.

Resources

For such articles and developer content, visit: https://vickybytes.com

Top comments (0)