Fixed some remaining changes from the transition to Slash commands

This commit is contained in:
ION606
2022-10-06 12:41:15 -04:00
parent b30fdc9e7f
commit d69e7e0479
12 changed files with 151 additions and 23 deletions
+19
View File
@@ -1,6 +1,18 @@
const hastebin = require("hastebin-gen");
const { addComplaintButton } = require('../dev only/submitcomplaint');
const { Constants } = require('discord.js');
const { URL } = require("url");
function isValidUrl(s) {
try {
new URL(s);
return true;
} catch (err) {
return false;
}
};
module.exports ={
name: "scrape",
@@ -9,6 +21,13 @@ module.exports ={
const axios = require('axios');
// const cheerio = require('cheerio');
const url = interaction.options.data[0].value;
if (!isValidUrl(url)) {
return interaction.reply("Please enter a valid url").catch((err) => {
interaction.channel.send("Please enter a valid url");
});
}
axios(url)
.then(async response => {
const html = response.data;