Add sticker pack url to list output

This commit is contained in:
AsamK 2022-01-03 18:50:27 +01:00
parent 99eef05084
commit 8a5f98dac6
10 changed files with 133 additions and 44 deletions

View file

@ -43,10 +43,10 @@ public class UploadStickerPackCommand implements JsonRpcLocalCommand {
try {
var url = m.uploadStickerPack(path);
if (outputWriter instanceof PlainTextWriter writer) {
writer.println("{}", url);
writer.println("{}", url.getUrl());
} else {
final var writer = (JsonWriter) outputWriter;
writer.write(Map.of("url", url));
writer.write(Map.of("url", url.getUrl()));
}
} catch (IOException e) {
throw new IOErrorException("Upload error (maybe image size too large):" + e.getMessage(), e);