I made a bot using JDA for discord which you can send in a general channel a GIF with the following link: https://media.giphy.com/media/SFKcOy1EPQGZyAYST9/source.gif and it work just fine for example like this:
getJDA().getGuildChannelById("104867295769431245")
.getMembers().stream().filter(s -> s.hasPermission(Permission.ADMINISTRATOR))
.findFirst().ifPresent(
s -> s.getUser().openPrivateChannel().queue(
s -> s.sendMessage("Image: <URL here>")).queue());
Thats because it's just a URL but i want to store images from website like the link i gave and load them as array to the message. The problem is that i can't fetch the GIF. If i try using this code:
final var image = ImageIO.read(new URL("https://media.giphy.com/media/SFKcOy1EPQGZyAYST9/giphy.gif"));
It simply fail because the URL has also other containt. Anyone know any way that i can extract this GIF from this website?