The ting goes grrrrra #46

Merged
Schlauer-Hax merged 4 commits from hax-dev into master 2019-11-03 16:49:48 +01:00
3 changed files with 55 additions and 9 deletions
Showing only changes of commit 51458771aa - Show all commits

10
pom.xml
View file

@ -35,22 +35,22 @@
<dependency>
<groupId>com.rethinkdb</groupId>
<artifactId>rethinkdb-driver</artifactId>
<version>LATEST</version>
<version>2.3.3</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>LATEST</version>
<version>2.8.6</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
<version>1.7.29</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.4</version>
<version>1.7.29</version>
</dependency>
</dependencies>
@ -71,7 +71,7 @@
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>

View file

@ -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.owner.TestCommand;
import com.bbn.hadder.commands.settings.PrefixCommand;
@ -24,7 +25,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!");
@ -47,8 +51,8 @@ public class Hadder {
builder.setToken(config.getString("Token"));
CommandHandler.cmdlist.addAll(List.of(new HelpCommand(), new TestCommand(), new BanCommand(), new PrefixCommand(), new ShutdownCommand(), new KickCommand(), new PingCommand(), new GifCommand(), new ClearCommand(), new GitHubCommand()));
CommandHandler.cmdlist.addAll(List.of(new HelpCommand(), new TestCommand(), new BanCommand(), new PrefixCommand(), new ShutdownCommand(), new KickCommand(), new PingCommand(), new GifCommand(), new ClearCommand(), new GitHubCommand(), new RebootCommand()));
builder.addEventListeners(
new MentionListener(),
new PrivateMessageListener(),
@ -61,7 +65,5 @@ public class Hadder {
} catch (LoginException e) {
e.printStackTrace();
}
}
}

View file

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