Advertisement
Rashwan-

Ping Code

Mar 23rd, 2020
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. client.on('message', async msg =>{
  2.     var prefix = '$';//Prefix
  3.     if (msg.author.bot) return undefined;
  4.     if (!msg.content.startsWith(prefix)) return undefined;
  5.    
  6.     let args = msg.content.split(' ');
  7.  
  8.     let command = msg.content.toLowerCase().split(" ")[0];
  9.     command = command.slice(prefix.length)
  10.  
  11.     if(command === `ping`) {
  12.     let embed = new Discord.RichEmbed()
  13.     .setColor('RANDOM')
  14.     .setTitle("Ping Pong!!")
  15.     .setDescription(`${client.ping} ms`)
  16.     .setFooter(`${msg.author.tag}`);
  17.     msg.delete().catch(O_o=>{})
  18.     msg.channel.send(embed);
  19.     }
  20. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement