new shortener (again)

This commit is contained in:
Jonny_Bro (Nikita) 2024-12-04 11:55:24 +05:00
parent d3bc25dcb1
commit 15bb5bf014

View file

@ -51,19 +51,17 @@ class Shorturl extends BaseCommand {
await interaction.deferReply({ ephemeral: interaction.options.getBoolean("ephemeral") || false });
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",
headers: {
"Authorization": `Bearer ${client.config.apiKeys.sink}`,
"Content-Type": "application/json",
Authorization: client.config.apiKeys.zipline,
},
body: JSON.stringify({ url: url }),
}).then(res => res.json());
console.log(res);
interaction.editReply({
content: `<${res.url}>`,
content: `<https://s.jonnybro.ru/${res.slug}>`,
});
}
}