diff options
Diffstat (limited to 'src/commands/utility/whois.ts')
| -rw-r--r-- | src/commands/utility/whois.ts | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/commands/utility/whois.ts b/src/commands/utility/whois.ts new file mode 100644 index 0000000..95c954c --- /dev/null +++ b/src/commands/utility/whois.ts @@ -0,0 +1,36 @@ +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 }); + }); + } +};
\ No newline at end of file |