export default function(client,app,special){ // client: https://docs.wwebjs.dev/Client.html // app: https://expressjs.com/en/4x/api.html client.on('message_create',async msg=>{ let texto=msg.body.toString(); //Chequear que lo.hemos enviado al mensaje y empieza con el identificador if(!msg.fromMe || !texto.startsWith(special.prefix)) return; //Quitamos el identificador y obtenemos el comando y sus argumentos let args=texto.slice(special.prefix.length).split(" "); let comando = args.shift(); args=args.join(" ").split("|"); switch(comando){ case "saludar": await msg.reply("Hola!"); break; case "echo": await msg.reply(args.join("|")); break; default: return; break; //No se si este break va, pero por las dudas } }); return {name:`Nombre del plugin(SerĂ¡ visto en ${special.prefix}help)`, comandos:[ {name:"saludar",description:"Saludar, este comando no requiere argumentos"}, {name:"echo",description:"Este comando repite todo lo escrito luego",args:["[texto]"]} ]} }