34 lines
795 B
JavaScript
34 lines
795 B
JavaScript
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);
|
|
});
|
|
}
|
|
}
|
|
};
|