diff --git a/CHANGELOG.md b/CHANGELOG.md
index 59c682fe7..1142da5dd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,7 +8,7 @@ Experimental changelog. Mostly based on [keepachangelog](https://keepachangelog.
- `.shopadd command` You can now sell commands in the shop. The command will execute as if you were the one running it when someone buys it
- type `.h .shopadd` for more info
--
+- `.stickyroles` Users leaving the server will have their roles saved to the database and reapplied if they rejoin within 30 days.
## [4.3.22] - 23.04.2023
diff --git a/src/Nadeko.Bot.Common/Nadeko.Bot.Common.csproj b/src/Nadeko.Bot.Common/Nadeko.Bot.Common.csproj
index a29c7f445..ac4e7b67c 100644
--- a/src/Nadeko.Bot.Common/Nadeko.Bot.Common.csproj
+++ b/src/Nadeko.Bot.Common/Nadeko.Bot.Common.csproj
@@ -17,7 +17,7 @@
-
+
diff --git a/src/Nadeko.Bot.Db/Models/giveaway/GiveawayModel.cs b/src/Nadeko.Bot.Db/Models/giveaway/GiveawayModel.cs
new file mode 100644
index 000000000..2ce735bcb
--- /dev/null
+++ b/src/Nadeko.Bot.Db/Models/giveaway/GiveawayModel.cs
@@ -0,0 +1,12 @@
+namespace NadekoBot.Db.Models;
+
+public sealed class GiveawayModel
+{
+ public int Id { get; set; }
+ public ulong GuildId { get; set; }
+ public ulong MessageId { get; set; }
+ public string Message { get; set; }
+
+ public IList Participants { get; set; } = new List();
+ public DateTime EndsAt { get; set; }
+}
\ No newline at end of file
diff --git a/src/Nadeko.Bot.Db/Models/giveaway/GiveawayUser.cs b/src/Nadeko.Bot.Db/Models/giveaway/GiveawayUser.cs
new file mode 100644
index 000000000..a2779b4eb
--- /dev/null
+++ b/src/Nadeko.Bot.Db/Models/giveaway/GiveawayUser.cs
@@ -0,0 +1,9 @@
+namespace NadekoBot.Db.Models;
+
+public sealed class GiveawayUser
+{
+ public int Id { get; set; }
+ public int GiveawayId { get; set; }
+ public ulong UserId { get; set; }
+ public string Name { get; set; }
+}
\ No newline at end of file
diff --git a/src/Nadeko.Bot.Db/Nadeko.Bot.Db.csproj.DotSettings b/src/Nadeko.Bot.Db/Nadeko.Bot.Db.csproj.DotSettings
new file mode 100644
index 000000000..0227ccdcf
--- /dev/null
+++ b/src/Nadeko.Bot.Db/Nadeko.Bot.Db.csproj.DotSettings
@@ -0,0 +1,2 @@
+
+ True
\ No newline at end of file
diff --git a/src/Nadeko.Bot.Modules.Administration/Role/RoleCommands.cs b/src/Nadeko.Bot.Modules.Administration/Role/RoleCommands.cs
index 087a90791..736e45ec7 100644
--- a/src/Nadeko.Bot.Modules.Administration/Role/RoleCommands.cs
+++ b/src/Nadeko.Bot.Modules.Administration/Role/RoleCommands.cs
@@ -189,7 +189,7 @@ public partial class Administration
[Cmd]
[RequireContext(ContextType.Guild)]
[UserPerm(GuildPerm.Administrator)]
- [BotPerm(GuildPerm.Administrator)]
+ [BotPerm(GuildPerm.ManageRoles)]
public async Task StickyRoles()
{
var newState = await _stickyRoleSvc.ToggleStickyRoles(ctx.Guild.Id);
diff --git a/src/Nadeko.Bot.Modules.Administration/Role/StickyRolesService.cs b/src/Nadeko.Bot.Modules.Administration/Role/StickyRolesService.cs
index 71c35c2a7..679d64f35 100644
--- a/src/Nadeko.Bot.Modules.Administration/Role/StickyRolesService.cs
+++ b/src/Nadeko.Bot.Modules.Administration/Role/StickyRolesService.cs
@@ -79,7 +79,7 @@ public sealed class StickyRolesService : INService, IReadyExecutor
{
GuildId = guildId,
UserId = userId,
- RoleIds = string.Join(',', guRoles.Select(x => x.Id.ToString())),
+ RoleIds = string.Join(',', guRoles.Where(x => !x.IsEveryone && !x.IsManaged).Select(x => x.Id.ToString())),
DateAdded = DateTime.UtcNow
});
}
diff --git a/src/Nadeko.Bot.Modules.Utility/Giveaway/GiveawayCommands.cs b/src/Nadeko.Bot.Modules.Utility/Giveaway/GiveawayCommands.cs
new file mode 100644
index 000000000..4ed420726
--- /dev/null
+++ b/src/Nadeko.Bot.Modules.Utility/Giveaway/GiveawayCommands.cs
@@ -0,0 +1,114 @@
+namespace NadekoBot.Modules.Utility;
+
+public partial class Utility
+{
+ [Name("Giveaways")]
+ [Group("ga")]
+ public partial class GiveawayCommands : NadekoModule
+ {
+ [Cmd]
+ [UserPerm(GuildPerm.ManageMessages)]
+ [BotPerm(ChannelPerm.ManageMessages | ChannelPerm.AddReactions)]
+ public async Task GiveawayStart(TimeSpan duration, [Leftover] string message)
+ {
+ if (duration > TimeSpan.FromDays(30))
+ {
+ await ReplyErrorLocalizedAsync(strs.giveaway_duration_invalid);
+ return;
+ }
+
+ var eb = _eb.Create(ctx)
+ .WithPendingColor()
+ .WithTitle(GetText(strs.giveaway_starting))
+ .WithDescription(message);
+
+ var startingMsg = await ctx.Channel.EmbedAsync(eb);
+
+ var maybeId =
+ await _service.StartGiveawayAsync(ctx.Guild.Id, ctx.Channel.Id, startingMsg.Id, duration, message);
+
+
+ if (maybeId is not int id)
+ {
+ await startingMsg.DeleteAsync();
+ await ReplyErrorLocalizedAsync(strs.giveaway_max_amount_reached);
+ return;
+ }
+
+ eb
+ .WithTitle(GetText(strs.giveaway_started))
+ .WithFooter($"id: {new kwum(id).ToString()}");
+
+ await startingMsg.AddReactionAsync(new Emoji(GiveawayService.GiveawayEmoji));
+ await startingMsg.ModifyAsync(x => x.Embed = eb.Build());
+ }
+
+ [Cmd]
+ [UserPerm(GuildPerm.ManageMessages)]
+ public async Task GiveawayEnd(kwum id)
+ {
+ var (giveaway, winner) = await _service.EndGiveawayAsync(ctx.Guild.Id, id);
+
+ if (winner is null || giveaway is null)
+ return;
+
+ var eb = _eb.Create(ctx)
+ .WithOkColor()
+ .WithTitle(GetText(strs.giveaway_ended))
+ .WithDescription(giveaway.Message)
+ .AddField(GetText(strs.winner),
+ $"""
+ {winner.Name}
+ <@{winner.UserId}>
+ {Format.Code(winner.UserId.ToString())}
+ """,
+ true);
+
+ await ctx.Channel.EmbedAsync(eb);
+ }
+
+ [Cmd]
+ [UserPerm(GuildPerm.ManageMessages)]
+ public async Task GiveawayReroll(kwum id)
+ {
+ }
+
+ [Cmd]
+ [UserPerm(GuildPerm.ManageMessages)]
+ public async Task GiveawayCancel(kwum id)
+ {
+ var success = await _service.CancelGiveawayAsync(ctx.Guild.Id, id);
+
+ if (!success)
+ {
+ await ReplyConfirmLocalizedAsync(strs.giveaway_not_found);
+ return;
+ }
+
+ await ReplyConfirmLocalizedAsync(strs.giveaway_cancelled);
+ }
+
+ [Cmd]
+ [UserPerm(GuildPerm.ManageMessages)]
+ public async Task GiveawayList()
+ {
+ var giveaways = await _service.GetGiveawaysAsync(ctx.Guild.Id);
+
+ if (!giveaways.Any())
+ {
+ await ReplyErrorLocalizedAsync(strs.no_givaways);
+ return;
+ }
+
+ var eb = _eb.Create(ctx)
+ .WithOkColor();
+
+ foreach (var g in giveaways)
+ {
+ eb.AddField($"id: {new kwum(g.Id)}", g.Message, true);
+ }
+
+ await ctx.Channel.EmbedAsync(eb);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Nadeko.Bot.Modules.Utility/Giveaway/GiveawayService.cs b/src/Nadeko.Bot.Modules.Utility/Giveaway/GiveawayService.cs
new file mode 100644
index 000000000..0970ab2b9
--- /dev/null
+++ b/src/Nadeko.Bot.Modules.Utility/Giveaway/GiveawayService.cs
@@ -0,0 +1,209 @@
+using LinqToDB;
+using LinqToDB.EntityFrameworkCore;
+using NadekoBot.Common.ModuleBehaviors;
+using NadekoBot.Db.Models;
+
+namespace NadekoBot.Modules.Utility;
+
+public sealed class GiveawayService : INService, IReadyExecutor
+{
+ public static string GiveawayEmoji = "🎉";
+
+ private readonly DbService _db;
+ private readonly IBotCredentials _creds;
+ private readonly DiscordSocketClient _client;
+ private GiveawayModel[] _shardGiveaways;
+ private readonly NadekoRandom _rng;
+
+ public GiveawayService(DbService db, IBotCredentials creds, DiscordSocketClient client)
+ {
+ _db = db;
+ _creds = creds;
+ _client = client;
+ _rng = new NadekoRandom();
+
+
+ _client.ReactionAdded += OnReactionAdded;
+ _client.ReactionRemoved += OnReactionRemoved;
+ }
+
+ private async Task OnReactionRemoved(Cacheable msg,
+ Cacheable arg2,
+ SocketReaction r)
+ {
+ if (!r.User.IsSpecified)
+ return;
+
+ var user = r.User.Value;
+
+ if (user.IsBot || user.IsWebhook)
+ return;
+
+ if (r.Emote is Emoji e && e.Name == GiveawayEmoji)
+ {
+ await LeaveGivawayAsync(msg.Id, user.Id);
+ }
+ }
+
+ private async Task OnReactionAdded(Cacheable msg, Cacheable ch,
+ SocketReaction r)
+ {
+ if (!r.User.IsSpecified)
+ return;
+
+ var user = r.User.Value;
+
+ if (user.IsBot || user.IsWebhook)
+ return;
+
+ var textChannel = ch.Value as ITextChannel;
+
+ if (textChannel is null)
+ return;
+
+
+ if (r.Emote is Emoji e && e.Name == GiveawayEmoji)
+ {
+ await JoinGivawayAsync(msg.Id, user.Id, user.Username);
+ }
+ }
+
+ public async Task OnReadyAsync()
+ {
+ // load giveaways for this shard from the database
+ await using var ctx = _db.GetDbContext();
+
+ _shardGiveaways = await ctx
+ .GetTable()
+ .Where(x => Linq2DbExpressions.GuildOnShard(x.GuildId, _creds.TotalShards, _client.ShardId))
+ .ToArrayAsync();
+ }
+
+ public async Task StartGiveawayAsync(ulong guildId, ulong channelId, ulong messageId, TimeSpan duration,
+ string message)
+ {
+ await using var ctx = _db.GetDbContext();
+
+ // first check if there are more than 5 giveaways
+ var count = await ctx
+ .GetTable()
+ .CountAsync(x => x.GuildId == guildId);
+
+ if (count >= 5)
+ return null;
+
+ var endsAt = DateTime.UtcNow + duration;
+ var output = await ctx.GetTable()
+ .InsertWithOutputAsync(() => new GiveawayModel
+ {
+ GuildId = guildId,
+ MessageId = messageId,
+ Message = message,
+ EndsAt = endsAt,
+ });
+
+ return output.Id;
+ }
+
+
+ public async Task<(GiveawayModel? giveaway, GiveawayUser? winner)> EndGiveawayAsync(ulong guildId, int id)
+ {
+ await using var ctx = _db.GetDbContext();
+
+ var giveaway = await ctx
+ .GetTable()
+ .Where(x => x.GuildId == guildId && x.Id == id)
+ .LoadWith(x => x.Participants)
+ .FirstOrDefaultAsyncLinqToDB();
+
+ if (giveaway is null)
+ return default;
+
+ await ctx
+ .GetTable()
+ .Where(x => x.Id == id)
+ .DeleteAsync();
+
+ if (giveaway.Participants.Count == 0)
+ return default;
+
+ if (giveaway.Participants.Count == 1)
+ return (giveaway, giveaway.Participants[0]);
+
+ return (giveaway, giveaway.Participants[_rng.Next(0, giveaway.Participants.Count - 1)]);
+ }
+
+ public async Task RerollGiveawayAsync(ulong guildId, int id)
+ {
+ }
+
+ public async Task CancelGiveawayAsync(ulong guildId, int id)
+ {
+ await using var ctx = _db.GetDbContext();
+
+ var count = await ctx
+ .GetTable()
+ .Where(x => x.GuildId == guildId && x.Id == id)
+ .DeleteAsync();
+
+ // todo clear cache
+
+ return count > 0;
+ }
+
+ public async Task> GetGiveawaysAsync(ulong guildId)
+ {
+ await using var ctx = _db.GetDbContext();
+
+ return await ctx
+ .GetTable()
+ .Where(x => x.GuildId == guildId)
+ .ToListAsync();
+ }
+
+ public async Task JoinGivawayAsync(ulong messageId, ulong userId, string userName)
+ {
+ await using var ctx = _db.GetDbContext();
+
+ var giveaway = await ctx
+ .GetTable()
+ .Where(x => x.MessageId == messageId)
+ .FirstOrDefaultAsyncLinqToDB();
+
+ if (giveaway is null)
+ return false;
+
+ // add the user to the database
+ await ctx.GetTable()
+ .InsertAsync(
+ () => new GiveawayUser()
+ {
+ UserId = userId,
+ GiveawayId = giveaway.Id,
+ Name = userName,
+ }
+ );
+
+ return true;
+ }
+
+ public async Task LeaveGivawayAsync(ulong messageId, ulong userId)
+ {
+ await using var ctx = _db.GetDbContext();
+
+ var giveaway = await ctx
+ .GetTable()
+ .Where(x => x.MessageId == messageId)
+ .FirstOrDefaultAsyncLinqToDB();
+
+ if (giveaway is null)
+ return false;
+
+ await ctx
+ .GetTable()
+ .Where(x => x.UserId == userId && x.GiveawayId == giveaway.Id)
+ .DeleteAsync();
+
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/src/Nadeko.Bot.Modules.Utility/Nadeko.Bot.Modules.Utility.csproj b/src/Nadeko.Bot.Modules.Utility/Nadeko.Bot.Modules.Utility.csproj
index e83c2e026..b9c7e8e0a 100644
--- a/src/Nadeko.Bot.Modules.Utility/Nadeko.Bot.Modules.Utility.csproj
+++ b/src/Nadeko.Bot.Modules.Utility/Nadeko.Bot.Modules.Utility.csproj
@@ -24,8 +24,4 @@
-
-
-
-
diff --git a/src/NadekoBot/Db/NadekoContext.cs b/src/NadekoBot/Db/NadekoContext.cs
index 96600b246..8a2f666d0 100644
--- a/src/NadekoBot/Db/NadekoContext.cs
+++ b/src/NadekoBot/Db/NadekoContext.cs
@@ -493,6 +493,25 @@ public abstract class NadekoContext : DbContext
}).IsUnique());
#endregion
+
+
+ #region Giveaway
+
+ modelBuilder.Entity()
+ .HasMany(x => x.Participants)
+ .WithOne()
+ .HasForeignKey(x => x.GiveawayId)
+ .OnDelete(DeleteBehavior.Cascade);
+
+ modelBuilder.Entity(gu => gu
+ .HasIndex(x => new
+ {
+ x.GiveawayId,
+ x.UserId
+ })
+ .IsUnique());
+
+ #endregion
}
#if DEBUG
diff --git a/src/NadekoBot/Migrations/Mysql/20240424152958_giveaway.Designer.cs b/src/NadekoBot/Migrations/Mysql/20240424152958_giveaway.Designer.cs
new file mode 100644
index 000000000..1a87a9cd6
--- /dev/null
+++ b/src/NadekoBot/Migrations/Mysql/20240424152958_giveaway.Designer.cs
@@ -0,0 +1,3907 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Nadeko.Bot.Db;
+
+#nullable disable
+
+namespace NadekoBot.Db.Migrations.Mysql
+{
+ [DbContext(typeof(MysqlContext))]
+ [Migration("20240424152958_giveaway")]
+ partial class giveaway
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.3")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.AntiAltSetting", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Action")
+ .HasColumnType("int")
+ .HasColumnName("action");
+
+ b.Property("ActionDurationMinutes")
+ .HasColumnType("int")
+ .HasColumnName("actiondurationminutes");
+
+ b.Property("GuildConfigId")
+ .HasColumnType("int")
+ .HasColumnName("guildconfigid");
+
+ b.Property("MinAge")
+ .HasColumnType("time(6)")
+ .HasColumnName("minage");
+
+ b.Property("RoleId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("roleid");
+
+ b.HasKey("Id")
+ .HasName("pk_antialtsetting");
+
+ b.HasIndex("GuildConfigId")
+ .IsUnique()
+ .HasDatabaseName("ix_antialtsetting_guildconfigid");
+
+ b.ToTable("antialtsetting", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.AntiRaidSetting", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Action")
+ .HasColumnType("int")
+ .HasColumnName("action");
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("GuildConfigId")
+ .HasColumnType("int")
+ .HasColumnName("guildconfigid");
+
+ b.Property("PunishDuration")
+ .HasColumnType("int")
+ .HasColumnName("punishduration");
+
+ b.Property("Seconds")
+ .HasColumnType("int")
+ .HasColumnName("seconds");
+
+ b.Property("UserThreshold")
+ .HasColumnType("int")
+ .HasColumnName("userthreshold");
+
+ b.HasKey("Id")
+ .HasName("pk_antiraidsetting");
+
+ b.HasIndex("GuildConfigId")
+ .IsUnique()
+ .HasDatabaseName("ix_antiraidsetting_guildconfigid");
+
+ b.ToTable("antiraidsetting", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.AntiSpamIgnore", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("AntiSpamSettingId")
+ .HasColumnType("int")
+ .HasColumnName("antispamsettingid");
+
+ b.Property("ChannelId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("channelid");
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.HasKey("Id")
+ .HasName("pk_antispamignore");
+
+ b.HasIndex("AntiSpamSettingId")
+ .HasDatabaseName("ix_antispamignore_antispamsettingid");
+
+ b.ToTable("antispamignore", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.AntiSpamSetting", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Action")
+ .HasColumnType("int")
+ .HasColumnName("action");
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("GuildConfigId")
+ .HasColumnType("int")
+ .HasColumnName("guildconfigid");
+
+ b.Property("MessageThreshold")
+ .HasColumnType("int")
+ .HasColumnName("messagethreshold");
+
+ b.Property("MuteTime")
+ .HasColumnType("int")
+ .HasColumnName("mutetime");
+
+ b.Property("RoleId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("roleid");
+
+ b.HasKey("Id")
+ .HasName("pk_antispamsetting");
+
+ b.HasIndex("GuildConfigId")
+ .IsUnique()
+ .HasDatabaseName("ix_antispamsetting_guildconfigid");
+
+ b.ToTable("antispamsetting", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.AutoCommand", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("ChannelId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("channelid");
+
+ b.Property("ChannelName")
+ .HasColumnType("longtext")
+ .HasColumnName("channelname");
+
+ b.Property("CommandText")
+ .HasColumnType("longtext")
+ .HasColumnName("commandtext");
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("GuildId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("guildid");
+
+ b.Property("GuildName")
+ .HasColumnType("longtext")
+ .HasColumnName("guildname");
+
+ b.Property("Interval")
+ .HasColumnType("int")
+ .HasColumnName("interval");
+
+ b.Property("VoiceChannelId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("voicechannelid");
+
+ b.Property("VoiceChannelName")
+ .HasColumnType("longtext")
+ .HasColumnName("voicechannelname");
+
+ b.HasKey("Id")
+ .HasName("pk_autocommands");
+
+ b.ToTable("autocommands", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.AutoTranslateChannel", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("AutoDelete")
+ .HasColumnType("tinyint(1)")
+ .HasColumnName("autodelete");
+
+ b.Property("ChannelId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("channelid");
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("GuildId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("guildid");
+
+ b.HasKey("Id")
+ .HasName("pk_autotranslatechannels");
+
+ b.HasIndex("ChannelId")
+ .IsUnique()
+ .HasDatabaseName("ix_autotranslatechannels_channelid");
+
+ b.HasIndex("GuildId")
+ .HasDatabaseName("ix_autotranslatechannels_guildid");
+
+ b.ToTable("autotranslatechannels", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.AutoTranslateUser", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("ChannelId")
+ .HasColumnType("int")
+ .HasColumnName("channelid");
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("Source")
+ .HasColumnType("longtext")
+ .HasColumnName("source");
+
+ b.Property("Target")
+ .HasColumnType("longtext")
+ .HasColumnName("target");
+
+ b.Property("UserId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("userid");
+
+ b.HasKey("Id")
+ .HasName("pk_autotranslateusers");
+
+ b.HasAlternateKey("ChannelId", "UserId")
+ .HasName("ak_autotranslateusers_channelid_userid");
+
+ b.ToTable("autotranslateusers", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.BanTemplate", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("GuildId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("guildid");
+
+ b.Property("PruneDays")
+ .HasColumnType("int")
+ .HasColumnName("prunedays");
+
+ b.Property("Text")
+ .HasColumnType("longtext")
+ .HasColumnName("text");
+
+ b.HasKey("Id")
+ .HasName("pk_bantemplates");
+
+ b.HasIndex("GuildId")
+ .IsUnique()
+ .HasDatabaseName("ix_bantemplates_guildid");
+
+ b.ToTable("bantemplates", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.BlacklistEntry", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("ItemId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("itemid");
+
+ b.Property("Type")
+ .HasColumnType("int")
+ .HasColumnName("type");
+
+ b.HasKey("Id")
+ .HasName("pk_blacklist");
+
+ b.ToTable("blacklist", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.CommandAlias", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("GuildConfigId")
+ .HasColumnType("int")
+ .HasColumnName("guildconfigid");
+
+ b.Property("Mapping")
+ .HasColumnType("longtext")
+ .HasColumnName("mapping");
+
+ b.Property("Trigger")
+ .HasColumnType("longtext")
+ .HasColumnName("trigger");
+
+ b.HasKey("Id")
+ .HasName("pk_commandalias");
+
+ b.HasIndex("GuildConfigId")
+ .HasDatabaseName("ix_commandalias_guildconfigid");
+
+ b.ToTable("commandalias", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.CommandCooldown", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("CommandName")
+ .HasColumnType("longtext")
+ .HasColumnName("commandname");
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("GuildConfigId")
+ .HasColumnType("int")
+ .HasColumnName("guildconfigid");
+
+ b.Property("Seconds")
+ .HasColumnType("int")
+ .HasColumnName("seconds");
+
+ b.HasKey("Id")
+ .HasName("pk_commandcooldown");
+
+ b.HasIndex("GuildConfigId")
+ .HasDatabaseName("ix_commandcooldown_guildconfigid");
+
+ b.ToTable("commandcooldown", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.CurrencyTransaction", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Amount")
+ .HasColumnType("bigint")
+ .HasColumnName("amount");
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("Extra")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnName("extra");
+
+ b.Property("Note")
+ .HasColumnType("longtext")
+ .HasColumnName("note");
+
+ b.Property("OtherId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("otherid")
+ .HasDefaultValueSql("NULL");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasColumnType("longtext")
+ .HasColumnName("type");
+
+ b.Property("UserId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("userid");
+
+ b.HasKey("Id")
+ .HasName("pk_currencytransactions");
+
+ b.HasIndex("UserId")
+ .HasDatabaseName("ix_currencytransactions_userid");
+
+ b.ToTable("currencytransactions", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.DelMsgOnCmdChannel", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("ChannelId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("channelid");
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("GuildConfigId")
+ .HasColumnType("int")
+ .HasColumnName("guildconfigid");
+
+ b.Property("State")
+ .HasColumnType("tinyint(1)")
+ .HasColumnName("state");
+
+ b.HasKey("Id")
+ .HasName("pk_delmsgoncmdchannel");
+
+ b.HasIndex("GuildConfigId")
+ .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid");
+
+ b.ToTable("delmsgoncmdchannel", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.DiscordPermOverride", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Command")
+ .HasColumnType("varchar(255)")
+ .HasColumnName("command");
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("GuildId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("guildid");
+
+ b.Property("Perm")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("perm");
+
+ b.HasKey("Id")
+ .HasName("pk_discordpermoverrides");
+
+ b.HasIndex("GuildId", "Command")
+ .IsUnique()
+ .HasDatabaseName("ix_discordpermoverrides_guildid_command");
+
+ b.ToTable("discordpermoverrides", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.ExcludedItem", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("ItemId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("itemid");
+
+ b.Property("ItemType")
+ .HasColumnType("int")
+ .HasColumnName("itemtype");
+
+ b.Property("XpSettingsId")
+ .HasColumnType("int")
+ .HasColumnName("xpsettingsid");
+
+ b.HasKey("Id")
+ .HasName("pk_excludeditem");
+
+ b.HasIndex("XpSettingsId")
+ .HasDatabaseName("ix_excludeditem_xpsettingsid");
+
+ b.ToTable("excludeditem", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.FeedSub", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("ChannelId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("channelid");
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("GuildConfigId")
+ .HasColumnType("int")
+ .HasColumnName("guildconfigid");
+
+ b.Property("Message")
+ .HasColumnType("longtext")
+ .HasColumnName("message");
+
+ b.Property("Url")
+ .IsRequired()
+ .HasColumnType("varchar(255)")
+ .HasColumnName("url");
+
+ b.HasKey("Id")
+ .HasName("pk_feedsub");
+
+ b.HasAlternateKey("GuildConfigId", "Url")
+ .HasName("ak_feedsub_guildconfigid_url");
+
+ b.ToTable("feedsub", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.FilterChannelId", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("ChannelId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("channelid");
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("GuildConfigId")
+ .HasColumnType("int")
+ .HasColumnName("guildconfigid");
+
+ b.HasKey("Id")
+ .HasName("pk_filterchannelid");
+
+ b.HasIndex("GuildConfigId")
+ .HasDatabaseName("ix_filterchannelid_guildconfigid");
+
+ b.ToTable("filterchannelid", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.FilterLinksChannelId", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("ChannelId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("channelid");
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("GuildConfigId")
+ .HasColumnType("int")
+ .HasColumnName("guildconfigid");
+
+ b.HasKey("Id")
+ .HasName("pk_filterlinkschannelid");
+
+ b.HasIndex("GuildConfigId")
+ .HasDatabaseName("ix_filterlinkschannelid_guildconfigid");
+
+ b.ToTable("filterlinkschannelid", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.FilterWordsChannelId", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("ChannelId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("channelid");
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("GuildConfigId")
+ .HasColumnType("int")
+ .HasColumnName("guildconfigid");
+
+ b.HasKey("Id")
+ .HasName("pk_filterwordschannelid");
+
+ b.HasIndex("GuildConfigId")
+ .HasDatabaseName("ix_filterwordschannelid_guildconfigid");
+
+ b.ToTable("filterwordschannelid", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.FilteredWord", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("GuildConfigId")
+ .HasColumnType("int")
+ .HasColumnName("guildconfigid");
+
+ b.Property("Word")
+ .HasColumnType("longtext")
+ .HasColumnName("word");
+
+ b.HasKey("Id")
+ .HasName("pk_filteredword");
+
+ b.HasIndex("GuildConfigId")
+ .HasDatabaseName("ix_filteredword_guildconfigid");
+
+ b.ToTable("filteredword", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.GCChannelId", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("ChannelId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("channelid");
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("GuildConfigId")
+ .HasColumnType("int")
+ .HasColumnName("guildconfigid");
+
+ b.HasKey("Id")
+ .HasName("pk_gcchannelid");
+
+ b.HasIndex("GuildConfigId")
+ .HasDatabaseName("ix_gcchannelid_guildconfigid");
+
+ b.ToTable("gcchannelid", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.GamblingStats", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("Bet")
+ .HasColumnType("decimal(65,30)")
+ .HasColumnName("bet");
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("Feature")
+ .HasColumnType("varchar(255)")
+ .HasColumnName("feature");
+
+ b.Property("PaidOut")
+ .HasColumnType("decimal(65,30)")
+ .HasColumnName("paidout");
+
+ b.HasKey("Id")
+ .HasName("pk_gamblingstats");
+
+ b.HasIndex("Feature")
+ .IsUnique()
+ .HasDatabaseName("ix_gamblingstats_feature");
+
+ b.ToTable("gamblingstats", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.GroupName", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("GuildConfigId")
+ .HasColumnType("int")
+ .HasColumnName("guildconfigid");
+
+ b.Property("Name")
+ .HasColumnType("longtext")
+ .HasColumnName("name");
+
+ b.Property("Number")
+ .HasColumnType("int")
+ .HasColumnName("number");
+
+ b.HasKey("Id")
+ .HasName("pk_groupname");
+
+ b.HasIndex("GuildConfigId", "Number")
+ .IsUnique()
+ .HasDatabaseName("ix_groupname_guildconfigid_number");
+
+ b.ToTable("groupname", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.GuildConfig", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("AutoAssignRoleIds")
+ .HasColumnType("longtext")
+ .HasColumnName("autoassignroleids");
+
+ b.Property("AutoDeleteByeMessagesTimer")
+ .HasColumnType("int")
+ .HasColumnName("autodeletebyemessagestimer");
+
+ b.Property("AutoDeleteGreetMessagesTimer")
+ .HasColumnType("int")
+ .HasColumnName("autodeletegreetmessagestimer");
+
+ b.Property("AutoDeleteSelfAssignedRoleMessages")
+ .HasColumnType("tinyint(1)")
+ .HasColumnName("autodeleteselfassignedrolemessages");
+
+ b.Property("BoostMessage")
+ .HasColumnType("longtext")
+ .HasColumnName("boostmessage");
+
+ b.Property("BoostMessageChannelId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("boostmessagechannelid");
+
+ b.Property("BoostMessageDeleteAfter")
+ .HasColumnType("int")
+ .HasColumnName("boostmessagedeleteafter");
+
+ b.Property("ByeMessageChannelId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("byemessagechannelid");
+
+ b.Property("ChannelByeMessageText")
+ .HasColumnType("longtext")
+ .HasColumnName("channelbyemessagetext");
+
+ b.Property("ChannelGreetMessageText")
+ .HasColumnType("longtext")
+ .HasColumnName("channelgreetmessagetext");
+
+ b.Property("CleverbotEnabled")
+ .HasColumnType("tinyint(1)")
+ .HasColumnName("cleverbotenabled");
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("DeleteMessageOnCommand")
+ .HasColumnType("tinyint(1)")
+ .HasColumnName("deletemessageoncommand");
+
+ b.Property("DeleteStreamOnlineMessage")
+ .HasColumnType("tinyint(1)")
+ .HasColumnName("deletestreamonlinemessage");
+
+ b.Property("DisableGlobalExpressions")
+ .HasColumnType("tinyint(1)")
+ .HasColumnName("disableglobalexpressions");
+
+ b.Property("DmGreetMessageText")
+ .HasColumnType("longtext")
+ .HasColumnName("dmgreetmessagetext");
+
+ b.Property("ExclusiveSelfAssignedRoles")
+ .HasColumnType("tinyint(1)")
+ .HasColumnName("exclusiveselfassignedroles");
+
+ b.Property("FilterInvites")
+ .HasColumnType("tinyint(1)")
+ .HasColumnName("filterinvites");
+
+ b.Property("FilterLinks")
+ .HasColumnType("tinyint(1)")
+ .HasColumnName("filterlinks");
+
+ b.Property("FilterWords")
+ .HasColumnType("tinyint(1)")
+ .HasColumnName("filterwords");
+
+ b.Property("GameVoiceChannel")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("gamevoicechannel");
+
+ b.Property("GreetMessageChannelId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("greetmessagechannelid");
+
+ b.Property("GuildId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("guildid");
+
+ b.Property("Locale")
+ .HasColumnType("longtext")
+ .HasColumnName("locale");
+
+ b.Property("MuteRoleName")
+ .HasColumnType("longtext")
+ .HasColumnName("muterolename");
+
+ b.Property("NotifyStreamOffline")
+ .HasColumnType("tinyint(1)")
+ .HasColumnName("notifystreamoffline");
+
+ b.Property("PermissionRole")
+ .HasColumnType("longtext")
+ .HasColumnName("permissionrole");
+
+ b.Property("Prefix")
+ .HasColumnType("longtext")
+ .HasColumnName("prefix");
+
+ b.Property("SendBoostMessage")
+ .HasColumnType("tinyint(1)")
+ .HasColumnName("sendboostmessage");
+
+ b.Property("SendChannelByeMessage")
+ .HasColumnType("tinyint(1)")
+ .HasColumnName("sendchannelbyemessage");
+
+ b.Property("SendChannelGreetMessage")
+ .HasColumnType("tinyint(1)")
+ .HasColumnName("sendchannelgreetmessage");
+
+ b.Property("SendDmGreetMessage")
+ .HasColumnType("tinyint(1)")
+ .HasColumnName("senddmgreetmessage");
+
+ b.Property("StickyRoles")
+ .HasColumnType("tinyint(1)")
+ .HasColumnName("stickyroles");
+
+ b.Property("TimeZoneId")
+ .HasColumnType("longtext")
+ .HasColumnName("timezoneid");
+
+ b.Property("VerboseErrors")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("tinyint(1)")
+ .HasDefaultValue(true)
+ .HasColumnName("verboseerrors");
+
+ b.Property("VerbosePermissions")
+ .HasColumnType("tinyint(1)")
+ .HasColumnName("verbosepermissions");
+
+ b.Property("WarnExpireAction")
+ .HasColumnType("int")
+ .HasColumnName("warnexpireaction");
+
+ b.Property("WarnExpireHours")
+ .HasColumnType("int")
+ .HasColumnName("warnexpirehours");
+
+ b.Property("WarningsInitialized")
+ .HasColumnType("tinyint(1)")
+ .HasColumnName("warningsinitialized");
+
+ b.HasKey("Id")
+ .HasName("pk_guildconfigs");
+
+ b.HasIndex("GuildId")
+ .IsUnique()
+ .HasDatabaseName("ix_guildconfigs_guildid");
+
+ b.HasIndex("WarnExpireHours")
+ .HasDatabaseName("ix_guildconfigs_warnexpirehours");
+
+ b.ToTable("guildconfigs", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.IgnoredLogItem", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("ItemType")
+ .HasColumnType("int")
+ .HasColumnName("itemtype");
+
+ b.Property("LogItemId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("logitemid");
+
+ b.Property("LogSettingId")
+ .HasColumnType("int")
+ .HasColumnName("logsettingid");
+
+ b.HasKey("Id")
+ .HasName("pk_ignoredlogchannels");
+
+ b.HasIndex("LogSettingId", "LogItemId", "ItemType")
+ .IsUnique()
+ .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype");
+
+ b.ToTable("ignoredlogchannels", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.IgnoredVoicePresenceChannel", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("ChannelId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("channelid");
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("LogSettingId")
+ .HasColumnType("int")
+ .HasColumnName("logsettingid");
+
+ b.HasKey("Id")
+ .HasName("pk_ignoredvoicepresencechannels");
+
+ b.HasIndex("LogSettingId")
+ .HasDatabaseName("ix_ignoredvoicepresencechannels_logsettingid");
+
+ b.ToTable("ignoredvoicepresencechannels", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.ImageOnlyChannel", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("ChannelId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("channelid");
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("GuildId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("guildid");
+
+ b.Property("Type")
+ .HasColumnType("int")
+ .HasColumnName("type");
+
+ b.HasKey("Id")
+ .HasName("pk_imageonlychannels");
+
+ b.HasIndex("ChannelId")
+ .IsUnique()
+ .HasDatabaseName("ix_imageonlychannels_channelid");
+
+ b.ToTable("imageonlychannels", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.LogSetting", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("ChannelCreatedId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("channelcreatedid");
+
+ b.Property("ChannelDestroyedId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("channeldestroyedid");
+
+ b.Property("ChannelUpdatedId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("channelupdatedid");
+
+ b.Property("DateAdded")
+ .HasColumnType("datetime(6)")
+ .HasColumnName("dateadded");
+
+ b.Property("GuildId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("guildid");
+
+ b.Property("LogOtherId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("logotherid");
+
+ b.Property("LogUserPresenceId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("loguserpresenceid");
+
+ b.Property("LogVoicePresenceId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("logvoicepresenceid");
+
+ b.Property("LogVoicePresenceTTSId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("logvoicepresencettsid");
+
+ b.Property("LogWarnsId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("logwarnsid");
+
+ b.Property("MessageDeletedId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("messagedeletedid");
+
+ b.Property("MessageUpdatedId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("messageupdatedid");
+
+ b.Property("ThreadCreatedId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("threadcreatedid");
+
+ b.Property("ThreadDeletedId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("threaddeletedid");
+
+ b.Property("UserBannedId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("userbannedid");
+
+ b.Property("UserJoinedId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("userjoinedid");
+
+ b.Property("UserLeftId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("userleftid");
+
+ b.Property("UserMutedId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("usermutedid");
+
+ b.Property("UserUnbannedId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("userunbannedid");
+
+ b.Property("UserUpdatedId")
+ .HasColumnType("bigint unsigned")
+ .HasColumnName("userupdatedid");
+
+ b.HasKey("Id")
+ .HasName("pk_logsettings");
+
+ b.HasIndex("GuildId")
+ .IsUnique()
+ .HasDatabaseName("ix_logsettings_guildid");
+
+ b.ToTable("logsettings", (string)null);
+ });
+
+ modelBuilder.Entity("Nadeko.Bot.Db.Models.MusicPlayerSettings", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int")
+ .HasColumnName("id");
+
+ MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id"));
+
+ b.Property("AutoDisconnect")
+ .HasColumnType("tinyint(1)")
+ .HasColumnName("autodisconnect");
+
+ b.Property