mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 14:19:11 +02:00
Replace deprecated url.parse
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const request = require('node-superfetch');
|
||||
const url = require('url');
|
||||
const { URL } = require('url');
|
||||
const validURL = require('valid-url');
|
||||
|
||||
module.exports = class IsItDownCommand extends Command {
|
||||
@@ -30,7 +30,7 @@ module.exports = class IsItDownCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, { site }) {
|
||||
const parsed = url.parse(site);
|
||||
const parsed = new URL(site);
|
||||
try {
|
||||
const { text } = await request
|
||||
.post('https://www.isitdownrightnow.com/check.php')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const request = require('node-superfetch');
|
||||
const url = require('url');
|
||||
const { URL } = require('url');
|
||||
const validURL = require('valid-url');
|
||||
|
||||
module.exports = class ScreenshotCommand extends Command {
|
||||
@@ -32,7 +32,7 @@ module.exports = class ScreenshotCommand extends Command {
|
||||
|
||||
async run(msg, { site }) {
|
||||
try {
|
||||
const parsed = url.parse(site);
|
||||
const parsed = new URL(site);
|
||||
if (!msg.channel.nsfw && this.client.adultSiteList.includes(parsed.host)) {
|
||||
return msg.reply('This site is NSFW.');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user