@friendlyrobot/discord-pi-agent 0.5.2 → 0.5.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.
Files changed (2) hide show
  1. package/dist/index.js +14 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -777,9 +777,16 @@ async function sendReply(message, text) {
777
777
  if (!firstChunk) {
778
778
  return;
779
779
  }
780
- await message.reply(firstChunk);
781
- for (const chunk of remainingChunks) {
782
- await channel.send(chunk);
780
+ try {
781
+ await message.reply(firstChunk);
782
+ for (const chunk of remainingChunks) {
783
+ await channel.send(chunk);
784
+ }
785
+ } catch (error) {
786
+ console.error("[gateway] send reply failed", {
787
+ messageId: message.id,
788
+ error
789
+ });
783
790
  }
784
791
  }
785
792
  async function startGatewayClient(config, agentService, sessionRegistry, authConfig) {
@@ -848,6 +855,10 @@ async function onMessage(message, config, agentService, sessionRegistry, authCon
848
855
  console.log("[gateway] ignored bot message", { messageId: message.id });
849
856
  return;
850
857
  }
858
+ if (message.system) {
859
+ console.log("[gateway] ignored system message", { messageId: message.id });
860
+ return;
861
+ }
851
862
  const scope = resolveScope(message);
852
863
  if (scope === null) {
853
864
  console.log("[gateway] unsupported channel type, ignoring", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@friendlyrobot/discord-pi-agent",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "description": "Reusable Discord gateway bridge for persistent pi agent sessions",
5
5
  "license": "MIT",
6
6
  "type": "module",