alan
alan
DIAdiscord.js - Imagine an app
Created by alan on 11/14/2023 in #djs-questions
Refresh autocomplete options with that's dependent on the other parameter
if (interaction.commandName === 'preset') {
// const selectedUser = interaction.options.get('user').value ? interaction.options.get('user').value : interaction.user.id;
//var selectedUser = '162955183670820864';
try {
selectedUser = interaction.options.get('user').value;
} catch {
selectedUser = interaction.user.id;
}
var preset = await sequelize.query(`SELECT \`id\`, \`name\` FROM \`Presets\` WHERE userID = ?`, { replacements: [selectedUser], type: QueryTypes.SELECT });
const focusedValue = interaction.options.getFocused();
const filtered = preset.filter(choice => choice.name.includes(focusedValue));
await interaction.respond(
filtered.map(choice => ({ name: choice.name, value: choice.id })),
).catch(console.err);
}
if (interaction.commandName === 'preset') {
// const selectedUser = interaction.options.get('user').value ? interaction.options.get('user').value : interaction.user.id;
//var selectedUser = '162955183670820864';
try {
selectedUser = interaction.options.get('user').value;
} catch {
selectedUser = interaction.user.id;
}
var preset = await sequelize.query(`SELECT \`id\`, \`name\` FROM \`Presets\` WHERE userID = ?`, { replacements: [selectedUser], type: QueryTypes.SELECT });
const focusedValue = interaction.options.getFocused();
const filtered = preset.filter(choice => choice.name.includes(focusedValue));
await interaction.respond(
filtered.map(choice => ({ name: choice.name, value: choice.id })),
).catch(console.err);
}
7 replies
DIAdiscord.js - Imagine an app
Created by alan on 11/14/2023 in #djs-questions
Refresh autocomplete options with that's dependent on the other parameter
discord.js version - 14.12.1 node -v - 19.6.0
7 replies
DIAdiscord.js - Imagine an app
Created by alan on 5/25/2023 in #djs-questions
interaction fetchReply attachment URL is different than the actual URL
Hmmm I could try
14 replies
DIAdiscord.js - Imagine an app
Created by alan on 5/25/2023 in #djs-questions
interaction fetchReply attachment URL is different than the actual URL
Oh so I shouldn't edit that post after fetching the url?
14 replies
DIAdiscord.js - Imagine an app
Created by alan on 5/25/2023 in #djs-questions
interaction fetchReply attachment URL is different than the actual URL
But the fetchReply gets a different ID somehow
14 replies
DIAdiscord.js - Imagine an app
Created by alan on 5/25/2023 in #djs-questions
interaction fetchReply attachment URL is different than the actual URL
If I manually copy link from the message output, it's a different link and that one would be permanent
14 replies
DIAdiscord.js - Imagine an app
Created by alan on 5/25/2023 in #djs-questions
interaction fetchReply attachment URL is different than the actual URL
Yep correct
14 replies
DIAdiscord.js - Imagine an app
Created by alan on 5/25/2023 in #djs-questions
interaction fetchReply attachment URL is different than the actual URL
But would there be a way to get the persistent link? one that hopefully lasts forever
14 replies
DIAdiscord.js - Imagine an app
Created by alan on 5/25/2023 in #djs-questions
interaction fetchReply attachment URL is different than the actual URL
The links aren't ephemeral though duckthinking
14 replies
DIAdiscord.js - Imagine an app
Created by alan on 9/17/2022 in #djs-questions
ButtonBuilder setEmoji with a valid emojiID is throwing an error
Oh my bad I pasted the wrong ID from my clipboard >.> ignore me lmao sorry
5 replies
DIAdiscord.js - Imagine an app
Created by alan on 9/17/2022 in #djs-questions
ButtonBuilder setEmoji with a valid emojiID is throwing an error
14.3.0 and v16.13.0
5 replies