You can now specify 'allin' instead of the amount when playing .wheel, .br and .bf

This commit is contained in:
Master Kwoth
2017-11-15 18:21:36 +01:00
parent 8c278fd1bd
commit 2a411a00a6
3 changed files with 54 additions and 11 deletions

View File

@ -15,16 +15,31 @@ namespace NadekoBot.Modules.Gambling
{
private readonly CurrencyService _cs;
private readonly IBotConfigProvider _bc;
private readonly DbService _db;
public WheelOfFortuneCommands(CurrencyService cs, IBotConfigProvider bc)
public WheelOfFortuneCommands(CurrencyService cs, IBotConfigProvider bc,
DbService db)
{
_cs = cs;
_bc = bc;
_db = db;
}
public enum Allin { Allin, All }
[NadekoCommand, Usage, Description, Aliases]
public Task WheelOfFortune(Allin _)
{
long cur;
using (var uow = _db.UnitOfWork)
{
cur = uow.Currency.GetUserCurrency(Context.User.Id);
}
return WheelOfFortune(cur);
}
[NadekoCommand, Usage, Description, Aliases]
[RequireContext(ContextType.Guild)]
public async Task WheelOfFortune(int bet)
public async Task WheelOfFortune(long bet)
{
const int minBet = 10;
if (bet < minBet)