This commit is contained in:
GregTCLTK 2020-03-14 16:22:06 +01:00
parent 36994799bd
commit b8cf0cfe05
No known key found for this signature in database
GPG key ID: A91BADE5C070FF67

View file

@ -37,7 +37,7 @@ public class CoronaCommand implements Command {
Response response = client.newCall(request).execute(); Response response = client.newCall(request).execute();
JSONObject json = new JSONObject(response.body().string()).getJSONObject("data"); JSONObject json = new JSONObject(response.body().string()).getJSONObject("data");
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("`Confirmed cases:` **").append(json.get("totalConfirmedNumber")).append("**\n").append("`Deaths:` **").append(json.get("totalDeathNumbers")).append("** \n").append("`Recovered:`" ).append("** \n"); stringBuilder.append("`Confirmed cases:` **").append(json.get("totalConfirmedNumbers")).append("**\n").append("`Deaths:` **").append(json.get("totalDeathNumbers")).append("** \n").append("`Recovered:` **").append(json.get("totalRecoveredNumbers")).append("** \n");
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO).setDescription(stringBuilder).build()).queue(); e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO).setDescription(stringBuilder).build()).queue();
} catch (IOException ex) { } catch (IOException ex) {
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR) e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR)