summaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
author8cy <[email protected]>2020-06-06 09:09:25 -0700
committer8cy <[email protected]>2020-06-06 09:09:25 -0700
commit9d9d024fb0d8c9105d625edebdefb0d5a23341db (patch)
tree854cdbc5712434d26cca03439210716b1987470e /src/commands
parentowner can remove darling, change website cmd url (diff)
downloaddep-core-9d9d024fb0d8c9105d625edebdefb0d5a23341db.tar.xz
dep-core-9d9d024fb0d8c9105d625edebdefb0d5a23341db.zip
add whois, change versioning in package.json
make msgContent a const instead of a var in app.js
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/utility/whois.ts36
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