From 0bf9fb3c655d4ec40696634c9ad7c6bf9606defa Mon Sep 17 00:00:00 2001 From: monty Date: Sun, 22 Dec 2019 21:20:54 +0100 Subject: [PATCH] help me --- DiscordModules/General/dig.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 DiscordModules/General/dig.js diff --git a/DiscordModules/General/dig.js b/DiscordModules/General/dig.js new file mode 100644 index 0000000..1c45055 --- /dev/null +++ b/DiscordModules/General/dig.js @@ -0,0 +1,33 @@ +const Command = require('../../src/structures/Command'); +const exec = require('shell-exec'); +const dig = require('node-dig-dns'); +let DomainReg = new RegExp(`(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]`); +module.exports = class Dig extends Command { + constructor() { + super({ + name: 'dig', + description: 'dig website dns information stuff', + aliases: [], + module: 'General', + cooldown: 10, + guildOnly: false, + developerOnly: false, + nsfw: false + }); + } + + async command(ctx) { + console.log(ctx.args); + console.log(ctx.args[0].match(DomainReg)); + + if (ctx.args[0].match(DomainReg)) { + dig([ 'shyzu.link', 'ns' ]) + .then((result) => { + console.log(result); + }) + .catch((err) => { + console.log('Error:', err); + }); + } + } +};