Merge branches by BBNBot #429
2 changed files with 6 additions and 6 deletions
6
pom.xml
6
pom.xml
|
|
@ -5,7 +5,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>Hadder</groupId>
|
||||
<artifactId>Hadder</artifactId>
|
||||
<version>1.3.2</version>
|
||||
<version>1.3.3</version>
|
||||
<name>Hadder</name>
|
||||
<inceptionYear>2019</inceptionYear>
|
||||
<description>Hadder is a multi-purpose Discord bot.</description>
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
<dependency>
|
||||
<groupId>net.dv8tion</groupId>
|
||||
<artifactId>JDA</artifactId>
|
||||
<version>4.1.1_124</version>
|
||||
<version>4.1.1_127</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
|
|
@ -96,7 +96,7 @@
|
|||
<dependency>
|
||||
<groupId>com.sedmelluq</groupId>
|
||||
<artifactId>lavaplayer</artifactId>
|
||||
<version>1.3.38</version>
|
||||
<version>1.3.40</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
|
|
|
|||
|
|
@ -31,13 +31,13 @@ public class CoronaCommand implements Command {
|
|||
@Override
|
||||
public void executed(String[] args, CommandEvent e) {
|
||||
OkHttpClient client = new OkHttpClient();
|
||||
Request request = new Request.Builder().url("https://api.covid.stream/latest/numbers").build();
|
||||
Request request = new Request.Builder().url("https://corona.lmao.ninja/all").build();
|
||||
|
||||
try {
|
||||
Response response = client.newCall(request).execute();
|
||||
JSONObject json = new JSONObject(response.body().string()).getJSONObject("data");
|
||||
JSONObject json = new JSONObject(response.body().string());
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
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");
|
||||
stringBuilder.append("`Confirmed cases:` **").append(json.get("cases")).append("**\n").append("`Deaths:` **").append(json.get("deaths")).append("** \n").append("`Recovered:` **").append(json.get("recovered")).append("** \n").append("`Active cases:` **").append(json.get("active")).append("**");
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO).setDescription(stringBuilder).build()).queue();
|
||||
} catch (IOException ex) {
|
||||
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue