add toggle command
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 1m56s
/ Build BaseBand Installer (push) Successful in 35s
/ Build BaseBand Loader (push) Successful in 1m14s
/ Build BaseBand Server (push) Successful in 1m20s

This commit is contained in:
Daniella / Tove 2024-06-13 16:46:59 +02:00
parent 90480fccf4
commit f7737de145
Signed by: TudbuT
GPG key ID: B3CF345217F202D3
2 changed files with 32 additions and 0 deletions

View file

@ -66,6 +66,7 @@ public class Setup {
new Spotify(), new Spotify(),
new Test(), new Test(),
new Timer(), new Timer(),
new Toggle(),
new TPAccept(), new TPAccept(),
new Trigger(), new Trigger(),
new Trust(), new Trust(),

View file

@ -0,0 +1,31 @@
package de.com.baseband.client.feature.command;
import de.com.baseband.client.feature.Feature;
import de.com.baseband.client.feature.Features;
import de.com.baseband.client.feature.category.Command;
import de.com.baseband.client.feature.client.Client;
import de.com.baseband.client.util.interact.Chat;
@Command
public class Toggle extends Feature {
@Override
public void onCommand(String[] args) {
if(args.length != 1) {
Chat.print("Syntax: " + Client.prefix + this + " <module>");
return;
}
for (Feature feature : Features.features) {
if(feature.toString().equalsIgnoreCase(args[0])) {
feature.toggle();
return;
}
}
Chat.print("Toggled!");
}
@Override
public String toString() {
return "T";
}
}