Nimbi

ping.ts

Dec 24th, 2020 (edited)
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { config } from '../../modules/config/cfg';
  2. import { permissions } from '../../modules/config/permissions';
  3.  
  4. config.commands.raw(
  5.   {
  6.     name: 'ping',
  7.     aliases: ['echo', 'beep'],
  8.     description: "Responds with the bot's ping.",
  9.     filters: permissions.user
  10.   },
  11.   async (msg) => {
  12.     const embed = new discord.Embed();
  13.     const start = Date.now();
  14.     const latency = new Date(msg.timestamp).getTime() - start;
  15.     embed.setTitle(`**__PING__**`);
  16.     embed.setDescription(`The ping is ${latency}ms`);
  17.     embed.setThumbnail({
  18.       url: config.images.loadingImage
  19.     });
  20.     embed.setColor(0xf600ff);
  21.     embed.setTimestamp(new Date().toISOString());
  22.     await msg.reply({ embed: embed });
  23.   }
  24. );
  25.  
Add Comment
Please, Sign In to add comment