Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

163
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda