Telegram Context
by @fourthdensity
Fetches recent Telegram messages at session start to maintain conversation context across sessions, with toggle and manual fetch commands.
clawhub install telegram-contextπ About This Skill
name: telegram-context description: Toggle-enabled skill that fetches Telegram message history at session start for conversational continuity. Maintains context across sessions without relying solely on memory files. homepage: https://github.com/openclaw/skills metadata: openclaw: emoji: "π¬" requires: bins: [] env: [] permissions: - message:read
Telegram Context
Provides conversational continuity by fetching recent Telegram messages at session start. When enabled, the agent automatically retrieves message history to maintain context across disconnected sessions.
Credits
Created by @fourthdensity
Commands
/telegram-context on β Enable automatic history fetching/telegram-context off β Disable automatic fetching/telegram-context status β Show current settings/telegram-context fetch [n] β Manually fetch last n messages (default: 20)Setup
1. The skill auto-detects Telegram channels β no configuration needed
2. State is stored in memory/telegram-context.json
3. Only activates when the current channel is Telegram
How It Works
When a session starts in Telegram:
1. Check memory/telegram-context.json for enabled state
2. If enabled, fetch recent messages via message tool
3. Provide history as context for the conversation
4. Update lastFetch timestamp
State File
memory/telegram-context.json:
{
"enabled": true,
"fetchCount": 20,
"lastFetch": "2025-01-15T10:30:00Z"
}
Implementation Notes
Command Handlers
Enable/disable:
// Read current state
read: memory/telegram-context.json// Update state
write: memory/telegram-context.json
{
"enabled": true/false,
"fetchCount": 20,
"lastFetch": "2025-01-15T10:30:00Z"
}
Manual fetch:
message: {
action: "list",
limit: 20 // or user-specified count
}
// Provide results as context summary
Session Start Behavior
At the start of each Telegram session:
1. Check if memory/telegram-context.json exists
2. If enabled, call message tool with action: "list"
3. Summarize recent messages for context window
4. Acknowledge continuity to user (optional)
Implementation Scope
The skill uses OpenClaw's built-in message tool with:
action: "list" β limited to the current Telegram chat onlyPrivacy & Security
Data Handling:
telegram-context.json β only settings and timestampsRecommendations for Sensitive Conversations:
/telegram-context fetch) instead of auto-fetch/telegram-context offUser Control:
Limitations
Tips
fetchCount to 10-30 for most use cases (balance context vs. tokens)/telegram-context fetch 50 when you need deep context for a specific taskMEMORY.md for long-term persistenceβοΈ Configuration
1. The skill auto-detects Telegram channels β no configuration needed
2. State is stored in memory/telegram-context.json
3. Only activates when the current channel is Telegram
π Tips & Best Practices
fetchCount to 10-30 for most use cases (balance context vs. tokens)/telegram-context fetch 50 when you need deep context for a specific taskMEMORY.md for long-term persistence