@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.
- package/package.json +1 -1
- package/src/discord.js +15 -7
package/package.json
CHANGED
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
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
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) {
|