@tritard/waterbrother 0.16.151 → 0.16.152

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 +15 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tritard/waterbrother",
3
- "version": "0.16.151",
3
+ "version": "0.16.152",
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
@@ -1589,13 +1589,21 @@ async function handleDiscordSlashInteraction(runtime, interaction, { log = () =>
1589
1589
 
1590
1590
  async function handleDiscordAutocompleteInteraction(runtime, interaction, { log = () => {} } = {}) {
1591
1591
  const discord = normalizeDiscordRuntime(runtime);
1592
- const state = await loadDiscordGatewayState();
1593
- const choices = await buildDiscordAutocompleteChoices(runtime, state, interaction);
1594
- await createInteractionResponse(discord, interaction, {
1595
- type: 8,
1596
- data: { choices }
1597
- });
1598
- log(`discord: autocomplete reply in ${String(interaction?.channel_id || "").trim()}`);
1592
+ try {
1593
+ const state = await loadDiscordGatewayState();
1594
+ const choices = await buildDiscordAutocompleteChoices(runtime, state, interaction);
1595
+ await createInteractionResponse(discord, interaction, {
1596
+ type: 8,
1597
+ data: { choices }
1598
+ });
1599
+ log(`discord: autocomplete reply in ${String(interaction?.channel_id || "").trim()}`);
1600
+ } catch (error) {
1601
+ await createInteractionResponse(discord, interaction, {
1602
+ type: 8,
1603
+ data: { choices: [] }
1604
+ }).catch(() => null);
1605
+ throw error;
1606
+ }
1599
1607
  }
1600
1608
 
1601
1609
  async function buildDiscordAbout(runtime, state, message) {