Skip to content

Commit

Permalink
fix: bw dump command
Browse files Browse the repository at this point in the history
  • Loading branch information
Misat11 committed Feb 24, 2024
1 parent 24f95ac commit 5bd156c
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -348,13 +348,14 @@ protected void construct(Command.Builder<CommandSender> commandSenderWrapperBuil
"expires", LocalDateTime.now().plusDays(30).format(DateTimeFormatter.ofPattern("YYYY-MM-dd'T'HH:mm:ss'Z'")),
"files", files.stream()
.map(aFile -> nullValuesAllowingMap(
"name", aFile.getContent(),
"name", aFile.getName(),
"content", nullValuesAllowingMap(
"format", "text",
"highlight_language", aFile.getLanguage(),
"value", aFile.getContent()
)
))
.collect(Collectors.toList())
))))).build(), HttpResponse.BodyHandlers.ofString())
.thenAccept(stringHttpResponse -> {
if (stringHttpResponse.statusCode() >= 200 && stringHttpResponse.statusCode() <= 299) {
Expand All @@ -373,7 +374,9 @@ protected void construct(Command.Builder<CommandSender> commandSenderWrapperBuil
throw new RuntimeException(e);
}
} else {
org.screamingsandals.lib.lang.Message.of(LangKeys.DUMP_FAILED).defaultPrefix().send(sender);
org.screamingsandals.lib.lang.Message.of(LangKeys.DUMP_FAILED).defaultPrefix()
.joinPlainText(" " + stringHttpResponse.statusCode() + " - " + stringHttpResponse.body())
.send(sender);
}
});
}
Expand Down

0 comments on commit 5bd156c

Please sign in to comment.