Compare commits
No commits in common. "master" and "i18n" have entirely different histories.
9 changed files with 83 additions and 59 deletions
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
|
|
@ -1,5 +1,5 @@
|
||||||
blank_issues_enabled: false
|
blank_issues_enabled: false
|
||||||
contact_links:
|
contact_links:
|
||||||
- name: BBN Holding Discord Support
|
- name: BigBotNetwork Discord Support
|
||||||
url: https://discord.gg/nPwjaJk
|
url: https://discord.gg/nPwjaJk
|
||||||
about: Please ask questions here.
|
about: Please ask questions here.
|
||||||
|
|
|
||||||
13
.github/dependabot.yml
vendored
13
.github/dependabot.yml
vendored
|
|
@ -1,13 +0,0 @@
|
||||||
version: 2
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: maven
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: monthly
|
|
||||||
time: "13:00"
|
|
||||||
open-pull-requests-limit: 99
|
|
||||||
target-branch: greg-dev
|
|
||||||
assignees:
|
|
||||||
- GregTCLTK
|
|
||||||
labels:
|
|
||||||
- pending-deploy
|
|
||||||
10
README.md
10
README.md
|
|
@ -3,13 +3,13 @@
|
||||||
Hadder Discord is a multi-purpose Discord bot with 100% uptime.
|
Hadder Discord is a multi-purpose Discord bot with 100% uptime.
|
||||||
|
|
||||||
<a href="https://discord.gg/nPwjaJk"><img src="https://discord.com/api/guilds/757966278936756345/embed.png"/></a>
|
<a href="https://discord.gg/nPwjaJk"><img src="https://discord.com/api/guilds/757966278936756345/embed.png"/></a>
|
||||||
[](https://github.com/BBN-Holding/Hadder)
|
[](https://github.com/BigBotNetwork/Hadder)
|
||||||
[](https://www.codacy.com/gh/BBN-Holding/Hadder?utm_source=github.com&utm_medium=referral&utm_content=BBN-Holding/Hadder&utm_campaign=Badge_Grade)
|
[](https://www.codacy.com/gh/BigBotNetwork/Hadder?utm_source=github.com&utm_medium=referral&utm_content=BigBotNetwork/Hadder&utm_campaign=Badge_Grade)
|
||||||
[](https://www.codefactor.io/repository/github/bigbotnetwork/hadder)
|
[](https://www.codefactor.io/repository/github/bigbotnetwork/hadder)
|
||||||
[](https://bbn.crowdin.com/hadder)
|
[](https://bbn.crowdin.com/hadder)
|
||||||
[](https://github.com/BBN-Holding/Hadder/issues)
|
[](https://github.com/BigBotNetwork/Hadder/issues)
|
||||||
[](https://github.com/BBN-Holding/Hadder/blob/master/LICENSE)
|
[](https://github.com/BigBotNetwork/Hadder/blob/master/LICENSE)
|
||||||
[](https://wakatime.com/badge/github/BBN-Holding/Hadder)
|
[](https://wakatime.com/badge/github/BigBotNetwork/Hadder)
|
||||||
|
|
||||||
## Hadder Team
|
## Hadder Team
|
||||||
### Developer
|
### Developer
|
||||||
|
|
|
||||||
75
pom.xml
75
pom.xml
|
|
@ -6,11 +6,11 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>Hadder</groupId>
|
<groupId>Hadder</groupId>
|
||||||
<artifactId>Hadder</artifactId>
|
<artifactId>Hadder</artifactId>
|
||||||
<version>2.0.4</version>
|
<version>2.0.0</version>
|
||||||
<name>Hadder</name>
|
<name>Hadder</name>
|
||||||
<inceptionYear>2019</inceptionYear>
|
<inceptionYear>2019</inceptionYear>
|
||||||
<description>Hadder is a multi-purpose Discord bot.</description>
|
<description>Hadder is a multi-purpose Discord bot.</description>
|
||||||
<url>https://github.com/BBN-Holding/Hadder</url>
|
<url>https://github.com/BigBotNetwork/Hadder</url>
|
||||||
|
|
||||||
<licenses>
|
<licenses>
|
||||||
<license>
|
<license>
|
||||||
|
|
@ -58,61 +58,106 @@
|
||||||
<name>jcenter-bintray</name>
|
<name>jcenter-bintray</name>
|
||||||
<url>https://jcenter.bintray.com</url>
|
<url>https://jcenter.bintray.com</url>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
|
||||||
<id>dv8tion</id>
|
|
||||||
<name>m2-dv8tion</name>
|
|
||||||
<url>https://m2.dv8tion.net/releases</url>
|
|
||||||
</repository>
|
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.maven</groupId>
|
<groupId>org.apache.maven</groupId>
|
||||||
<artifactId>maven-model</artifactId>
|
<artifactId>maven-model</artifactId>
|
||||||
<version>3.8.6</version>
|
<version>3.6.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.dv8tion</groupId>
|
<groupId>net.dv8tion</groupId>
|
||||||
<artifactId>JDA</artifactId>
|
<artifactId>JDA</artifactId>
|
||||||
<version>4.4.0_352</version>
|
<version>4.2.0_247</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.json</groupId>
|
<groupId>org.json</groupId>
|
||||||
<artifactId>json</artifactId>
|
<artifactId>json</artifactId>
|
||||||
<version>20220924</version>
|
<version>20210307</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-simple</artifactId>
|
<artifactId>slf4j-simple</artifactId>
|
||||||
<version>2.0.3</version>
|
<version>1.7.30</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>club.minnced</groupId>
|
<groupId>club.minnced</groupId>
|
||||||
<artifactId>discord-webhooks</artifactId>
|
<artifactId>discord-webhooks</artifactId>
|
||||||
<version>0.8.2</version>
|
<version>0.5.6</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.kohsuke</groupId>
|
<groupId>org.kohsuke</groupId>
|
||||||
<artifactId>github-api</artifactId>
|
<artifactId>github-api</artifactId>
|
||||||
<version>1.313</version>
|
<version>1.125</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.sedmelluq</groupId>
|
<groupId>com.sedmelluq</groupId>
|
||||||
<artifactId>lavaplayer</artifactId>
|
<artifactId>lavaplayer</artifactId>
|
||||||
<version>1.3.78</version>
|
<version>1.3.73</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
<artifactId>jackson-annotations</artifactId>
|
||||||
|
<version>2.12.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.mongodb</groupId>
|
<groupId>org.mongodb</groupId>
|
||||||
<artifactId>mongodb-driver-sync</artifactId>
|
<artifactId>mongodb-driver-sync</artifactId>
|
||||||
<version>4.7.1</version>
|
<version>4.2.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
<pluginManagement>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-clean-plugin</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<version>3.2.0</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.22.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<version>3.2.0</version>
|
||||||
|
<configuration>
|
||||||
|
<finalName>Hadder-Build</finalName>
|
||||||
|
<archive>
|
||||||
|
<manifest>
|
||||||
|
<mainClass>one.bbn.hadder.Hadder</mainClass>
|
||||||
|
</manifest>
|
||||||
|
</archive>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-install-plugin</artifactId>
|
||||||
|
<version>2.5.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
|
<version>2.8.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-site-plugin</artifactId>
|
||||||
|
<version>3.9.1</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||||
|
<version>3.1.1</version>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.8.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>15</source>
|
<source>15</source>
|
||||||
<target>15</target>
|
<target>15</target>
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ public class FeedbackCommand implements Command {
|
||||||
String description = e2.getMessage().getContentDisplay();
|
String description = e2.getMessage().getContentDisplay();
|
||||||
try {
|
try {
|
||||||
GitHub connection = GitHub.connectUsingOAuth(e.getConfig().getGitHubToken());
|
GitHub connection = GitHub.connectUsingOAuth(e.getConfig().getGitHubToken());
|
||||||
GHRepository Hadder = connection.getOrganization("BBN-Holding").getRepository("Hadder");
|
GHRepository Hadder = connection.getOrganization("BigBotNetwork").getRepository("Hadder");
|
||||||
GHIssue issue = Hadder.createIssue(title).body("<strong>Feedback by " + e.getAuthor().getAsTag() + "</strong><br>" + description).label("feedback").create();
|
GHIssue issue = Hadder.createIssue(title).body("<strong>Feedback by " + e.getAuthor().getAsTag() + "</strong><br>" + description).label("feedback").create();
|
||||||
issue.addLabels("feedback");
|
issue.addLabels("feedback");
|
||||||
e.getTextChannel().sendMessage(
|
e.getTextChannel().sendMessage(
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ package one.bbn.hadder.commands.music;
|
||||||
import one.bbn.hadder.commands.Command;
|
import one.bbn.hadder.commands.Command;
|
||||||
import one.bbn.hadder.commands.CommandEvent;
|
import one.bbn.hadder.commands.CommandEvent;
|
||||||
import one.bbn.hadder.utils.MessageEditor;
|
import one.bbn.hadder.utils.MessageEditor;
|
||||||
import org.codehaus.plexus.util.StringUtils;
|
import org.jsoup.internal.StringUtil;
|
||||||
|
|
||||||
public class VolumeCommand implements Command {
|
public class VolumeCommand implements Command {
|
||||||
|
|
||||||
|
|
@ -28,7 +28,7 @@ public class VolumeCommand implements Command {
|
||||||
if (args.length > 0) {
|
if (args.length > 0) {
|
||||||
if (e.getAudioManager().hasPlayer(e.getGuild()) && e.getAudioManager().getPlayer(e.getGuild()).getPlayingTrack() != null) {
|
if (e.getAudioManager().hasPlayer(e.getGuild()) && e.getAudioManager().getPlayer(e.getGuild()).getPlayingTrack() != null) {
|
||||||
if (e.getMember().getVoiceState().inVoiceChannel() && e.getGuild().getSelfMember().getVoiceState().inVoiceChannel() && e.getGuild().getSelfMember().getVoiceState().getChannel().equals(e.getMember().getVoiceState().getChannel())) {
|
if (e.getMember().getVoiceState().inVoiceChannel() && e.getGuild().getSelfMember().getVoiceState().inVoiceChannel() && e.getGuild().getSelfMember().getVoiceState().getChannel().equals(e.getMember().getVoiceState().getChannel())) {
|
||||||
if (StringUtils.isNumeric(args[0])) {
|
if (StringUtil.isNumeric(args[0])) {
|
||||||
int volume = Integer.parseInt(args[0]);
|
int volume = Integer.parseInt(args[0]);
|
||||||
if (volume < 201 && volume > 0 || e.getConfig().getOwners().contains(e.getAuthor().getIdLong())) {
|
if (volume < 201 && volume > 0 || e.getConfig().getOwners().contains(e.getAuthor().getIdLong())) {
|
||||||
e.getAudioManager().getPlayer(e.getGuild()).setVolume(volume);
|
e.getAudioManager().getPlayer(e.getGuild()).setVolume(volume);
|
||||||
|
|
|
||||||
|
|
@ -43,11 +43,7 @@ public class Mongo {
|
||||||
BasicDBObject whereQuery = new BasicDBObject();
|
BasicDBObject whereQuery = new BasicDBObject();
|
||||||
whereQuery.put(where, what);
|
whereQuery.put(where, what);
|
||||||
FindIterable<Document> it = collection.find(whereQuery);
|
FindIterable<Document> it = collection.find(whereQuery);
|
||||||
try {
|
return it.cursor().next().get(column);
|
||||||
return it.cursor().next().get(column);
|
|
||||||
} catch (NoSuchElementException ignore) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public JSONObject getObjectByID(String collection, String id) {
|
public JSONObject getObjectByID(String collection, String id) {
|
||||||
|
|
@ -57,10 +53,7 @@ public class Mongo {
|
||||||
String response = db.getCollection(collection).find(whereQuery).cursor().next().toJson();
|
String response = db.getCollection(collection).find(whereQuery).cursor().next().toJson();
|
||||||
return new JSONObject(response);
|
return new JSONObject(response);
|
||||||
} catch (NoSuchElementException e) {
|
} catch (NoSuchElementException e) {
|
||||||
if (collection.equals("user"))
|
insertUser(id);
|
||||||
insertUser(id);
|
|
||||||
else if (collection.equals("server"))
|
|
||||||
insertGuild(id);
|
|
||||||
String response2 = db.getCollection(collection).find(whereQuery).cursor().next().toJson();
|
String response2 = db.getCollection(collection).find(whereQuery).cursor().next().toJson();
|
||||||
return new JSONObject(response2);
|
return new JSONObject(response2);
|
||||||
}
|
}
|
||||||
|
|
@ -137,7 +130,8 @@ public class Mongo {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasStarboardMessage(String message_id) {
|
public boolean hasStarboardMessage(String message_id) {
|
||||||
return this.getByID("stars", "id", message_id, "guild") != null;
|
this.getByID("stars", "id", message_id, "guild");
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void insertStarboardMessage(String message_id, String guild_id, String starboard_message_id) {
|
public void insertStarboardMessage(String message_id, String guild_id, String starboard_message_id) {
|
||||||
|
|
|
||||||
|
|
@ -78,16 +78,13 @@ public class CommandListener extends ListenerAdapter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
e.getAuthor().openPrivateChannel().complete().sendMessage(new EmbedBuilder()
|
||||||
e.getAuthor().openPrivateChannel().complete().sendMessage(new EmbedBuilder()
|
.setTitle("No permission")
|
||||||
.setTitle("No permission")
|
.setDescription("I need the `MESSAGE WRITE` permission in order to work!")
|
||||||
.setDescription("I need the `MESSAGE WRITE` permission in order to work!")
|
.setColor(Color.RED)
|
||||||
.setColor(Color.RED)
|
.setFooter("Hadder", "https://bbn.one/images/Hadder.png")
|
||||||
.setFooter("Hadder", "https://bbn.one/images/Hadder.png")
|
.setTimestamp(Instant.now())
|
||||||
.setTimestamp(Instant.now())
|
.build()).queue();
|
||||||
.build()).queue();
|
|
||||||
} catch (ErrorResponseException ignore) {}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ public class MentionListener extends ListenerAdapter {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
GitHub connection = GitHub.connectUsingOAuth(config.getGitHubToken());
|
GitHub connection = GitHub.connectUsingOAuth(config.getGitHubToken());
|
||||||
GHRepository Hadder = connection.getOrganization("BBN-Holding").getRepository("Hadder");
|
GHRepository Hadder = connection.getOrganization("BigBotNetwork").getRepository("Hadder");
|
||||||
version = Hadder.getLatestRelease().getTagName();
|
version = Hadder.getLatestRelease().getTagName();
|
||||||
} catch (IOException ioException) {
|
} catch (IOException ioException) {
|
||||||
ioException.printStackTrace();
|
ioException.printStackTrace();
|
||||||
|
|
@ -65,7 +65,8 @@ public class MentionListener extends ListenerAdapter {
|
||||||
.addField("User-Prefix", mongoUser.getPrefix(), true)
|
.addField("User-Prefix", mongoUser.getPrefix(), true)
|
||||||
.addField("Guild-Prefix", mongoServer.getPrefix(), true)
|
.addField("Guild-Prefix", mongoServer.getPrefix(), true)
|
||||||
.addField("Join our Dev Server!", "[Click here!](https://discord.gg/nPwjaJk)", true)
|
.addField("Join our Dev Server!", "[Click here!](https://discord.gg/nPwjaJk)", true)
|
||||||
.addField("Github", "[Click here!](https://github.com/BBN-Holding/Hadder)", false);
|
.addField("Github", "[Click here!](https://github.com/BigBotNetwork/Hadder)", false)
|
||||||
|
.addField("Twitch", "[Click here!](https://www.twitch.tv/bigbotnetwork)", false);
|
||||||
e.getChannel().sendMessage(builder.build()).queue();
|
e.getChannel().sendMessage(builder.build()).queue();
|
||||||
} else if (e.getMessage().getContentRaw().equalsIgnoreCase("@someone")) {
|
} else if (e.getMessage().getContentRaw().equalsIgnoreCase("@someone")) {
|
||||||
int member = new Random().nextInt(e.getGuild().getMembers().size() - 1);
|
int member = new Random().nextInt(e.getGuild().getMembers().size() - 1);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue