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

166
Vistas
Button interaction failed

i have problem because i made smth in ButtonClickEvent and it works well but when someone click button under this button i have error "This interaction failed", i have to finish in code action with button or what can i do with this ?

Declaring button:

channel.sendFile(file,"paint.png").setEmbeds(embed.build()).setActionRow(Button.success("veryfication","VERYFI!")).queue();

And ButtonClickEvent:

public void onButtonClick(ButtonClickEvent e){
    if(e.getButton() != null) {
        if (e.getButton().getId().equalsIgnoreCase("veryfication")) {
            final Member member = e.getMember();
            if (member != null && member.getRoles() != null) {
                if (!member.getRoles().contains(e.getGuild().getRoleById("920701070831939669"))) {
                    e.getGuild().addRoleToMember(member, e.getGuild().getRoleById("920701070831939669")).queue();
                }
            }
        }
    }
}

Image:

Button error

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Discord requires that you acknowledge the button interaction. This can be done with one of the following:

  • deferReply Reply with a "bot is thinking..." message and edit it later
  • reply Reply with a message
  • deferEdit Do nothing (or edit later)
  • editMessage Edit the message the button was clicked on

If you only want to acknowledge the button was clicked, without responding with a message or editing the message, you can simply use event.deferEdit().queue();.

over 4 years ago · Santiago Trujillo 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