v1.1.1 #386
5 changed files with 50 additions and 19 deletions
20
pom.xml
20
pom.xml
|
|
@ -5,9 +5,19 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>Hadder</groupId>
|
<groupId>Hadder</groupId>
|
||||||
<artifactId>Hadder</artifactId>
|
<artifactId>Hadder</artifactId>
|
||||||
<version>1.1.0</version>
|
<version>1.1.1</version>
|
||||||
|
|
||||||
<name>Hadder</name>
|
<name>Hadder</name>
|
||||||
|
<inceptionYear>2019</inceptionYear>
|
||||||
|
<description>Hadder is a multi-purpose Discord bot.</description>
|
||||||
|
<url>https://github.com/BigBotNetwork/Hadder</url>
|
||||||
|
|
||||||
|
<licenses>
|
||||||
|
<license>
|
||||||
|
<name>GNU Affero General Public License v3.0</name>
|
||||||
|
<url>https://www.gnu.org/licenses/agpl-3.0.en.html</url>
|
||||||
|
<distribution>repo</distribution>
|
||||||
|
</license>
|
||||||
|
</licenses>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
|
@ -56,7 +66,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.dv8tion</groupId>
|
<groupId>net.dv8tion</groupId>
|
||||||
<artifactId>JDA</artifactId>
|
<artifactId>JDA</artifactId>
|
||||||
<version>4.1.1_108</version>
|
<version>4.1.1_110</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.json</groupId>
|
<groupId>org.json</groupId>
|
||||||
|
|
@ -81,7 +91,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.kohsuke</groupId>
|
<groupId>org.kohsuke</groupId>
|
||||||
<artifactId>github-api</artifactId>
|
<artifactId>github-api</artifactId>
|
||||||
<version>1.106</version>
|
<version>1.107</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.sedmelluq</groupId>
|
<groupId>com.sedmelluq</groupId>
|
||||||
|
|
@ -91,7 +101,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-annotations</artifactId>
|
<artifactId>jackson-annotations</artifactId>
|
||||||
<version>2.10.2</version>
|
<version>2.10.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
|
|
||||||
package com.bbn.hadder.commands.general;
|
package com.bbn.hadder.commands.general;
|
||||||
|
|
||||||
import com.bbn.hadder.Hadder;
|
|
||||||
import com.bbn.hadder.commands.Command;
|
import com.bbn.hadder.commands.Command;
|
||||||
import com.bbn.hadder.commands.CommandEvent;
|
import com.bbn.hadder.commands.CommandEvent;
|
||||||
import com.bbn.hadder.utils.MessageEditor;
|
import com.bbn.hadder.utils.MessageEditor;
|
||||||
|
|
@ -32,8 +31,8 @@ public class InviteCommand implements Command {
|
||||||
"",
|
"",
|
||||||
"commands.general.invite.success.description",
|
"commands.general.invite.success.description",
|
||||||
"(https://discordapp.com/oauth2/authorize?client_id="
|
"(https://discordapp.com/oauth2/authorize?client_id="
|
||||||
+ Hadder.shardManager.getGuilds().get(0).getSelfMember().getId()
|
+ e.getJDA().getSelfUser().getId()
|
||||||
+ "&scope=bot&permissions=470133879)")
|
+ "&scope=bot&permissions=1043852663)")
|
||||||
.build()).queue();
|
.build()).queue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ public class RulesCommand implements Command {
|
||||||
try {
|
try {
|
||||||
TextChannel channel = e1.getGuild().getTextChannelsByName(e1.getMessage().getContentRaw(), true).get(0);
|
TextChannel channel = e1.getGuild().getTextChannelsByName(e1.getMessage().getContentRaw(), true).get(0);
|
||||||
createRules(e, e1, channel);
|
createRules(e, e1, channel);
|
||||||
} catch (NullPointerException ex) {
|
} catch (NullPointerException | IndexOutOfBoundsException ex) {
|
||||||
e.getTextChannel().sendMessage(
|
e.getTextChannel().sendMessage(
|
||||||
e.getMessageEditor().getMessage(
|
e.getMessageEditor().getMessage(
|
||||||
MessageEditor.MessageType.ERROR,
|
MessageEditor.MessageType.ERROR,
|
||||||
|
|
|
||||||
|
|
@ -70,17 +70,22 @@ public class Config {
|
||||||
.key("Tokens").object()
|
.key("Tokens").object()
|
||||||
.key("BotToken").value(null)
|
.key("BotToken").value(null)
|
||||||
.key("Giphy").value(null)
|
.key("Giphy").value(null)
|
||||||
|
.key("GitHub").value(null)
|
||||||
.key("MythicalBotList").value(null)
|
.key("MythicalBotList").value(null)
|
||||||
.key("BotsForDiscord").value(null)
|
.key("BotsForDiscord").value(null)
|
||||||
.key("DiscordBotList").value(null)
|
.key("DiscordBotList").value(null)
|
||||||
.key("DiscordBestBots").value(null)
|
|
||||||
.key("DiscordBoats").value(null)
|
.key("DiscordBoats").value(null)
|
||||||
.key("YetAnotherBotList").value(null)
|
.key("YetAnotherBotList").value(null)
|
||||||
.value("DiscordExtremeList").value(null)
|
.key("DiscordExtremeList").value(null)
|
||||||
.value("DiscordBotReviews").value(null)
|
.key("DiscordBotReviews").value(null)
|
||||||
.value("DiscordBots").value(null)
|
.key("DiscordBots").value(null)
|
||||||
.value("BotListSpace").value(null)
|
.key("BotListSpace").value(null)
|
||||||
.endObject().endObject().toString();
|
.key("DiscordBots2").value(null)
|
||||||
|
.key("CloudList").value(null)
|
||||||
|
.key("Arcane").value(null)
|
||||||
|
.endObject()
|
||||||
|
.key("Clyde").value("Clyde")
|
||||||
|
.endObject().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getBotToken() {
|
public String getBotToken() {
|
||||||
|
|
@ -143,10 +148,6 @@ public class Config {
|
||||||
return config.getJSONObject("Tokens").getString("DiscordExtremeList");
|
return config.getJSONObject("Tokens").getString("DiscordExtremeList");
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDiscordBotReviewsToken() {
|
|
||||||
return config.getJSONObject("Tokens").getString("DiscordBotReviews");
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDiscordBotsToken() {
|
public String getDiscordBotsToken() {
|
||||||
return config.getJSONObject("Tokens").getString("DiscordBots");
|
return config.getJSONObject("Tokens").getString("DiscordBots");
|
||||||
}
|
}
|
||||||
|
|
@ -163,6 +164,10 @@ public class Config {
|
||||||
return config.getJSONObject("Tokens").getString("CloudList");
|
return config.getJSONObject("Tokens").getString("CloudList");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getArcaneToken() {
|
||||||
|
return config.getJSONObject("Tokens").getString("Arcane");
|
||||||
|
}
|
||||||
|
|
||||||
public String getClydeName() {
|
public String getClydeName() {
|
||||||
return config.getString("Clyde");
|
return config.getString("Clyde");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ public class BotList {
|
||||||
private static String BotListSpace = "https://api.botlist.space/v1/bots/637002314162372639";
|
private static String BotListSpace = "https://api.botlist.space/v1/bots/637002314162372639";
|
||||||
private static String DiscordBots2 = "https://discord.bots.gg/api/v1/bots/637002314162372639/stats";
|
private static String DiscordBots2 = "https://discord.bots.gg/api/v1/bots/637002314162372639/stats";
|
||||||
private static String CloudList = "https://www.cloudlist.xyz/api/stats/637002314162372639";
|
private static String CloudList = "https://www.cloudlist.xyz/api/stats/637002314162372639";
|
||||||
|
private static String ArcaneBotCenter = "https://arcane-botcenter.xyz/api/637002314162372639/stats";
|
||||||
|
|
||||||
private Config config;
|
private Config config;
|
||||||
|
|
||||||
|
|
@ -57,6 +58,7 @@ public class BotList {
|
||||||
json.put("users", Hadder.shardManager.getUsers().size());
|
json.put("users", Hadder.shardManager.getUsers().size());
|
||||||
json.put("shard_count", Hadder.shardManager.getShards().size());
|
json.put("shard_count", Hadder.shardManager.getShards().size());
|
||||||
json.put("shardCount", Hadder.shardManager.getShards().size());
|
json.put("shardCount", Hadder.shardManager.getShards().size());
|
||||||
|
json.put("member_count", Hadder.shardManager.getUsers().size());
|
||||||
|
|
||||||
RequestBody body = RequestBody.create(MediaType.parse("application/json"), json.toString());
|
RequestBody body = RequestBody.create(MediaType.parse("application/json"), json.toString());
|
||||||
|
|
||||||
|
|
@ -209,6 +211,21 @@ public class BotList {
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Arcane Bot Center
|
||||||
|
|
||||||
|
Request arcane = new Request.Builder()
|
||||||
|
.url(ArcaneBotCenter)
|
||||||
|
.post(body)
|
||||||
|
.addHeader("Authorization", config.getArcaneToken())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
try {
|
||||||
|
new OkHttpClient().newCall(arcane).execute().close();
|
||||||
|
System.out.println("Successfully posted count to the Arcane Bot Center!");
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue