@tritard/waterbrother 0.16.152 → 0.16.154

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/package.json +1 -1
  2. package/src/discord.js +16 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tritard/waterbrother",
3
- "version": "0.16.152",
3
+ "version": "0.16.154",
4
4
  "description": "Waterbrother: bring-your-own-model coding CLI with local tools, sessions, operator modes, and approval controls",
5
5
  "type": "module",
6
6
  "bin": {
package/src/discord.js CHANGED
@@ -2580,6 +2580,22 @@ export async function runDiscordGateway(runtime = {}, { log = console.log, signa
2580
2580
  }
2581
2581
  } catch (error) {
2582
2582
  log(`discord: interaction failed: ${error instanceof Error ? error.message : String(error)}`);
2583
+ try {
2584
+ if (Number(packet.d?.type || 0) === 4) {
2585
+ await createInteractionResponse(discord, packet.d, {
2586
+ type: 8,
2587
+ data: { choices: [] }
2588
+ });
2589
+ } else {
2590
+ await createInteractionResponse(discord, packet.d, {
2591
+ type: 4,
2592
+ data: {
2593
+ content: `Slash command failed: ${error instanceof Error ? error.message : String(error)}`.slice(0, 1900),
2594
+ ...(shouldUseEphemeralInteraction(packet.d) ? { flags: 64 } : {})
2595
+ }
2596
+ });
2597
+ }
2598
+ } catch {}
2583
2599
  }
2584
2600
  return;
2585
2601
  }