From 321e3f67dbd79779ea6e7bc6d51ee0eef89d5621 Mon Sep 17 00:00:00 2001 From: Madpeter Date: Wed, 6 May 2020 17:34:44 +0100 Subject: [PATCH] New command: Balance returns the bots L$ value via smart target. --- Core/Commands/Self/Balance.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Core/Commands/Self/Balance.cs diff --git a/Core/Commands/Self/Balance.cs b/Core/Commands/Self/Balance.cs new file mode 100644 index 0000000..e39afa1 --- /dev/null +++ b/Core/Commands/Self/Balance.cs @@ -0,0 +1,17 @@ +namespace BSB.Commands.Self +{ + public class Balance : CoreCommand_SmartReply_1arg + { + public override string Helpfile { get { return "Requests the current balance and sends that via the smart reply target and then requests the balance to update."; } } + public override bool CallFunction(string[] args) + { + if(bot.GetAllowFunds == true) + { + bool status = bot.GetCommandsInterface.SmartCommandReply(args[0], bot.GetClient.Self.Balance.ToString(), CommandName); + bot.GetClient.Self.RequestBalance(); + return status; + } + return bot.GetCommandsInterface.SmartCommandReply(args[0], "0", CommandName); + } + } +}