From 1a1038ceecea730939b9757926bde0469cd19d9d Mon Sep 17 00:00:00 2001 From: BitHeaven Date: Wed, 22 Jan 2025 10:52:55 +0500 Subject: [PATCH] Add message command in config --- .../java/ru/bitheaven/donpayintegplug/DonateThread.java | 2 +- .../java/ru/bitheaven/donpayintegplug/config/Config.java | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/ru/bitheaven/donpayintegplug/DonateThread.java b/src/main/java/ru/bitheaven/donpayintegplug/DonateThread.java index 786e840..0dcb40e 100644 --- a/src/main/java/ru/bitheaven/donpayintegplug/DonateThread.java +++ b/src/main/java/ru/bitheaven/donpayintegplug/DonateThread.java @@ -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)); diff --git a/src/main/java/ru/bitheaven/donpayintegplug/config/Config.java b/src/main/java/ru/bitheaven/donpayintegplug/config/Config.java index badea6d..e406491 100644 --- a/src/main/java/ru/bitheaven/donpayintegplug/config/Config.java +++ b/src/main/java/ru/bitheaven/donpayintegplug/config/Config.java @@ -4,6 +4,7 @@ import java.util.List; public class Config { private String donpayToken = ""; + 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; + } }