Sir_Spaceboi

Untitled

Oct 10th, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. const Discord = require('discord.js');
  2. const bot = new Discord.Client();
  3. const { token, prefix } = require('./botconfig.json');
  4.  
  5. bot.on('ready', () => {
  6. console.log('Bot is online!');
  7. bot.user.setActivity('Quack', { type: "PLAYING" })
  8. .then(presence => console.log(`Activity set to ${presence.activities[0].name}`))
  9. .catch(console.error);
  10. })
  11.  
  12. bot.on("message", message => {
  13. if (message.author.bot) return
  14.  
  15. const args = message.content.slice(prefix.length).trim().split(/ +/g);
  16. const command = args.shift().toLowerCase();
  17.  
  18. if (command === 'ping') {
  19. message.channel.send('Pinging...').then(sent => {
  20. sent.edit(`Pong! \n**MS:** ${sent.createdTimestamp - message.createdTimestamp}ms`);
  21. });
  22. }
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34. bot.login(token);
Advertisement
Add Comment
Please, Sign In to add comment