diff --git a/commands/utility/whois.js b/commands/utility/whois.js new file mode 100644 index 0000000..0a2193f --- /dev/null +++ b/commands/utility/whois.js @@ -0,0 +1,31 @@ +const { Command } = require('discord-akairo'); +const whois = require('whois'); + +class whoisCommand extends Command { + constructor() { + super('whois', { + aliases: ['whois'], + category: 'utility', + args: [ + { + id: 'domain', + type: 'string', + match: 'rest', + } + ], + description: { + content: 'Show\'s whois data about website. (ATTENTION, CAN BE SPAMMY)', + usage: '[website]', + examples: ['namejeff.xyz'] + } + }); + } + + async exec(message, args) { + whois.lookup(args.domain, function(err, data) { + return message.channel.send(data, {split: true, code: true }); + }); + } +} + +module.exports = whoisCommand; \ No newline at end of file