Moves the Balance command into the info namespace
This commit is contained in:
parent
0b636fc648
commit
6fc33d558c
2 changed files with 21 additions and 17 deletions
21
Core/Commands/Info/Balance.cs
Normal file
21
Core/Commands/Info/Balance.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
namespace BSB.Commands.Info
|
||||||
|
{
|
||||||
|
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 (base.CallFunction(args) == true)
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in a new issue