我正在尝试用另一个嵌入来编辑邮件的嵌入。当我这样做时,图像会再次出现在聊天中编辑的嵌入的顶部。有没有办法防止这种情况?
@Override
public void onGuildReady(@NotNull GuildReadyEvent event) {
super.onGuildReady(event);
String fileName = "image.png";
Guild guild = event.getGuild();
InputStream in = getClass().getResourceAsStream("/someResource.png");
EmbedBuilder eb = new EmbedBuilder()
.setTitle("Title :")
.setDescription("Description")
.setImage("attachment://" + fileName)
.setColor(new Color(255, 204, 81));
guild.getTextChannels().get(0).sendMessage(eb.build()).addFile(in, fileName).queue(
message -> {
MessageEmbed me = message.getEmbeds().get(0);
message.editMessage(
new EmbedBuilder()
.setTitle(me.getTitle())
.setDescription(me.getDescription())
.setImage(me.getImage().getUrl())
.setColor(me.getColor())
.build()
).queue();
}
);
}
结果:
暂无答案!
目前还没有任何答案,快来回答吧!