Create Users Dms

When I am trying to send a message to a user via bot it says object Object
22 Replies
d.js toolkit
d.js toolkit12mo ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
treble/luna
treble/luna12mo ago
show your code
Dãrķ Søŭł
Dãrķ Søŭł12mo ago
treble/luna
treble/luna12mo ago
thats not your code
Dãrķ Søŭł
Dãrķ Søŭł12mo ago
if (interaction.commandName === 'accept') {
const id = interaction.options.get('id');
interaction.users.send(`${id}`, `Hello <@${id}>, wanna learn a secret?\n\nBefore we proceed to the secret, allow me to introduce myself. I am <@1071792638912647219>, created by @d4rk.s0ul to assist all Pizzaland managers in monitoring the actions of their staff members. My purpose is to provide advanced features and reach new heights of functionality. I am capable of overseeing every command and moderating any action taken by staff or managers in the server, subject to approval by my creator, for the safety of the server.\n\nNow, onto the secret...\n\nYou have been selected to join our team as a staff member. However, please keep in mind that the results of your application have not been announced yet, so this information must remain confidential for now.You can procceed to join the provided server below.\n\n||https://discord.gg/YBvgs995Y8||`)
}
if (interaction.commandName === 'accept') {
const id = interaction.options.get('id');
interaction.users.send(`${id}`, `Hello <@${id}>, wanna learn a secret?\n\nBefore we proceed to the secret, allow me to introduce myself. I am <@1071792638912647219>, created by @d4rk.s0ul to assist all Pizzaland managers in monitoring the actions of their staff members. My purpose is to provide advanced features and reach new heights of functionality. I am capable of overseeing every command and moderating any action taken by staff or managers in the server, subject to approval by my creator, for the safety of the server.\n\nNow, onto the secret...\n\nYou have been selected to join our team as a staff member. However, please keep in mind that the results of your application have not been announced yet, so this information must remain confidential for now.You can procceed to join the provided server below.\n\n||https://discord.gg/YBvgs995Y8||`)
}
treble/luna
treble/luna12mo ago
first of all i have no clue how that even works because interaction.users isnt a thing its interaction.user and .send takes a single param and you need to specify what you .get .getString, .getUser, etc
Dãrķ Søŭł
Dãrķ Søŭł12mo ago
the .get('id') works, then how can I fix the .send so it can actually send it?
treble/luna
treble/luna12mo ago
use a single param and no your .get does not work since what you are sending is just ${id} as the second parameter does not exist and is ignored
Dãrķ Søŭł
Dãrķ Søŭł12mo ago
so it dmed the runner okay
treble/luna
treble/luna12mo ago
since .get returns an object, you're stringifying the object and thus sending Object object so use .getX with x being your type
Dãrķ Søŭł
Dãrķ Søŭł12mo ago
okay and how I use a single param?
treble/luna
treble/luna12mo ago
by not separating it with a , , basic js
Dãrķ Søŭł
Dãrķ Søŭł12mo ago
oh okay, the docs was saying it has a ,
Dãrķ Søŭł
Dãrķ Søŭł12mo ago
Unknown User
Unknown User12mo ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ Søŭł12mo ago
oh okay thank you! I will fix the code I changed the .get to .getString('id') but it now has an error
treble/luna
treble/luna12mo ago
show that error
Dãrķ Søŭł
Dãrķ Søŭł12mo ago
treble/luna
treble/luna12mo ago
show your code
Danial
Danial12mo ago
Around line 45
Dãrķ Søŭł
Dãrķ Søŭł12mo ago
I fixed it, I was being stupid thank you for your help!
treble/luna
treble/luna12mo ago
yw