fixed base amount in .vote
This commit is contained in:
parent
ced58d17c3
commit
682ecb6f08
2 changed files with 14 additions and 8 deletions
src/EllieBot/Modules
|
@ -3,6 +3,7 @@ using System.Globalization;
|
|||
using LinqToDB;
|
||||
using LinqToDB.EntityFrameworkCore;
|
||||
using EllieBot.Common.ModuleBehaviors;
|
||||
using EllieBot.Common.TypeReaders;
|
||||
using EllieBot.Db.Models;
|
||||
using EllieBot.Modules.Gambling.Common;
|
||||
using EllieBot.Modules.Gambling.Common.Connect4;
|
||||
|
@ -208,8 +209,9 @@ public class GamblingService : IEService, IReadyExecutor
|
|||
private string N(long amount)
|
||||
=> CurrencyHelper.N(amount, CultureInfo.InvariantCulture, _gcs.Data.Currency.Sign);
|
||||
|
||||
public async Task<(long val, string msg)> GetAmountAndMessage(ulong userId, long originalAmount)
|
||||
public async Task<(long val, string msg)> GetAmountAndMessage(ulong userId, long baseAmount)
|
||||
{
|
||||
var totalAmount = baseAmount;
|
||||
var gcsData = _gcs.Data;
|
||||
var boostGuilds = gcsData.BoostBonus.GuildIds ?? [];
|
||||
var guildUsers = await boostGuilds
|
||||
|
@ -232,19 +234,19 @@ public class GamblingService : IEService, IReadyExecutor
|
|||
var booster = userInfo != default;
|
||||
|
||||
if (booster)
|
||||
originalAmount += gcsData.BoostBonus.BaseTimelyBonus;
|
||||
totalAmount += gcsData.BoostBonus.BaseTimelyBonus;
|
||||
|
||||
var hasCompletedDailies = await _quests.UserCompletedDailies(userId);
|
||||
|
||||
if (hasCompletedDailies)
|
||||
originalAmount = (long)(1.5 * originalAmount);
|
||||
totalAmount = (long)(1.5 * totalAmount);
|
||||
|
||||
var patron = await _ps.GetPatronAsync(userId);
|
||||
var percentBonus = (_ps.PercentBonus(patron) / 100f);
|
||||
|
||||
originalAmount += (long)(originalAmount * percentBonus);
|
||||
totalAmount += (long)(totalAmount * percentBonus);
|
||||
|
||||
var msg = $"**{N(originalAmount)}** base reward\n\n";
|
||||
var msg = $"**{N(baseAmount)}** base reward\n\n";
|
||||
if (boostGuilds.Count > 0)
|
||||
{
|
||||
if (booster)
|
||||
|
@ -261,7 +263,7 @@ public class GamblingService : IEService, IReadyExecutor
|
|||
else
|
||||
msg += $"❌ *+0 bonus for the [Patreon](https://patreon.com/elliebot) pledge*\n";
|
||||
}
|
||||
|
||||
|
||||
if (hasCompletedDailies)
|
||||
{
|
||||
msg += $"✅ *+50% bonus for completing daily quests*\n";
|
||||
|
@ -271,6 +273,7 @@ public class GamblingService : IEService, IReadyExecutor
|
|||
msg += $"❌ *+0 bonus for completing daily quests*\n";
|
||||
}
|
||||
|
||||
return (originalAmount, msg);
|
||||
|
||||
return (totalAmount, msg);
|
||||
}
|
||||
}
|
|
@ -10,7 +10,7 @@ public partial class Searches
|
|||
public partial class FeedCommands : EllieModule<FeedsService>
|
||||
{
|
||||
private static readonly Regex _ytChannelRegex =
|
||||
new(@"youtube\.com\/(?:c\/|channel\/|user\/)?(?<channelid>[a-zA-Z0-9\-_]{1,})");
|
||||
MyRegex();
|
||||
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
|
@ -146,5 +146,8 @@ public partial class Searches
|
|||
})
|
||||
.SendAsync();
|
||||
}
|
||||
|
||||
[GeneratedRegex(@"youtube\.com\/(?:c\/|channel\/|user\/)?(?<channelid>[a-zA-Z0-9\-_]{1,})")]
|
||||
private static partial Regex MyRegex();
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue