mirror of
https://github.com/SrIzan10/vinci.git
synced 2026-06-06 01:07:00 +00:00
feat: Comando de acortar enlaces!
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
TOKEN=token
|
||||
PREFIX=v!
|
||||
MONGODB=mongodb://
|
||||
HYPIXEL_API=API_KEY
|
||||
HYPIXEL_API=API_KEY
|
||||
YOURLS_KEY=YOURLS_SIGNATURE
|
||||
24
commands/misc/shorten.ts
Normal file
24
commands/misc/shorten.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
const { commandModule, CommandType } = require('@sern/handler');
|
||||
import axios, { AxiosError, AxiosResponse } from "axios";
|
||||
import { ApplicationCommandOptionType } from "discord.js";
|
||||
import { publish } from "../../src/plugins/publish";
|
||||
|
||||
export default commandModule({
|
||||
name: 'acortar',
|
||||
type: CommandType.Both,
|
||||
plugins: [publish(['1000400148289036298', '928018226330337280'])],
|
||||
description: 'Acorta una URL a vinci.tk',
|
||||
options: [
|
||||
{
|
||||
name: 'url',
|
||||
description: 'la URL larga',
|
||||
type: ApplicationCommandOptionType.String,
|
||||
required: true
|
||||
}
|
||||
],
|
||||
//alias : [],
|
||||
execute: async (ctx, options) => {
|
||||
const url = options[1].getString('url', true);
|
||||
const request = await axios(`https://vinci.tk/yourls-api.php?signature=${process.env.YOURLS_KEY}&action=shorturl&format=json&url=${url}`, {validateStatus: function (status) {return status === 200|| status === 400; }}).then((res: AxiosResponse) => res.data)
|
||||
ctx.reply({content: `URL acortada: ${request.shorturl}\nURL original: ${url}`, ephemeral: true});
|
||||
}})
|
||||
@@ -10,7 +10,7 @@ export default commandModule({
|
||||
name: 'ping',
|
||||
type: CommandType.Both,
|
||||
plugins: [publish(['1000400148289036298'])],
|
||||
// 928018226330337280
|
||||
// , '928018226330337280'
|
||||
description: 'A ping command',
|
||||
//alias : [],
|
||||
execute: async (ctx, args) => {
|
||||
|
||||
@@ -7,6 +7,4 @@ export default eventModule({
|
||||
execute(err) {
|
||||
console.log(err);
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
1933
package-lock.json
generated
1933
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -21,17 +21,12 @@
|
||||
},
|
||||
"homepage": "https://github.com/SrIzan10/vinci#readme",
|
||||
"dependencies": {
|
||||
"@discordjs/opus": "^0.8.0",
|
||||
"@sern/handler": "^1.1.8-beta",
|
||||
"@tmware/status-rotate": "^1.2.10",
|
||||
"axios": "^0.27.2",
|
||||
"date-and-time": "^2.4.1",
|
||||
"discord-giveaways": "^6.0.1",
|
||||
"discord.js": "^14.1.2",
|
||||
"dotenv": "^16.0.1",
|
||||
"fs": "^0.0.1-security",
|
||||
"mongoose": "^6.5.1",
|
||||
"ms": "^2.1.3",
|
||||
"util": "^0.12.4"
|
||||
"ms": "^2.1.3"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user