Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

dm command discord.js

if (cmd === `!dm`) {
 let dUser =
  message.guild.member(message.mentions.users.first()) ||
  message.guild.members.get(args[0]);
 if (!dUser) return message.channel.send("Can't find user!");
 if (!message.member.hasPermission('ADMINISTRATOR'))
  return message.reply("You can't you that command!");
 let dMessage = args.join(' ').slice(22);
 if (dMessage.length < 1) return message.reply('You must supply a message!');

 dUser.send(`${dUser} A moderator from WP Coding Club sent you: ${dMessage}`);

 message.author.send(
  `${message.author} You have sent your message to ${dUser}`
 );
}
Comment

dm command discord.js

case 'dm':
  mentiondm = message.mentions.users.first();
  message.channel.bulkDelete(1);
  if (!message.member.roles.cache.some(role => role.name === "Owner")) return message.channel.send('Beep Boing: This command is way too powerful for you to use!');
  if (mentiondm == null) return message.reply('Beep Boing: No user to send message to!');
  mentionMessage = message.content.slice(3);
  mentiondm.send(mentionMessage);
  console.log('Message Sent!')
  break;
Comment

dm discord.js

(user).send("your message here");
Comment

discord.js dm

case 'dm':
  mentiondm = message.mentions.users.first();
  message.channel.bulkDelete(1);
  if (!message.member.roles.cache.some(role => role.name === "Owner")) return message.channel.send('Beep Boing: This command is way too powerful for you to use!');
  if (mentiondm == null) return message.reply('Beep Boing: No user to send message to!');
  mentionMessage = message.content.slice(3);
  mentiondm.send(mentionMessage);
  console.log('Message Sent!')
  break;
 Run code snippet
Comment

PREVIOUS NEXT
Code Example
Javascript :: alphabet to number javascript 
Javascript :: jquery change select value 
Javascript :: javascript throw new error 
Javascript :: CastError: Cast to ObjectId failed for value "undefined" at path "_id" for model 
Javascript :: javascript regex 
Javascript :: array contains method 
Javascript :: get first duv with jquery 
Javascript :: error metro bundler process exited with code 1 react native 
Javascript :: chart js in angular 13 
Javascript :: selector id jquery but is variable 
Javascript :: download images from http link in react 
Javascript :: js bubble sort 
Javascript :: get all image tags javascript 
Javascript :: js hexadecimal 
Javascript :: nodemon watch extensions 
Javascript :: closure in js 
Javascript :: how to get all the voice channels in discord js 
Javascript :: How to access the GET parameters after “?” in Express 
Javascript :: js copy array into another 
Javascript :: regex js pattern tags 
Javascript :: javascript date to string format dd mmm yyyy 
Javascript :: jquery display text in div 
Javascript :: how to add items in an array in js 
Javascript :: use bootstrap 5 with vue 
Javascript :: Return the average of the given array rounded down to its nearest integer. 
Javascript :: open modal useState 
Javascript :: netmask /24 
Javascript :: jquery get all input name and values and submit 
Javascript :: react native vector icons not showing 
Javascript :: convert array to object 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =