Fix parse-domain

This commit is contained in:
Dragon Fire
2024-03-20 17:09:53 -04:00
parent 845e57c725
commit 51a81624f3
5 changed files with 21 additions and 7 deletions
+2 -3
View File
@@ -1,6 +1,5 @@
const Command = require('../../framework/Command');
const request = require('node-superfetch');
const { parseDomain, ParseResultType } = import('parse-domain');
const { GODADDY_KEY, GODADDY_SECRET } = process.env;
module.exports = class DomainAvailableCommand extends Command {
@@ -30,8 +29,8 @@ module.exports = class DomainAvailableCommand extends Command {
}
async run(msg, { url }) {
const { type, domain, topLevelDomains } = parseDomain(url.hostname);
if (type !== ParseResultType.Listed) return msg.reply('This domain is not supported.');
const { type, domain, topLevelDomains } = this.client.parseDomain(url.hostname);
if (type !== this.client.ParseResultType.Listed) return msg.reply('This domain is not supported.');
try {
const { body } = await request
.get('https://api.godaddy.com/v1/domains/available')
+2 -3
View File
@@ -1,6 +1,5 @@
const Command = require('../../framework/Command');
const request = require('node-superfetch');
const { parseDomain, ParseResultType } = import('parse-domain');
module.exports = class IsItDownCommand extends Command {
constructor(client) {
@@ -28,8 +27,8 @@ module.exports = class IsItDownCommand extends Command {
}
async run(msg, { url }) {
const { type, domain, topLevelDomains } = parseDomain(url.hostname);
if (type !== ParseResultType.Listed) return msg.reply('This domain is not supported.');
const { type, domain, topLevelDomains } = this.client.parseDomain(url.hostname);
if (type !== this.client.ParseResultType.Listed) return msg.reply('This domain is not supported.');
try {
const { text } = await request
.post('https://www.isitdownrightnow.com/check.php')