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 });
|
||||
|
||||
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}>`,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue