forked from TheCurle/Camelot
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split moderation commands into their own module
- Loading branch information
1 parent
4467f96
commit 35ad492
Showing
7 changed files
with
74 additions
and
19 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
config/src/main/groovy/net/neoforged/camelot/config/module/Moderation.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package net.neoforged.camelot.config.module | ||
|
||
import groovy.transform.CompileStatic | ||
|
||
/** | ||
* The module that provides moderation commands. | ||
* <p> | ||
* The commands included in this module are: | ||
* <ul> | ||
* <li>{@code /warn add}, {@code /warn delete}</li> | ||
* <li>{@code /note add}, {@code /note remove}</li> | ||
* <li>{@code /mute}, {@code /unmute}</li> | ||
* <li>{@code /ban}, {@code /unban}</li> | ||
* <li>{@code /kick}</li> | ||
* <li>{@code /purge}</li> | ||
* </ul> | ||
*/ | ||
@CompileStatic | ||
class Moderation extends ModuleConfiguration { | ||
} |
4 changes: 4 additions & 0 deletions
4
config/src/main/groovy/net/neoforged/camelot/config/module/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** | ||
* The package containing the configurations of all Camelot modules. | ||
*/ | ||
package net.neoforged.camelot.config.module; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/main/java/net/neoforged/camelot/module/ModerationModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package net.neoforged.camelot.module; | ||
|
||
import com.google.auto.service.AutoService; | ||
import com.jagrosh.jdautilities.command.CommandClientBuilder; | ||
import net.neoforged.camelot.BotMain; | ||
import net.neoforged.camelot.commands.moderation.BanCommand; | ||
import net.neoforged.camelot.commands.moderation.KickCommand; | ||
import net.neoforged.camelot.commands.moderation.ModLogsCommand; | ||
import net.neoforged.camelot.commands.moderation.MuteCommand; | ||
import net.neoforged.camelot.commands.moderation.NoteCommand; | ||
import net.neoforged.camelot.commands.moderation.PurgeCommand; | ||
import net.neoforged.camelot.commands.moderation.UnbanCommand; | ||
import net.neoforged.camelot.commands.moderation.UnmuteCommand; | ||
import net.neoforged.camelot.commands.moderation.WarnCommand; | ||
import net.neoforged.camelot.config.module.Moderation; | ||
|
||
/** | ||
* The module that provides moderation commands. | ||
*/ | ||
@AutoService(CamelotModule.class) | ||
public class ModerationModule extends CamelotModule.Base<Moderation> { | ||
public ModerationModule() { | ||
super(Moderation.class); | ||
} | ||
|
||
@Override | ||
public String id() { | ||
return "moderation"; | ||
} | ||
|
||
@Override | ||
public void registerCommands(CommandClientBuilder builder) { | ||
builder.addSlashCommands( | ||
new ModLogsCommand(BotMain.BUTTON_MANAGER), | ||
new NoteCommand(), new WarnCommand(), | ||
new MuteCommand(), new UnmuteCommand(), | ||
new KickCommand(), new PurgeCommand(), | ||
new BanCommand(), new UnbanCommand() | ||
); | ||
} | ||
} |