Jaede
DIAdiscord.js - Imagine an app
•Created by Jaede on 9/21/2023 in #djs-questions
user.send both resolving and rejecting
no, i test for if the author of the message is the bot and ignore anything sent by the bot...this is specifically for a test user sending the bot a DM, the bot processing that DM, and sending a reply back
14 replies
DIAdiscord.js - Imagine an app
•Created by Jaede on 9/21/2023 in #djs-questions
user.send both resolving and rejecting
yes...effectively:
client.on("messageCreate", async(message) => {
client.users.fetch...
});
there's more stuff in there, but that's the flow
14 replies
DIAdiscord.js - Imagine an app
•Created by Jaede on 9/21/2023 in #djs-questions
user.send both resolving and rejecting
...along with the message on the console, and the error in the console from both the .then and .catch blocks
14 replies
DIAdiscord.js - Imagine an app
•Created by Jaede on 9/21/2023 in #djs-questions
user.send both resolving and rejecting
i get the message in my test user's DMs
14 replies
DIAdiscord.js - Imagine an app
•Created by Jaede on 9/21/2023 in #djs-questions
user.send both resolving and rejecting
i assume that doesn't impact the resolve/reject of the user.send though
14 replies
DIAdiscord.js - Imagine an app
•Created by Jaede on 9/21/2023 in #djs-questions
user.send both resolving and rejecting
k, good to know
14 replies
DIAdiscord.js - Imagine an app
•Created by Jaede on 9/21/2023 in #djs-questions
user.send both resolving and rejecting
Sure...
const client = new Client({
intents : [ GatewayIntentBits.Guilds, GatewayIntentBits.DirectMessages, GatewayIntentBits.MessageContent ],
partials : [ Partials.Channel, Partials.Message ]
});
// lots of stuff happens inbetween
client.users.fetch(discordUserId).then((user) => {
if( user ) {
//code block from above
} else {
// resolve a previous promise
}
}).catch((err) => {
// handle the errors and reject
})
14 replies