removed the tlauncher words and other stuff

This commit is contained in:
2022-07-27 14:40:44 +02:00
parent 10f54c07f8
commit d1a88834be
4 changed files with 68 additions and 14 deletions

View File

@@ -6,14 +6,6 @@ const token = process.env.TOKEN
const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildMembers, GatewayIntentBits.MessageContent]
});
const TLauncherWords = [
"T Launcher",
"tlauncher",
"Tlauncher",
"TLauncher",
"T launcher",
"t launcher"
]
Sern.init({client,sernPrefix,commands : './commands'});
@@ -21,10 +13,4 @@ client.on('ready', () => {
console.log("logged on!")
})
client.on('message', message => {
if (message.content.startsWith(TLauncherWords)) {
message.reply("Hola!\nTLauncher no se puede utilizar en el servidor oficial de Minecraft debido a la gran vulnerabilidad que nos supone tenerlo no premium.\nSi tienes una cuenta premium, puedes pedir permiso con el comando /mcform.\nGracias\n*Este mensaje es automatizado. Si ha sido un error, siento mucho molestar!*")
}
})
client.login(token);

View File

@@ -0,0 +1,27 @@
const { commandModule, CommandType } = require('@sern/handler');
const { ActionRowBuilder, ButtonBuilder, ButtonStyle, ModalBuilder, EmbedBuilder, TextInputBuilder, TextInputStyle, InteractionType } = require('discord.js');
import { publish } from "../src/plugins/publish";
import { ownerOnly } from "../src/plugins/ownerOnly"
export default commandModule({
type: CommandType.Modal,
plugins: [],
description: 'Envia el formulario para entrar al servidor.',
//alias : [],
async execute (modal) {
const value = modal.fields.getTextInputValue('mcUsernameInput');
const tlvalue = modal.fields.getTextInputValue('tlauncherInput');
if (tlvalue === 'Si' || tlvalue === 'Si'.toLowerCase() || tlvalue === 'S' || tlvalue === 'S'.toLowerCase()){
// si dice que sí está permitido, no se envía el formulario y se dice que no se puede usar TLauncher porque patatín patatán
await modal.reply({content: '**Hola! No se ha enviado el formulario porque has respondido que sí.**\nTLauncher no se puede utilizar en el servidor oficial de Minecraft debido a la gran vulnerabilidad que nos supone tenerlo no premium.\nAhora que tienes en cuenta esto, si estás en no premium, no puedes hacer nada. Si tienes MC comprado, corre de nuevo el comando respondiendo que no.\nGracias', ephemeral: true})
} else if (tlvalue === 'No' || tlvalue === 'No'.toLowerCase() || tlvalue === 'N' || tlvalue === 'N'.toLowerCase()){
// si dice que no está permitido, se envía el formulario
await modal.reply({content: 'Enviado!, Gracias por utilizar tu Mona Lisa de confianza\n~Sr Izan, 2022', ephemeral: true})
modal.client.guilds.cache.get("928018226330337280").channels.cache.get("998195363376803850").send(`Solicitud enviada por ${modal.user}.\nUsername de Minecraft: ${value}`);
} else {
// si no dice ni sí ni que no, le decimos al usuario que envíe de nuevo el formulario con sí o no.
await modal.reply({content: '**ERROR: No se ha enviado el formulario porque no has respondido ni sí ni no.**\nVuelve a intentarlo o notifica este error mencionando a Sr Izan en el servidor.', ephemeral: true})
}
}
});

View File

@@ -0,0 +1,41 @@
const { commandModule, CommandType } = require('@sern/handler');
const { ActionRowBuilder, ButtonBuilder, ButtonStyle, ModalBuilder, EmbedBuilder, TextInputBuilder, TextInputStyle, InteractionType } = require('discord.js');
import { publish } from "../src/plugins/publish";
import { ownerOnly } from "../src/plugins/ownerOnly"
export default commandModule({
name: 'mcform',
type: CommandType.Both,
plugins: [publish(['1000400148289036298', '928018226330337280'])],
description: 'Envia el formulario para entrar al servidor.',
//alias : [],
execute: async (ctx, args, interaction) => {
const modal = new ModalBuilder()
.setCustomId('mcform')
.setTitle('Formulario para entrar al servidor');
// Create the text input components
const input = new TextInputBuilder()
.setCustomId('mcUsernameInput')
// The label is the prompt the user sees for this input
.setLabel("Cuál es tu nombre de usuario de Minecraft?")
// Short means only a single line of text
.setStyle(TextInputStyle.Short);
const tlinput = new TextInputBuilder()
.setCustomId('tlauncherInput')
// The label is the prompt the user sees for this input
.setLabel("TLauncher está permitido en el servidor? Di (S)i o (N)o.")
// Short means only a single line of text
.setStyle(TextInputStyle.Short);
// An action row only holds one text input,
// so you need one action row per text input.
const usernameActionRow = new ActionRowBuilder().addComponents(input);
const tlActionRow = new ActionRowBuilder().addComponents(tlinput);
// Add inputs to the modal
modal.addComponents(usernameActionRow, tlActionRow);
await ctx.interaction.showModal(modal);
}
});