diff --git a/commands/Fun/lmgtfy.js b/commands/Fun/lmgtfy.js index 7aec9300..a8d7b581 100644 --- a/commands/Fun/lmgtfy.js +++ b/commands/Fun/lmgtfy.js @@ -60,13 +60,13 @@ class LMGTFY extends BaseCommand { const query = interaction.options.getString("query").replace(/[' '_]/g, "+"), short = interaction.options.getBoolean("short"), - url = `https://letmegooglethat.com/?q=${query}`; + url = `https://letmegooglethat.com/?q=${encodeURIComponent(query)}`; if (short) { - const res = await fetch(`https://is.gd/create.php?format=simple&url=${encodeURIComponent(url)}`).then(res => res.text()); + const res = await fetch(`https://plsgo.ru/yourls-api.php?signature=${client.config.apiKeys.jababot_yourls}&action=shorturl&url=${encodeURIComponent(url)}&format=json`).then(res => res.json()); interaction.editReply({ - content: `<${res}>`, + content: `<${res.shorturl}>`, }); } else { interaction.editReply({ diff --git a/commands/General/shorturl.js b/commands/General/shorturl.js index 6730205a..a000611c 100644 --- a/commands/General/shorturl.js +++ b/commands/General/shorturl.js @@ -47,7 +47,7 @@ class Shorturl extends BaseCommand { */ async execute(client, interaction) { const url = interaction.options.getString("url"); - const res = await fetch(`http://plsgo.ru/yourls-api.php?signature=${client.config.apiKeys.jababot_yourls}&action=shorturl&url=${encodeURIComponent(url)}&format=json`).then(res => res.json()); + const res = await fetch(`https://plsgo.ru/yourls-api.php?signature=${client.config.apiKeys.jababot_yourls}&action=shorturl&url=${encodeURIComponent(url)}&format=json`).then(res => res.json()); interaction.reply({ content: `<${res.shorturl}>`,