Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "claudeclaw",
"source": "./",
"description": "Cron-like daemon that runs Claude prompts on a schedule",
"version": "1.0.43",
"version": "1.0.44",
"keywords": [
"cron",
"heartbeat",
Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "claudeclaw",
"version": "1.0.43",
"version": "1.0.44",
"description": "Cron-like daemon that runs Claude prompts on a schedule"
}
15 changes: 14 additions & 1 deletion src/commands/telegram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ interface TelegramUser {
interface TelegramMessage {
message_id: number;
from?: TelegramUser;
reply_to_message?: { message_id?: number; from?: TelegramUser };
reply_to_message?: { message_id?: number; from?: TelegramUser; text?: string; caption?: string };
quote?: { text?: string };
chat: { id: number; type: string };
message_thread_id?: number;
text?: string;
Expand Down Expand Up @@ -1385,6 +1386,18 @@ async function handleMessage(message: TelegramMessage): Promise<void> {

const promptParts = [`[Telegram from ${label}]`];
if (threadId) promptParts.push(`[thread:${threadId}]`);
// Include the message being replied to / quoted so Claude has the context.
// Telegram puts the full original in reply_to_message; quote.text holds the
// specific highlighted excerpt when the user quotes only part of a message.
const repliedText = message.reply_to_message?.text ?? message.reply_to_message?.caption;
const quotedExcerpt = message.quote?.text;
if (quotedExcerpt || repliedText) {
const fromBot = botId != null && message.reply_to_message?.from?.id === botId;
const who = fromBot
? "your own earlier message"
: `a message from ${message.reply_to_message?.from?.first_name ?? "someone"}`;
promptParts.push(`In reply to ${who}: ${wrapUntrusted("replied-message", quotedExcerpt ?? repliedText!, 2000)}`);
}
if (skillContext) {
// Strip the slash command from the message text and pass remaining args
const args = text.trim().slice(command!.length).trim();
Expand Down
Loading