From e5ffa7b622d206255a1f5046e750e616bf26e847 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Sat, 18 Nov 2023 16:30:42 +0500 Subject: [PATCH] use HTTPs in shorturl --- commands/Fun/lmgtfy.js | 6 +++--- commands/General/shorturl.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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}>`,