Some music bot functionality added

This commit is contained in:
2020-07-22 02:40:56 -05:00
parent 4838eee050
commit 82a25dbe09
55 changed files with 1391 additions and 197 deletions

View File

@@ -0,0 +1,20 @@
package com.fpghoti.biscuit.commands.base;
import com.fpghoti.biscuit.commands.BaseCommand;
import com.fpghoti.biscuit.commands.CommandType;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
public abstract class ClientCommand extends BaseCommand{
public boolean called(String[] args, MessageReceivedEvent event) {
return true;
}
public abstract void execute(String[] args, MessageReceivedEvent event);
public CommandType getType() {
return CommandType.CLIENT;
}
}

View File

@@ -0,0 +1,14 @@
package com.fpghoti.biscuit.commands.base;
import com.fpghoti.biscuit.commands.BaseCommand;
import com.fpghoti.biscuit.commands.CommandType;
public abstract class ConsoleCommand extends BaseCommand{
public abstract void execute(String[] args);
public CommandType getType() {
return CommandType.CONSOLE;
}
}

View File

@@ -0,0 +1,56 @@
package com.fpghoti.biscuit.commands.base;
import com.fpghoti.biscuit.biscuit.Biscuit;
import com.fpghoti.biscuit.commands.BaseCommand;
import com.fpghoti.biscuit.commands.CommandType;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
public class CustomCommand extends BaseCommand {
public static String fixPlaceholders(MessageReceivedEvent event, String msg) {
msg = msg.replace("<user>", event.getAuthor().getAsMention());
return msg;
}
private String name;
private Biscuit biscuit;
public CustomCommand(String name, Biscuit biscuit) {
this.name = name;
this.biscuit = biscuit;
}
@Override
public String getName() {
return this.name;
}
@Override
public String getUsage() {
return biscuit.getProperties().getCommandSignifier() + name;
}
@Override
public String getDescription() {
String desc = biscuit.getConfig().getFromConfig("cc-" + name + "-description", biscuit);
if(desc == null) {
return "null";
}
return desc;
}
@Override
public CommandType getType() {
return null;
}
public String getMessage() {
String msg = biscuit.getConfig().getFromConfig("cc-" + name + "-message", biscuit);
if(msg == null) {
return "null";
}
return msg;
}
}

View File

@@ -0,0 +1,9 @@
package com.fpghoti.biscuit.commands.base;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
public abstract class MusicClientCommand extends ClientCommand{
public abstract void execute(String[] args, MessageReceivedEvent event);
}