Merge pull request #533 from BigBotNetwork/greg-dev

v1.3.16
This commit is contained in:
Skidder 2020-08-23 21:47:54 +02:00 committed by GitHub
commit 405e740de9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
55 changed files with 337 additions and 322 deletions

View file

@ -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

View file

@ -1,10 +1,8 @@
{
"Owners": [
],
"Database": {
"IP":"",
"IP": "",
"Port": 6775,
"DBName": "",
"Username": "",

343
pom.xml
View file

@ -1,180 +1,183 @@
<?xml version="1.0" encoding="UTF-8" ?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Hadder</groupId>
<artifactId>Hadder</artifactId>
<version>1.3.15</version>
<name>Hadder</name>
<inceptionYear>2019</inceptionYear>
<description>Hadder is a multi-purpose Discord bot.</description>
<url>https://github.com/BigBotNetwork/Hadder</url>
<modelVersion>4.0.0</modelVersion>
<groupId>Hadder</groupId>
<artifactId>Hadder</artifactId>
<version>1.3.16</version>
<name>Hadder</name>
<inceptionYear>2019</inceptionYear>
<description>Hadder is a multi-purpose Discord bot.</description>
<url>https://github.com/BigBotNetwork/Hadder</url>
<licenses>
<license>
<name>GNU Affero General Public License v3.0</name>
<url>https://www.gnu.org/licenses/agpl-3.0.en.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<licenses>
<license>
<name>GNU Affero General Public License v3.0</name>
<url>https://www.gnu.org/licenses/agpl-3.0.en.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.13</maven.compiler.source>
<maven.compiler.target>1.13</maven.compiler.target>
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss'Z'</maven.build.timestamp.format>
</properties>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.13</maven.compiler.source>
<maven.compiler.target>1.13</maven.compiler.target>
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss'Z'</maven.build.timestamp.format>
</properties>
<developers>
<developer>
<id>Hax#6775</id>
<name>Hax</name>
<email>hax@bigbotnetwork.com</email>
<url>https://bigbotnetwork.com/</url>
<timezone>Europe/Berlin</timezone>
<properties>
<picUrl>https://cdn.discordapp.com/avatars/261083609148948488/f2c9efc629ef65fffa634f0d63cd467e.webp</picUrl>
</properties>
</developer>
<developer>
<id>Skidder#6775</id>
<name>Greg</name>
<email>skidder@bigbotnetwork.com</email>
<url>https://bigbotnetwork.com/</url>
<timezone>Europe/Berlin</timezone>
<properties>
<picUrl>https://cdn.discordapp.com/avatars/401817301919465482/a_f81bd03e3862de579dec59241714d86d.gif</picUrl>
</properties>
</developer>
</developers>
<developers>
<developer>
<id>Hax#6775</id>
<name>Hax</name>
<email>hax@bigbotnetwork.com</email>
<url>https://bigbotnetwork.com/</url>
<timezone>Europe/Berlin</timezone>
<properties>
<picUrl>https://cdn.discordapp.com/avatars/261083609148948488/f2c9efc629ef65fffa634f0d63cd467e.webp
</picUrl>
</properties>
</developer>
<developer>
<id>Skidder#6775</id>
<name>Greg</name>
<email>skidder@bigbotnetwork.com</email>
<url>https://bigbotnetwork.com/</url>
<timezone>Europe/Berlin</timezone>
<properties>
<picUrl>https://cdn.discordapp.com/avatars/401817301919465482/a_f81bd03e3862de579dec59241714d86d.gif
</picUrl>
</properties>
</developer>
</developers>
<repositories>
<repository>
<id>jcenter</id>
<name>jcenter-bintray</name>
<url>https://jcenter.bintray.com</url>
</repository>
</repositories>
<repositories>
<repository>
<id>jcenter</id>
<name>jcenter-bintray</name>
<url>https://jcenter.bintray.com</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<version>3.6.3</version>
</dependency>
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>4.1.1_165</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20200518</version>
</dependency>
<dependency>
<groupId>com.rethinkdb</groupId>
<artifactId>rethinkdb-driver</artifactId>
<version>2.4.4</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.30</version>
</dependency>
<dependency>
<groupId>club.minnced</groupId>
<artifactId>discord-webhooks</artifactId>
<version>0.3.1</version>
</dependency>
<dependency>
<groupId>org.kohsuke</groupId>
<artifactId>github-api</artifactId>
<version>1.114</version>
</dependency>
<dependency>
<groupId>com.sedmelluq</groupId>
<artifactId>lavaplayer</artifactId>
<version>1.3.50</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.11.0</version>
</dependency>
</dependencies>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<version>3.6.3</version>
</dependency>
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>4.2.0_194</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20200518</version>
</dependency>
<dependency>
<groupId>com.rethinkdb</groupId>
<artifactId>rethinkdb-driver</artifactId>
<version>2.4.4</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.30</version>
</dependency>
<dependency>
<groupId>club.minnced</groupId>
<artifactId>discord-webhooks</artifactId>
<version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.kohsuke</groupId>
<artifactId>github-api</artifactId>
<version>1.116</version>
</dependency>
<dependency>
<groupId>com.sedmelluq</groupId>
<artifactId>lavaplayer</artifactId>
<version>1.3.50</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.11.2</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.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>com.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.0</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.1.0</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>13</source>
<target>13</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<finalName>Hadder-Build</finalName>
<archive>
<manifest>
<mainClass>com.bbn.hadder.Hadder</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</plugin>
</plugins>
</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>com.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.0</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>13</source>
<target>13</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<finalName>Hadder-Build</finalName>
<archive>
<manifest>
<mainClass>com.bbn.hadder.Hadder</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

@ -17,15 +17,20 @@
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;

View file

@ -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;

View file

@ -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;
}
}

