Skip to content

Commit a42980c

Browse files
iPythoningclaude
andcommitted
feat: Telegram best practices — market-adaptive channels, bot commands, inline keyboards
Upgrade Telegram from "secondary channel" to strategic channel with full SDR capabilities: - TOOLS.md: comprehensive Telegram section — bot commands (/catalog, /quote, /status), inline keyboard templates, large file strategy (2GB), market priority table, WhatsApp corrected to "Business App" (not API) - AGENTS.md: Stage 10 rewritten with market-adaptive channel priority (Telegram-first for Russia/CIS/Iran/Eastern Europe), WhatsApp 72h auto-switch - HEARTBEAT.md: new #13 WhatsApp Window Expiry Check — 48h warning zone, 72h auto-switch to Telegram, delivery failure detection - skills/telegram-toolkit/: full SKILL.md with bot command definitions, inline keyboard JSON templates for BANT qualification, large file routing, Telegram-first market guide, nurture cadence, channel broadcast strategy Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 721f120 commit a42980c

5 files changed

Lines changed: 303 additions & 16 deletions

File tree

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ Built on [OpenClaw](https://openclaw.dev), battle-tested with real B2B export co
2020
│ SOUL.md → Personality, values, rules │
2121
│ AGENTS.md → Full sales workflow (10 stages)│
2222
│ USER.md → Owner profile, ICP, scoring │
23-
│ HEARTBEAT.md → 12-item pipeline inspection │
23+
│ HEARTBEAT.md → 13-item pipeline inspection │
2424
│ MEMORY.md → 4-layer anti-amnesia protocol │
2525
│ TOOLS.md → CRM, channels, integrations │
2626
├─────────────────────────────────────────────────┤
2727
│ Skills → Extensible capabilities │
2828
│ Product KB → Your product catalog │
29-
│ Cron Jobs → 12 automated scheduled tasks │
29+
│ Cron Jobs → 13 automated scheduled tasks │
3030
├─────────────────────────────────────────────────┤
3131
│ OpenClaw Gateway (WhatsApp / Telegram / Email) │
3232
└─────────────────────────────────────────────────┘
@@ -110,7 +110,7 @@ That's it. Your AI SDR is live on WhatsApp and ready to sell.
110110
| **9. Email Outreach** | Personalized cold email sequences (Day 1/3/7/14), auto follow-up |
111111
| **10. Multi-Channel Orchestration** | Cross-channel coordination (WhatsApp + Email + Telegram), auto-switching |
112112

113-
### Automated Scheduling (12 Cron Jobs)
113+
### Automated Scheduling (13 Cron Jobs)
114114

115115
| Schedule | Task |
116116
|----------|------|
@@ -124,6 +124,7 @@ That's it. Your AI SDR is live on WhatsApp and ready to sell.
124124
| Weekly Mon | Weekly summary report |
125125
| Daily 12:00 | CRM snapshot to ChromaDB (L4 disaster recovery) |
126126
| Daily 14:00 | Memory health check (Supermemory + ChromaDB stats) |
127+
| Every 30 min | WhatsApp 72h window expiry check → auto-switch to Telegram |
127128

128129
### Human-Like Conversations
129130
- Responds in the customer's language (auto-detected)
@@ -183,6 +184,7 @@ Pre-built capabilities that extend your AI SDR:
183184
| **delivery-queue** | Schedule messages with human-like delays. Drip campaigns, timed follow-ups. |
184185
| **supermemory** | Semantic memory engine. Store research notes, competitor intel, market insights. |
185186
| **chroma-memory** | Per-turn conversation storage with customer isolation, auto-tagging, and CRM snapshots. |
187+
| **telegram-toolkit** | Bot commands, inline keyboards, large file handling, and Telegram-first market strategies. |
186188
| **sdr-humanizer** | Rules for natural conversation — pacing, cultural adaptation, anti-patterns. |
187189
| **lead-discovery** | AI-driven lead discovery. Web search for potential buyers, ICP evaluation, CRM auto-entry. |
188190
| **quotation-generator** | Auto-generate PDF proforma invoices with company letterhead, multi-language support. |

skills/telegram-toolkit/SKILL.md

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
# telegram-toolkit — Telegram SDR Best Practices & Templates
2+
3+
> Bot commands, inline keyboards, large file handling, and channel-specific sales strategies for Telegram-based B2B SDR.
4+
5+
## Why Telegram for B2B Sales
6+
7+
| Advantage | Impact |
8+
|-----------|--------|
9+
| **No 72h window** | Proactive outreach anytime — nurture, follow-ups, stalled leads |
10+
| **2GB file limit** | Full product catalogs, certifications, video demos |
11+
| **Bot commands** | Structured self-service (`/catalog`, `/quote`, `/status`) |
12+
| **Inline keyboards** | One-tap BANT qualification, 3-5x faster than free-text |
13+
| **Username-based** | Lower barrier — customer doesn't expose phone number |
14+
| **Free API** | No per-message cost |
15+
| **No account bans** | Bot API is stable, unlike WhatsApp's aggressive anti-automation |
16+
17+
## Bot Commands
18+
19+
Register these commands with @BotFather using `/setcommands`:
20+
21+
```
22+
start - Welcome message and product overview
23+
catalog - Browse product catalog
24+
quote - Request a quotation
25+
status - Check order or quote status
26+
contact - Speak with a human representative
27+
language - Change conversation language
28+
```
29+
30+
### Command Behavior
31+
32+
#### `/start`
33+
1. Detect language from Telegram user profile
34+
2. Send welcome message with company intro (2-3 sentences max)
35+
3. Create CRM record: source = `telegram_organic`, status = `new`
36+
4. Offer product categories via inline keyboard
37+
5. Begin BANT qualification naturally
38+
39+
#### `/catalog`
40+
1. Check CRM for customer's product interest (if returning)
41+
2. If known interest: Send relevant product section + full catalog link
42+
3. If unknown: Send inline keyboard with product categories
43+
4. Always include: specs, MOQ, typical lead time
44+
5. File format: PDF preferred, under 20MB per file
45+
46+
#### `/quote`
47+
1. Check if BANT data exists in memory
48+
2. If incomplete: Trigger inline keyboard qualification flow
49+
3. If complete: Generate quote draft → send to owner for approval
50+
4. Confirm to customer: "I'm preparing your quotation, will have it ready shortly."
51+
52+
#### `/status`
53+
1. Read CRM for customer's active records
54+
2. Return: latest status, pending actions, next follow-up date
55+
3. If quote_sent: "Your quote was sent on [date]. Would you like to discuss it?"
56+
4. If no records: "I don't have an active order for you yet. Would you like to start one?"
57+
58+
## Inline Keyboard Flows
59+
60+
### Quick BANT Qualification
61+
62+
**Step 1 — Need (Product):**
63+
```json
64+
{
65+
"text": "What products are you interested in?",
66+
"reply_markup": {
67+
"inline_keyboard": [
68+
[{"text": "{{product_1}}", "callback_data": "product_1"}],
69+
[{"text": "{{product_2}}", "callback_data": "product_2"}],
70+
[{"text": "{{product_3}}", "callback_data": "product_3"}],
71+
[{"text": "📋 Full catalog", "callback_data": "full_catalog"}]
72+
]
73+
}
74+
}
75+
```
76+
77+
**Step 2 — Budget (Volume):**
78+
```json
79+
{
80+
"text": "What's your estimated order quantity?",
81+
"reply_markup": {
82+
"inline_keyboard": [
83+
[{"text": "< 100 units", "callback_data": "qty_small"}],
84+
[{"text": "100-500", "callback_data": "qty_medium"}],
85+
[{"text": "500-1000", "callback_data": "qty_large"}],
86+
[{"text": "1000+", "callback_data": "qty_bulk"}]
87+
]
88+
}
89+
}
90+
```
91+
92+
**Step 3 — Timeline:**
93+
```json
94+
{
95+
"text": "When do you need delivery?",
96+
"reply_markup": {
97+
"inline_keyboard": [
98+
[{"text": "This month", "callback_data": "timeline_urgent"}],
99+
[{"text": "1-3 months", "callback_data": "timeline_soon"}],
100+
[{"text": "3-6 months", "callback_data": "timeline_planning"}],
101+
[{"text": "Just exploring", "callback_data": "timeline_exploring"}]
102+
]
103+
}
104+
}
105+
```
106+
107+
**Step 4 — Authority:**
108+
After 3 keyboard interactions, ask naturally in conversation:
109+
"Are you the purchasing decision-maker, or should I prepare materials for your team?"
110+
(Don't use a keyboard for this — it feels too transactional.)
111+
112+
### Quick Actions Keyboard
113+
Send after qualification is complete:
114+
```json
115+
{
116+
"text": "How can I help you next?",
117+
"reply_markup": {
118+
"inline_keyboard": [
119+
[{"text": "📋 Get a quote", "callback_data": "action_quote"}],
120+
[{"text": "📦 Product specs", "callback_data": "action_specs"}],
121+
[{"text": "🏭 Factory info", "callback_data": "action_factory"}],
122+
[{"text": "👤 Talk to sales rep", "callback_data": "action_human"}]
123+
]
124+
}
125+
}
126+
```
127+
128+
## Large File Strategy
129+
130+
Telegram's 2GB limit makes it the best channel for heavy files:
131+
132+
| Use Case | File | Action |
133+
|----------|------|--------|
134+
| Product catalog | PDF, 10-100MB | Send directly via Telegram |
135+
| Certification docs (ISO, CE, etc.) | PDF, 1-20MB | Send on request |
136+
| Product video / factory tour | MP4, 50MB-2GB | Send via Telegram, link on WhatsApp |
137+
| Test reports | PDF, 1-10MB | Send on request |
138+
| Proforma invoice | PDF, < 5MB | Send here + email for formal record |
139+
140+
**Cross-channel file routing:**
141+
When customer is on WhatsApp and needs a large file:
142+
> "The full catalog is 85MB — I'll send it to you on Telegram. What's your Telegram username?"
143+
144+
## Telegram-First Markets
145+
146+
In these markets, treat Telegram as the **primary** channel:
147+
148+
| Market | Why Telegram First |
149+
|--------|-------------------|
150+
| Russia / CIS | 80%+ business messaging on Telegram |
151+
| Iran | Telegram is the dominant platform |
152+
| Eastern Europe | Strong Telegram adoption for B2B |
153+
| Central Asia | Telegram preferred over WhatsApp |
154+
| Tech/crypto industry | Global preference for Telegram |
155+
156+
**Detection:** Check CRM `country` field. If Russia/CIS/Iran/Eastern Europe, default to Telegram-first strategy.
157+
158+
## Nurture via Telegram
159+
160+
Telegram has no messaging window — ideal for long-term nurture:
161+
162+
### Nurture Cadence (Telegram)
163+
| Timing | Content |
164+
|--------|---------|
165+
| Day 0 | Initial contact + product overview |
166+
| Day 3 | Relevant case study or industry insight |
167+
| Day 7 | Specific product recommendation based on their interest |
168+
| Day 14 | New product announcement or limited offer |
169+
| Day 30 | Market update or trade show invitation |
170+
| Day 60+ | Quarterly check-in with personalized industry news |
171+
172+
### Telegram Channel (One-to-Many)
173+
For customers who follow your brand channel:
174+
- Weekly: Industry news, market trends
175+
- Bi-weekly: New product announcements
176+
- Monthly: Case studies, customer success stories
177+
- Never: Direct sales pitches (keep those in DM)
178+
179+
## Security Notes
180+
181+
- Bot Token stored in `secrets.sh`, never in config.sh or workspace files
182+
- `dmPolicy: "pairing"` requires pairing code — use for exclusive/VIP access
183+
- `dmPolicy: "open"` (not available in all OpenClaw versions) — accepts all DMs
184+
- Admin commands restricted to whitelist (same as WhatsApp)
185+
- Rate limit: Same anti-abuse measures as WhatsApp (15 msg/5min, 50 msg/1hr)

workspace/AGENTS.md

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,39 @@ Rules:
8787
- Track: email_sent → email_replied → convert to WhatsApp conversation
8888

8989
### Stage 10: Multi-Channel Orchestration
90-
Channel priority: WhatsApp > Email > Telegram
91-
Rules:
92-
- If WhatsApp available: Primary channel, email as supplement for formal docs
93-
- If only email: Full email sequence, suggest WhatsApp connection in email
94-
- If Telegram: Use for quick updates, WhatsApp for detailed discussion
95-
- Auto-switch: If no reply on primary channel for 3 days, try secondary channel
96-
- Cross-channel context: Always check all channel history before responding
90+
91+
#### Market-Adaptive Channel Priority
92+
Channel priority depends on the customer's market — **not hardcoded**:
93+
94+
| Market | Primary | Secondary | Tertiary |
95+
|--------|---------|-----------|----------|
96+
| Africa / Latin America / South Asia | WhatsApp | Email | Telegram |
97+
| Middle East / Southeast Asia | WhatsApp | Telegram | Email |
98+
| Russia / CIS / Iran / Eastern Europe | **Telegram** | Email | WhatsApp |
99+
| Europe / Turkey | WhatsApp | Telegram | Email |
100+
| Tech-savvy / privacy-conscious buyers | **Telegram** | Email | WhatsApp |
101+
102+
Detect market from CRM `country` field. If customer initiates on Telegram, respect that as their preferred channel.
103+
104+
#### Channel Rules
105+
- Respond on the channel the customer initiates from — never force a channel switch
106+
- WhatsApp 72h window expired → auto-switch to Telegram (no window limit) or Email
107+
- Large files (>10MB catalogs, certifications, videos) → always via Telegram
108+
- Formal documents (contracts, PIs) → Email with Telegram/WhatsApp notification
109+
- If no reply on primary channel for 3 days → try secondary channel
110+
- Cross-channel context: Always check ALL channel history before responding (4-layer memory covers this)
111+
112+
#### Telegram-Specific Advantages
113+
- Use **Bot Commands** (`/catalog`, `/quote`, `/status`) for structured self-service
114+
- Use **Inline Keyboards** for rapid BANT qualification (one-tap vs free-text)
115+
- Use Telegram for **proactive nurture** — no messaging window restrictions
116+
- Offer Telegram as alternative when customer is reluctant to share phone number
117+
118+
#### WhatsApp-Specific Notes
119+
- Uses WhatsApp Business App (not API) — `dmPolicy: "open"`, admin whitelist for system commands
120+
- 72h conversation window: after 72h of customer silence, outbound messages may fail
121+
- CTWA ad leads: can reply directly within 72h window
122+
- Monitor delivery receipts — never mark "contacted" if delivery failed
97123

98124
## Dynamic ICP Scoring
99125
ICP score adjusts based on interaction signals:

workspace/HEARTBEAT.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,21 @@ Run `chroma:snapshot` to backup current pipeline state to ChromaDB (L4 fallback)
7676
- This is disaster recovery — if MemOS or Supermemory has issues, ChromaDB has the data.
7777
- Report: "CRM snapshot stored: [N] active leads, [M] pipeline value."
7878

79+
## 13. WhatsApp Window Expiry Check (Every heartbeat)
80+
Check CRM for leads where:
81+
- Primary channel = WhatsApp AND `last_contact` > 48h (approaching 72h window)
82+
- AND status is active (contacted / interested / quote_sent / negotiating)
83+
84+
**48-60h** (warning zone):
85+
- Send a gentle follow-up on WhatsApp before window expires: "Hi [Name], just checking in on [last topic]..."
86+
87+
**72h+ expired**:
88+
- If customer has Telegram: Auto-switch follow-up to Telegram
89+
- If no Telegram: Switch to Email
90+
- Update CRM notes: "WhatsApp window expired, switched to [channel]"
91+
- Never mark as "contacted" if WhatsApp delivery actually failed
92+
93+
Found: List leads approaching/past window expiry with recommended action.
94+
None: Skip.
95+
7996
No issues → reply only: HEARTBEAT_OK

workspace/TOOLS.md

Lines changed: 63 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ gws sheets spreadsheets.values append --params '{"spreadsheetId":"{{sheets_id}}"
1414
```
1515
Only use append and update — never overwrite entire rows.
1616

17-
## WhatsApp (Primary Conversation Channel)
17+
## WhatsApp Business App (Primary Conversation Channel)
1818
AI directly replies to customer inquiries — no human relay.
1919
Channel policy: `dmPolicy: "open"`, `allowFrom: ["*"]` — accept all contacts.
20-
CTWA ad leads can be replied to directly (72-hour conversation window).
20+
Admin whitelist controls system commands; all other contacts get normal sales conversation.
2121

2222
### 72-Hour Window Handling
23-
WhatsApp Business API restricts outbound messages after 72h of customer inactivity:
23+
WhatsApp restricts outbound messages after 72h of customer inactivity:
2424
1. Before sending, check: `now() - last_customer_message < 72h`
25-
2. If expired: Switch to email channel or notify owner for manual WhatsApp contact
25+
2. If expired: **Auto-switch to Telegram** (no window limit) or email. See HEARTBEAT #13.
2626
3. Never mark CRM as "contacted" if message delivery actually failed
2727
4. Implement delivery receipt verification — check for sent/delivered/read status
2828

@@ -31,8 +31,65 @@ Web UI for monitoring bot status, conversations, and cron jobs.
3131
Access: `http://SERVER_IP:{{gateway_port}}/?token={{gateway_token}}`
3232
Gateway bind: `lan` (network accessible). Change to `loopback` for localhost-only.
3333

34-
## Telegram (Secondary Channel)
35-
Quick updates, document sharing. Use WhatsApp for detailed discussion.
34+
## Telegram (Strategic Channel — No Window Limits)
35+
Telegram has **zero messaging restrictions** — unlike WhatsApp's 72h window, you can proactively message any customer at any time. This makes it the best channel for follow-ups, nurture, and markets where Telegram is dominant.
36+
37+
### Channel Strengths
38+
- **No 72h window**: Proactive outreach anytime (nurture, follow-ups, stalled leads)
39+
- **Files up to 2GB**: Full product catalogs, certifications, test reports, video demos
40+
- **Bot Commands**: Structured self-service for customers (`/catalog`, `/quote`, `/status`)
41+
- **Inline Keyboards**: One-tap BANT qualification, faster than typing
42+
- **Username-based**: Customer doesn't expose phone number — lower barrier to connect
43+
- **Free API**: No per-message cost unlike WhatsApp Business API
44+
45+
### Bot Commands (auto-registered)
46+
| Command | Action |
47+
|---------|--------|
48+
| `/start` | Welcome message + language detection + CRM record creation |
49+
| `/catalog` | Send product catalog PDF or product line summary |
50+
| `/quote` | Start quotation flow → trigger BANT collection via inline keyboards |
51+
| `/status` | Check order/quote status from CRM |
52+
| `/contact` | Request human sales rep → notify owner |
53+
| `/language` | Switch conversation language |
54+
55+
### Inline Keyboard Templates
56+
Use inline keyboards for structured qualification — 3-5x faster than free-text BANT:
57+
58+
**Order Volume:**
59+
```
60+
[< 100 units] [100-500] [500-1000] [1000+]
61+
```
62+
63+
**Timeline:**
64+
```
65+
[This month] [1-3 months] [3-6 months] [Just exploring]
66+
```
67+
68+
**Product Interest:**
69+
```
70+
[{{product_1}}] [{{product_2}}]
71+
[{{product_3}}] [View full catalog]
72+
```
73+
74+
### Large File Strategy
75+
| File Type | Size | Channel |
76+
|-----------|------|---------|
77+
| Quick quote (1-2 pages) | < 10MB | WhatsApp or Telegram |
78+
| Full product catalog | 10-100MB | **Telegram only** |
79+
| Certification documents | 10-50MB | **Telegram only** |
80+
| Video demos | 50MB-2GB | **Telegram only** |
81+
| Contracts / PIs | < 10MB | Email (formal) + Telegram (fast copy) |
82+
83+
When sending large files: "I'll share the full catalog on Telegram — it's [X]MB, too large for WhatsApp."
84+
85+
### Market Priority
86+
Telegram is the **primary** channel (not secondary) in these markets:
87+
- **Russia / CIS**: Telegram is THE messaging app
88+
- **Iran**: Telegram dominant for business
89+
- **Eastern Europe**: Strong Telegram adoption
90+
- **Tech-savvy buyers globally**: Many prefer Telegram for business
91+
92+
See AGENTS.md Stage 10 for market-adaptive channel priority rules.
3693

3794
## Gmail (Email Outreach + Inbox Monitoring)
3895
Access via gws CLI:

0 commit comments

Comments
 (0)