mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-12-18 17:39:33 +05:00
new shortener (again)
This commit is contained in:
parent
d3bc25dcb1
commit
15bb5bf014
1 changed files with 3 additions and 5 deletions
|
@ -51,19 +51,17 @@ class Shorturl extends BaseCommand {
|
||||||
await interaction.deferReply({ ephemeral: interaction.options.getBoolean("ephemeral") || false });
|
await interaction.deferReply({ ephemeral: interaction.options.getBoolean("ephemeral") || false });
|
||||||
|
|
||||||
const url = interaction.options.getString("url");
|
const url = interaction.options.getString("url");
|
||||||
const res = await fetch("https://i.jonnybro.ru/api/shorten", {
|
const res = fetch("https://s.jonnybro.ru/api/link/create", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
|
"Authorization": `Bearer ${client.config.apiKeys.sink}`,
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
Authorization: client.config.apiKeys.zipline,
|
|
||||||
},
|
},
|
||||||
body: JSON.stringify({ url: url }),
|
body: JSON.stringify({ url: url }),
|
||||||
}).then(res => res.json());
|
}).then(res => res.json());
|
||||||
|
|
||||||
console.log(res);
|
|
||||||
|
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
content: `<${res.url}>`,
|
content: `<https://s.jonnybro.ru/${res.slug}>`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue