@unicitylabs/openclaw-unicity 0.3.3 → 0.3.4
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/README.md +1 -0
- package/package.json +1 -1
- package/src/channel.ts +8 -3
package/README.md
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
<a href="https://www.npmjs.com/package/@unicitylabs/openclaw-unicity"><img src="https://img.shields.io/npm/v/@unicitylabs/openclaw-unicity" alt="npm version" /></a>
|
|
9
9
|
<a href="https://github.com/unicitynetwork/openclaw-unicity/blob/main/LICENSE"><img src="https://img.shields.io/github/license/unicitynetwork/openclaw-unicity" alt="license" /></a>
|
|
10
|
+
<a href="https://deepwiki.com/unicitynetwork/openclaw-unicity"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki"></a>
|
|
10
11
|
</p>
|
|
11
12
|
|
|
12
13
|
---
|
package/package.json
CHANGED
package/src/channel.ts
CHANGED
|
@@ -480,9 +480,14 @@ export const unicityChannelPlugin = {
|
|
|
480
480
|
const metadataHeader = `[SenderName: ${senderName} | SenderId: ${msg.senderPubkey} | GroupId: ${msg.groupId} | GroupName: ${groupName} | IsOwner: ${isOwner} | CommandAuthorized: ${isOwner}]`;
|
|
481
481
|
const sanitizedContent = msg.content.replace(/\[(?:SenderName|SenderId|IsOwner|CommandAuthorized|GroupId|GroupName)\s*:/gi, "[BLOCKED:");
|
|
482
482
|
|
|
483
|
-
//
|
|
484
|
-
//
|
|
485
|
-
|
|
483
|
+
// Detect if the agent was mentioned — either by @nametag in the text
|
|
484
|
+
// or by replying to the agent's own message (implicit mention, mirrors
|
|
485
|
+
// Discord's behavior). Without this, the mention gate skips the message.
|
|
486
|
+
const agentTag = sphere.identity?.nametag?.replace(/^@/, "");
|
|
487
|
+
const wasTextMentioned = agentTag
|
|
488
|
+
? msg.content.toLowerCase().includes(`@${agentTag.toLowerCase()}`)
|
|
489
|
+
: false;
|
|
490
|
+
const wasMentioned = wasTextMentioned || isReplyToSelf(msg) || undefined;
|
|
486
491
|
|
|
487
492
|
ctx.log?.info(`[${ctx.account.accountId}] Group message from ${senderName} in ${groupName}: ${msg.content.slice(0, 80)}`);
|
|
488
493
|
|