Version v3.5.0
This commit is contained in:
parent
77a37a0ed3
commit
8bbc22c06c
1 changed files with 35 additions and 0 deletions
35
unused/commands/Utilities/shorturl.js
Normal file
35
unused/commands/Utilities/shorturl.js
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
const URLClient = require("../../../client/URLClient");
|
||||||
|
module.exports = {
|
||||||
|
name: "shorten-url",
|
||||||
|
description: "Shorten a URL",
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
type: 3,
|
||||||
|
name: "short-name",
|
||||||
|
description:
|
||||||
|
"The short name that for the shorten-url (For example, https://url.cath.gq/youtube)",
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 3,
|
||||||
|
name: "link",
|
||||||
|
description:
|
||||||
|
"The link for the shorten-url (For example, https://youtube.com)",
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
run: async (client, interaction, args) => {
|
||||||
|
if (!args[1].includes("https://")) {
|
||||||
|
interaction.followUp({ content: "The link must contain 'https://'" });
|
||||||
|
} else {
|
||||||
|
const shortName = args[0];
|
||||||
|
const targetURL = args[1];
|
||||||
|
const cc = await URLClient.createShortURL(shortName, targetURL);
|
||||||
|
if (!cc) {
|
||||||
|
interaction.followUp({ content: `URL already exist` });
|
||||||
|
} else {
|
||||||
|
interaction.followUp({ content: `https://url.cath.gq/${cc}` });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
Loading…
Reference in a new issue