Introducing Eval Command
This commit is contained in:
parent
399aade130
commit
53ef9fb1ff
4 changed files with 41 additions and 2 deletions
|
|
@ -71,6 +71,7 @@ public class Hadder {
|
||||||
new RulesCommand(),
|
new RulesCommand(),
|
||||||
new FeedbackCommand(),
|
new FeedbackCommand(),
|
||||||
new AvatarCommand(),
|
new AvatarCommand(),
|
||||||
|
new EvalCommand(),
|
||||||
new LinkCommand()), config, helpCommand);
|
new LinkCommand()), config, helpCommand);
|
||||||
|
|
||||||
builder.addEventListeners(
|
builder.addEventListeners(
|
||||||
|
|
|
||||||
38
src/main/java/com/bbn/hadder/commands/owner/EvalCommand.java
Normal file
38
src/main/java/com/bbn/hadder/commands/owner/EvalCommand.java
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.bbn.hadder.commands.owner;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @author Skidder / GregTCLTK
|
||||||
|
*/
|
||||||
|
|
||||||
|
import com.bbn.hadder.commands.Command;
|
||||||
|
import com.bbn.hadder.commands.CommandEvent;
|
||||||
|
import com.bbn.hadder.utils.MessageEditor;
|
||||||
|
import net.dv8tion.jda.api.EmbedBuilder;
|
||||||
|
|
||||||
|
public class EvalCommand implements Command {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void executed(String[] args, CommandEvent event) {
|
||||||
|
if (event.getConfig().getOwners().toString().contains(event.getAuthor().getId())) {
|
||||||
|
|
||||||
|
} 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[]{"eval"};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String description() {
|
||||||
|
return "You know what a eval command is ;)";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String usage() {
|
||||||
|
return "<Code to execute>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -15,7 +15,7 @@ public class RebootCommand implements Command {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void executed(String[] args, CommandEvent event) {
|
public void executed(String[] args, CommandEvent event) {
|
||||||
if (event.getAuthor().getId().equals("477141528981012511") || event.getAuthor().getId().equals("261083609148948488")) {
|
if (event.getConfig().getOwners().toString().contains(event.getAuthor().getId())) {
|
||||||
System.exit(69);
|
System.exit(69);
|
||||||
} else {
|
} else {
|
||||||
EmbedBuilder builder = new EmbedBuilder();
|
EmbedBuilder builder = new EmbedBuilder();
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import net.dv8tion.jda.api.EmbedBuilder;
|
||||||
public class ShutdownCommand implements Command {
|
public class ShutdownCommand implements Command {
|
||||||
@Override
|
@Override
|
||||||
public void executed(String[] args, CommandEvent event) {
|
public void executed(String[] args, CommandEvent event) {
|
||||||
if (event.getAuthor().getId().equals("477141528981012511") || event.getAuthor().getId().equals("261083609148948488")) {
|
if (event.getConfig().getOwners().toString().contains(event.getAuthor().getId())) {
|
||||||
EmbedBuilder builder = new EmbedBuilder();
|
EmbedBuilder builder = new EmbedBuilder();
|
||||||
event.getTextChannel().sendMessage(new MessageEditor().setDefaultSettings(MessageEditor.MessageType.INFO, builder).setTitle("Shutdown").build()).queue();
|
event.getTextChannel().sendMessage(new MessageEditor().setDefaultSettings(MessageEditor.MessageType.INFO, builder).setTitle("Shutdown").build()).queue();
|
||||||
event.getJDA().getShardManager().shutdown();
|
event.getJDA().getShardManager().shutdown();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue