use HTTPs in shorturl

This commit is contained in:
Jonny_Bro (Nikita) 2023-11-18 16:30:42 +05:00
parent 44c6de3fa5
commit e5ffa7b622
2 changed files with 4 additions and 4 deletions

View file

@ -60,13 +60,13 @@ class LMGTFY extends BaseCommand {
const query = interaction.options.getString("query").replace(/[' '_]/g, "+"), const query = interaction.options.getString("query").replace(/[' '_]/g, "+"),
short = interaction.options.getBoolean("short"), short = interaction.options.getBoolean("short"),
url = `https://letmegooglethat.com/?q=${query}`; url = `https://letmegooglethat.com/?q=${encodeURIComponent(query)}`;
if (short) { 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({ interaction.editReply({
content: `<${res}>`, content: `<${res.shorturl}>`,
}); });
} else { } else {
interaction.editReply({ interaction.editReply({

View file

@ -47,7 +47,7 @@ class Shorturl extends BaseCommand {
*/ */
async execute(client, interaction) { async execute(client, interaction) {
const url = interaction.options.getString("url"); 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({ interaction.reply({
content: `<${res.shorturl}>`, content: `<${res.shorturl}>`,