View file

@ -16,13 +16,13 @@
package com.bbn.hadder.commands;
import com.bbn.hadder.db.Rethink;
import com.bbn.hadder.db.RethinkServer;
import com.bbn.hadder.db.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;

View file

@ -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",

View file

@ -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);
}

View file

@ -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();
}
}

View file

@ -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

View file

@ -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());

View file

@ -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

View file

@ -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();
}
}

View file

@ -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());
}

View file

@ -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");

View file

@ -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;

View file

@ -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 {

View file

@ -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();
}

View file

@ -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

View file

@ -31,7 +31,8 @@ public class RoleAssignmentCommand implements Command {
//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();
} else
e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue();
}
@Override

View file

@ -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();
}
}

View file

@ -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);

View file

@ -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) {

View file

@ -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();
}
}

View file

@ -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();
}

View file

@ -51,7 +51,7 @@ public class RecordCommand implements Command {
audioManager.openAudioConnection(event.getMember().getVoiceState().getChannel());
} else {
for (Map.Entry<String, Queue<byte[]>> key : queue.entrySet()) {
File file = new File("./"+event.getJDA().getUserById(key.getKey())+".wav");
File file = new File("./" + event.getJDA().getUserById(key.getKey()) + ".wav");
}

View file

@ -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 {

View file

@ -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

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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

View file

@ -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 {

View file

@ -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

View file

@ -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

View file

@ -16,11 +16,11 @@
package com.bbn.hadder.commands.owner;
import com.bbn.hadder.db.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<String> hashSet = new LinkedHashSet<>(commands);
ArrayList<String> 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;

View file

@ -52,7 +52,7 @@ public class LanguageCommand implements Command {
"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

View file

@ -37,7 +37,7 @@ public class UserPrefixCommand implements Command {
@Override
public String[] labels() {
return new String[] { "userprefix" };
return new String[]{"userprefix"};
}
@Override

View file

@ -16,13 +16,13 @@
package com.bbn.hadder.core;
import com.bbn.hadder.db.Rethink;
import com.bbn.hadder.db.RethinkServer;
import com.bbn.hadder.db.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;

View file

@ -16,11 +16,11 @@
package com.bbn.hadder.listener;
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 com.bbn.hadder.audio.AudioManager;
import com.bbn.hadder.core.CommandHandler;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.Permission;
import net.dv8tion.jda.api.entities.ChannelType;

View file

@ -16,8 +16,8 @@
package com.bbn.hadder.listener;
import com.bbn.hadder.db.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;

View file

@ -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")) {

View file

@ -5,11 +5,9 @@
package com.bbn.hadder.listener;
import com.bbn.hadder.core.Config;
import com.bbn.hadder.core.Perms;
import net.dv8tion.jda.api.entities.Emote;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import net.dv8tion.jda.api.hooks.ListenerAdapter;
import org.json.JSONObject;
import javax.annotation.Nonnull;
@ -28,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(" ");
}

View file

@ -16,8 +16,8 @@
package com.bbn.hadder.listener;
import com.bbn.hadder.db.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;

View file

@ -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();
}
}
}

View file

@ -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())) {

View file

@ -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 + "`";
}
}