import { Command, CommandoMessage } from 'discord.js-commando'; import emoji from 'emoji-random'; import whois from 'whois'; module.exports = class WhoIsUtility extends Command { constructor(client) { super(client, { name: 'whois', group: 'utility', memberName: 'whois', description: 'Perform a whois on a specified or domain.', examples: ['uwu!whois google.com'], userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], throttling: { usages: 5, duration: 30 }, args: [ { key: 'host', prompt: 'What host/ domain would you like to perform a who is on?', type: 'string' } ] }); } async run(msg: CommandoMessage, { host }) { whois.lookup(host, (err, data) => { if (err) return msg.reply(`Woops, there was an error getting that information for you! Please re-check your specified host/ domain. ${emoji.random()}`); msg.reply(`Check your DMs for the whois! ${emoji.random()}`); msg.author.send(data, { split: true }); }); } };