beginnigs of ban command

This commit is contained in:
Venal 2018-02-11 20:07:20 -05:00
parent cfe7ec22e2
commit e31f5f1d6a
3 changed files with 40 additions and 0 deletions

View File

@ -6,10 +6,12 @@
<sourceOutputDir name="target/generated-sources/annotations" /> <sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" /> <outputRelativeToContentRoot value="true" />
<module name="Bot" />
<module name="Rixa" /> <module name="Rixa" />
</profile> </profile>
</annotationProcessing> </annotationProcessing>
<bytecodeTargetLevel> <bytecodeTargetLevel>
<module name="Bot" target="1.8" />
<module name="Rixa" target="1.8" /> <module name="Rixa" target="1.8" />
</bytecodeTargetLevel> </bytecodeTargetLevel>
</component> </component>

View File

@ -5,6 +5,7 @@ import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import io.rixa.bot.commands.cmds.admin.ConfigCommand; import io.rixa.bot.commands.cmds.admin.ConfigCommand;
import io.rixa.bot.commands.cmds.admin.PMCommand; import io.rixa.bot.commands.cmds.admin.PMCommand;
import io.rixa.bot.commands.cmds.general.*; import io.rixa.bot.commands.cmds.general.*;
import io.rixa.bot.commands.cmds.moderator.BanCommand;
import io.rixa.bot.commands.cmds.moderator.ClearCommand; import io.rixa.bot.commands.cmds.moderator.ClearCommand;
import io.rixa.bot.commands.cmds.moderator.MuteCommand; import io.rixa.bot.commands.cmds.moderator.MuteCommand;
import io.rixa.bot.commands.cmds.other.ShutdownCommand; import io.rixa.bot.commands.cmds.other.ShutdownCommand;
@ -113,6 +114,7 @@ public class Rixa {
private void registerCommands() { private void registerCommands() {
this.commandHandler.registerCommands( this.commandHandler.registerCommands(
new AdviceCommand("advice", RixaPermission.NONE, "Receive advice from the great beyond..."), new AdviceCommand("advice", RixaPermission.NONE, "Receive advice from the great beyond..."),
new BanCommand("ban", RixaPermission.BAN_MEMBER, "Ban a player from your server."),
new ClearCommand("clear", RixaPermission.CLEAR_CHAT, "Clear Chat!", Arrays.asList("deleemessages", "cmessages")), new ClearCommand("clear", RixaPermission.CLEAR_CHAT, "Clear Chat!", Arrays.asList("deleemessages", "cmessages")),
new ConfigCommand("config", RixaPermission.ACCESS_CONFIG, "Access the config menu"), new ConfigCommand("config", RixaPermission.ACCESS_CONFIG, "Access the config menu"),
new FeaturesCommand("features", RixaPermission.NONE, "List Rixa's official features!"), new FeaturesCommand("features", RixaPermission.NONE, "List Rixa's official features!"),

View File

@ -0,0 +1,36 @@
package io.rixa.bot.commands.cmds.moderator;
import io.rixa.bot.Rixa;
import io.rixa.bot.commands.Command;
import io.rixa.bot.commands.perms.RixaPermission;
import io.rixa.bot.guild.RixaGuild;
import io.rixa.bot.guild.manager.GuildManager;
import io.rixa.bot.utils.MessageFactory;
import jdk.nashorn.internal.objects.annotations.Getter;
import net.dv8tion.jda.core.entities.Guild;
import net.dv8tion.jda.core.entities.Member;
import net.dv8tion.jda.core.entities.TextChannel;
import java.util.List;
public class BanCommand extends Command {
RixaPermission permission;
public BanCommand(String command, RixaPermission permission, String descriptopn) {
super(command, permission, descriptopn);
this.permission = permission;
}
@Override
public void execute(String command, Guild guild, Member member, TextChannel channel, String[] args) {
RixaGuild rixaGuild = GuildManager.getInstance().getGuild(guild);
if (args.length < 1) {
MessageFactory.create(
String.format("Incorrect Usage! Example: `%s%s @User`", rixaGuild.getSettings().getPrefix(),
command)).setColor(member.getColor()).queue(channel);
}
}
}