Nahana
Nahana
DIAdiscord.js - Imagine an app
Created by Nahana on 1/1/2024 in #djs-questions
Get user by ID via DM Slash command
I'm trying to get a User obj for a specifc user by their ID, but from a Slash command thats run via a DM ... I know when working in the guild, it can be gotten from like interaction.guild.members.cache.get(UID) however, in DMs there is no guild. Is there any way to do this? Or even get the guild object (by ID) from a DM message? Basically I'm budling a secret santa type bot for my server ... User A can send the bot a question via a slash command, the bot then gets who User A drew for the drawing; and sends them (User B) a DM asking the question .. but I can't get the user object for User B in the DMs so send the message to
9 replies
DIAdiscord.js - Imagine an app
Created by Nahana on 12/31/2022 in #djs-questions
How do I get the current guild id in a client ready event?
I figured it would be client.guild.id but that's undefined. Is there a different way, or can I not access guild in ClientReady?
module.exports = {
name: Events.ClientReady,
once: true,
execute(client) {
console.log(`Ready! Logged in as ${client.user.tag}`)
setStatus(client)
},
}
module.exports = {
name: Events.ClientReady,
once: true,
execute(client) {
console.log(`Ready! Logged in as ${client.user.tag}`)
setStatus(client)
},
}
11 replies