Build a Daily Briefing Bot
Build a Daily Briefing Bot — easy-to-understand guide based on official docs
Every morning, you probably check the same few things—weather, calendar, news, and messages. What if your team’s chat app could just hand you that summary before your coffee kicks in? That’s exactly what we’ll build today: a friendly bot that posts a daily briefing into your WeCom group, using Hermes Agent.
What You’ll Need
- A WeCom group chat (with admin rights)
- Hermes Agent installed and connected to WeCom
- A simple Python script for your “briefing” logic
Don’t worry—we’ll keep the code minimal. The magic is in the configuration.
Step 1: Lock Down Who Can Talk to Your Bot
First, let’s make sure only the right people can trigger your briefing. In your Hermes Agent config file, you’ll set a group policy. Here’s a simple example:
group_policy:
allow: true
group_allow_from:
- "user_admin"
- "user_charlie"
groups:
"daily-briefing":
allow_from:
- "user_charlie"
"*":
allow_from:
- "user_admin"
How this works:
group_policy: allowmeans groups are allowed by default.group_allow_fromlists who can talk to the bot at all.- The
groupssection says: in the “daily-briefing” group, only Charlie can ask for briefings. For any other group, only the admin can. - The
"*"is a wildcard—it catches all groups you didn’t list.
If you leave allow_from empty for a group, everyone in that group can use the bot (as long as they pass the top-level check).
Step 2: Handle Incoming Media (Optional but Handy)
Maybe your team sends screenshots or voice notes in the briefing chat. Hermes Agent automatically downloads images, files, and even extracts voice text. It also decrypts AES-encrypted media from WeCom—no setup needed. Just make sure you have the cryptography package:
pip install cryptography
That’s it. The bot will cache media locally so your agent can read it.
Step 3: Send Your Daily Briefing
Now for the fun part—sending the summary. Hermes Agent gives you simple commands. Here’s a tiny Python snippet you might run every morning:
from hermes_agent import WeComAdapter
adapter = WeComAdapter()
adapter.send("Good morning! Here’s your briefing: ...", group_id="daily-briefing")
adapter.send_image("weather_chart.png", group_id="daily-briefing")
adapter.send_document("report.pdf", group_id="daily-briefing")
What you can send:
| Method | What it sends | Size limit |
|---|---|---|
send |
Markdown text | 4000 chars |
send_image |
Image file | 10 MB |
send_document |
Any file | 20 MB |
send_voice |
AMR audio | 2 MB |
send_video |
Video | 10 MB |
Smart fallback: If your image is 11 MB, the bot automatically sends it as a file instead of failing. If a file is over 20 MB, it politely rejects it and tells the chat.
Step 4: Schedule It
You don’t need a cron job inside Hermes—just use your own scheduler. For example, a simple schedule library:
import schedule
import time
def job():
# your briefing logic here
adapter.send("Daily briefing ready!", group_id="daily-briefing")
schedule.every().day.at("08:00").do(job)
while True:
schedule.run_pending()
time.sleep(60)
Summary & Practical Tip
You now have a bot that greets your team each morning, respects permissions, and handles media gracefully. The key takeaway: Hermes Agent does the heavy lifting (media decryption, chunked uploads, permission checks), so you focus on the content.
Pro tip: Start with a simple text-only briefing. Once that’s stable, add one image (like a weather chart). Then expand to files and voice. Small steps keep your bot reliable and your team happy.
📖 Official Docs
This article is based on the official Hermes Agent documentation:Official docs › guides/daily-briefing-bot