mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-24 22:24:58 +05:00
use HTTPs in shorturl
This commit is contained in:
parent
44c6de3fa5
commit
e5ffa7b622
2 changed files with 4 additions and 4 deletions
|
@ -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({
|
||||
|
|
|
@ -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}>`,
|
||||
|
|
Loading…
Reference in a new issue