Love
Love
DIAdiscord.js - Imagine an app
Created by Love on 7/11/2023 in #djs-questions
execute function not ending after return statement?
Thanks! I will give this a shot when I get home
12 replies
DIAdiscord.js - Imagine an app
Created by Love on 7/11/2023 in #djs-questions
execute function not ending after return statement?
so if I had something like
const something = con.execute(`SELECT discord_id FROM users WHERE discord_id = ?;`, [target.id], (err, result) => {
if (err) throw err;
// If they have not registered, let the author know and stop running.
if (result.length === 0) {
return true;
}
});
const something = con.execute(`SELECT discord_id FROM users WHERE discord_id = ?;`, [target.id], (err, result) => {
if (err) throw err;
// If they have not registered, let the author know and stop running.
if (result.length === 0) {
return true;
}
});
then my something variable would hold the value true?
12 replies
DIAdiscord.js - Imagine an app
Created by Love on 7/11/2023 in #djs-questions
execute function not ending after return statement?
I have a feeling that the issue has something to do with the return statement on line 26 being nested within the callback function of con.execute() on line 22, but I’m not sure how to properly solve the problem
12 replies
DIAdiscord.js - Imagine an app
Created by Love on 7/11/2023 in #djs-questions
execute function not ending after return statement?
[email protected] and node v18.15.0
12 replies