Answers for "check if command is a dm in discord.js"

1

see if discord message is in dm discord.js

if(message.channel.type === 'dm'){
	message.channel.send("Pog");
}
Posted by: Guest on November-30-2020
0

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}`
 );
}
Posted by: Guest on April-26-2021

Code answers related to "check if command is a dm in discord.js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language