summaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/bot.ts2
-rw-r--r--src/commands/utility/whois.ts36
-rw-r--r--src/config.json2
3 files changed, 38 insertions, 2 deletions
diff --git a/src/bot.ts b/src/bot.ts
index 7900d7a..3e07da2 100644
--- a/src/bot.ts
+++ b/src/bot.ts
@@ -125,7 +125,7 @@ client.on('guildMemberRemove', member => {
})
client.on('message', async msg => {
- var msgContent = msg.content.toLowerCase();
+ const msgContent = msg.content.toLowerCase();
function prefixCheck() {
if (msgContent.startsWith('uwu!')) {
return true;
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
diff --git a/src/config.json b/src/config.json
index d9c16f9..6ab342c 100644
--- a/src/config.json
+++ b/src/config.json
@@ -2,6 +2,6 @@
"secret":"Njk5NDczMjYzOTk4MjcxNDg5.XpU5oQ.btZuxVudhNllSQY6CxrXXtMJm9A",
"secret-dev":"NzEyMDg4MzY5MjA2OTE5MjY5.XsMeEw.Yy0a8m2vZLDbPi7cZ8aqCalMR68",
"yt-api-key":"AIzaSyCeG1lQAeInv4vjFv_eTL9IFAFNdQC9Nk8",
- "version":"1.10.21",
+ "version":"1.10.22",
"fortniteTrackerNetworkToken": "4cf21f95-5f1a-412a-b4a7-e5424adc314a"
} \ No newline at end of file