polygram 0.5.9 → 0.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/polygram.js +11 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polygram",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.10",
|
|
4
4
|
"description": "Telegram daemon for Claude Code that preserves the OpenClaw per-chat session model. Migration path for OpenClaw users moving to Claude Code.",
|
|
5
5
|
"main": "lib/ipc-client.js",
|
|
6
6
|
"bin": {
|
package/polygram.js
CHANGED
|
@@ -1626,9 +1626,17 @@ function shouldHandle(msg, chatConfig, botUsername) {
|
|
|
1626
1626
|
const text = msg.text || msg.caption || '';
|
|
1627
1627
|
const isReplyToBot = msg.reply_to_message?.from?.username === botUsername;
|
|
1628
1628
|
const hasMention = text.includes(`@${botUsername}`);
|
|
1629
|
-
//
|
|
1630
|
-
//
|
|
1631
|
-
|
|
1629
|
+
// A reply targeting some other user (not the bot) is a strong signal
|
|
1630
|
+
// "this message is for that person, not me". Paired users normally
|
|
1631
|
+
// bypass requireMention, but not in this case — without the guard a
|
|
1632
|
+
// paired user saying "Gotcha!" to a teammate gets processed by the
|
|
1633
|
+
// bot just because the user is paired, which is what bit us in
|
|
1634
|
+
// UMI Group on 0.5.9 (bot leaked reasoning as a reply to "Gotcha!").
|
|
1635
|
+
const repliesToOtherUser = !!msg.reply_to_message
|
|
1636
|
+
&& msg.reply_to_message.from?.username !== botUsername;
|
|
1637
|
+
// Paired users bypass requireMention — operator-trusted, no @ needed
|
|
1638
|
+
// every time. Skipped when they're replying to a non-bot user (above).
|
|
1639
|
+
const paired = !repliesToOtherUser && pairings && msg.from?.id
|
|
1632
1640
|
? pairings.hasLivePairing({ bot_name: BOT_NAME, user_id: msg.from.id, chat_id: chatId })
|
|
1633
1641
|
: false;
|
|
1634
1642
|
if (!isReplyToBot && !hasMention && !paired) return false;
|