From b1061cd877555c828aca68132d98ded393a49624 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Thu, 31 Oct 2019 19:51:13 +0100 Subject: [PATCH 1/7] startBot() --- src/main/java/com/bbn/hadder/Hadder.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/bbn/hadder/Hadder.java b/src/main/java/com/bbn/hadder/Hadder.java index ce583e1..9354014 100644 --- a/src/main/java/com/bbn/hadder/Hadder.java +++ b/src/main/java/com/bbn/hadder/Hadder.java @@ -4,6 +4,7 @@ import com.bbn.hadder.commands.general.*; import com.bbn.hadder.commands.fun.GifCommand; import com.bbn.hadder.commands.misc.GitHubCommand; import com.bbn.hadder.commands.moderation.*; +import com.bbn.hadder.commands.owner.RebootCommand; import com.bbn.hadder.commands.owner.ShutdownCommand; import com.bbn.hadder.commands.settings.PrefixCommand; import com.bbn.hadder.core.CommandHandler; @@ -23,7 +24,10 @@ import java.util.List; public class Hadder { public static void main(String[] args) { + startBot(); + } + public static void startBot() { File configfile = new File("./config.json"); if (!configfile.exists()) { System.err.println("No Config File Found!"); @@ -46,7 +50,7 @@ public class Hadder { builder.setToken(config.getString("Token")); - CommandHandler.cmdlist.addAll(List.of(new TestCommand(), new BanCommand(), new PrefixCommand(), new ShutdownCommand(), new KickCommand(), new PingCommand(), new GifCommand(), new ClearCommand(), new GitHubCommand())); + CommandHandler.cmdlist.addAll(List.of(new TestCommand(), new BanCommand(), new PrefixCommand(), new ShutdownCommand(), new KickCommand(), new PingCommand(), new GifCommand(), new ClearCommand(), new GitHubCommand(), new RebootCommand())); builder.addEventListeners( new MentionListener(), @@ -60,7 +64,5 @@ public class Hadder { } catch (LoginException e) { e.printStackTrace(); } - } - } From a36586f8d2efc3002bbfce2128b7a088572d34f9 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Thu, 31 Oct 2019 22:42:20 +0100 Subject: [PATCH 2/7] Restart Command without Restart xD --- .../hadder/commands/owner/RebootCommand.java | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/main/java/com/bbn/hadder/commands/owner/RebootCommand.java diff --git a/src/main/java/com/bbn/hadder/commands/owner/RebootCommand.java b/src/main/java/com/bbn/hadder/commands/owner/RebootCommand.java new file mode 100644 index 0000000..2e4c609 --- /dev/null +++ b/src/main/java/com/bbn/hadder/commands/owner/RebootCommand.java @@ -0,0 +1,44 @@ +package com.bbn.hadder.commands.owner; + +/* + * @author Skidder / GregTCLTK + */ + +import com.bbn.hadder.Rethink; +import com.bbn.hadder.commands.Command; +import com.bbn.hadder.utils.MessageEditor; +import net.dv8tion.jda.api.EmbedBuilder; +import net.dv8tion.jda.api.events.message.MessageReceivedEvent; + +import java.util.Timer; +import java.util.TimerTask; + +import static com.bbn.hadder.Hadder.startBot; + +public class RebootCommand implements Command { + + @Override + public void executed(String[] args, MessageReceivedEvent event) { + if (event.getAuthor().getId().equals("477141528981012511") || event.getAuthor().getId().equals("261083609148948488")) { + + } else { + EmbedBuilder builder = new EmbedBuilder(); + event.getTextChannel().sendMessage(new MessageEditor().setDefaultSettings(MessageEditor.Messagetype.NO_PERMISSION, builder).build()).queue(); + } + } + + @Override + public String[] labels() { + return new String[]{"restart"}; + } + + @Override + public String description() { + return "Restart the bot"; + } + + @Override + public String usage() { + return labels()[0]; + } +} From bdf58caac6aef642f93900ccc3c7950a7a94f875 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2019 09:38:12 +0000 Subject: [PATCH 3/7] Bump maven-resources-plugin from 3.0.2 to 3.1.0 Bumps [maven-resources-plugin](https://github.com/apache/maven-resources-plugin) from 3.0.2 to 3.1.0. - [Release notes](https://github.com/apache/maven-resources-plugin/releases) - [Commits](https://github.com/apache/maven-resources-plugin/compare/maven-resources-plugin-3.0.2...maven-resources-plugin-3.1.0) Signed-off-by: dependabot-preview[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b900e3b..ff2a74c 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ maven-resources-plugin - 3.0.2 + 3.1.0 maven-compiler-plugin From 56563b4857b33cb9407b9463076cc33629e8e7c5 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2019 09:38:14 +0000 Subject: [PATCH 4/7] Bump slf4j-api from 1.7.5 to 1.7.29 Bumps [slf4j-api](https://github.com/qos-ch/slf4j) from 1.7.5 to 1.7.29. - [Release notes](https://github.com/qos-ch/slf4j/releases) - [Commits](https://github.com/qos-ch/slf4j/commits) Signed-off-by: dependabot-preview[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b900e3b..80d1aed 100644 --- a/pom.xml +++ b/pom.xml @@ -45,7 +45,7 @@ org.slf4j slf4j-api - 1.7.5 + 1.7.29 org.slf4j From 84e8cb755de5ac700ad8f336070d26fc2c02c4fb Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2019 09:38:29 +0000 Subject: [PATCH 5/7] Bump rethinkdb-driver from LATEST to 2.3.3 Bumps [rethinkdb-driver](https://github.com/rethinkdb/rethinkdb) from LATEST to 2.3.3. - [Release notes](https://github.com/rethinkdb/rethinkdb/releases) - [Commits](https://github.com/rethinkdb/rethinkdb/commits/v2.3.3) Signed-off-by: dependabot-preview[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b900e3b..51afb1a 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ com.rethinkdb rethinkdb-driver - LATEST + 2.3.3 com.google.code.gson From 017e9c418ec3e5d2efc390b6d1ea2d5c73d35e35 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2019 09:38:48 +0000 Subject: [PATCH 6/7] Bump slf4j-simple from 1.6.4 to 1.7.29 Bumps [slf4j-simple](https://github.com/qos-ch/slf4j) from 1.6.4 to 1.7.29. - [Release notes](https://github.com/qos-ch/slf4j/releases) - [Commits](https://github.com/qos-ch/slf4j/commits) Signed-off-by: dependabot-preview[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b900e3b..a25b8fa 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ org.slf4j slf4j-simple - 1.6.4 + 1.7.29 From 45475f68d936726bec855f06d121a3193c78ad40 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2019 09:39:13 +0000 Subject: [PATCH 7/7] Bump gson from LATEST to 2.8.6 Bumps [gson](https://github.com/google/gson) from LATEST to 2.8.6. - [Release notes](https://github.com/google/gson/releases) - [Changelog](https://github.com/google/gson/blob/master/CHANGELOG.md) - [Commits](https://github.com/google/gson/commits/gson-parent-2.8.6) Signed-off-by: dependabot-preview[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b900e3b..0b7e11b 100644 --- a/pom.xml +++ b/pom.xml @@ -40,7 +40,7 @@ com.google.code.gson gson - LATEST + 2.8.6 org.slf4j