Compare commits
No commits in common. "v5" and "5.1.20" have entirely different histories.
8 changed files with 18 additions and 16 deletions
|
@ -1,4 +1,5 @@
|
||||||
using Microsoft.EntityFrameworkCore;
|
#nullable disable
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
using EllieBot.Db.Models;
|
using EllieBot.Db.Models;
|
||||||
|
|
||||||
namespace EllieBot.Db;
|
namespace EllieBot.Db;
|
||||||
|
@ -16,8 +17,6 @@ public static class SelfAssignableRolesExtensions
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IReadOnlyCollection<SelfAssignedRole> GetFromGuild(
|
public static IReadOnlyCollection<SelfAssignedRole> GetFromGuild(this DbSet<SelfAssignedRole> roles, ulong guildId)
|
||||||
this DbSet<SelfAssignedRole> roles,
|
|
||||||
ulong guildId)
|
|
||||||
=> roles.AsQueryable().Where(s => s.GuildId == guildId).ToArray();
|
=> roles.AsQueryable().Where(s => s.GuildId == guildId).ToArray();
|
||||||
}
|
}
|
|
@ -7,7 +7,7 @@ public static class MigrationQueries
|
||||||
{
|
{
|
||||||
public static void UpdateUsernames(MigrationBuilder migrationBuilder)
|
public static void UpdateUsernames(MigrationBuilder migrationBuilder)
|
||||||
{
|
{
|
||||||
migrationBuilder.Sql("UPDATE DiscordUser SET Username = '??' || Username WHERE Discriminator = '????';");
|
migrationBuilder.Sql("UPDATE DiscordUser SET Username = '??' + Username WHERE Discriminator = '????';");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void MigrateRero(MigrationBuilder migrationBuilder)
|
public static void MigrateRero(MigrationBuilder migrationBuilder)
|
||||||
|
|
|
@ -265,7 +265,7 @@ public partial class Gambling : GamblingModule<GamblingService>
|
||||||
{
|
{
|
||||||
msg += "\n\n";
|
msg += "\n\n";
|
||||||
if (booster)
|
if (booster)
|
||||||
msg += $"*+{N(Config.BoostBonus.BaseTimelyBonus)} bonus for boosting {userInfo.guild}!*\n";
|
msg += $"*+{N(Config.BoostBonus.BaseTimelyBonus)} bonus for boosting {userInfo.guild}!*";
|
||||||
|
|
||||||
if (percentBonus > float.Epsilon)
|
if (percentBonus > float.Epsilon)
|
||||||
msg +=
|
msg +=
|
||||||
|
|
|
@ -8,7 +8,7 @@ namespace EllieBot.Modules.Gambling.Services;
|
||||||
public sealed class UserBetStatsService : IEService
|
public sealed class UserBetStatsService : IEService
|
||||||
{
|
{
|
||||||
private const long RESET_MIN_PRICE = 1000;
|
private const long RESET_MIN_PRICE = 1000;
|
||||||
private const decimal RESET_TOTAL_MULTIPLIER = 0.002m;
|
private const decimal RESET_TOTAL_MULTIPLIER = 0.02m;
|
||||||
|
|
||||||
private readonly DbService _db;
|
private readonly DbService _db;
|
||||||
private readonly ICurrencyService _cs;
|
private readonly ICurrencyService _cs;
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#nullable disable
|
||||||
using LinqToDB;
|
using LinqToDB;
|
||||||
using LinqToDB.Data;
|
using LinqToDB.Data;
|
||||||
using LinqToDB.EntityFrameworkCore;
|
using LinqToDB.EntityFrameworkCore;
|
||||||
|
@ -52,7 +53,8 @@ public sealed class BlacklistService : IExecOnMessage, IReadyExecutor
|
||||||
|
|
||||||
private ValueTask OnReload(BlacklistEntry[] newBlacklist)
|
private ValueTask OnReload(BlacklistEntry[] newBlacklist)
|
||||||
{
|
{
|
||||||
newBlacklist ??= [];
|
if (newBlacklist is null)
|
||||||
|
return default;
|
||||||
|
|
||||||
blacklistedGuilds =
|
blacklistedGuilds =
|
||||||
new HashSet<ulong>(newBlacklist.Where(x => x.Type == BlacklistType.Server).Select(x => x.ItemId))
|
new HashSet<ulong>(newBlacklist.Where(x => x.Type == BlacklistType.Server).Select(x => x.ItemId))
|
||||||
|
@ -67,9 +69,9 @@ public sealed class BlacklistService : IExecOnMessage, IReadyExecutor
|
||||||
return default;
|
return default;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task<bool> ExecOnMessageAsync(IGuild? guild, IUserMessage usrMsg)
|
public Task<bool> ExecOnMessageAsync(IGuild guild, IUserMessage usrMsg)
|
||||||
{
|
{
|
||||||
if (guild is not null && blacklistedGuilds.Contains(guild.Id))
|
if (blacklistedGuilds.Contains(guild.Id))
|
||||||
{
|
{
|
||||||
Log.Information("Blocked input from blacklisted guild: {GuildName} [{GuildId}]",
|
Log.Information("Blocked input from blacklisted guild: {GuildName} [{GuildId}]",
|
||||||
guild.Name,
|
guild.Name,
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System.Text.RegularExpressions;
|
#nullable disable
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace EllieBot.Common.TypeReaders.Models;
|
namespace EllieBot.Common.TypeReaders.Models;
|
||||||
|
|
||||||
|
@ -8,8 +9,8 @@ public class StoopidTime
|
||||||
@"^(?:(?<months>\d)mo)?(?:(?<weeks>\d{1,2})w)?(?:(?<days>\d{1,2})d)?(?:(?<hours>\d{1,4})h)?(?:(?<minutes>\d{1,5})m)?(?:(?<seconds>\d{1,6})s)?$",
|
@"^(?:(?<months>\d)mo)?(?:(?<weeks>\d{1,2})w)?(?:(?<days>\d{1,2})d)?(?:(?<hours>\d{1,4})h)?(?:(?<minutes>\d{1,5})m)?(?:(?<seconds>\d{1,6})s)?$",
|
||||||
RegexOptions.Compiled | RegexOptions.Multiline);
|
RegexOptions.Compiled | RegexOptions.Multiline);
|
||||||
|
|
||||||
public string Input { get; set; } = string.Empty;
|
public string Input { get; set; }
|
||||||
public TimeSpan Time { get; set; } = default;
|
public TimeSpan Time { get; set; }
|
||||||
|
|
||||||
private StoopidTime() { }
|
private StoopidTime() { }
|
||||||
|
|
||||||
|
@ -52,8 +53,8 @@ public class StoopidTime
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static implicit operator TimeSpan?(StoopidTime? st)
|
public static implicit operator TimeSpan(StoopidTime st)
|
||||||
=> st?.Time;
|
=> st.Time;
|
||||||
|
|
||||||
public static implicit operator StoopidTime(TimeSpan ts)
|
public static implicit operator StoopidTime(TimeSpan ts)
|
||||||
=> new()
|
=> new()
|
||||||
|
|
|
@ -1517,7 +1517,7 @@ take:
|
||||||
betroll:
|
betroll:
|
||||||
desc: |-
|
desc: |-
|
||||||
Bets the specified amount of currency and rolls a dice.
|
Bets the specified amount of currency and rolls a dice.
|
||||||
Rolling over 65 yields x2 of your currency, over 90 - x4 and 100 x10.
|
Rolling over 66 yields x2 of your currency, over 90 - x4 and 100 x10.
|
||||||
You can specify 'all', 'half' or 'X%' instead of the amount to bet that part of your current balance.
|
You can specify 'all', 'half' or 'X%' instead of the amount to bet that part of your current balance.
|
||||||
ex:
|
ex:
|
||||||
- 5
|
- 5
|
||||||
|
|
Loading…
Reference in a new issue