Add message command in config

This commit is contained in:
BitHeaven 2025-01-22 10:52:55 +05:00
parent a73e43168c
commit 1a1038ceec
2 changed files with 10 additions and 1 deletions

View File

@ -52,7 +52,7 @@ public class DonateThread extends Thread {
lastDonate = objects.getInt("id");
DonPayIntegPlug.commands.addLast("title @a title \"" + msg.replace("{username}", objects.getJSONObject("vars").getString("name")) + "\"");
DonPayIntegPlug.commands.addLast(ConfigHandler.load().getMessageCmd().replace("{message}", msg.replace("{username}", objects.getJSONObject("vars").getString("name"))));
DonPayIntegPlug.commands.addLast(cmd.replace("{username}", objects.getJSONObject("vars").getString("name")));
logger.info(String.format("Exec donate #%d", lastDonate));

View File

@ -4,6 +4,7 @@ import java.util.List;
public class Config {
private String donpayToken = "<YOUR_TOKEN>";
private String messageCmd = "title @a title \"{message}\"";
private int reqCooldown = 15;
private int cmdCooldown = 2;
private int lastDonate = 0;
@ -49,4 +50,12 @@ public class Config {
public void setCmdCooldown(int cmdCooldown) {
this.cmdCooldown = cmdCooldown;
}
public String getMessageCmd() {
return messageCmd;
}
public void setMessageCmd(String messageCmd) {
this.messageCmd = messageCmd;
}
}