diff --git a/src/main/java/me/chayapak1/chomens_bot/evalFunctions/GetBotUsernameFunction.java b/src/main/java/me/chayapak1/chomens_bot/evalFunctions/GetBotUsernameFunction.java new file mode 100644 index 0000000..8a37a9c --- /dev/null +++ b/src/main/java/me/chayapak1/chomens_bot/evalFunctions/GetBotUsernameFunction.java @@ -0,0 +1,15 @@ +package me.chayapak1.chomens_bot.evalFunctions; + +import me.chayapak1.chomens_bot.Bot; +import me.chayapak1.chomens_bot.data.eval.EvalFunction; + +public class GetBotUsernameFunction extends EvalFunction { + public GetBotUsernameFunction (Bot bot) { + super("getBotUsername", bot); + } + + @Override + public Output execute(Object... args) { + return new Output(bot.username, false); + } +} diff --git a/src/main/java/me/chayapak1/chomens_bot/plugins/EvalPlugin.java b/src/main/java/me/chayapak1/chomens_bot/plugins/EvalPlugin.java index f483d1c..b011ca5 100644 --- a/src/main/java/me/chayapak1/chomens_bot/plugins/EvalPlugin.java +++ b/src/main/java/me/chayapak1/chomens_bot/plugins/EvalPlugin.java @@ -7,10 +7,7 @@ import io.socket.client.Socket; import me.chayapak1.chomens_bot.Bot; import me.chayapak1.chomens_bot.data.eval.EvalFunction; import me.chayapak1.chomens_bot.data.eval.EvalOutput; -import me.chayapak1.chomens_bot.evalFunctions.ChatFunction; -import me.chayapak1.chomens_bot.evalFunctions.CoreFunction; -import me.chayapak1.chomens_bot.evalFunctions.CorePlaceBlockFunction; -import me.chayapak1.chomens_bot.evalFunctions.GetPlayerListFunction; +import me.chayapak1.chomens_bot.evalFunctions.*; import java.util.ArrayList; import java.util.HashMap; @@ -38,6 +35,7 @@ public class EvalPlugin { functions.add(new CorePlaceBlockFunction(bot)); functions.add(new ChatFunction(bot)); functions.add(new GetPlayerListFunction(bot)); + functions.add(new GetBotUsernameFunction(bot)); try { socket = IO.socket(bot.config.eval.address);