@elizaos/plugin-discord 1.0.5 → 1.0.6

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/index.js CHANGED
@@ -2456,6 +2456,10 @@ var MessageManager = class {
2456
2456
  interval: null,
2457
2457
  cleared: false
2458
2458
  };
2459
+ startTyping();
2460
+ const typingInterval = setInterval(startTyping, 8e3);
2461
+ typingData.interval = typingInterval;
2462
+ await new Promise((resolve) => setTimeout(resolve, 200));
2459
2463
  const newMessage = {
2460
2464
  id: messageId,
2461
2465
  entityId: entityId2,
@@ -2485,10 +2489,6 @@ var MessageManager = class {
2485
2489
  };
2486
2490
  const callback = async (content, files) => {
2487
2491
  try {
2488
- startTyping();
2489
- const typingInterval = setInterval(startTyping, 8e3);
2490
- typingData.interval = typingInterval;
2491
- typingData.cleared = false;
2492
2492
  if (message.id && !content.inReplyTo) {
2493
2493
  content.inReplyTo = createUniqueUuid4(this.runtime, message.id);
2494
2494
  }
@@ -2499,7 +2499,7 @@ var MessageManager = class {
2499
2499
  logger4.warn("Discord - User not found", message.author.id);
2500
2500
  return [];
2501
2501
  }
2502
- u.send(content.text);
2502
+ await u.send(content.text || "");
2503
2503
  messages = [content];
2504
2504
  } else {
2505
2505
  messages = await sendMessageInChunks(
@@ -2558,7 +2558,7 @@ var MessageManager = class {
2558
2558
  clearInterval(typingData.interval);
2559
2559
  typingData.cleared = true;
2560
2560
  }
2561
- }, 500);
2561
+ }, 3e4);
2562
2562
  } catch (error) {
2563
2563
  console.error("Error handling message:", error);
2564
2564
  }