mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 06:42:50 +02:00
Fix parse-domain
This commit is contained in:
@@ -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')
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user