diff --git a/commands/fun/8ball.ts b/commands/fun/8ball.ts new file mode 100644 index 0000000..028532c --- /dev/null +++ b/commands/fun/8ball.ts @@ -0,0 +1,36 @@ +const { commandModule, CommandType } = require('@sern/handler'); +import { publish } from "../../src/plugins/publish"; +import { ownerOnly } from "../../src/plugins/ownerOnly" +import { ApplicationCommandOptionType } from "discord.js"; +/* +import { publish } from "../../src/plugins/publish"; +import { ownerOnly } from "../../src/plugins/ownerOnly" +*/ + +export default commandModule({ + name: '8ball', + type: CommandType.Both, + plugins: [publish(['1000400148289036298', '928018226330337280'])], + description: 'Preguntale a la 8-ball cosas.', + //alias : [], + options: [{ + name: "pregunta", + description: "Escribe lo que le quieres preguntar.", + type: ApplicationCommandOptionType.String, + required: true + }], + execute: async (ctx, options) => { + // yes, the question argument is never used. There is no reason to use it in the code. + var eightballwords = [ + 'Probablemente', + 'Sí', + 'No', + 'Dudable', + 'Como lo veo, todo indica a que sí', + 'A lo mejor', + 'No cuentes con ello', + 'Buena suerte' + ] + await ctx.reply({content: `La bola tiene respuesta: ${eightballwords[Math.floor(Math.random() * eightballwords.length)]}.`, ephemeral: true}) + }, +}); \ No newline at end of file diff --git a/commands/haha-goofy-stuff/joke.ts b/commands/fun/joke.ts similarity index 100% rename from commands/haha-goofy-stuff/joke.ts rename to commands/fun/joke.ts diff --git a/commands/moderation/slowmode.ts b/commands/moderation/slowmode.ts new file mode 100644 index 0000000..c7dd030 --- /dev/null +++ b/commands/moderation/slowmode.ts @@ -0,0 +1,36 @@ +const { commandModule, CommandType } = require('@sern/handler'); +import { publish } from "../../src/plugins/publish"; +import { ownerOnly } from "../../src/plugins/ownerOnly" +import { ApplicationCommandOptionType } from "discord.js"; + +export default commandModule({ + name: 'slowmode', + type: CommandType.Both, + plugins: [publish(['1000400148289036298', '928018226330337280']), ownerOnly()], + description: 'ADMIN: Pon modo lento a canales de texto', + options: [ + { + name: "segundos", + description: "Los segundos de modo lento", + type: ApplicationCommandOptionType.Number, + required: true + }, + { + name: "razon", + description: "La razón del modo lento", + type: ApplicationCommandOptionType.String, + required: true + } + ], + //alias : [], + execute: async (ctx, options) => { + const seconds = options[1].getNumber("segundos", true); + const reason = options[1].getString("razon", true); + + ctx.channel.setRateLimitPerUser(seconds, reason) + + ctx.reply({content: `Se han añadido ${seconds} segundos de modo lento al canal de voz actual`}) + const sendToMods = ctx.client.guilds.cache.get('928018226330337280')!.channels.cache.get('1004118323258208257') + await sendToMods.send({content: `Se ha aplicado modo lento al canal ${ctx.channel}.\nEfectuado por ${ctx.user} con ${seconds} segundos de retardo.\nRazón: ${reason}`}) + }, +}); \ No newline at end of file diff --git a/commands/moderation/timeoutUser.ts b/commands/moderation/timeoutUser.ts index 9e4a0aa..e55a411 100644 --- a/commands/moderation/timeoutUser.ts +++ b/commands/moderation/timeoutUser.ts @@ -10,7 +10,7 @@ import { ownerOnly } from "../../src/plugins/ownerOnly" export default commandModule({ name: 'timeout', type: CommandType.Both, - plugins: [publish(['1000400148289036298', '928018226330337280'])], + plugins: [publish(['1000400148289036298', '928018226330337280']), ownerOnly()], description: 'ADMIN: Silencia a usuarios.', options: [ { @@ -41,7 +41,7 @@ export default commandModule({ const minutosToMilisegundos = minutos * 60 * 1000 const sendToMods = ctx.client.guilds.cache.get('928018226330337280')!.channels.cache.get('1004118323258208257') - await sendToMods.send({content: `Se ha silenciado a ${usuario}.\nSlencio efectuado por ${ctx.user} con ${minutos} de duración.\nRazón: ${razon}`}) + await sendToMods.send({content: `Se ha silenciado a ${usuario}.\nSlencio efectuado por ${ctx.user} con ${minutos} minutos de duración.\nRazón: ${razon}`}) usuario.timeout(minutosToMilisegundos, razon).then(() => {ctx.reply({content: `Se ha silenciado a ${usuario} correctamente.`, ephemeral: true})}) } diff --git a/commands/ping.ts b/commands/ping.ts index 99fb8e5..20adcdd 100644 --- a/commands/ping.ts +++ b/commands/ping.ts @@ -13,7 +13,8 @@ export default commandModule({ // , '928018226330337280' description: 'A ping command', //alias : [], - execute: async (ctx, args) => { + options: [], + execute: async (ctx, options) => { await ctx.reply('Hello World!'); }, }); \ No newline at end of file