Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

185
Vistas
TypeError: option.getMember("objetivo) no es una función

Así que hice este comando de patada y terminé de codificarlo. Ahora recibo este error y literalmente no tengo idea de cómo solucionarlo. Busqué en Internet durante una hora y todavía no tengo idea de dónde está el problema.

Aquí está el error:

 TypeError: options.getMember is not a function at Object.execute (/Users/Aplex/Documents/Aplel/Commands/Moderation/kick.js:32:32) at Object.execute (/Users/Aplex/Documents/Aplel/Events/Interaction/interactionCreate.js:21:21) at Client.<anonymous> (/Users/Aplex/Documents/Aplel/Structures/Handlers/Events.js:18:54) at Client.emit (node:events:538:35) at InteractionCreateAction.handle (/Users/Aplex/Documents/Aplel/node_modules/discord.js/src/client/actions/InteractionCreate.js:74:12) at Object.module.exports [as INTERACTION_CREATE] (/Users/Aplex/Documents/Aplel/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36) at WebSocketManager.handlePacket (/Users/Aplex/Documents/Aplel/node_modules/discord.js/src/client/websocket/WebSocketManager.js:351:31) at WebSocketShard.onPacket (/Users/Aplex/Documents/Aplel/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22) at WebSocketShard.onMessage (/Users/Aplex/Documents/Aplel/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10) at WebSocket.onMessage (/Users/Aplex/Documents/Aplel/node_modules/ws/lib/event-target.js:199:18)

Y aquí está mi código:

 const { Client, CommandInteraction } = require("discord.js"); module.exports = { name: "kick", description: "Kick a member", userPermission: ["KICK_MEMBERS"], options: [ { name: "target", description: "target to kick", type: "USER", required: true }, { name: "reason", description: "reason for this kick", type: "STRING", required: false, } ], /** * * @param {Client} client * @param {CommandInteraction} interaction * @param {String} args */ execute: async(client, interaction, args) => { const { options, member } = interaction; const target = options.getMember("target"); const reason = options.getString("reason") || "No reason provided"; if(!target.roles.highest.position >= member.roles.highest.position) return interaction.followUp({content: "You can't take action on this user as their role is higher than yours!", }); await target.send(`You have been kicked from ${interaction.guild.name}, reason ${reason}`); target.kick(reason); interaction.followUp({content: `Kicked ${target.user.tag} successfully! reason: ${reason}`}); }, };

¿Alguien sabe dónde está el problema aquí? ¡Sería muy apreciado si alguien ayudara!

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

¿Puedo asumir que estás siguiendo los tutoriales de lyxcode?

Si es así, en la línea

 execute(client, interaction, args)

cambiarlo a

 execute(interaction, client, args)

esto debería coincidir con su archivo de interacción Crear.

también, cambie followUp para reply

¡Ojalá esto lo arregle para ti!

about 4 years ago · Juan Pablo Isaza Denunciar

0

Si está tratando de obtener el caché de la cuenta del miembro, tal vez debería intentar algo como esto: client.members.cache.get('User ID');

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda