diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 37a9d61..aa30f8c 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -3,9 +3,9 @@ name: Hadder on: [push] jobs: - build: - runs-on: ubuntu-latest - steps: + build: + runs-on: ubuntu-latest + steps: - uses: actions/checkout@v1 - name: Set up JDK 1.13 uses: actions/setup-java@v1 @@ -14,11 +14,11 @@ jobs: - name: Build with Maven run: mvn -B package --file pom.xml - deploy: - runs-on: ubuntu-latest - needs: build - if: github.ref == 'refs/heads/master' - steps: + deploy: + runs-on: ubuntu-latest + needs: build + if: github.ref == 'refs/heads/master' + steps: - uses: actions/checkout@v1 - name: Set up JDK 1.13 uses: actions/setup-java@v1 @@ -32,15 +32,13 @@ jobs: local: ./target/Hadder-Build.jar remote: /home/Hadder-Build.jar host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - password: ${{ secrets.PASSWORD }} + privateKey: ${{ secrets.PK }} - name: executing remote ssh commands using password uses: appleboy/ssh-action@master with: host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - password: ${{ secrets.PASSWORD }} port: ${{ secrets.PORT }} + key: ${{ secrets.PK }} script: /home/deploy.sh - name: Send Webhook Notification if: always() diff --git a/example-config.json b/example-config.json index f787317..cd6ecaa 100644 --- a/example-config.json +++ b/example-config.json @@ -1,11 +1,13 @@ { - "Owners": - [], - "Database":{"IP":"", + "Owners": [ + ], + "Database": { + "IP": "", "Port": 6775, "DBName": "", "Username": "", - "Password": ""}, + "Password": "" + }, "Tokens": { "BotToken": "", "Giphy": "", @@ -13,14 +15,15 @@ "MythicalBotList": "", "BotsForDiscord": "", "DiscordBotList": "", - "DiscordBestBots": "", "DiscordBoats": "", "YetAnotherBotList": "", "DiscordExtremeList": "", "DiscordBotReviews": "", "DiscordBots": "", "BotListSpace": "", - "DiscordBots2": "" + "DiscordBots2": "", + "CloudList": "", + "Arcane": "" }, "Clyde": "" } diff --git a/pom.xml b/pom.xml index dc82ae3..185c8ee 100644 --- a/pom.xml +++ b/pom.xml @@ -1,180 +1,183 @@ - + - 4.0.0 - Hadder - Hadder - 1.3.11 - Hadder - 2019 - Hadder is a multi-purpose Discord bot. - https://github.com/BigBotNetwork/Hadder + 4.0.0 + Hadder + Hadder + 1.3.16 + Hadder + 2019 + Hadder is a multi-purpose Discord bot. + https://github.com/BigBotNetwork/Hadder - - - GNU Affero General Public License v3.0 - https://www.gnu.org/licenses/agpl-3.0.en.html - repo - - + + + GNU Affero General Public License v3.0 + https://www.gnu.org/licenses/agpl-3.0.en.html + repo + + - - UTF-8 - 1.13 - 1.13 - yyyy-MM-dd'T'HH:mm:ss'Z' - + + UTF-8 + 1.13 + 1.13 + yyyy-MM-dd'T'HH:mm:ss'Z' + - - - Hax#6775 - Hax - hax@bigbotnetwork.com - https://bigbotnetwork.com/ - Europe/Berlin - - https://cdn.discordapp.com/avatars/261083609148948488/f2c9efc629ef65fffa634f0d63cd467e.webp - - - - Skidder#6775 - Greg - skidder@bigbotnetwork.com - https://bigbotnetwork.com/ - Europe/Berlin - - https://cdn.discordapp.com/avatars/477141528981012511/a_ba4bd8e5b381874edcd06a68d1acd3aa.gif - - - + + + Hax#6775 + Hax + hax@bigbotnetwork.com + https://bigbotnetwork.com/ + Europe/Berlin + + https://cdn.discordapp.com/avatars/261083609148948488/f2c9efc629ef65fffa634f0d63cd467e.webp + + + + + Skidder#6775 + Greg + skidder@bigbotnetwork.com + https://bigbotnetwork.com/ + Europe/Berlin + + https://cdn.discordapp.com/avatars/401817301919465482/a_f81bd03e3862de579dec59241714d86d.gif + + + + - - - jcenter - jcenter-bintray - https://jcenter.bintray.com - - + + + jcenter + jcenter-bintray + https://jcenter.bintray.com + + - - - org.apache.maven - maven-model - 3.6.3 - - - net.dv8tion - JDA - 4.1.1_155 - - - org.json - json - 20200518 - - - com.rethinkdb - rethinkdb-driver - 2.4.3 - - - org.slf4j - slf4j-simple - 1.7.30 - - - club.minnced - discord-webhooks - 0.3.1 - - - org.kohsuke - github-api - 1.111 - - - com.sedmelluq - lavaplayer - 1.3.49 - - - com.fasterxml.jackson.core - jackson-annotations - 2.11.0 - - + + + org.apache.maven + maven-model + 3.6.3 + + + net.dv8tion + JDA + 4.2.0_204 + + + org.json + json + 20200518 + + + com.rethinkdb + rethinkdb-driver + 2.4.4 + + + org.slf4j + slf4j-simple + 1.7.30 + + + club.minnced + discord-webhooks + 0.4.1 + + + org.kohsuke + github-api + 1.116 + + + com.sedmelluq + lavaplayer + 1.3.50 + + + com.fasterxml.jackson.core + jackson-annotations + 2.11.2 + + - - - - - maven-clean-plugin - 3.1.0 - - - maven-resources-plugin - 3.1.0 - - - maven-surefire-plugin - 2.22.2 - - - maven-jar-plugin - 3.2.0 - - Hadder-Build - - - com.bbn.hadder.Hadder - - - - - - maven-install-plugin - 2.5.2 - - - maven-deploy-plugin - 2.8.2 - - - maven-site-plugin - 3.9.0 - - - maven-project-info-reports-plugin - 3.0.0 - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - 13 - 13 - - - - maven-assembly-plugin - - Hadder-Build - - - com.bbn.hadder.Hadder - - - - jar-with-dependencies - - false - - - - + + + + + maven-clean-plugin + 3.1.0 + + + maven-resources-plugin + 3.2.0 + + + maven-surefire-plugin + 2.22.2 + + + maven-jar-plugin + 3.2.0 + + Hadder-Build + + + com.bbn.hadder.Hadder + + + + + + maven-install-plugin + 2.5.2 + + + maven-deploy-plugin + 2.8.2 + + + maven-site-plugin + 3.9.1 + + + maven-project-info-reports-plugin + 3.1.1 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 13 + 13 + + + + maven-assembly-plugin + + Hadder-Build + + + com.bbn.hadder.Hadder + + + + jar-with-dependencies + + false + + + + diff --git a/src/main/java/com/bbn/hadder/Hadder.java b/src/main/java/com/bbn/hadder/Hadder.java index ab8edbe..447e8d0 100644 --- a/src/main/java/com/bbn/hadder/Hadder.java +++ b/src/main/java/com/bbn/hadder/Hadder.java @@ -17,15 +17,21 @@ package com.bbn.hadder; import com.bbn.hadder.audio.AudioManager; +import com.bbn.hadder.commands.fun.AvatarCommand; +import com.bbn.hadder.commands.fun.ClydeCommand; +import com.bbn.hadder.commands.fun.GifCommand; +import com.bbn.hadder.commands.fun.MemeCommand; import com.bbn.hadder.commands.general.*; import com.bbn.hadder.commands.misc.*; import com.bbn.hadder.commands.moderation.*; +import com.bbn.hadder.commands.music.*; import com.bbn.hadder.commands.nsfw.*; import com.bbn.hadder.commands.owner.*; -import com.bbn.hadder.commands.fun.*; -import com.bbn.hadder.commands.settings.*; -import com.bbn.hadder.commands.music.*; -import com.bbn.hadder.core.*; +import com.bbn.hadder.commands.settings.LanguageCommand; +import com.bbn.hadder.commands.settings.UserPrefixCommand; +import com.bbn.hadder.core.CommandHandler; +import com.bbn.hadder.core.Config; +import com.bbn.hadder.db.Rethink; import com.bbn.hadder.listener.*; import net.dv8tion.jda.api.OnlineStatus; import net.dv8tion.jda.api.entities.Activity; @@ -98,7 +104,6 @@ public class Hadder { new AvatarCommand(), new EvalCommand(), new JoinCommand(), - new LeaveCommand(), new GuildLeaveCommand(), new MemeCommand(), new InviteDetectCommand(), diff --git a/src/main/java/com/bbn/hadder/audio/AudioManager.java b/src/main/java/com/bbn/hadder/audio/AudioManager.java index 512f460..28c75c5 100644 --- a/src/main/java/com/bbn/hadder/audio/AudioManager.java +++ b/src/main/java/com/bbn/hadder/audio/AudioManager.java @@ -18,7 +18,10 @@ package com.bbn.hadder.audio; import com.bbn.hadder.commands.CommandEvent; import com.bbn.hadder.utils.MessageEditor; -import com.sedmelluq.discord.lavaplayer.player.*; +import com.sedmelluq.discord.lavaplayer.player.AudioLoadResultHandler; +import com.sedmelluq.discord.lavaplayer.player.AudioPlayer; +import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; +import com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager; import com.sedmelluq.discord.lavaplayer.source.AudioSourceManagers; import com.sedmelluq.discord.lavaplayer.tools.FriendlyException; import com.sedmelluq.discord.lavaplayer.track.AudioPlaylist; diff --git a/src/main/java/com/bbn/hadder/audio/TrackManager.java b/src/main/java/com/bbn/hadder/audio/TrackManager.java index 669f32c..423cc35 100644 --- a/src/main/java/com/bbn/hadder/audio/TrackManager.java +++ b/src/main/java/com/bbn/hadder/audio/TrackManager.java @@ -24,7 +24,9 @@ import net.dv8tion.jda.api.entities.Guild; import net.dv8tion.jda.api.entities.Member; import net.dv8tion.jda.api.entities.VoiceChannel; -import java.util.*; +import java.util.LinkedHashSet; +import java.util.Queue; +import java.util.Set; import java.util.concurrent.LinkedBlockingQueue; public class TrackManager extends AudioEventAdapter { @@ -91,13 +93,11 @@ public class TrackManager extends AudioEventAdapter { queue.remove(entry); } - public boolean isLoop() - { + public boolean isLoop() { return loop; } - public void setLoop(boolean repeating) - { + public void setLoop(boolean repeating) { this.loop = repeating; } } diff --git a/src/main/java/com/bbn/hadder/commands/CommandEvent.java b/src/main/java/com/bbn/hadder/commands/CommandEvent.java index 90b1d8b..ad56b79 100644 --- a/src/main/java/com/bbn/hadder/commands/CommandEvent.java +++ b/src/main/java/com/bbn/hadder/commands/CommandEvent.java @@ -16,13 +16,13 @@ package com.bbn.hadder.commands; -import com.bbn.hadder.Rethink; -import com.bbn.hadder.RethinkServer; -import com.bbn.hadder.RethinkUser; import com.bbn.hadder.audio.AudioManager; import com.bbn.hadder.commands.general.HelpCommand; import com.bbn.hadder.core.CommandHandler; import com.bbn.hadder.core.Config; +import com.bbn.hadder.db.Rethink; +import com.bbn.hadder.db.RethinkServer; +import com.bbn.hadder.db.RethinkUser; import com.bbn.hadder.utils.EventWaiter; import com.bbn.hadder.utils.MessageEditor; import net.dv8tion.jda.api.JDA; diff --git a/src/main/java/com/bbn/hadder/commands/fun/AvatarCommand.java b/src/main/java/com/bbn/hadder/commands/fun/AvatarCommand.java index d40f71e..25f8295 100644 --- a/src/main/java/com/bbn/hadder/commands/fun/AvatarCommand.java +++ b/src/main/java/com/bbn/hadder/commands/fun/AvatarCommand.java @@ -31,7 +31,7 @@ public class AvatarCommand implements Command { @Override public void executed(String[] args, CommandEvent e) { if (args.length == 0) { - User u = e.getAuthor(); + User u = e.getAuthor(); e.getTextChannel().sendMessage( e.getMessageEditor().getMessage( MessageEditor.MessageType.INFO, @@ -39,9 +39,9 @@ public class AvatarCommand implements Command { u.getAsTag(), "", "") - .setImage(u.getAvatarUrl()) - .setFooter(u.getAsTag()) - .build()).queue(); + .setImage(u.getAvatarUrl()) + .setFooter(u.getAsTag()) + .build()).queue(); } else if (e.getMessage().getMentionedUsers().size() == 1) { User u = e.getMessage().getMentionedUsers().get(0); e.getTextChannel().sendMessage( @@ -51,9 +51,9 @@ public class AvatarCommand implements Command { u.getAsTag(), "", "") - .setImage(u.getAvatarUrl()) - .setFooter(u.getAsTag()) - .build()).queue(); + .setImage(u.getAvatarUrl()) + .setFooter(u.getAsTag()) + .build()).queue(); } else if (args[0].length() == 18) { try { User u = e.getJDA().getUserById(args[0]); @@ -77,14 +77,14 @@ public class AvatarCommand implements Command { JSONObject json = new JSONObject(response.body().string()); String url = "https://cdn.discordapp.com/avatars/" + args[0] + "/" + json.getString("avatar") + ".png"; e.getTextChannel().sendMessage(e.getMessageEditor().getMessage( - MessageEditor.MessageType.INFO, - "commands.fun.avatar.success.title", - json.getString("username") + "#" + json.getString("discriminator"), - "", - "") - .setImage(url) - .setFooter(json.getString("username") + "#" + json.getString("discriminator")) - .build()).queue(); + MessageEditor.MessageType.INFO, + "commands.fun.avatar.success.title", + json.getString("username") + "#" + json.getString("discriminator"), + "", + "") + .setImage(url) + .setFooter(json.getString("username") + "#" + json.getString("discriminator")) + .build()).queue(); } catch (JSONException ex) { e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, "commands.fun.avatar.error.title", diff --git a/src/main/java/com/bbn/hadder/commands/fun/ClydeCommand.java b/src/main/java/com/bbn/hadder/commands/fun/ClydeCommand.java index 50f2bcf..0101020 100644 --- a/src/main/java/com/bbn/hadder/commands/fun/ClydeCommand.java +++ b/src/main/java/com/bbn/hadder/commands/fun/ClydeCommand.java @@ -66,7 +66,8 @@ public class ClydeCommand implements Command { } webhook.delete().queue(); e.getMessage().delete().queue(); - } else e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue(); + } else + e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue(); } else e.getHelpCommand().sendHelp(this, e); } diff --git a/src/main/java/com/bbn/hadder/commands/fun/MemeCommand.java b/src/main/java/com/bbn/hadder/commands/fun/MemeCommand.java index 9aa4aa2..3bf9ebc 100644 --- a/src/main/java/com/bbn/hadder/commands/fun/MemeCommand.java +++ b/src/main/java/com/bbn/hadder/commands/fun/MemeCommand.java @@ -41,18 +41,18 @@ public class MemeCommand implements Command { String url = json.getString("url"); e.getTextChannel().sendMessage( e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, - "commands.fun.meme.success.title", "") - .setImage(url) + "commands.fun.meme.success.title", "") + .setImage(url) .setAuthor("Subreddit: " + json.getString("subreddit")) - .build()).queue(); + .build()).queue(); } catch (IOException ignore) { e.getTextChannel().sendMessage( e.getMessageEditor().getMessage( MessageEditor.MessageType.ERROR, "error", "commands.fun.meme.api.error") - .setColor(Color.RED) - .build()).queue(); + .setColor(Color.RED) + .build()).queue(); } } diff --git a/src/main/java/com/bbn/hadder/commands/general/AboutCommand.java b/src/main/java/com/bbn/hadder/commands/general/AboutCommand.java index e2f2f58..7a0e439 100644 --- a/src/main/java/com/bbn/hadder/commands/general/AboutCommand.java +++ b/src/main/java/com/bbn/hadder/commands/general/AboutCommand.java @@ -30,8 +30,8 @@ public class AboutCommand implements Command { "commands.general.about.success.title", "commands.general.about.success.description") .addField(e.getMessageEditor().getTerm("commands.general.about.success.field.one.title"), e.getMessageEditor().getTerm("commands.general.about.success.field.one.description", "(https://donatebot.io/checkout/448554629282922527?buyer=" + e.getAuthor().getId() + "). :smiley:", ""), true) - .setThumbnail("https://bigbotnetwork.com/images/Hadder.png") - .build()).queue(); + .setThumbnail("https://bigbotnetwork.com/images/Hadder.png") + .build()).queue(); } @Override diff --git a/src/main/java/com/bbn/hadder/commands/general/EqualsCommand.java b/src/main/java/com/bbn/hadder/commands/general/EqualsCommand.java index 6cfb621..2144fd7 100644 --- a/src/main/java/com/bbn/hadder/commands/general/EqualsCommand.java +++ b/src/main/java/com/bbn/hadder/commands/general/EqualsCommand.java @@ -41,10 +41,10 @@ public class EqualsCommand implements Command { String secondString = msge2.getMessage().getContentRaw(); e.getChannel().sendMessage( e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO) - .setTitle((firstString.equals(secondString)) ? e.getMessageEditor().getTerm( "commands.general.equals.string.equals.true") : e.getMessageEditor().getTerm( "commands.general.equals.string.equals.false")) - .addField(e.getMessageEditor().getTerm( "commands.general.equals.string.first"), firstString, false) - .addField(e.getMessageEditor().getTerm( "commands.general.equals.string.second"), secondString, false) - .addField(e.getMessageEditor().getTerm( "commands.general.equals.string.result"), String.valueOf(firstString.equals(secondString)), false) + .setTitle((firstString.equals(secondString)) ? e.getMessageEditor().getTerm("commands.general.equals.string.equals.true") : e.getMessageEditor().getTerm("commands.general.equals.string.equals.false")) + .addField(e.getMessageEditor().getTerm("commands.general.equals.string.first"), firstString, false) + .addField(e.getMessageEditor().getTerm("commands.general.equals.string.second"), secondString, false) + .addField(e.getMessageEditor().getTerm("commands.general.equals.string.result"), String.valueOf(firstString.equals(secondString)), false) .build()).queue(); }, e.getJDA(), e.getAuthor()); }, e.getJDA(), e.getAuthor()); diff --git a/src/main/java/com/bbn/hadder/commands/general/InviteCommand.java b/src/main/java/com/bbn/hadder/commands/general/InviteCommand.java index 68e3f68..669b3f0 100644 --- a/src/main/java/com/bbn/hadder/commands/general/InviteCommand.java +++ b/src/main/java/com/bbn/hadder/commands/general/InviteCommand.java @@ -33,7 +33,7 @@ public class InviteCommand implements Command { "(https://discordapp.com/oauth2/authorize?client_id=" + e.getJDA().getSelfUser().getId() + "&scope=bot&permissions=1043852663)") - .build()).queue(); + .build()).queue(); } @Override diff --git a/src/main/java/com/bbn/hadder/commands/misc/CoronaCommand.java b/src/main/java/com/bbn/hadder/commands/misc/CoronaCommand.java index a09a087..3f357ae 100644 --- a/src/main/java/com/bbn/hadder/commands/misc/CoronaCommand.java +++ b/src/main/java/com/bbn/hadder/commands/misc/CoronaCommand.java @@ -48,9 +48,9 @@ public class CoronaCommand implements Command { .build()).queue(); } catch (IOException ex) { e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR) - .setTitle("API Error") - .setDescription("Try again later!") - .build()).queue(); + .setTitle("API Error") + .setDescription("Try again later!") + .build()).queue(); } } diff --git a/src/main/java/com/bbn/hadder/commands/misc/FeedbackCommand.java b/src/main/java/com/bbn/hadder/commands/misc/FeedbackCommand.java index 9592704..68bbb77 100644 --- a/src/main/java/com/bbn/hadder/commands/misc/FeedbackCommand.java +++ b/src/main/java/com/bbn/hadder/commands/misc/FeedbackCommand.java @@ -33,16 +33,16 @@ public class FeedbackCommand implements Command { e.getTextChannel().sendMessage( e.getMessageEditor().getMessage( MessageEditor.MessageType.INFO, - "commands.misc.feedback.title.request.title", - "commands.misc.feedback.title.request.description") - .build()).queue(); - new EventWaiter().newOnMessageEventWaiter(e1 -> { - String title = e1.getMessage().getContentDisplay(); - e1.getChannel().sendMessage(e.getMessageEditor().getMessage( - MessageEditor.MessageType.INFO, - "commands.misc.feedback.description.request.title", - "commands.misc.feedback.description.request.description") + "commands.misc.feedback.title.request.title", + "commands.misc.feedback.title.request.description") .build()).queue(); + new EventWaiter().newOnMessageEventWaiter(e1 -> { + String title = e1.getMessage().getContentDisplay(); + e1.getChannel().sendMessage(e.getMessageEditor().getMessage( + MessageEditor.MessageType.INFO, + "commands.misc.feedback.description.request.title", + "commands.misc.feedback.description.request.description") + .build()).queue(); new EventWaiter().newOnMessageEventWaiter(e2 -> { String description = e2.getMessage().getContentDisplay(); try { @@ -56,12 +56,12 @@ public class FeedbackCommand implements Command { "commands.misc.feedback.success.title", "") .setDescription(issue.getHtmlUrl().toString()) - .build()).queue(); + .build()).queue(); } catch (IOException ex) { ex.printStackTrace(); } - }, e.getJDA(), e.getAuthor()); }, e.getJDA(), e.getAuthor()); + }, e.getJDA(), e.getAuthor()); } diff --git a/src/main/java/com/bbn/hadder/commands/misc/GitHubCommand.java b/src/main/java/com/bbn/hadder/commands/misc/GitHubCommand.java index fa9ad54..606c9bb 100644 --- a/src/main/java/com/bbn/hadder/commands/misc/GitHubCommand.java +++ b/src/main/java/com/bbn/hadder/commands/misc/GitHubCommand.java @@ -54,10 +54,12 @@ public class GitHubCommand implements Command { String website = "None"; try { bio = json.getString("bio"); - } catch (JSONException ignored) {} + } catch (JSONException ignored) { + } try { location = json.getString("location"); - } catch (JSONException ignored) {} + } catch (JSONException ignored) { + } if (!json.getString("blog").equals("")) website = json.getString("blog"); diff --git a/src/main/java/com/bbn/hadder/commands/misc/MoveAllCommand.java b/src/main/java/com/bbn/hadder/commands/misc/MoveAllCommand.java index 3dbf7c0..9c6aea6 100644 --- a/src/main/java/com/bbn/hadder/commands/misc/MoveAllCommand.java +++ b/src/main/java/com/bbn/hadder/commands/misc/MoveAllCommand.java @@ -15,6 +15,7 @@ */ package com.bbn.hadder.commands.misc; + import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; import com.bbn.hadder.core.Perm; diff --git a/src/main/java/com/bbn/hadder/commands/misc/ScreenShareCommand.java b/src/main/java/com/bbn/hadder/commands/misc/ScreenShareCommand.java index c000356..fd7a584 100644 --- a/src/main/java/com/bbn/hadder/commands/misc/ScreenShareCommand.java +++ b/src/main/java/com/bbn/hadder/commands/misc/ScreenShareCommand.java @@ -21,7 +21,6 @@ import com.bbn.hadder.commands.CommandEvent; import com.bbn.hadder.utils.EventWaiter; import com.bbn.hadder.utils.MessageEditor; import com.bbn.hadder.utils.MessageEditor.MessageType; - import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.entities.VoiceChannel; @@ -31,8 +30,8 @@ public class ScreenShareCommand implements Command { @Override public void executed(String[] args, CommandEvent e) { - if (args.length>0) { - if (args[0].matches("[0-9]*") && args.length==1 && args[0].length() == 18) { + if (args.length > 0) { + if (args[0].matches("[0-9]*") && args.length == 1 && args[0].length() == 18) { if (e.getGuild().getVoiceChannelById(args[0]) != null) { e.getChannel().sendMessage(e.getMessageEditor().getMessage( MessageEditor.MessageType.INFO, @@ -66,7 +65,7 @@ public class ScreenShareCommand implements Command { e.getHelpCommand().sendHelp(this, e); } }, e.getJDA(), e.getAuthor()); - } else if (vcs.size()==0) { + } else if (vcs.size() == 0) { e.getChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, "commands.misc.screenshare.channel.existing.error", "commands.misc.screenshare.channel.existing.description").build()).queue(); e.getHelpCommand().sendHelp(this, e); } else { diff --git a/src/main/java/com/bbn/hadder/commands/misc/ServerStatsCommand.java b/src/main/java/com/bbn/hadder/commands/misc/ServerStatsCommand.java index 009a8a0..9d31c5c 100644 --- a/src/main/java/com/bbn/hadder/commands/misc/ServerStatsCommand.java +++ b/src/main/java/com/bbn/hadder/commands/misc/ServerStatsCommand.java @@ -38,7 +38,7 @@ public class ServerStatsCommand implements Command { .addField("Emotes", String.valueOf(e.getGuild().getEmotes().size()), true) .addField("Categories", String.valueOf(e.getGuild().getCategories().size()), true) .addField("Text/Voice/Store Channels", "`" + e.getGuild().getTextChannels().size() + "`" + "/" + "`" + e.getGuild().getVoiceChannels().size() + "`" + "/" + "`" + e.getGuild().getStoreChannels().size() + "`", true) - .addField("Verification Level", e.getGuild().getVerificationLevel().getKey() + ": " + e.getGuild().getVerificationLevel(), true) + .addField("Verification Level", e.getGuild().getVerificationLevel().getKey() + ": " + e.getGuild().getVerificationLevel(), true) .addField("MFA Level", String.valueOf(e.getGuild().getRequiredMFALevel().getKey()), true) .addField("Member Count", String.valueOf(e.getGuild().getMemberCount()), true) .addField("Explicit Content Level", e.getGuild().getExplicitContentLevel().getKey() + ": " + e.getGuild().getExplicitContentLevel(), true) @@ -48,7 +48,8 @@ public class ServerStatsCommand implements Command { .setImage(e.getGuild().getBannerUrl()); if (e.getGuild().getDescription() != null) eb.addField("Description", e.getGuild().getDescription(), true); - if (e.getGuild().getVanityCode() != null) eb.addField("Vanity Code", "[" + e.getGuild().getVanityCode() + "](https://discord.gg/" + e.getGuild().getVanityCode() + ")", true); + if (e.getGuild().getVanityCode() != null) + eb.addField("Vanity Code", "[" + e.getGuild().getVanityCode() + "](https://discord.gg/" + e.getGuild().getVanityCode() + ")", true); e.getTextChannel().sendMessage(eb.build()).queue(); } diff --git a/src/main/java/com/bbn/hadder/commands/moderation/InviteDetectCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/InviteDetectCommand.java index bd1e4cd..99f5f48 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/InviteDetectCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/InviteDetectCommand.java @@ -68,6 +68,7 @@ public class InviteDetectCommand implements Command { break; default: e.getHelpCommand().sendHelp(this, e); + break; } } else e.getHelpCommand().sendHelp(this, e); } diff --git a/src/main/java/com/bbn/hadder/commands/moderation/RegionChangeCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/RegionChangeCommand.java index cd81ab1..a72c608 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/RegionChangeCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/RegionChangeCommand.java @@ -108,14 +108,14 @@ public class RegionChangeCommand implements Command { .build()).queue(); } - public void setRegion (Region region, String region_name, CommandEvent e) { + public void setRegion(Region region, String region_name, CommandEvent e) { e.getGuild().getManager().setRegion(region).reason("Region changed by " + e.getAuthor().getAsTag()).queue(); e.getTextChannel().sendMessage( e.getMessageEditor().getMessage( MessageEditor.MessageType.INFO, "commands.moderation.regionchange.success.title", "", "commands.moderation.regionchange.success.description", region_name) - .build()).queue(); + .build()).queue(); } @Override diff --git a/src/main/java/com/bbn/hadder/commands/moderation/RoleAssignmentCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/RoleAssignmentCommand.java deleted file mode 100644 index 4503a3f..0000000 --- a/src/main/java/com/bbn/hadder/commands/moderation/RoleAssignmentCommand.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2019-2020 GregTCLTK and Schlauer-Hax - * - * Licensed under the GNU Affero General Public License, Version 3.0; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.gnu.org/licenses/agpl-3.0.en.html - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.bbn.hadder.commands.moderation; - -import com.bbn.hadder.commands.Command; -import com.bbn.hadder.commands.CommandEvent; -import com.bbn.hadder.core.Perm; -import com.bbn.hadder.core.Perms; -import com.bbn.hadder.utils.MessageEditor; -import net.dv8tion.jda.api.Permission; - -@Perms(Perm.MANAGE_ROLES) -public class RoleAssignmentCommand implements Command { - - @Override - public void executed(String[] args, CommandEvent e) { - //TODO: THIS LOL - if (e.getGuild().getSelfMember().hasPermission(Permission.MANAGE_ROLES)) { - - } else e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue(); - } - - @Override - public String[] labels() { - return new String[0]; - } - - @Override - public String description() { - return null; - } - - @Override - public String usage() { - return null; - } - - @Override - public String example() { - return null; - } -} diff --git a/src/main/java/com/bbn/hadder/commands/moderation/RulesCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/RulesCommand.java index 756c327..e797080 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/RulesCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/RulesCommand.java @@ -86,7 +86,7 @@ public class RulesCommand implements Command { "", "commands.moderation.rules.rules.description", channel.getName()) - .build()).queue(); + .build()).queue(); e.getEventWaiter().newOnMessageEventWaiter(e2 -> { String message = e2.getMessage().getContentRaw(); e2.getChannel().sendMessage( @@ -94,21 +94,21 @@ public class RulesCommand implements Command { MessageEditor.MessageType.INFO, "commands.moderation.rules.role.title", "commands.moderation.rules.role.description") - .build()).queue(); + .build()).queue(); new EventWaiter().newOnMessageEventWaiter(e3 -> { if (e3.getMessage().getMentionedRoles().size() == 1) { Role role = e3.getMessage().getMentionedRoles().get(0); setRole(e, channel, message, e3, role); } else if (e3.getGuild().getRolesByName(e3.getMessage().getContentRaw(), true).size() > 0) { - Role role = e3.getGuild().getRolesByName(e3.getMessage().getContentRaw(), true).get(0); - setRole(e, channel, message, e3, role); + Role role = e3.getGuild().getRolesByName(e3.getMessage().getContentRaw(), true).get(0); + setRole(e, channel, message, e3, role); } else { e3.getChannel().sendMessage( e.getMessageEditor().getMessage( MessageEditor.MessageType.ERROR, "commands.moderation.rules.role.error.title", "commands.moderation.rules.role.error.description") - .build()).queue(); + .build()).queue(); } }, e.getJDA(), e.getAuthor()); }, e.getJDA(), e.getAuthor()); @@ -124,7 +124,7 @@ public class RulesCommand implements Command { MessageEditor.MessageType.ERROR, "commands.moderation.rules.guild.error.title", "commands.moderation.rules.guild.error.description") - .build()).queue(); + .build()).queue(); } } diff --git a/src/main/java/com/bbn/hadder/commands/moderation/StarboardCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/StarboardCommand.java index 03629d5..11af987 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/StarboardCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/StarboardCommand.java @@ -25,18 +25,18 @@ public class StarboardCommand implements Command { @Override public void executed(String[] args, CommandEvent e) { - if (e.getMessage().getMentionedChannels().size()==1) { + if (e.getMessage().getMentionedChannels().size() == 1) { e.getRethinkServer().setStarboard(e.getMessage().getMentionedChannels().get(0).getId()); e.getChannel().sendMessage( e.getMessageEditor().getMessage( MessageEditor.MessageType.INFO, - "commands.moderation.starboard.success.title","") + "commands.moderation.starboard.success.title", "") .build()) .queue(); } else { - if (args.length>0) { + if (args.length > 0) { TextChannel channel = e.getGuild().getTextChannelById(args[0]); - if (channel!=null) { + if (channel != null) { e.getRethinkServer().setStarboard(channel.getId()); } } else e.getHelpCommand().sendHelp(this, e); diff --git a/src/main/java/com/bbn/hadder/commands/music/BassCommand.java b/src/main/java/com/bbn/hadder/commands/music/BassCommand.java index 61facab..45fa9f8 100644 --- a/src/main/java/com/bbn/hadder/commands/music/BassCommand.java +++ b/src/main/java/com/bbn/hadder/commands/music/BassCommand.java @@ -22,8 +22,8 @@ import com.bbn.hadder.utils.MessageEditor; import com.sedmelluq.discord.lavaplayer.filter.equalizer.EqualizerFactory; public class BassCommand implements Command { - private static final float[] BASS_BOOST = { 0.2f, 0.15f, 0.1f, 0.05f, 0.0f, -0.05f, -0.1f, -0.1f, -0.1f, -0.1f, -0.1f, - -0.1f, -0.1f, -0.1f, -0.1f }; + private static final float[] BASS_BOOST = {0.2f, 0.15f, 0.1f, 0.05f, 0.0f, -0.05f, -0.1f, -0.1f, -0.1f, -0.1f, -0.1f, + -0.1f, -0.1f, -0.1f, -0.1f}; @Override public void executed(String[] args, CommandEvent e) { diff --git a/src/main/java/com/bbn/hadder/commands/music/JoinCommand.java b/src/main/java/com/bbn/hadder/commands/music/JoinCommand.java index aac598c..4f3a850 100644 --- a/src/main/java/com/bbn/hadder/commands/music/JoinCommand.java +++ b/src/main/java/com/bbn/hadder/commands/music/JoinCommand.java @@ -29,7 +29,7 @@ public class JoinCommand implements Command { public void executed(String[] args, CommandEvent e) { if (e.getMember().getVoiceState().inVoiceChannel()) { AudioManager audioManager = e.getGuild().getAudioManager(); - if(!audioManager.isAttemptingToConnect()) { + if (!audioManager.isAttemptingToConnect()) { VoiceChannel vc = e.getMember().getVoiceState().getChannel(); if (e.getGuild().getSelfMember().getVoiceState().inVoiceChannel()) { if (!e.getGuild().getSelfMember().getVoiceState().getChannel().getId().equals(vc.getId())) { @@ -51,11 +51,11 @@ public class JoinCommand implements Command { } } else { e.getTextChannel().sendMessage( - e.getMessageEditor().getMessage( - MessageEditor.MessageType.WARNING, - "commands.music.join.error.connecting.already.title", - "commands.music.join.error.connecting.already.description") - .build()).queue(); + e.getMessageEditor().getMessage( + MessageEditor.MessageType.WARNING, + "commands.music.join.error.connecting.already.title", + "commands.music.join.error.connecting.already.description") + .build()).queue(); } } else { try { @@ -74,16 +74,16 @@ public class JoinCommand implements Command { } } else { e.getTextChannel().sendMessage(e.getMessageEditor().getMessage( - MessageEditor.MessageType.WARNING, - "commands.music.join.error.connecting.trying.title", - "commands.music.join.error.connecting.trying.description") - .build()).queue(); + MessageEditor.MessageType.WARNING, + "commands.music.join.error.connecting.trying.title", + "commands.music.join.error.connecting.trying.description") + .build()).queue(); } } else { e.getTextChannel().sendMessage(e.getMessageEditor().getMessage( - MessageEditor.MessageType.ERROR, - "commands.music.join.error.channel.title", - "commands.music.join.error.channel.description") + MessageEditor.MessageType.ERROR, + "commands.music.join.error.channel.title", + "commands.music.join.error.channel.description") .build()).queue(); } } diff --git a/src/main/java/com/bbn/hadder/commands/music/LeaveCommand.java b/src/main/java/com/bbn/hadder/commands/music/LeaveCommand.java deleted file mode 100644 index d63cdb1..0000000 --- a/src/main/java/com/bbn/hadder/commands/music/LeaveCommand.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2019-2020 GregTCLTK and Schlauer-Hax - * - * Licensed under the GNU Affero General Public License, Version 3.0; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.gnu.org/licenses/agpl-3.0.en.html - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.bbn.hadder.commands.music; - -import com.bbn.hadder.commands.Command; -import com.bbn.hadder.commands.CommandEvent; -import com.bbn.hadder.utils.MessageEditor; - -public class LeaveCommand implements Command { - - @Override - public void executed(String[] args, CommandEvent e) { - if (e.getGuild().getSelfMember().getVoiceState().inVoiceChannel()) { - if (e.getMember().getVoiceState().inVoiceChannel() && e.getGuild().getSelfMember().getVoiceState().getChannel().equals(e.getMember().getVoiceState().getChannel())) { - e.getGuild().getAudioManager().closeAudioConnection(); - e.getTextChannel().sendMessage(e.getMessageEditor().getMessage( - MessageEditor.MessageType.INFO, - "commands.music.leave.success.title", - "commands.music.leave.success.description") - .build()).queue(); - } else { - e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, - "commands.music.leave.error.channel.title", - "commands.music.leave.error.channel.description") - .build()).queue(); - } - } else { - e.getTextChannel().sendMessage(e.getMessageEditor().getMessage( - MessageEditor.MessageType.ERROR, - "commands.music.leave.error.connected.tile", - "commands.music.leave.error.connected.description") - .build()).queue(); - } - } - - @Override - public String[] labels() { - return new String[]{"leave", "quit"}; - } - - @Override - public String description() { - return "commands.music.leave.help.description"; - } - - @Override - public String usage() { - return null; - } - - @Override - public String example() { - return null; - } -} diff --git a/src/main/java/com/bbn/hadder/commands/music/QueueCommand.java b/src/main/java/com/bbn/hadder/commands/music/QueueCommand.java index 56c1fc7..185e91d 100644 --- a/src/main/java/com/bbn/hadder/commands/music/QueueCommand.java +++ b/src/main/java/com/bbn/hadder/commands/music/QueueCommand.java @@ -38,10 +38,10 @@ public class QueueCommand implements Command { long queuelength = 0; for (AudioInfo g : queue) { queuelength = queuelength + g.getTrack().getInfo().length; - builder.append("("+e.getAudioManager().getTimestamp(g.getTrack().getInfo().length)+") **").append(g.getTrack().getInfo().author).append("**: `").append(g.getTrack().getInfo().title).append("` \n"); + builder.append("(" + e.getAudioManager().getTimestamp(g.getTrack().getInfo().length) + ") **").append(g.getTrack().getInfo().author).append("**: `").append(g.getTrack().getInfo().title).append("` \n"); } e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, - "commands.music.queue.success.title", "("+String.valueOf(e.getAudioManager().getTimestamp(queuelength))+")", + "commands.music.queue.success.title", "(" + String.valueOf(e.getAudioManager().getTimestamp(queuelength)) + ")", "commands.music.queue.success.description", builder.toString()) .build()).queue(); } diff --git a/src/main/java/com/bbn/hadder/commands/music/RecordCommand.java b/src/main/java/com/bbn/hadder/commands/music/RecordCommand.java index 95ca154..9f540cf 100644 --- a/src/main/java/com/bbn/hadder/commands/music/RecordCommand.java +++ b/src/main/java/com/bbn/hadder/commands/music/RecordCommand.java @@ -51,7 +51,7 @@ public class RecordCommand implements Command { audioManager.openAudioConnection(event.getMember().getVoiceState().getChannel()); } else { for (Map.Entry> key : queue.entrySet()) { - File file = new File("./"+event.getJDA().getUserById(key.getKey())+".wav"); + File file = new File("./" + event.getJDA().getUserById(key.getKey()) + ".wav"); } diff --git a/src/main/java/com/bbn/hadder/commands/music/SkipCommand.java b/src/main/java/com/bbn/hadder/commands/music/SkipCommand.java index be1a5b1..5695395 100644 --- a/src/main/java/com/bbn/hadder/commands/music/SkipCommand.java +++ b/src/main/java/com/bbn/hadder/commands/music/SkipCommand.java @@ -26,10 +26,19 @@ public class SkipCommand implements Command { public void executed(String[] args, CommandEvent e) { if (e.getAudioManager().hasPlayer(e.getGuild()) && !e.getAudioManager().getTrackManager(e.getGuild()).getQueuedTracks().isEmpty()) { if (e.getMember().getVoiceState().inVoiceChannel() && e.getGuild().getSelfMember().getVoiceState().inVoiceChannel() && e.getGuild().getSelfMember().getVoiceState().getChannel().equals(e.getMember().getVoiceState().getChannel())) { - e.getAudioManager().forceSkipTrack(e); - e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, - "commands.music.skip.success.title", - "commands.music.skip.success.description").build()).queue(); + if (!e.getAudioManager().getTrackManager(e.getGuild()).isLoop()) { + e.getAudioManager().forceSkipTrack(e); + e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, + "commands.music.skip.success.title", + "commands.music.skip.success.description").build()).queue(); + } else { + e.getAudioManager().getTrackManager(e.getGuild()).setLoop(false); + e.getAudioManager().forceSkipTrack(e); + e.getAudioManager().getTrackManager(e.getGuild()).setLoop(true); + e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, + "commands.music.skip.success.title", + "commands.music.skip.success.description").build()).queue(); + } } else { e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, "commands.music.skip.error.connected.title", diff --git a/src/main/java/com/bbn/hadder/commands/music/StopCommand.java b/src/main/java/com/bbn/hadder/commands/music/StopCommand.java index e11dfac..96a1811 100644 --- a/src/main/java/com/bbn/hadder/commands/music/StopCommand.java +++ b/src/main/java/com/bbn/hadder/commands/music/StopCommand.java @@ -26,6 +26,7 @@ public class StopCommand implements Command { public void executed(String[] args, CommandEvent e) { 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())) { + e.getAudioManager().getTrackManager(e.getGuild()).setLoop(false); e.getAudioManager().players.remove(e.getGuild().getId()); e.getAudioManager().getPlayer(e.getGuild()).destroy(); e.getAudioManager().getTrackManager(e.getGuild()).purgeQueue(); @@ -48,7 +49,7 @@ public class StopCommand implements Command { @Override public String[] labels() { - return new String[]{"stop"}; + return new String[]{"stop", "leave"}; } @Override diff --git a/src/main/java/com/bbn/hadder/commands/nsfw/AnalCommand.java b/src/main/java/com/bbn/hadder/commands/nsfw/AnalCommand.java index b760ceb..8d51300 100644 --- a/src/main/java/com/bbn/hadder/commands/nsfw/AnalCommand.java +++ b/src/main/java/com/bbn/hadder/commands/nsfw/AnalCommand.java @@ -18,8 +18,8 @@ package com.bbn.hadder.commands.nsfw; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; -import com.bbn.hadder.utils.MessageEditor; import com.bbn.hadder.utils.Http; +import com.bbn.hadder.utils.MessageEditor; public class AnalCommand implements Command { diff --git a/src/main/java/com/bbn/hadder/commands/nsfw/BDSMCommand.java b/src/main/java/com/bbn/hadder/commands/nsfw/BDSMCommand.java index 53ec6b3..8cc55d3 100644 --- a/src/main/java/com/bbn/hadder/commands/nsfw/BDSMCommand.java +++ b/src/main/java/com/bbn/hadder/commands/nsfw/BDSMCommand.java @@ -18,8 +18,8 @@ package com.bbn.hadder.commands.nsfw; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; -import com.bbn.hadder.utils.MessageEditor; import com.bbn.hadder.utils.Http; +import com.bbn.hadder.utils.MessageEditor; public class BDSMCommand implements Command { @@ -42,7 +42,7 @@ public class BDSMCommand implements Command { @Override public String[] labels() { - return new String[] { "bdsm" }; + return new String[]{"bdsm"}; } @Override diff --git a/src/main/java/com/bbn/hadder/commands/nsfw/BlowjobCommand.java b/src/main/java/com/bbn/hadder/commands/nsfw/BlowjobCommand.java index d53de45..b2a3b4f 100644 --- a/src/main/java/com/bbn/hadder/commands/nsfw/BlowjobCommand.java +++ b/src/main/java/com/bbn/hadder/commands/nsfw/BlowjobCommand.java @@ -18,8 +18,8 @@ package com.bbn.hadder.commands.nsfw; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; -import com.bbn.hadder.utils.MessageEditor; import com.bbn.hadder.utils.Http; +import com.bbn.hadder.utils.MessageEditor; public class BlowjobCommand implements Command { diff --git a/src/main/java/com/bbn/hadder/commands/nsfw/BoobsCommand.java b/src/main/java/com/bbn/hadder/commands/nsfw/BoobsCommand.java index f47c0ef..9344148 100644 --- a/src/main/java/com/bbn/hadder/commands/nsfw/BoobsCommand.java +++ b/src/main/java/com/bbn/hadder/commands/nsfw/BoobsCommand.java @@ -18,8 +18,8 @@ package com.bbn.hadder.commands.nsfw; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; -import com.bbn.hadder.utils.MessageEditor; import com.bbn.hadder.utils.Http; +import com.bbn.hadder.utils.MessageEditor; public class BoobsCommand implements Command { diff --git a/src/main/java/com/bbn/hadder/commands/nsfw/CumCommand.java b/src/main/java/com/bbn/hadder/commands/nsfw/CumCommand.java index 9207c05..9f45457 100644 --- a/src/main/java/com/bbn/hadder/commands/nsfw/CumCommand.java +++ b/src/main/java/com/bbn/hadder/commands/nsfw/CumCommand.java @@ -18,8 +18,8 @@ package com.bbn.hadder.commands.nsfw; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; -import com.bbn.hadder.utils.MessageEditor; import com.bbn.hadder.utils.Http; +import com.bbn.hadder.utils.MessageEditor; public class CumCommand implements Command { diff --git a/src/main/java/com/bbn/hadder/commands/nsfw/EroticCommand.java b/src/main/java/com/bbn/hadder/commands/nsfw/EroticCommand.java index 729bfea..8e1d25f 100644 --- a/src/main/java/com/bbn/hadder/commands/nsfw/EroticCommand.java +++ b/src/main/java/com/bbn/hadder/commands/nsfw/EroticCommand.java @@ -18,8 +18,8 @@ package com.bbn.hadder.commands.nsfw; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; -import com.bbn.hadder.utils.MessageEditor; import com.bbn.hadder.utils.Http; +import com.bbn.hadder.utils.MessageEditor; public class EroticCommand implements Command { diff --git a/src/main/java/com/bbn/hadder/commands/nsfw/FeetCommand.java b/src/main/java/com/bbn/hadder/commands/nsfw/FeetCommand.java index a46af5c..2771465 100644 --- a/src/main/java/com/bbn/hadder/commands/nsfw/FeetCommand.java +++ b/src/main/java/com/bbn/hadder/commands/nsfw/FeetCommand.java @@ -18,8 +18,8 @@ package com.bbn.hadder.commands.nsfw; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; -import com.bbn.hadder.utils.MessageEditor; import com.bbn.hadder.utils.Http; +import com.bbn.hadder.utils.MessageEditor; public class FeetCommand implements Command { diff --git a/src/main/java/com/bbn/hadder/commands/nsfw/FingeringCommand.java b/src/main/java/com/bbn/hadder/commands/nsfw/FingeringCommand.java index 3eba6d1..613aeb6 100644 --- a/src/main/java/com/bbn/hadder/commands/nsfw/FingeringCommand.java +++ b/src/main/java/com/bbn/hadder/commands/nsfw/FingeringCommand.java @@ -18,8 +18,8 @@ package com.bbn.hadder.commands.nsfw; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; -import com.bbn.hadder.utils.MessageEditor; import com.bbn.hadder.utils.Http; +import com.bbn.hadder.utils.MessageEditor; public class FingeringCommand implements Command { diff --git a/src/main/java/com/bbn/hadder/commands/nsfw/LickingCommand.java b/src/main/java/com/bbn/hadder/commands/nsfw/LickingCommand.java index 3e199ff..2cca595 100644 --- a/src/main/java/com/bbn/hadder/commands/nsfw/LickingCommand.java +++ b/src/main/java/com/bbn/hadder/commands/nsfw/LickingCommand.java @@ -18,8 +18,8 @@ package com.bbn.hadder.commands.nsfw; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; -import com.bbn.hadder.utils.MessageEditor; import com.bbn.hadder.utils.Http; +import com.bbn.hadder.utils.MessageEditor; public class LickingCommand implements Command { diff --git a/src/main/java/com/bbn/hadder/commands/nsfw/PornCommand.java b/src/main/java/com/bbn/hadder/commands/nsfw/PornCommand.java index 9c181b1..eebcb33 100644 --- a/src/main/java/com/bbn/hadder/commands/nsfw/PornCommand.java +++ b/src/main/java/com/bbn/hadder/commands/nsfw/PornCommand.java @@ -18,8 +18,8 @@ package com.bbn.hadder.commands.nsfw; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; -import com.bbn.hadder.utils.MessageEditor; import com.bbn.hadder.utils.Http; +import com.bbn.hadder.utils.MessageEditor; public class PornCommand implements Command { diff --git a/src/main/java/com/bbn/hadder/commands/nsfw/PussyCommand.java b/src/main/java/com/bbn/hadder/commands/nsfw/PussyCommand.java index 5a395b4..d00dad8 100644 --- a/src/main/java/com/bbn/hadder/commands/nsfw/PussyCommand.java +++ b/src/main/java/com/bbn/hadder/commands/nsfw/PussyCommand.java @@ -18,8 +18,8 @@ package com.bbn.hadder.commands.nsfw; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; -import com.bbn.hadder.utils.MessageEditor; import com.bbn.hadder.utils.Http; +import com.bbn.hadder.utils.MessageEditor; public class PussyCommand implements Command { diff --git a/src/main/java/com/bbn/hadder/commands/nsfw/RandomPornCommand.java b/src/main/java/com/bbn/hadder/commands/nsfw/RandomPornCommand.java index 7c1518c..40ffca4 100644 --- a/src/main/java/com/bbn/hadder/commands/nsfw/RandomPornCommand.java +++ b/src/main/java/com/bbn/hadder/commands/nsfw/RandomPornCommand.java @@ -18,8 +18,8 @@ package com.bbn.hadder.commands.nsfw; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; -import com.bbn.hadder.utils.MessageEditor; import com.bbn.hadder.utils.Http; +import com.bbn.hadder.utils.MessageEditor; public class RandomPornCommand implements Command { @@ -44,7 +44,7 @@ public class RandomPornCommand implements Command { @Override public String[] labels() { - return new String[] { "randomporn", "pornrandom" }; + return new String[]{"randomporn", "pornrandom"}; } @Override diff --git a/src/main/java/com/bbn/hadder/commands/nsfw/SoloCommand.java b/src/main/java/com/bbn/hadder/commands/nsfw/SoloCommand.java index d3f8a28..c7652fd 100644 --- a/src/main/java/com/bbn/hadder/commands/nsfw/SoloCommand.java +++ b/src/main/java/com/bbn/hadder/commands/nsfw/SoloCommand.java @@ -18,8 +18,8 @@ package com.bbn.hadder.commands.nsfw; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; -import com.bbn.hadder.utils.MessageEditor; import com.bbn.hadder.utils.Http; +import com.bbn.hadder.utils.MessageEditor; public class SoloCommand implements Command { diff --git a/src/main/java/com/bbn/hadder/commands/nsfw/SpankCommand.java b/src/main/java/com/bbn/hadder/commands/nsfw/SpankCommand.java index 59805b0..bac668d 100644 --- a/src/main/java/com/bbn/hadder/commands/nsfw/SpankCommand.java +++ b/src/main/java/com/bbn/hadder/commands/nsfw/SpankCommand.java @@ -18,8 +18,8 @@ package com.bbn.hadder.commands.nsfw; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; -import com.bbn.hadder.utils.MessageEditor; import com.bbn.hadder.utils.Http; +import com.bbn.hadder.utils.MessageEditor; public class SpankCommand implements Command { @@ -42,7 +42,7 @@ public class SpankCommand implements Command { @Override public String[] labels() { - return new String[] { "spank", "beat", "hit" }; + return new String[]{"spank", "beat", "hit"}; } @Override diff --git a/src/main/java/com/bbn/hadder/commands/nsfw/TransCommand.java b/src/main/java/com/bbn/hadder/commands/nsfw/TransCommand.java index 439f284..9beea46 100644 --- a/src/main/java/com/bbn/hadder/commands/nsfw/TransCommand.java +++ b/src/main/java/com/bbn/hadder/commands/nsfw/TransCommand.java @@ -18,8 +18,8 @@ package com.bbn.hadder.commands.nsfw; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; -import com.bbn.hadder.utils.MessageEditor; import com.bbn.hadder.utils.Http; +import com.bbn.hadder.utils.MessageEditor; public class TransCommand implements Command { @@ -43,7 +43,7 @@ public class TransCommand implements Command { @Override public String[] labels() { - return new String[] { "trans" }; + return new String[]{"trans"}; } @Override diff --git a/src/main/java/com/bbn/hadder/commands/owner/BlacklistCommand.java b/src/main/java/com/bbn/hadder/commands/owner/BlacklistCommand.java index 50555a4..d385d22 100644 --- a/src/main/java/com/bbn/hadder/commands/owner/BlacklistCommand.java +++ b/src/main/java/com/bbn/hadder/commands/owner/BlacklistCommand.java @@ -16,11 +16,11 @@ package com.bbn.hadder.commands.owner; -import com.bbn.hadder.RethinkUser; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; import com.bbn.hadder.core.Perm; import com.bbn.hadder.core.Perms; +import com.bbn.hadder.db.RethinkUser; import com.bbn.hadder.utils.MessageEditor; import net.dv8tion.jda.api.entities.User; @@ -50,12 +50,12 @@ public class BlacklistCommand implements Command { LinkedHashSet hashSet = new LinkedHashSet<>(commands); ArrayList commandsWithoutDuplicates = new ArrayList<>(hashSet); - String newblacklisted = ((commandsWithoutDuplicates.size()!=0) ? String.join(",", commandsWithoutDuplicates) : "none"); + String newblacklisted = ((commandsWithoutDuplicates.size() != 0) ? String.join(",", commandsWithoutDuplicates) : "none"); u.setBlacklisted(newblacklisted); e.getTextChannel().sendMessage( e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, - "commands.owner.blacklist.success."+args[0].toLowerCase()+".title", "", - "commands.owner.blacklist.success."+args[0].toLowerCase()+".description", newblacklisted) + "commands.owner.blacklist.success." + args[0].toLowerCase() + ".title", "", + "commands.owner.blacklist.success." + args[0].toLowerCase() + ".description", newblacklisted) .build()).queue(); u.push(); } else e.getHelpCommand().sendHelp(this, e); @@ -75,7 +75,7 @@ public class BlacklistCommand implements Command { e.getTextChannel().sendMessage( e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO) .setTitle("Blacklisted Users") - .setDescription((stringBuilder.length()!=0) ? ("``" + stringBuilder.toString() + "``") : "No blacklisted Users") + .setDescription((stringBuilder.length() != 0) ? ("``" + stringBuilder.toString() + "``") : "No blacklisted Users") .build()).queue(); break; diff --git a/src/main/java/com/bbn/hadder/commands/settings/LanguageCommand.java b/src/main/java/com/bbn/hadder/commands/settings/LanguageCommand.java index 7c6ab93..eea064a 100644 --- a/src/main/java/com/bbn/hadder/commands/settings/LanguageCommand.java +++ b/src/main/java/com/bbn/hadder/commands/settings/LanguageCommand.java @@ -49,10 +49,10 @@ public class LanguageCommand implements Command { break; default: e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, - "List", - "`de`, `en`, `es`, `fr`, `ru`, `tr`, `zh`") + "commands.settings.language.error.title", "", + "commands.settings.language.error.description", "`de`, `en`, `es`, `fr`, `ru`, `tr`, `zh`") .build()).queue(); - break; + break; } } else e.getHelpCommand().sendHelp(this, e); } @@ -70,7 +70,7 @@ public class LanguageCommand implements Command { @Override public String[] labels() { - return new String[] { "language" }; + return new String[]{"language"}; } @Override diff --git a/src/main/java/com/bbn/hadder/commands/settings/UserPrefixCommand.java b/src/main/java/com/bbn/hadder/commands/settings/UserPrefixCommand.java index 3867bb4..21e6d06 100644 --- a/src/main/java/com/bbn/hadder/commands/settings/UserPrefixCommand.java +++ b/src/main/java/com/bbn/hadder/commands/settings/UserPrefixCommand.java @@ -37,7 +37,7 @@ public class UserPrefixCommand implements Command { @Override public String[] labels() { - return new String[] { "userprefix" }; + return new String[]{"userprefix"}; } @Override diff --git a/src/main/java/com/bbn/hadder/core/CommandHandler.java b/src/main/java/com/bbn/hadder/core/CommandHandler.java index 7ab130a..39a000a 100644 --- a/src/main/java/com/bbn/hadder/core/CommandHandler.java +++ b/src/main/java/com/bbn/hadder/core/CommandHandler.java @@ -16,13 +16,13 @@ package com.bbn.hadder.core; -import com.bbn.hadder.Rethink; -import com.bbn.hadder.RethinkServer; -import com.bbn.hadder.RethinkUser; import com.bbn.hadder.audio.AudioManager; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; import com.bbn.hadder.commands.general.HelpCommand; +import com.bbn.hadder.db.Rethink; +import com.bbn.hadder.db.RethinkServer; +import com.bbn.hadder.db.RethinkUser; import com.bbn.hadder.utils.EventWaiter; import com.bbn.hadder.utils.MessageEditor; import net.dv8tion.jda.api.events.message.MessageReceivedEvent; diff --git a/src/main/java/com/bbn/hadder/Rethink.java b/src/main/java/com/bbn/hadder/db/Rethink.java similarity index 98% rename from src/main/java/com/bbn/hadder/Rethink.java rename to src/main/java/com/bbn/hadder/db/Rethink.java index 069209f..6651a39 100644 --- a/src/main/java/com/bbn/hadder/Rethink.java +++ b/src/main/java/com/bbn/hadder/db/Rethink.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package com.bbn.hadder; +package com.bbn.hadder.db; import com.bbn.hadder.core.Config; import com.rethinkdb.RethinkDB; @@ -31,7 +31,7 @@ public class Rethink { private Connection conn; private Config config; - Rethink(Config config) { + public Rethink(Config config) { this.config = config; } diff --git a/src/main/java/com/bbn/hadder/RethinkServer.java b/src/main/java/com/bbn/hadder/db/RethinkServer.java similarity index 97% rename from src/main/java/com/bbn/hadder/RethinkServer.java rename to src/main/java/com/bbn/hadder/db/RethinkServer.java index e54dfd9..0993922 100644 --- a/src/main/java/com/bbn/hadder/RethinkServer.java +++ b/src/main/java/com/bbn/hadder/db/RethinkServer.java @@ -10,11 +10,11 @@ * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and + * See the License for the specific language governing permissions and * limitations under the License. */ -package com.bbn.hadder; +package com.bbn.hadder.db; import org.json.JSONObject; diff --git a/src/main/java/com/bbn/hadder/RethinkUser.java b/src/main/java/com/bbn/hadder/db/RethinkUser.java similarity index 95% rename from src/main/java/com/bbn/hadder/RethinkUser.java rename to src/main/java/com/bbn/hadder/db/RethinkUser.java index 0579947..ba65bc3 100644 --- a/src/main/java/com/bbn/hadder/RethinkUser.java +++ b/src/main/java/com/bbn/hadder/db/RethinkUser.java @@ -10,11 +10,11 @@ * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and + * See the License for the specific language governing permissions and * limitations under the License. */ -package com.bbn.hadder; +package com.bbn.hadder.db; import org.json.JSONObject; diff --git a/src/main/java/com/bbn/hadder/listener/CommandListener.java b/src/main/java/com/bbn/hadder/listener/CommandListener.java index 286d320..5117359 100644 --- a/src/main/java/com/bbn/hadder/listener/CommandListener.java +++ b/src/main/java/com/bbn/hadder/listener/CommandListener.java @@ -16,11 +16,11 @@ package com.bbn.hadder.listener; -import com.bbn.hadder.Rethink; -import com.bbn.hadder.RethinkServer; -import com.bbn.hadder.RethinkUser; import com.bbn.hadder.audio.AudioManager; import com.bbn.hadder.core.CommandHandler; +import com.bbn.hadder.db.Rethink; +import com.bbn.hadder.db.RethinkServer; +import com.bbn.hadder.db.RethinkUser; import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.Permission; import net.dv8tion.jda.api.entities.ChannelType; diff --git a/src/main/java/com/bbn/hadder/listener/GuildListener.java b/src/main/java/com/bbn/hadder/listener/GuildListener.java index 91204ca..4a62731 100644 --- a/src/main/java/com/bbn/hadder/listener/GuildListener.java +++ b/src/main/java/com/bbn/hadder/listener/GuildListener.java @@ -16,8 +16,8 @@ package com.bbn.hadder.listener; -import com.bbn.hadder.Rethink; import com.bbn.hadder.core.Config; +import com.bbn.hadder.db.Rethink; import com.bbn.hadder.utils.BotList; import com.bbn.hadder.utils.MessageEditor; import net.dv8tion.jda.api.entities.Member; diff --git a/src/main/java/com/bbn/hadder/listener/InviteLinkListener.java b/src/main/java/com/bbn/hadder/listener/InviteLinkListener.java index ea00e93..69dddfd 100644 --- a/src/main/java/com/bbn/hadder/listener/InviteLinkListener.java +++ b/src/main/java/com/bbn/hadder/listener/InviteLinkListener.java @@ -16,8 +16,8 @@ package com.bbn.hadder.listener; -import com.bbn.hadder.Rethink; -import com.bbn.hadder.RethinkServer; +import com.bbn.hadder.db.Rethink; +import com.bbn.hadder.db.RethinkServer; import net.dv8tion.jda.api.Permission; import net.dv8tion.jda.api.entities.ChannelType; import net.dv8tion.jda.api.entities.Message; diff --git a/src/main/java/com/bbn/hadder/listener/MentionListener.java b/src/main/java/com/bbn/hadder/listener/MentionListener.java index 7fb9e11..16b2b19 100644 --- a/src/main/java/com/bbn/hadder/listener/MentionListener.java +++ b/src/main/java/com/bbn/hadder/listener/MentionListener.java @@ -16,9 +16,9 @@ package com.bbn.hadder.listener; -import com.bbn.hadder.Rethink; -import com.bbn.hadder.RethinkServer; -import com.bbn.hadder.RethinkUser; +import com.bbn.hadder.db.Rethink; +import com.bbn.hadder.db.RethinkServer; +import com.bbn.hadder.db.RethinkUser; import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.entities.ChannelType; import net.dv8tion.jda.api.events.message.MessageReceivedEvent; @@ -71,7 +71,7 @@ public class MentionListener extends ListenerAdapter { ); builder.addField("Developer", devs.toString(), false); builder.addField("Join our Dev Server!", "[Click here!](https://discord.gg/58My2dM)", true); - builder.addField("Github", "[Click here!](https://github.com/BigBotNetwork/Hadder)",false); + builder.addField("Github", "[Click here!](https://github.com/BigBotNetwork/Hadder)", false); builder.addField("Twitch", "[Click here!](https://www.twitch.tv/bigbotnetwork)", false); e.getChannel().sendMessage(builder.build()).queue(); } else if (e.getMessage().getContentRaw().equalsIgnoreCase("@someone")) { diff --git a/src/main/java/com/bbn/hadder/listener/OwnerMessageListener.java b/src/main/java/com/bbn/hadder/listener/OwnerMessageListener.java index e578716..7e46a1a 100644 --- a/src/main/java/com/bbn/hadder/listener/OwnerMessageListener.java +++ b/src/main/java/com/bbn/hadder/listener/OwnerMessageListener.java @@ -26,7 +26,7 @@ public class OwnerMessageListener extends ListenerAdapter { if (!emotename.contains(" ")) { Emote[] emotes = event.getJDA().getEmotesByName(emotename, true).toArray(new Emote[0]); StringBuilder sb = new StringBuilder(); - if (emotes.length!=0) { + if (emotes.length != 0) { for (Emote emote : emotes) { sb.append(emote.getAsMention()).append(" "); } diff --git a/src/main/java/com/bbn/hadder/listener/PrivateMessageListener.java b/src/main/java/com/bbn/hadder/listener/PrivateMessageListener.java index fc258f9..8e94bbe 100644 --- a/src/main/java/com/bbn/hadder/listener/PrivateMessageListener.java +++ b/src/main/java/com/bbn/hadder/listener/PrivateMessageListener.java @@ -16,8 +16,8 @@ package com.bbn.hadder.listener; -import com.bbn.hadder.Rethink; -import com.bbn.hadder.RethinkUser; +import com.bbn.hadder.db.Rethink; +import com.bbn.hadder.db.RethinkUser; import com.bbn.hadder.utils.MessageEditor; import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.entities.ChannelType; diff --git a/src/main/java/com/bbn/hadder/listener/ReadyListener.java b/src/main/java/com/bbn/hadder/listener/ReadyListener.java index 51b3491..c520a4c 100644 --- a/src/main/java/com/bbn/hadder/listener/ReadyListener.java +++ b/src/main/java/com/bbn/hadder/listener/ReadyListener.java @@ -16,8 +16,8 @@ package com.bbn.hadder.listener; -import com.bbn.hadder.Rethink; import com.bbn.hadder.core.Config; +import com.bbn.hadder.db.Rethink; import com.bbn.hadder.utils.BotList; import net.dv8tion.jda.api.entities.Guild; import net.dv8tion.jda.api.entities.User; diff --git a/src/main/java/com/bbn/hadder/listener/RulesListener.java b/src/main/java/com/bbn/hadder/listener/RulesListener.java index 8ee5fc4..04901cf 100644 --- a/src/main/java/com/bbn/hadder/listener/RulesListener.java +++ b/src/main/java/com/bbn/hadder/listener/RulesListener.java @@ -16,8 +16,8 @@ package com.bbn.hadder.listener; -import com.bbn.hadder.Rethink; -import com.bbn.hadder.RethinkServer; +import com.bbn.hadder.db.Rethink; +import com.bbn.hadder.db.RethinkServer; import net.dv8tion.jda.api.events.message.react.MessageReactionAddEvent; import net.dv8tion.jda.api.events.message.react.MessageReactionRemoveEvent; import net.dv8tion.jda.api.hooks.ListenerAdapter; @@ -60,14 +60,15 @@ public class RulesListener extends ListenerAdapter { RethinkServer rethinkServer = new RethinkServer(rethink.getObjectByID("server", e.getGuild().getId()), rethink); if (e.getMember().getRoles().contains(e.getGuild().getRoleById(rethinkServer.getRoleID()))) { e.getGuild().removeRoleFromMember(e.getMember(), e.getGuild().getRoleById(rethinkServer.getRoleID())).reason("Accepted rules").queue(); - } else e.getGuild().addRoleToMember(e.getMember(), e.getGuild().getRoleById(rethinkServer.getRoleID())).reason("Accepted rules").queue(); + } else + e.getGuild().addRoleToMember(e.getMember(), e.getGuild().getRoleById(rethinkServer.getRoleID())).reason("Accepted rules").queue(); } @Override public void onMessageReactionRemove(MessageReactionRemoveEvent e) { RethinkServer rethinkServer = new RethinkServer(rethink.getObjectByID("server", e.getGuild().getId()), rethink); if (e.getMessageId().equals(rethinkServer.getMessageID()) && !e.getUser().isBot()) { - e.getGuild().removeRoleFromMember(e.getMember(), e.getGuild().getRoleById(rethinkServer.getRoleID())).reason("Withdrawal of the acceptance of the rules").queue(); + e.getGuild().removeRoleFromMember(e.getMember(), e.getGuild().getRoleById(rethinkServer.getRoleID())).reason("Withdrawal of the acceptance of the rules").queue(); } } } diff --git a/src/main/java/com/bbn/hadder/listener/StarboardListener.java b/src/main/java/com/bbn/hadder/listener/StarboardListener.java index 2467ad5..060777b 100644 --- a/src/main/java/com/bbn/hadder/listener/StarboardListener.java +++ b/src/main/java/com/bbn/hadder/listener/StarboardListener.java @@ -16,8 +16,8 @@ package com.bbn.hadder.listener; -import com.bbn.hadder.Rethink; -import com.bbn.hadder.RethinkServer; +import com.bbn.hadder.db.Rethink; +import com.bbn.hadder.db.RethinkServer; import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.MessageBuilder; import net.dv8tion.jda.api.entities.MessageReaction; diff --git a/src/main/java/com/bbn/hadder/utils/EventWaiter.java b/src/main/java/com/bbn/hadder/utils/EventWaiter.java index 2d44b8c..c07120b 100644 --- a/src/main/java/com/bbn/hadder/utils/EventWaiter.java +++ b/src/main/java/com/bbn/hadder/utils/EventWaiter.java @@ -31,7 +31,7 @@ public class EventWaiter { Object listener = new ListenerAdapter() { @Override public void onGuildMessageReceived(@Nonnull GuildMessageReceivedEvent event) { - if (user==null) { + if (user == null) { onEvent.accept(event); event.getJDA().getShardManager().removeEventListener(this); } else if (event.getAuthor().getId().equals(user.getId())) { @@ -47,7 +47,7 @@ public class EventWaiter { Object listener = new ListenerAdapter() { @Override public void onGuildMessageReactionAdd(@Nonnull GuildMessageReactionAddEvent event) { - if (user==null) { + if (user == null) { onEvent.accept(event); event.getJDA().getShardManager().removeEventListener(this); } else if (event.getUser().getId().equals(user.getId())) { diff --git a/src/main/java/com/bbn/hadder/utils/MessageEditor.java b/src/main/java/com/bbn/hadder/utils/MessageEditor.java index c760b70..9485aa6 100644 --- a/src/main/java/com/bbn/hadder/utils/MessageEditor.java +++ b/src/main/java/com/bbn/hadder/utils/MessageEditor.java @@ -16,7 +16,7 @@ package com.bbn.hadder.utils; -import com.bbn.hadder.RethinkUser; +import com.bbn.hadder.db.RethinkUser; import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.entities.User; @@ -49,11 +49,12 @@ public class MessageEditor { } public EmbedBuilder getMessage(MessageType type, String title, String title_extra, String title_extra_two, - String description, String description_extra, String description_extra_two) { - String language = (this.user!=null) ? rethinkUser.getLanguage() : null; + String description, String description_extra, String description_extra_two) { + String language = (this.user != null) ? rethinkUser.getLanguage() : null; EmbedBuilder eb = this.getDefaultSettings(type); if (!"".equals(title)) eb.setTitle(this.handle(language, title, title_extra, title_extra_two)); - if (!"".equals(description)) eb.setDescription(this.handle(language, description, description_extra, description_extra_two)); + if (!"".equals(description)) + eb.setDescription(this.handle(language, description, description_extra, description_extra_two)); return eb; } @@ -133,6 +134,7 @@ public class MessageEditor { ResourceBundle resourceBundle = ResourceBundle.getBundle("Translations/Translations", locale); if (resourceBundle.containsKey(string)) return resourceBundle.getString(string).replaceAll("%extra%", extra).replaceAll("%extra_two%", extra_two); - else return "This key doesn't exist. Please report this to the Bot Developers. Key: `" + string + "` Language_code: `" + language_code + "`"; + else + return "This key doesn't exist. Please report this to the Bot Developers. Key: `" + string + "` Language_code: `" + language_code + "`"; } } diff --git a/src/main/resources/Translations/Translations_de.properties b/src/main/resources/Translations/Translations_de.properties index 6322a4d..1f826d7 100644 --- a/src/main/resources/Translations/Translations_de.properties +++ b/src/main/resources/Translations/Translations_de.properties @@ -23,7 +23,7 @@ success\! = Erfolgreich\! commands.fun.avatar.success.title = Avatar von %extra% commands.fun.avatar.error.title = Benutzer nicht gefunden commands.fun.avatar.error.description = Ich kann keinen Benutzer mit dieser ID finden\! -commands.fun.avatar.help.description = Sends the avatar of the specified Member. +commands.fun.avatar.help.description = Sendet das Avatar des angegebenen Mitglieds. commands.fun.gif.error.description = Bitte versuche es mit einem anderen Begriff erneut. commands.fun.gif.help.description = Sucht nach einem GIF auf Giphy. commands.fun.meme.success.title = Dein zufälliges Meme\: @@ -172,17 +172,17 @@ commands.moderation.rules.role.description = Die Regeln wurden erfolgreich festg commands.moderation.rules.role.error.title = Rolle existiert nicht commands.moderation.rules.role.error.description = Die angegebene Rolle existiert auf diesem Server nicht. commands.moderation.rules.role.permission.error.title = Keine Berechtigung -commands.moderation.rules.role.permission.error.description = Du kannst diese Rolle nicht auswählen, weil du keinen Zugriff auf sie hast. +commands.moderation.rules.role.permission.error.description = Du kannst diese Rolle nicht auswählen, da du keinen Zugriff auf sie hast. commands.moderation.rules.guild.error.title = Falsche Guild -commands.moderation.rules.guild.error.description = Der erwähnte Kanal muss auf diesem Server sein\! +commands.moderation.rules.guild.error.description = Der angegebene Kanal muss sich auf diesem Server befinden\! commands.moderation.rules.emote.accept.title = Benutzerdefiniertes Zustimmungsemote commands.moderation.rules.emote.accept.description = The role has been successfully set to %extra%. Now send me the emote on which your user should react to to get verified. commands.moderation.rules.emote.decline.title = Benutzerdefiniertes Ablehnungsemote commands.moderation.rules.emote.decline.description = The first emote has been successfully set to %extra%. Please send me now the decline emote. -commands.moderation.rules.emote.error.access.description = Ich kann auf die benutzerdefinierten Emote(s) nicht zugreifen. -commands.moderation.rules.emote.error.equal.title = Emotes sind gleich +commands.moderation.rules.emote.error.access.description = Ich kann auf benutzerdefinierten Emotes nicht zugreifen. +commands.moderation.rules.emote.error.equal.title = Die Emotes sind gleich commands.moderation.rules.emote.error.equal.description = Die zwei angegebenen Emotes sind gleich. -commands.moderation.rules.emoji.decline.description = Das erste Emote wurde erfolgreich festgelegt. Bitte sende mir jetzt das Ablehnungsemote. +commands.moderation.rules.emoji.decline.description = Das erste Emote wurde erfolgreich festgelegt. Bitte sende mir nun das Ablehnungsemote. commands.moderation.rules.emoji.error.description = Das angegebene Emote kann nicht verwendet werden. commands.moderation.rules.success.title = Regeln erfolgreich festgelegt commands.moderation.rules.success.description = Ich habe die Regeln erfolgreich in %extra% gesendet. @@ -223,13 +223,6 @@ commands.music.join.error.channel.description = Du befindest dich nicht in einem commands.music.join.error.permission.title = Keine Berechtigung commands.music.join.error.permission.description = Ich bin nicht Berechtigt deinem Sprachkanal beizutreten. commands.music.join.help.description = Tritt deinem Sprachkanal bei. -commands.music.leave.success.title = Verbindung erfolgreich getrennt -commands.music.leave.success.description = Ich habe die Verbindung zum Sprachkanal erfolgreich getrennt -commands.music.leave.error.channel.title = Kein Kanal -commands.music.leave.error.channel.description = Du musst im selben Sprachkanal wie der Bot sein. -commands.music.leave.error.connected.tile = Nicht verbunden -commands.music.leave.error.connected.description = Ich bin derzeit in keinem Sprachkanal auf diesem Server -commands.music.leave.help.description = Verlässt einen Sprachkanal. commands.music.play.load.title = %extra% Now loading %extra% commands.music.play.load.description = Versuche das Lied zu laden... commands.music.play.success.loading.title = %extra% Jetzt läuft %extra% @@ -332,6 +325,8 @@ commands.owner.blacklist.help.description = Blacklist a user for specific comman commands.settings.language.success.title = Sprache festgelegt commands.settings.language.success.description = `%extra%` ist jetzt deine neue Sprache. +commands.settings.language.error.title = Language not found +commands.settings.language.error.description = Please choose one of the following language codes\: %extra% commands.settings.language.help.description = Führt den angegebenen Code aus. commands.settings.prefix.success.title = Prefix erfolgreich gesetzt commands.settings.prefix.success.description = Ich habe erfolgreich den neuen Prefix für dich auf `%extra% `gesetzt. diff --git a/src/main/resources/Translations/Translations_en.properties b/src/main/resources/Translations/Translations_en.properties index 043a3f1..98016c1 100644 --- a/src/main/resources/Translations/Translations_en.properties +++ b/src/main/resources/Translations/Translations_en.properties @@ -223,13 +223,6 @@ commands.music.join.error.channel.description = You aren't in a Voice Channel. commands.music.join.error.permission.title = No permission commands.music.join.error.permission.description = I am not allowed to join your voice channel. commands.music.join.help.description = Joins your voice channel. -commands.music.leave.success.title = Successfully disconnected -commands.music.leave.success.description = I successfully disconnected from the Voice Channel -commands.music.leave.error.channel.title = No channel -commands.music.leave.error.channel.description = You have to be in the same voice channel as the bot. -commands.music.leave.error.connected.tile = Not connected -commands.music.leave.error.connected.description = I'm currently in no Voice Channel on this Guild -commands.music.leave.help.description = Leaves your voice channel. commands.music.play.load.title = %extra% Now loading %extra% commands.music.play.load.description = Trying to load the song... commands.music.play.success.loading.title = %extra% Now playing %extra% @@ -332,6 +325,8 @@ commands.owner.blacklist.help.description = Blacklist a user for specific comman commands.settings.language.success.title = Language set commands.settings.language.success.description = `%extra%` is your new language now. +commands.settings.language.error.title = Language not found +commands.settings.language.error.description = Please choose one of the following language codes\: %extra% commands.settings.language.help.description = Sets the new primary language for a user. commands.settings.prefix.success.title = Successfully set prefix commands.settings.prefix.success.description = I successfully set the new prefix for you to `%extra%`. diff --git a/src/main/resources/Translations/Translations_es.properties b/src/main/resources/Translations/Translations_es.properties index 043a3f1..98016c1 100644 --- a/src/main/resources/Translations/Translations_es.properties +++ b/src/main/resources/Translations/Translations_es.properties @@ -223,13 +223,6 @@ commands.music.join.error.channel.description = You aren't in a Voice Channel. commands.music.join.error.permission.title = No permission commands.music.join.error.permission.description = I am not allowed to join your voice channel. commands.music.join.help.description = Joins your voice channel. -commands.music.leave.success.title = Successfully disconnected -commands.music.leave.success.description = I successfully disconnected from the Voice Channel -commands.music.leave.error.channel.title = No channel -commands.music.leave.error.channel.description = You have to be in the same voice channel as the bot. -commands.music.leave.error.connected.tile = Not connected -commands.music.leave.error.connected.description = I'm currently in no Voice Channel on this Guild -commands.music.leave.help.description = Leaves your voice channel. commands.music.play.load.title = %extra% Now loading %extra% commands.music.play.load.description = Trying to load the song... commands.music.play.success.loading.title = %extra% Now playing %extra% @@ -332,6 +325,8 @@ commands.owner.blacklist.help.description = Blacklist a user for specific comman commands.settings.language.success.title = Language set commands.settings.language.success.description = `%extra%` is your new language now. +commands.settings.language.error.title = Language not found +commands.settings.language.error.description = Please choose one of the following language codes\: %extra% commands.settings.language.help.description = Sets the new primary language for a user. commands.settings.prefix.success.title = Successfully set prefix commands.settings.prefix.success.description = I successfully set the new prefix for you to `%extra%`. diff --git a/src/main/resources/Translations/Translations_fr.properties b/src/main/resources/Translations/Translations_fr.properties index 043a3f1..98016c1 100644 --- a/src/main/resources/Translations/Translations_fr.properties +++ b/src/main/resources/Translations/Translations_fr.properties @@ -223,13 +223,6 @@ commands.music.join.error.channel.description = You aren't in a Voice Channel. commands.music.join.error.permission.title = No permission commands.music.join.error.permission.description = I am not allowed to join your voice channel. commands.music.join.help.description = Joins your voice channel. -commands.music.leave.success.title = Successfully disconnected -commands.music.leave.success.description = I successfully disconnected from the Voice Channel -commands.music.leave.error.channel.title = No channel -commands.music.leave.error.channel.description = You have to be in the same voice channel as the bot. -commands.music.leave.error.connected.tile = Not connected -commands.music.leave.error.connected.description = I'm currently in no Voice Channel on this Guild -commands.music.leave.help.description = Leaves your voice channel. commands.music.play.load.title = %extra% Now loading %extra% commands.music.play.load.description = Trying to load the song... commands.music.play.success.loading.title = %extra% Now playing %extra% @@ -332,6 +325,8 @@ commands.owner.blacklist.help.description = Blacklist a user for specific comman commands.settings.language.success.title = Language set commands.settings.language.success.description = `%extra%` is your new language now. +commands.settings.language.error.title = Language not found +commands.settings.language.error.description = Please choose one of the following language codes\: %extra% commands.settings.language.help.description = Sets the new primary language for a user. commands.settings.prefix.success.title = Successfully set prefix commands.settings.prefix.success.description = I successfully set the new prefix for you to `%extra%`. diff --git a/src/main/resources/Translations/Translations_ru.properties b/src/main/resources/Translations/Translations_ru.properties index 043a3f1..98016c1 100644 --- a/src/main/resources/Translations/Translations_ru.properties +++ b/src/main/resources/Translations/Translations_ru.properties @@ -223,13 +223,6 @@ commands.music.join.error.channel.description = You aren't in a Voice Channel. commands.music.join.error.permission.title = No permission commands.music.join.error.permission.description = I am not allowed to join your voice channel. commands.music.join.help.description = Joins your voice channel. -commands.music.leave.success.title = Successfully disconnected -commands.music.leave.success.description = I successfully disconnected from the Voice Channel -commands.music.leave.error.channel.title = No channel -commands.music.leave.error.channel.description = You have to be in the same voice channel as the bot. -commands.music.leave.error.connected.tile = Not connected -commands.music.leave.error.connected.description = I'm currently in no Voice Channel on this Guild -commands.music.leave.help.description = Leaves your voice channel. commands.music.play.load.title = %extra% Now loading %extra% commands.music.play.load.description = Trying to load the song... commands.music.play.success.loading.title = %extra% Now playing %extra% @@ -332,6 +325,8 @@ commands.owner.blacklist.help.description = Blacklist a user for specific comman commands.settings.language.success.title = Language set commands.settings.language.success.description = `%extra%` is your new language now. +commands.settings.language.error.title = Language not found +commands.settings.language.error.description = Please choose one of the following language codes\: %extra% commands.settings.language.help.description = Sets the new primary language for a user. commands.settings.prefix.success.title = Successfully set prefix commands.settings.prefix.success.description = I successfully set the new prefix for you to `%extra%`. diff --git a/src/main/resources/Translations/Translations_tr.properties b/src/main/resources/Translations/Translations_tr.properties index 043a3f1..98016c1 100644 --- a/src/main/resources/Translations/Translations_tr.properties +++ b/src/main/resources/Translations/Translations_tr.properties @@ -223,13 +223,6 @@ commands.music.join.error.channel.description = You aren't in a Voice Channel. commands.music.join.error.permission.title = No permission commands.music.join.error.permission.description = I am not allowed to join your voice channel. commands.music.join.help.description = Joins your voice channel. -commands.music.leave.success.title = Successfully disconnected -commands.music.leave.success.description = I successfully disconnected from the Voice Channel -commands.music.leave.error.channel.title = No channel -commands.music.leave.error.channel.description = You have to be in the same voice channel as the bot. -commands.music.leave.error.connected.tile = Not connected -commands.music.leave.error.connected.description = I'm currently in no Voice Channel on this Guild -commands.music.leave.help.description = Leaves your voice channel. commands.music.play.load.title = %extra% Now loading %extra% commands.music.play.load.description = Trying to load the song... commands.music.play.success.loading.title = %extra% Now playing %extra% @@ -332,6 +325,8 @@ commands.owner.blacklist.help.description = Blacklist a user for specific comman commands.settings.language.success.title = Language set commands.settings.language.success.description = `%extra%` is your new language now. +commands.settings.language.error.title = Language not found +commands.settings.language.error.description = Please choose one of the following language codes\: %extra% commands.settings.language.help.description = Sets the new primary language for a user. commands.settings.prefix.success.title = Successfully set prefix commands.settings.prefix.success.description = I successfully set the new prefix for you to `%extra%`. diff --git a/src/main/resources/Translations/Translations_zh.properties b/src/main/resources/Translations/Translations_zh.properties index 043a3f1..98016c1 100644 --- a/src/main/resources/Translations/Translations_zh.properties +++ b/src/main/resources/Translations/Translations_zh.properties @@ -223,13 +223,6 @@ commands.music.join.error.channel.description = You aren't in a Voice Channel. commands.music.join.error.permission.title = No permission commands.music.join.error.permission.description = I am not allowed to join your voice channel. commands.music.join.help.description = Joins your voice channel. -commands.music.leave.success.title = Successfully disconnected -commands.music.leave.success.description = I successfully disconnected from the Voice Channel -commands.music.leave.error.channel.title = No channel -commands.music.leave.error.channel.description = You have to be in the same voice channel as the bot. -commands.music.leave.error.connected.tile = Not connected -commands.music.leave.error.connected.description = I'm currently in no Voice Channel on this Guild -commands.music.leave.help.description = Leaves your voice channel. commands.music.play.load.title = %extra% Now loading %extra% commands.music.play.load.description = Trying to load the song... commands.music.play.success.loading.title = %extra% Now playing %extra% @@ -332,6 +325,8 @@ commands.owner.blacklist.help.description = Blacklist a user for specific comman commands.settings.language.success.title = Language set commands.settings.language.success.description = `%extra%` is your new language now. +commands.settings.language.error.title = Language not found +commands.settings.language.error.description = Please choose one of the following language codes\: %extra% commands.settings.language.help.description = Sets the new primary language for a user. commands.settings.prefix.success.title = Successfully set prefix commands.settings.prefix.success.description = I successfully set the new prefix for you to `%extra%`.