【发布时间】:2022-08-16 20:56:04
【问题描述】:
所以我试图制作一个只发送嵌入的命令。它可以工作,但在使用命令后并在它已经发送嵌入后显示“应用程序没有响应”的东西!
这就是它在 Discord 中的样子
@Override
public void onSlashCommandInteraction(@NotNull SlashCommandInteractionEvent event) {
String roles = String.valueOf(event.getMember().getRoles());
if (event.getName().equals(\"whosthatpokemon\")) {
Color relaxo = new Color(44, 106, 124);
EmbedBuilder embed = new EmbedBuilder();
embed.setColor(relaxo);
embed.setTitle(\"Who\'s that Pokemon?\");
embed.setDescription(\"Who is it?\");
embed.setImage(\"http://cdn.poll-maker.com/7-375248/snorlax.png?sz=1200-000000100053\");
event.getChannel().sendMessageEmbeds(embed.build()).setActionRow(sendButtons()).queue();
}
}
private static java.util.List<Button> sendButtons() {
List<Button> buttons = new ArrayList<>();
buttons.add(Button.danger(\"Snorlax\", \"Snorlax\"));
buttons.add(Button.success(\"Pickachu\", \"Pickachu\"));
buttons.add(Button.primary(\"Bulbasaur\", \"Bulbasaur\"));
return buttons;
}
-
交互需要在 3 秒内明确响应。 This 可能是您正在寻找的。
标签: java discord discord-jda