@aka_openclaw_plugin/mychat 0.2.3 → 0.2.5

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/dist/api.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as tryGetMychatRuntime, i as setMychatRuntime, n as init_runtime, t as getMychatRuntime } from "./runtime-CkiGSF1r.js";
2
- import { t as mychatPlugin } from "./channel-BVfWh6jv.js";
2
+ import { t as mychatPlugin } from "./channel-DXBwjTlu.js";
3
3
  //#region extensions/mychat/api.ts
4
4
  init_runtime();
5
5
  //#endregion
@@ -314,8 +314,7 @@ function extractMentionUserIds(message) {
314
314
  /** Check if the bot is mentioned in a message. */
315
315
  function isBotMentioned(message, botUserId) {
316
316
  if (!botUserId) return false;
317
- if (extractMentionUserIds(message).includes(botUserId)) return true;
318
- return (message.body?.text ?? "").includes(`@${botUserId}`);
317
+ return extractMentionUserIds(message).includes(botUserId);
319
318
  }
320
319
  //#endregion
321
320
  //#region extensions/mychat/src/monitor/message-handler.preflight.ts
@@ -426,10 +425,12 @@ function createMychatMessageHandler(params) {
426
425
  const prefix = mychatLogPrefix("handler");
427
426
  return { async handleMessage(message) {
428
427
  logger?.debug(`${prefix} received messageId=${message.id} type=${message.type} from=${message.from?.id} to=${message.to?.id}:${message.to?.kind} text=${(message.body?.text ?? "").slice(0, 80)}`);
428
+ logger?.debug(`${prefix} preflight check for messageId=${message.id}, body: ${JSON.stringify(message.body)}`);
429
429
  if (dedupe.isDuplicate(message.id)) {
430
430
  logger?.debug(`${prefix} duplicate messageId=${message.id}, skipping`);
431
431
  return;
432
432
  }
433
+ logger?.debug(`${prefix} preflight check for accountId=${account.accountId} messageId=${message.id}, account=${JSON.stringify(account)}`);
433
434
  const preflight = mychatPreflight(message, account);
434
435
  if (!preflight.allowed) {
435
436
  logger?.info(`${prefix} rejected messageId=${message.id} reason=${preflight.reason} from=${message.from?.id}`);
@@ -662,7 +663,8 @@ function registerMychatMonitorListeners(params) {
662
663
  typingListener.handle(message);
663
664
  break;
664
665
  case "ack":
665
- logger?.info(`${prefix} ack conversationId=${message.body?.subscribe?.conversationId} status=${message.body?.status} cursor=${message.body?.currentCursor}`);
666
+ logger?.debug(`${prefix} ack raw body=${JSON.stringify(message.body)}`);
667
+ logger?.info(`${prefix} ack conversationId=${message.body?.conversationId} status=${message.body?.status} cursor=${message.body?.currentCursor}`);
666
668
  break;
667
669
  default:
668
670
  logger?.debug(`${prefix} unhandled type=${message.type} id=${message.id}`);
@@ -1,2 +1,2 @@
1
- import { t as mychatPlugin } from "./channel-BVfWh6jv.js";
1
+ import { t as mychatPlugin } from "./channel-DXBwjTlu.js";
2
2
  export { mychatPlugin };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aka_openclaw_plugin/mychat",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "OpenClaw MyChat channel plugin",
5
5
  "repository": {
6
6
  "type": "git",