Skip to content

Commit

Permalink
fixes all broken images (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
talhoid committed Oct 7, 2023
1 parent 306b807 commit 5e6feec
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
build
.DS_Store
.env
bin
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public SlashCommandData build(SlashCommandData data) {

@Override
public void run(SlashCommandInteractionEvent event) {
Unirest.get("https://aws.random.cat/meow").asJsonAsync(response -> {
event.reply(response.getBody().getObject().getString("file")).queue();
Unirest.get("https://some-random-api.com/img/cat").asJsonAsync(response -> {
event.reply(response.getBody().getObject().getString("link")).queue();
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public SlashCommandData build(SlashCommandData data) {

@Override
public void run(SlashCommandInteractionEvent event) {
Unirest.get("https://some-random-api.ml/animal/dog").asJsonAsync(response -> {
event.reply(response.getBody().getObject().getString("image")).queue();
Unirest.get("https://some-random-api.com/img/dog").asJsonAsync(response -> {
event.reply(response.getBody().getObject().getString("link")).queue();
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public SlashCommandData build(SlashCommandData data) {
public void run(SlashCommandInteractionEvent event) {
String animal = ThreadLocalRandom.current().nextBoolean() ? "red_panda" : "panda";

Unirest.get("https://some-random-api.ml/animal/" + animal).asJsonAsync(response -> {
event.reply(response.getBody().getObject().getString("image")).queue();
Unirest.get("https://some-random-api.com/animal/" + animal).asJsonAsync(response -> {
event.reply(response.getBody().getObject().getString("link")).queue();
});
}
}

0 comments on commit 5e6feec

Please sign in to comment.