jackssrt
jackssrt
DIAdiscord.js - Imagine an app
Created by jackssrt on 7/23/2023 in #djs-voice
Can't install @discordjs/opus.
I am running windows 10, node v.20.4.0, @discordjs/opus v.0.16.0. I have installed Visual Studio 2022 Community Edition with the C++ workload, and use pnpm as my package manager. When I try to install @discordjs/opus after two minutes I get this error: https://hastebin.com/share/vebiterace.swift . Switching to opusscript is not an option either, because I get an error when trying to use it instead.
5 replies
DIAdiscord.js - Imagine an app
Created by jackssrt on 7/19/2023 in #djs-questions
AutocompleteInteraction#respond takes a long time to return
my code:
const i = Math.random();
console.time(`searching-${i}`);
const focusedValue = interaction.options.getFocused();
const colorDataCopy = [...COLOR_DATA];
// slice limits the options to only be 25
const results = search(colorDataCopy.map((v) => v.name), focusedValue).slice(0, 25).map((v) => ({ name: v, value: v }));
console.timeEnd(`searching-${i}`);
console.time(`responding-${i}`);
try {
await interaction.respond(results);
} catch {
console.log("error occurred");
}
console.timeEnd(`responding-${i}`);
const i = Math.random();
console.time(`searching-${i}`);
const focusedValue = interaction.options.getFocused();
const colorDataCopy = [...COLOR_DATA];
// slice limits the options to only be 25
const results = search(colorDataCopy.map((v) => v.name), focusedValue).slice(0, 25).map((v) => ({ name: v, value: v }));
console.timeEnd(`searching-${i}`);
console.time(`responding-${i}`);
try {
await interaction.respond(results);
} catch {
console.log("error occurred");
}
console.timeEnd(`responding-${i}`);
and the output:
searching-0.22228686743632897: 1.964ms
error occurred
responding-0.22228686743632897: 48.443s
searching-0.22228686743632897: 1.964ms
error occurred
responding-0.22228686743632897: 48.443s
This means that just calling AutocompleteInteraction#respond is taking around 50 seconds to complete. The error is from the interaction taking longer than 3 seconds. I have quite limited memory available (512mb). What could the problem be and how can I fix it?
14 replies
DIAdiscord.js - Imagine an app
Created by jackssrt on 4/7/2023 in #djs-questions
How do I make newly created channels automatically show up for everyone with onboarding enabled?
10 replies