From fb780ccee1e7428f868acf3de2c48951d3ead3ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Bersier?= Date: Fri, 21 Jun 2019 03:25:22 +0200 Subject: [PATCH] Show's website whois --- commands/utility/whois.js | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 commands/utility/whois.js diff --git a/commands/utility/whois.js b/commands/utility/whois.js new file mode 100644 index 00000000..0a2193f0 --- /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