2019-09-13 20:02:41 +00:00
|
|
|
const urlCheck = require("../utils/urlcheck.js");
|
|
|
|
const fetch = require("node-fetch");
|
|
|
|
|
|
|
|
exports.run = async (message, args) => {
|
|
|
|
if (args.length === 0 || !urlCheck(args[0])) return `${message.author.mention}, you need to provide a URL to shorten!`;
|
|
|
|
const data = await fetch(`https://is.gd/create.php?format=simple&url=${encodeURIComponent(args[0])}`);
|
|
|
|
const url = await data.text();
|
|
|
|
return url;
|
|
|
|
};
|
|
|
|
|
2019-12-02 20:47:22 +00:00
|
|
|
exports.aliases = ["urlshorten", "shortenlink", "urishorten", "shortenuri", "shortenurl"];
|
|
|
|
exports.category = 1;
|
|
|
|
exports.help = "Shortens a URL";
|
2019-12-05 16:58:46 +00:00
|
|
|
exports.params = "[url]";
|