added timely boost bonus to gambling.yml

.betstats renamed to .gamblestats/.gs
added .betstats, .betstats <game> and .betstats <user> <game?> command which shows you your stats for gambling commands
This commit is contained in:
Toastie 2024-11-05 16:11:05 +13:00
parent 39297c6f83
commit 7da8f2c403
Signed by: toastie_t0ast
GPG key ID: 27F3B6855AFD40A4
21 changed files with 13690 additions and 6320 deletions
src/EllieBot/Db

View file

@ -62,6 +62,7 @@ public abstract class EllieContext : DbContext
public DbSet<ArchivedTodoListModel> TodosArchive { get; set; }
public DbSet<HoneypotChannel> HoneyPotChannels { get; set; }
// public DbSet<GuildColors> GuildColors { get; set; }
@ -73,7 +74,16 @@ public abstract class EllieContext : DbContext
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
#region Flag Translate
#region UserBetStats
modelBuilder.Entity<UserBetStats>()
.HasIndex(x => new { x.UserId, x.Game })
.IsUnique();
#endregion
#region Flag Translate
modelBuilder.Entity<FlagTranslateChannel>()
.HasIndex(x => new { x.GuildId, x.ChannelId })
@ -85,12 +95,12 @@ public abstract class EllieContext : DbContext
modelBuilder.Entity<NCPixel>()
.HasAlternateKey(x => x.Position);
modelBuilder.Entity<NCPixel>()
.HasIndex(x => x.OwnerId);
#endregion
#region QUOTES
var quoteEntity = modelBuilder.Entity<Quote>();
@ -307,10 +317,10 @@ public abstract class EllieContext : DbContext
var selfassignableRolesEntity = modelBuilder.Entity<SelfAssignedRole>();
selfassignableRolesEntity.HasIndex(s => new
{
s.GuildId,
s.RoleId
})
{
s.GuildId,
s.RoleId
})
.IsUnique();
selfassignableRolesEntity.Property(x => x.Group).HasDefaultValue(0);
@ -384,10 +394,10 @@ public abstract class EllieContext : DbContext
var xps = modelBuilder.Entity<UserXpStats>();
xps.HasIndex(x => new
{
x.UserId,
x.GuildId
})
{
x.UserId,
x.GuildId
})
.IsUnique();
xps.HasIndex(x => x.UserId);
@ -433,9 +443,9 @@ public abstract class EllieContext : DbContext
.OnDelete(DeleteBehavior.SetNull);
ci.HasIndex(x => new
{
x.Name
})
{
x.Name
})
.IsUnique();
#endregion
@ -554,10 +564,10 @@ public abstract class EllieContext : DbContext
.IsUnique(false);
rr2.HasIndex(x => new
{
x.MessageId,
x.Emote
})
{
x.MessageId,
x.Emote
})
.IsUnique();
});
@ -632,11 +642,11 @@ public abstract class EllieContext : DbContext
{
// user can own only one of each item
x.HasIndex(model => new
{
model.UserId,
model.ItemType,
model.ItemKey
})
{
model.UserId,
model.ItemType,
model.ItemKey
})
.IsUnique();
});
@ -661,10 +671,10 @@ public abstract class EllieContext : DbContext
#region Sticky Roles
modelBuilder.Entity<StickyRole>(sr => sr.HasIndex(x => new
{
x.GuildId,
x.UserId
})
{
x.GuildId,
x.UserId
})
.IsUnique());
#endregion
@ -709,10 +719,10 @@ public abstract class EllieContext : DbContext
modelBuilder
.Entity<GreetSettings>(gs => gs.HasIndex(x => new
{
x.GuildId,
x.GreetType
})
{
x.GuildId,
x.GreetType
})
.IsUnique());
modelBuilder.Entity<GreetSettings>(gs =>
@ -720,7 +730,7 @@ public abstract class EllieContext : DbContext
gs
.Property(x => x.IsEnabled)
.HasDefaultValue(false);
gs
.Property(x => x.AutoDeleteTimer)
.HasDefaultValue(0);