From fe22ea0d143e6f5a25f2f18bbd95114121567a1a Mon Sep 17 00:00:00 2001 From: sylveondeko Date: Tue, 13 Aug 2024 23:43:02 -0400 Subject: [PATCH] add preliminary ticket stuff, add message counting and message reqs for giveaways --- src/Mewdeko/Common/MewdekoSlashModuleBase.cs | 12 +- src/Mewdeko/Database/MewdekoContext.cs | 24 + .../20240810050710_Tickets.Designer.cs | 4191 ++++++++++++++++ .../PostgreSql/20240810050710_Tickets.cs | 71 + .../20240814024523_MessageCounts.Designer.cs | 4217 +++++++++++++++++ .../20240814024523_MessageCounts.cs | 83 + .../MewdekoPostgresContextModelSnapshot.cs | 103 + src/Mewdeko/Database/Models/Giveaways.cs | 5 + src/Mewdeko/Database/Models/GuildConfig.cs | 1729 +++---- src/Mewdeko/Database/Models/MessageCount.cs | 27 + src/Mewdeko/Database/Models/TicketButton.cs | 22 + src/Mewdeko/Database/Models/TicketPanel.cs | 25 + src/Mewdeko/Mewdeko.csproj | 1 + .../Modules/Games/CleverBotCommands.cs | 48 - .../Common/ChatterBot/ChatterBotResponse.cs | 18 - .../Common/ChatterBot/ChatterBotSession.cs | 44 - .../Common/ChatterBot/CleverbotResponse.cs | 50 - .../Common/ChatterBot/IChatterBotSession.cs | 15 - .../ChatterBot/OfficialCleverbotSession.cs | 112 - .../Games/Services/ChatterbotService.cs | 227 - src/Mewdeko/Modules/Giveaways/Giveaways.cs | 19 +- .../Giveaways/Services/GiveawayService.cs | 30 +- .../OwnerOnly/Services/OwnerOnlyService.cs | 8 +- .../Modules/Tickets/Services/TicketService.cs | 134 + src/Mewdeko/Modules/Tickets/SlashTickets.cs | 143 + .../Modules/Utility/MessageCountCommands.cs | 49 + .../Utility/Services/MessageCountService.cs | 152 + 27 files changed, 10169 insertions(+), 1390 deletions(-) create mode 100644 src/Mewdeko/Database/Migrations/PostgreSql/20240810050710_Tickets.Designer.cs create mode 100644 src/Mewdeko/Database/Migrations/PostgreSql/20240810050710_Tickets.cs create mode 100644 src/Mewdeko/Database/Migrations/PostgreSql/20240814024523_MessageCounts.Designer.cs create mode 100644 src/Mewdeko/Database/Migrations/PostgreSql/20240814024523_MessageCounts.cs create mode 100644 src/Mewdeko/Database/Models/MessageCount.cs create mode 100644 src/Mewdeko/Database/Models/TicketButton.cs create mode 100644 src/Mewdeko/Database/Models/TicketPanel.cs delete mode 100644 src/Mewdeko/Modules/Games/CleverBotCommands.cs delete mode 100644 src/Mewdeko/Modules/Games/Common/ChatterBot/ChatterBotResponse.cs delete mode 100644 src/Mewdeko/Modules/Games/Common/ChatterBot/ChatterBotSession.cs delete mode 100644 src/Mewdeko/Modules/Games/Common/ChatterBot/CleverbotResponse.cs delete mode 100644 src/Mewdeko/Modules/Games/Common/ChatterBot/IChatterBotSession.cs delete mode 100644 src/Mewdeko/Modules/Games/Common/ChatterBot/OfficialCleverbotSession.cs delete mode 100644 src/Mewdeko/Modules/Games/Services/ChatterbotService.cs create mode 100644 src/Mewdeko/Modules/Tickets/Services/TicketService.cs create mode 100644 src/Mewdeko/Modules/Tickets/SlashTickets.cs create mode 100644 src/Mewdeko/Modules/Utility/MessageCountCommands.cs create mode 100644 src/Mewdeko/Modules/Utility/Services/MessageCountService.cs diff --git a/src/Mewdeko/Common/MewdekoSlashModuleBase.cs b/src/Mewdeko/Common/MewdekoSlashModuleBase.cs index bc20bf24a..797c2ebe6 100644 --- a/src/Mewdeko/Common/MewdekoSlashModuleBase.cs +++ b/src/Mewdeko/Common/MewdekoSlashModuleBase.cs @@ -65,7 +65,7 @@ public abstract class MewdekoSlashCommandModule : InteractionModuleBase public Task ErrorLocalizedAsync(string? textKey, params object?[] args) { var text = GetText(textKey, args); - return ctx.Interaction.SendErrorAsync(text, Config); + return !ctx.Interaction.HasResponded ? ctx.Interaction.SendErrorAsync(text, Config) : ctx.Interaction.SendErrorFollowupAsync(text, Config); } /// @@ -74,7 +74,7 @@ public Task ErrorLocalizedAsync(string? textKey, params object?[] args) public Task ReplyErrorLocalizedAsync(string? textKey, params object?[] args) { var text = GetText(textKey, args); - return ctx.Interaction.SendErrorAsync($"{Format.Bold(ctx.User.ToString())} {text}", Config); + return !ctx.Interaction.HasResponded ? ctx.Interaction.SendErrorAsync($"{Format.Bold(ctx.User.ToString())} {text}", Config): ctx.Interaction.SendErrorFollowupAsync($"{Format.Bold(ctx.User.ToString())} {text}", Config); } /// @@ -83,7 +83,7 @@ public Task ReplyErrorLocalizedAsync(string? textKey, params object?[] args) public Task EphemeralReplyErrorLocalizedAsync(string? textKey, params object?[] args) { var text = GetText(textKey, args); - return ctx.Interaction.SendEphemeralErrorAsync($"{Format.Bold(ctx.User.ToString())} {text}", Config); + return !ctx.Interaction.HasResponded ? ctx.Interaction.SendEphemeralFollowupErrorAsync($"{Format.Bold(ctx.User.ToString())} {text}", Config) : ctx.Interaction.SendEphemeralErrorAsync($"{Format.Bold(ctx.User.ToString())} {text}", Config); } /// @@ -92,7 +92,7 @@ public Task EphemeralReplyErrorLocalizedAsync(string? textKey, params object?[] public Task ConfirmLocalizedAsync(string? textKey, params object?[] args) { var text = GetText(textKey, args); - return ctx.Interaction.SendConfirmAsync(text); + return !ctx.Interaction.HasResponded ? ctx.Interaction.SendConfirmAsync(text) : ctx.Interaction.SendConfirmFollowupAsync(text); } /// @@ -101,7 +101,7 @@ public Task ConfirmLocalizedAsync(string? textKey, params object?[] args) public Task ReplyConfirmLocalizedAsync(string? textKey, params object?[] args) { var text = GetText(textKey, args); - return ctx.Interaction.SendConfirmAsync($"{Format.Bold(ctx.User.ToString())} {text}"); + return ctx.Interaction.HasResponded ? ctx.Interaction.SendConfirmFollowupAsync($"{Format.Bold(ctx.User.ToString())} {text}") : ctx.Interaction.SendConfirmAsync($"{Format.Bold(ctx.User.ToString())} {text}"); } /// @@ -110,7 +110,7 @@ public Task ReplyConfirmLocalizedAsync(string? textKey, params object?[] args) public Task EphemeralReplyConfirmLocalizedAsync(string? textKey, params object?[] args) { var text = GetText(textKey, args); - return ctx.Interaction.SendEphemeralConfirmAsync($"{Format.Bold(ctx.User.ToString())} {text}"); + return !ctx.Interaction.HasResponded ? ctx.Interaction.SendEphemeralConfirmAsync($"{Format.Bold(ctx.User.ToString())} {text}") : ctx.Interaction.SendEphemeralFollowupConfirmAsync($"{Format.Bold(ctx.User.ToString())} {text}"); } /// diff --git a/src/Mewdeko/Database/MewdekoContext.cs b/src/Mewdeko/Database/MewdekoContext.cs index 630756d2e..e5593858b 100644 --- a/src/Mewdeko/Database/MewdekoContext.cs +++ b/src/Mewdeko/Database/MewdekoContext.cs @@ -25,6 +25,11 @@ public MewdekoContext(DbContextOptions options) : base(options) /// public DbSet GiveawayUsers { get; set; } + /// + /// Message Counts + /// + public DbSet MessageCounts { get; set; } + /// /// Gets or sets the anti-alt settings. /// @@ -40,6 +45,16 @@ public MewdekoContext(DbContextOptions options) : base(options) /// public DbSet AntiRaidSettings { get; set; } + /// + /// Gets or sets ticket panels + /// + public DbSet TicketPanels { get; set; } + + /// + /// Gets or sets ticket buttons + /// + public DbSet TicketButtons { get; set; } + /// /// Gets or sets the anti-spam ignore settings. /// @@ -759,6 +774,15 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) .IsUnique(); #endregion + + #region Tickets + + modelBuilder.Entity() + .HasMany(p => p.Buttons) + .WithOne() + .HasForeignKey(b => b.TicketPanelId); + + #endregion } } } \ No newline at end of file diff --git a/src/Mewdeko/Database/Migrations/PostgreSql/20240810050710_Tickets.Designer.cs b/src/Mewdeko/Database/Migrations/PostgreSql/20240810050710_Tickets.Designer.cs new file mode 100644 index 000000000..503cb45ec --- /dev/null +++ b/src/Mewdeko/Database/Migrations/PostgreSql/20240810050710_Tickets.Designer.cs @@ -0,0 +1,4191 @@ +// +using System; +using Mewdeko.Database; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Mewdeko.Database.Migrations.PostgreSql +{ + [DbContext(typeof(MewdekoPostgresContext))] + [Migration("20240810050710_Tickets")] + partial class Tickets + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Mewdeko.Database.Models.Afk", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("Message") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.Property("WasTimed") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("When") + .HasColumnType("timestamp without time zone"); + + b.HasKey("Id"); + + b.ToTable("AFK"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AntiAltSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("ActionDurationMinutes") + .HasColumnType("integer"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("MinAge") + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId") + .IsUnique(); + + b.ToTable("AntiAltSetting"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AntiRaidSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("PunishDuration") + .HasColumnType("integer"); + + b.Property("Seconds") + .HasColumnType("integer"); + + b.Property("UserThreshold") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId") + .IsUnique(); + + b.ToTable("AntiRaidSetting"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AntiSpamIgnore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AntiSpamSettingId") + .HasColumnType("integer"); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.HasKey("Id"); + + b.HasIndex("AntiSpamSettingId"); + + b.ToTable("AntiSpamIgnore"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AntiSpamSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("MessageThreshold") + .HasColumnType("integer"); + + b.Property("MuteTime") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId") + .IsUnique(); + + b.ToTable("AntiSpamSetting"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AutoBanEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("Word") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("AutoBanWords"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AutoBanRoles", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("AutoBanRoles"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AutoCommand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("ChannelName") + .HasColumnType("text"); + + b.Property("CommandText") + .HasColumnType("text"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("GuildName") + .HasColumnType("text"); + + b.Property("Interval") + .HasColumnType("integer"); + + b.Property("VoiceChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("VoiceChannelName") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("AutoCommands"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AutoPublish", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BlacklistedUsers") + .HasColumnType("numeric(20,0)"); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("AutoPublish"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.BanTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("Text") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GuildId") + .IsUnique(); + + b.ToTable("BanTemplates"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.BlacklistEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("ItemId") + .HasColumnType("numeric(20,0)"); + + b.Property("Reason") + .HasColumnType("text"); + + b.Property("Type") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Blacklist"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.ChatTriggers", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AllowTarget") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("ApplicationCommandDescription") + .HasColumnType("text"); + + b.Property("ApplicationCommandId") + .HasColumnType("numeric(20,0)"); + + b.Property("ApplicationCommandName") + .HasColumnType("text"); + + b.Property("ApplicationCommandType") + .HasColumnType("integer"); + + b.Property("AutoDeleteTrigger") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("ContainsAnywhere") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("CrosspostingChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("CrosspostingWebhookUrl") + .HasColumnType("text"); + + b.Property("CustomPrefix") + .HasColumnType("text"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("DmResponse") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("EphemeralResponse") + .HasColumnType("boolean"); + + b.Property("GrantedRoles") + .HasColumnType("text"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("IsRegex") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("NoRespond") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("OwnerOnly") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("PrefixType") + .HasColumnType("integer"); + + b.Property("ReactToTrigger") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("Reactions") + .HasColumnType("text"); + + b.Property("RemovedRoles") + .HasColumnType("text"); + + b.Property("Response") + .HasColumnType("text"); + + b.Property("RoleGrantType") + .HasColumnType("integer"); + + b.Property("Trigger") + .HasColumnType("text"); + + b.Property("UseCount") + .HasColumnType("numeric(20,0)"); + + b.Property("ValidTriggerTypes") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("ChatTriggers"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.CommandAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("Mapping") + .HasColumnType("text"); + + b.Property("Trigger") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("CommandAlias"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.CommandCooldown", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CommandName") + .HasColumnType("text"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("Seconds") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("CommandCooldown"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.CommandStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("IsSlash") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("Module") + .ValueGeneratedOnAdd() + .HasColumnType("text") + .HasDefaultValue(""); + + b.Property("NameOrId") + .HasColumnType("text"); + + b.Property("Trigger") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("CommandStats"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Confessions", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("ConfessNumber") + .HasColumnType("numeric(20,0)"); + + b.Property("Confession") + .HasColumnType("text"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("MessageId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("Confessions"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.DelMsgOnCmdChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("State") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(true); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("DelMsgOnCmdChannel"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.DiscordPermOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Command") + .HasColumnType("text"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("Perm") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("GuildId", "Command") + .IsUnique(); + + b.ToTable("DiscordPermOverrides"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.DiscordUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AvatarId") + .HasColumnType("text"); + + b.Property("Bio") + .HasColumnType("text"); + + b.Property("Birthday") + .HasColumnType("timestamp without time zone"); + + b.Property("BirthdayDisplayMode") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Discriminator") + .HasColumnType("text"); + + b.Property("IsClubAdmin") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("IsDragon") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("LastLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp without time zone") + .HasDefaultValue(new DateTime(2017, 9, 21, 20, 53, 13, 305, DateTimeKind.Local)); + + b.Property("NotifyOnLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0); + + b.Property("ProfileColor") + .HasColumnType("bigint"); + + b.Property("ProfileImageUrl") + .HasColumnType("text"); + + b.Property("ProfilePrivacy") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0); + + b.Property("Pronouns") + .HasColumnType("text"); + + b.Property("PronounsClearedReason") + .HasColumnType("text"); + + b.Property("PronounsDisabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("StatsOptOut") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("SwitchFriendCode") + .HasColumnType("text"); + + b.Property("TotalXp") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.Property("Username") + .HasColumnType("text"); + + b.Property("ZodiacSign") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasAlternateKey("UserId"); + + b.HasIndex("TotalXp"); + + b.HasIndex("UserId"); + + b.ToTable("DiscordUser"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.ExcludedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("ItemId") + .HasColumnType("numeric(20,0)"); + + b.Property("ItemType") + .HasColumnType("integer"); + + b.Property("XpSettingsId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("XpSettingsId"); + + b.ToTable("ExcludedItem"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FeedSub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("Message") + .HasColumnType("text"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasAlternateKey("GuildConfigId", "Url"); + + b.ToTable("FeedSub"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FilterInvitesChannelIds", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("FilterInvitesChannelIds"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FilterLinksChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("FilterLinksChannelId"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FilterWordsChannelIds", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("FilterWordsChannelIds"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FilteredWord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("Word") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("FilteredWord"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FollowedStream", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("Message") + .HasColumnType("text"); + + b.Property("Type") + .HasColumnType("integer"); + + b.Property("Username") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("FollowedStream"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.GiveawayUsers", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GiveawayId") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("GiveawayUsers"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Giveaways", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BlacklistRoles") + .HasColumnType("text"); + + b.Property("BlacklistUsers") + .HasColumnType("text"); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Emote") + .HasColumnType("text"); + + b.Property("Ended") + .HasColumnType("integer"); + + b.Property("Item") + .HasColumnType("text"); + + b.Property("MessageId") + .HasColumnType("numeric(20,0)"); + + b.Property("RestrictTo") + .HasColumnType("text"); + + b.Property("ServerId") + .HasColumnType("numeric(20,0)"); + + b.Property("UseButton") + .HasColumnType("boolean"); + + b.Property("UseCaptcha") + .HasColumnType("boolean"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.Property("When") + .HasColumnType("timestamp without time zone"); + + b.Property("Winners") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Giveaways"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.GlobalUserBalance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Balance") + .HasColumnType("bigint"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("GlobalUserBalance"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.GroupName", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Number") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId", "Number") + .IsUnique(); + + b.ToTable("GroupName"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.GuildConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AcceptChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("AcceptMessage") + .HasColumnType("text"); + + b.Property("AfkDel") + .HasColumnType("text"); + + b.Property("AfkDisabledChannels") + .HasColumnType("text"); + + b.Property("AfkLength") + .HasColumnType("integer"); + + b.Property("AfkMessage") + .HasColumnType("text"); + + b.Property("AfkTimeout") + .HasColumnType("integer"); + + b.Property("AfkType") + .HasColumnType("integer"); + + b.Property("ArchiveOnAccept") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("ArchiveOnConsider") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("ArchiveOnDeny") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("ArchiveOnImplement") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("AutoAssignRoleId") + .HasColumnType("text"); + + b.Property("AutoBotRoleIds") + .HasColumnType("text"); + + b.Property("AutoDeleteByeMessages") + .HasColumnType("boolean"); + + b.Property("AutoDeleteByeMessagesTimer") + .HasColumnType("integer"); + + b.Property("AutoDeleteGreetMessages") + .HasColumnType("boolean"); + + b.Property("AutoDeleteGreetMessagesTimer") + .HasColumnType("integer"); + + b.Property("AutoDeleteSelfAssignedRoleMessages") + .HasColumnType("boolean"); + + b.Property("BoostMessage") + .HasColumnType("text"); + + b.Property("BoostMessageChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("BoostMessageDeleteAfter") + .HasColumnType("integer"); + + b.Property("ButtonRepostThreshold") + .HasColumnType("integer"); + + b.Property("ByeMessageChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("ChannelByeMessageText") + .HasColumnType("text"); + + b.Property("ChannelGreetMessageText") + .HasColumnType("text"); + + b.Property("CleverbotChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("CommandLogChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("ConfessionBlacklist") + .HasColumnType("text"); + + b.Property("ConfessionChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("ConfessionLogChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("ConsiderChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("ConsiderMessage") + .HasColumnType("text"); + + b.Property("CurrencyEmoji") + .HasColumnType("text"); + + b.Property("CurrencyName") + .HasColumnType("text"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("DeleteMessageOnCommand") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("DenyChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("DenyMessage") + .HasColumnType("text"); + + b.Property("DmGreetMessageText") + .HasColumnType("text"); + + b.Property("DmOnGiveawayWin") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(true); + + b.Property("Emote1Style") + .HasColumnType("integer"); + + b.Property("Emote2Style") + .HasColumnType("integer"); + + b.Property("Emote3Style") + .HasColumnType("integer"); + + b.Property("Emote4Style") + .HasColumnType("integer"); + + b.Property("Emote5Style") + .HasColumnType("integer"); + + b.Property("EmoteMode") + .HasColumnType("integer"); + + b.Property("ExclusiveSelfAssignedRoles") + .HasColumnType("boolean"); + + b.Property("FilterInvites") + .HasColumnType("boolean"); + + b.Property("FilterLinks") + .HasColumnType("boolean"); + + b.Property("FilterWords") + .HasColumnType("boolean"); + + b.Property("GBAction") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("GBEnabled") + .HasColumnType("integer"); + + b.Property("GEndMessage") + .HasColumnType("text"); + + b.Property("GRolesBlacklist") + .HasColumnType("text"); + + b.Property("GStartMessage") + .HasColumnType("text"); + + b.Property("GUsersBlacklist") + .HasColumnType("text"); + + b.Property("GWinMessage") + .HasColumnType("text"); + + b.Property("GameMasterRole") + .HasColumnType("numeric(20,0)"); + + b.Property("GameVoiceChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("GiveawayBanner") + .HasColumnType("text"); + + b.Property("GiveawayEmbedColor") + .HasColumnType("text"); + + b.Property("GiveawayEmote") + .HasColumnType("text"); + + b.Property("GiveawayEndMessage") + .HasColumnType("text"); + + b.Property("GiveawayPingRole") + .HasColumnType("numeric(20,0)"); + + b.Property("GiveawayWinEmbedColor") + .HasColumnType("text"); + + b.Property("GreetHook") + .HasColumnType("text"); + + b.Property("GreetMessageChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("ImplementChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("ImplementMessage") + .HasColumnType("text"); + + b.Property("JoinGraphColor") + .HasColumnType("bigint"); + + b.Property("Joins") + .HasColumnType("numeric(20,0)"); + + b.Property("LeaveGraphColor") + .HasColumnType("bigint"); + + b.Property("LeaveHook") + .HasColumnType("text"); + + b.Property("Leaves") + .HasColumnType("numeric(20,0)"); + + b.Property("Locale") + .HasColumnType("text"); + + b.Property("LogSettingId") + .HasColumnType("integer"); + + b.Property("MaxSuggestLength") + .HasColumnType("integer"); + + b.Property("MemberRole") + .HasColumnType("numeric(20,0)"); + + b.Property("MinSuggestLength") + .HasColumnType("integer"); + + b.Property("MiniWarnlogChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("MultiGreetType") + .HasColumnType("integer"); + + b.Property("MuteRoleName") + .HasColumnType("text"); + + b.Property("NotifyStreamOffline") + .HasColumnType("boolean"); + + b.Property("PermissionRole") + .HasColumnType("text"); + + b.Property("Prefix") + .HasColumnType("text"); + + b.Property("PreviewLinks") + .HasColumnType("integer"); + + b.Property("ReactChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("RepostThreshold") + .HasColumnType("integer"); + + b.Property("RewardAmount") + .HasColumnType("integer"); + + b.Property("RewardTimeoutSeconds") + .HasColumnType("integer"); + + b.Property("SendBoostMessage") + .HasColumnType("boolean"); + + b.Property("SendChannelByeMessage") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("SendChannelGreetMessage") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("SendDmGreetMessage") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("StaffRole") + .HasColumnType("numeric(20,0)"); + + b.Property("Star2") + .HasColumnType("text"); + + b.Property("StarboardAllowBots") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("StarboardChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("StarboardCheckChannels") + .HasColumnType("text"); + + b.Property("StarboardRemoveOnBelowThreshold") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(true); + + b.Property("StarboardRemoveOnDelete") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("StarboardRemoveOnReactionsClear") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("Stars") + .HasColumnType("integer"); + + b.Property("StatsOptOut") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("SuggestButtonChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("SuggestButtonColor") + .HasColumnType("integer"); + + b.Property("SuggestButtonEmote") + .HasColumnType("text"); + + b.Property("SuggestButtonMessage") + .HasColumnType("text"); + + b.Property("SuggestButtonMessageId") + .HasColumnType("numeric(20,0)"); + + b.Property("SuggestButtonName") + .HasColumnType("text"); + + b.Property("SuggestButtonRepostThreshold") + .HasColumnType("integer"); + + b.Property("SuggestCommandsType") + .HasColumnType("integer"); + + b.Property("SuggestEmotes") + .HasColumnType("text"); + + b.Property("SuggestMessage") + .HasColumnType("text"); + + b.Property("SuggestionThreadType") + .HasColumnType("integer"); + + b.Property("TOpenMessage") + .HasColumnType("text"); + + b.Property("TicketCategory") + .HasColumnType("numeric(20,0)"); + + b.Property("TicketChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("TimeZoneId") + .HasColumnType("text"); + + b.Property("UseStarboardBlacklist") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(true); + + b.Property("VerboseErrors") + .HasColumnType("boolean"); + + b.Property("VerbosePermissions") + .HasColumnType("boolean"); + + b.Property("VoteEmbed") + .HasColumnType("text"); + + b.Property("VotesChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("VotesPassword") + .HasColumnType("text"); + + b.Property("WarnExpireAction") + .HasColumnType("integer"); + + b.Property("WarnExpireHours") + .HasColumnType("integer"); + + b.Property("WarnMessage") + .HasColumnType("text"); + + b.Property("WarningsInitialized") + .HasColumnType("boolean"); + + b.Property("WarnlogChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("XpImgUrl") + .HasColumnType("text"); + + b.Property("XpTxtRate") + .HasColumnType("integer"); + + b.Property("XpTxtTimeout") + .HasColumnType("integer"); + + b.Property("XpVoiceRate") + .HasColumnType("integer"); + + b.Property("XpVoiceTimeout") + .HasColumnType("integer"); + + b.Property("fwarn") + .HasColumnType("integer"); + + b.Property("invwarn") + .HasColumnType("integer"); + + b.Property("removeroles") + .HasColumnType("integer"); + + b.Property("snipeset") + .HasColumnType("boolean"); + + b.Property("sugchan") + .HasColumnType("numeric(20,0)"); + + b.Property("sugnum") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("GuildId") + .IsUnique(); + + b.HasIndex("LogSettingId"); + + b.HasIndex("WarnExpireHours"); + + b.ToTable("GuildConfigs"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.GuildUserBalance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Balance") + .HasColumnType("bigint"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("GuildUserBalance"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.HighlightSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("HighlightsOn") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("IgnoredChannels") + .HasColumnType("text"); + + b.Property("IgnoredUsers") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("HighlightSettings"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Highlights", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.Property("Word") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Highlights"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.IgnoredLogChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("LogSettingId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("LogSettingId"); + + b.ToTable("IgnoredLogChannels"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.JoinLeaveLogs", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("IsJoin") + .HasColumnType("boolean"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("JoinLeaveLogs"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.LogSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AvatarUpdatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("ChannelCreated") + .HasColumnType("bigint"); + + b.Property("ChannelCreatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("ChannelDestroyed") + .HasColumnType("bigint"); + + b.Property("ChannelDestroyedId") + .HasColumnType("numeric(20,0)"); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("ChannelUpdated") + .HasColumnType("bigint"); + + b.Property("ChannelUpdatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("EventCreatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("IsLogging") + .HasColumnType("bigint"); + + b.Property("LogOtherId") + .HasColumnType("numeric(20,0)"); + + b.Property("LogUserPresence") + .HasColumnType("bigint"); + + b.Property("LogUserPresenceId") + .HasColumnType("numeric(20,0)"); + + b.Property("LogVoicePresence") + .HasColumnType("bigint"); + + b.Property("LogVoicePresenceId") + .HasColumnType("numeric(20,0)"); + + b.Property("LogVoicePresenceTTSId") + .HasColumnType("numeric(20,0)"); + + b.Property("MessageDeleted") + .HasColumnType("bigint"); + + b.Property("MessageDeletedId") + .HasColumnType("numeric(20,0)"); + + b.Property("MessageUpdated") + .HasColumnType("bigint"); + + b.Property("MessageUpdatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("NicknameUpdatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("RoleCreatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("RoleDeletedId") + .HasColumnType("numeric(20,0)"); + + b.Property("RoleUpdatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("ServerUpdatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("ThreadCreatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("ThreadDeletedId") + .HasColumnType("numeric(20,0)"); + + b.Property("ThreadUpdatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserBanned") + .HasColumnType("bigint"); + + b.Property("UserBannedId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserJoined") + .HasColumnType("bigint"); + + b.Property("UserJoinedId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserLeft") + .HasColumnType("bigint"); + + b.Property("UserLeftId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserMutedId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserPresenceChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserRoleAddedId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserRoleRemovedId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserUnbanned") + .HasColumnType("bigint"); + + b.Property("UserUnbannedId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserUpdated") + .HasColumnType("bigint"); + + b.Property("UserUpdatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("UsernameUpdatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("VoicePresenceChannelId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("LogSettings"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.MultiGreet", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("DeleteTime") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(1); + + b.Property("Disabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("GreetBots") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("Message") + .HasColumnType("text"); + + b.Property("WebhookUrl") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("MultiGreets"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.MusicPlayerSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AutoDisconnect") + .HasColumnType("integer"); + + b.Property("AutoPlay") + .HasColumnType("integer"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("MusicChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("PlayerRepeat") + .HasColumnType("integer"); + + b.Property("Volume") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(100); + + b.HasKey("Id"); + + b.HasIndex("GuildId") + .IsUnique(); + + b.ToTable("MusicPlayerSettings"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.MusicPlaylist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Author") + .HasColumnType("text"); + + b.Property("AuthorId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("IsDefault") + .HasColumnType("boolean"); + + b.Property("Name") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("MusicPlaylists"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.MutedUserId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.Property("roles") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("MutedUserId"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.NsfwBlacklitedTag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("Tag") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("NsfwBlacklitedTag"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.OwnerOnly", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CurrencyEmote") + .HasColumnType("text"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GptTokensUsed") + .HasColumnType("integer"); + + b.Property("Owners") + .HasColumnType("text"); + + b.Property("RewardAmount") + .HasColumnType("integer"); + + b.Property("RewardTimeoutSeconds") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("OwnerOnly"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Permission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("NextId") + .HasColumnType("integer"); + + b.Property("PrimaryTarget") + .HasColumnType("integer"); + + b.Property("PrimaryTargetId") + .HasColumnType("numeric(20,0)"); + + b.Property("SecondaryTarget") + .HasColumnType("integer"); + + b.Property("SecondaryTargetName") + .HasColumnType("text"); + + b.Property("State") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("NextId") + .IsUnique(); + + b.ToTable("Permission"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Permissionv2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("Index") + .HasColumnType("integer"); + + b.Property("IsCustomCommand") + .HasColumnType("boolean"); + + b.Property("PrimaryTarget") + .HasColumnType("integer"); + + b.Property("PrimaryTargetId") + .HasColumnType("numeric(20,0)"); + + b.Property("SecondaryTarget") + .HasColumnType("integer"); + + b.Property("SecondaryTargetName") + .HasColumnType("text"); + + b.Property("State") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("Permissionv2"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.PlaylistSong", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("MusicPlaylistId") + .HasColumnType("integer"); + + b.Property("Provider") + .HasColumnType("text"); + + b.Property("ProviderType") + .HasColumnType("integer"); + + b.Property("Query") + .HasColumnType("text"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("Uri") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("MusicPlaylistId"); + + b.ToTable("PlaylistSong"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.PollAnswers", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Index") + .HasColumnType("integer"); + + b.Property("PollsId") + .HasColumnType("integer"); + + b.Property("Text") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("PollsId"); + + b.ToTable("PollAnswer"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.PollVote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("PollId") + .HasColumnType("integer"); + + b.Property("PollsId") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.Property("VoteIndex") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("PollsId"); + + b.ToTable("PollVote"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Polls", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("PollType") + .HasColumnType("integer"); + + b.Property("Question") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GuildId") + .IsUnique(); + + b.ToTable("Poll"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.PublishUserBlacklist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("User") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("PublishUserBlacklist"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.PublishWordBlacklist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Word") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("PublishWordBlacklist"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Quote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AuthorId") + .HasColumnType("numeric(20,0)"); + + b.Property("AuthorName") + .IsRequired() + .HasColumnType("text"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("Keyword") + .IsRequired() + .HasColumnType("text"); + + b.Property("Text") + .IsRequired() + .HasColumnType("text"); + + b.Property("UseCount") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("GuildId"); + + b.HasIndex("Keyword"); + + b.ToTable("Quotes"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.ReactionRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("EmoteName") + .HasColumnType("text"); + + b.Property("ReactionRoleMessageId") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("ReactionRoleMessageId"); + + b.ToTable("ReactionRole"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.ReactionRoleMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Exclusive") + .HasColumnType("boolean"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("Index") + .HasColumnType("integer"); + + b.Property("MessageId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("ReactionRoleMessage"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Reminder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("IsPrivate") + .HasColumnType("boolean"); + + b.Property("Message") + .HasColumnType("text"); + + b.Property("ServerId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.Property("When") + .HasColumnType("timestamp without time zone"); + + b.HasKey("Id"); + + b.HasIndex("When"); + + b.ToTable("Reminders"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Repeater", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("Interval") + .HasColumnType("text"); + + b.Property("LastMessageId") + .HasColumnType("numeric(20,0)"); + + b.Property("Message") + .HasColumnType("text"); + + b.Property("NoRedundant") + .HasColumnType("boolean"); + + b.Property("StartTimeOfDay") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("GuildRepeater"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.RoleConnectionAuthStorage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("ExpiresAt") + .HasColumnType("timestamp without time zone"); + + b.Property("RefreshToken") + .HasColumnType("text"); + + b.Property("Scopes") + .HasColumnType("text"); + + b.Property("Token") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("AuthCodes"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.RoleGreet", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("DeleteTime") + .HasColumnType("integer"); + + b.Property("Disabled") + .HasColumnType("boolean"); + + b.Property("GreetBots") + .HasColumnType("boolean"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("Message") + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.Property("WebhookUrl") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("RoleGreets"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.RoleStateSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClearOnBan") + .HasColumnType("boolean"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("DeniedRoles") + .HasColumnType("text"); + + b.Property("DeniedUsers") + .HasColumnType("text"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("IgnoreBots") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.ToTable("RoleStateSettings"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.RotatingPlayingStatus", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Status") + .HasColumnType("text"); + + b.Property("Type") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("RotatingStatus"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.SelfAssignedRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Group") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("LevelRequirement") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("GuildId", "RoleId") + .IsUnique(); + + b.ToTable("SelfAssignableRoles"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.ServerRecoveryStore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("RecoveryKey") + .HasColumnType("text"); + + b.Property("TwoFactorKey") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("ServerRecoveryStore"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.StarboardPosts", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("MessageId") + .HasColumnType("numeric(20,0)"); + + b.Property("PostId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("Starboard"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.StatusRolesTable", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("ReaddRemoved") + .HasColumnType("boolean"); + + b.Property("RemoveAdded") + .HasColumnType("boolean"); + + b.Property("Status") + .HasColumnType("text"); + + b.Property("StatusChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("StatusEmbed") + .HasColumnType("text"); + + b.Property("ToAdd") + .HasColumnType("text"); + + b.Property("ToRemove") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("StatusRoles"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.StreamRoleBlacklistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.Property("Username") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("StreamRoleSettingsId"); + + b.ToTable("StreamRoleBlacklistedUser"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.StreamRoleSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddRoleId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("FromRoleId") + .HasColumnType("numeric(20,0)"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("Keyword") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId") + .IsUnique(); + + b.ToTable("StreamRoleSettings"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.StreamRoleWhitelistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.Property("Username") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("StreamRoleSettingsId"); + + b.ToTable("StreamRoleWhitelistedUser"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.SuggestThreads", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("MessageId") + .HasColumnType("numeric(20,0)"); + + b.Property("ThreadChannelId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("SuggestThreads"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.SuggestVotes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("EmotePicked") + .HasColumnType("integer"); + + b.Property("MessageId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("SuggestVotes"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.SuggestionsModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CurrentState") + .HasColumnType("integer"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("EmoteCount1") + .HasColumnType("integer"); + + b.Property("EmoteCount2") + .HasColumnType("integer"); + + b.Property("EmoteCount3") + .HasColumnType("integer"); + + b.Property("EmoteCount4") + .HasColumnType("integer"); + + b.Property("EmoteCount5") + .HasColumnType("integer"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("MessageId") + .HasColumnType("numeric(20,0)"); + + b.Property("StateChangeCount") + .HasColumnType("numeric(20,0)"); + + b.Property("StateChangeMessageId") + .HasColumnType("numeric(20,0)"); + + b.Property("StateChangeUser") + .HasColumnType("numeric(20,0)"); + + b.Property("Suggestion") + .HasColumnType("text"); + + b.Property("SuggestionId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("Suggestions"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Template", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AwardedColor") + .HasColumnType("text"); + + b.Property("AwardedFontSize") + .HasColumnType("integer"); + + b.Property("AwardedX") + .HasColumnType("integer"); + + b.Property("AwardedY") + .HasColumnType("integer"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("OutputSizeX") + .HasColumnType("integer"); + + b.Property("OutputSizeY") + .HasColumnType("integer"); + + b.Property("ShowAwarded") + .HasColumnType("boolean"); + + b.Property("ShowTimeOnLevel") + .HasColumnType("boolean"); + + b.Property("TemplateBarId") + .HasColumnType("integer"); + + b.Property("TemplateClubId") + .HasColumnType("integer"); + + b.Property("TemplateGuildId") + .HasColumnType("integer"); + + b.Property("TemplateUserId") + .HasColumnType("integer"); + + b.Property("TimeOnLevelColor") + .HasColumnType("text"); + + b.Property("TimeOnLevelFontSize") + .HasColumnType("integer"); + + b.Property("TimeOnLevelFormat") + .HasColumnType("text"); + + b.Property("TimeOnLevelX") + .HasColumnType("integer"); + + b.Property("TimeOnLevelY") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TemplateBarId"); + + b.HasIndex("TemplateClubId"); + + b.HasIndex("TemplateGuildId"); + + b.HasIndex("TemplateUserId"); + + b.ToTable("Template"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.TemplateBar", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BarColor") + .HasColumnType("text"); + + b.Property("BarDirection") + .HasColumnType("integer"); + + b.Property("BarLength") + .HasColumnType("integer"); + + b.Property("BarPointAx") + .HasColumnType("integer"); + + b.Property("BarPointAy") + .HasColumnType("integer"); + + b.Property("BarPointBx") + .HasColumnType("integer"); + + b.Property("BarPointBy") + .HasColumnType("integer"); + + b.Property("BarTransparency") + .HasColumnType("smallint"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("ShowBar") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.ToTable("TemplateBar"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.TemplateClub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClubIconSizeX") + .HasColumnType("integer"); + + b.Property("ClubIconSizeY") + .HasColumnType("integer"); + + b.Property("ClubIconX") + .HasColumnType("integer"); + + b.Property("ClubIconY") + .HasColumnType("integer"); + + b.Property("ClubNameColor") + .HasColumnType("text"); + + b.Property("ClubNameFontSize") + .HasColumnType("integer"); + + b.Property("ClubNameX") + .HasColumnType("integer"); + + b.Property("ClubNameY") + .HasColumnType("integer"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("ShowClubIcon") + .HasColumnType("boolean"); + + b.Property("ShowClubName") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.ToTable("TemplateClub"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.TemplateGuild", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildLevelColor") + .HasColumnType("text"); + + b.Property("GuildLevelFontSize") + .HasColumnType("integer"); + + b.Property("GuildLevelX") + .HasColumnType("integer"); + + b.Property("GuildLevelY") + .HasColumnType("integer"); + + b.Property("GuildRankColor") + .HasColumnType("text"); + + b.Property("GuildRankFontSize") + .HasColumnType("integer"); + + b.Property("GuildRankX") + .HasColumnType("integer"); + + b.Property("GuildRankY") + .HasColumnType("integer"); + + b.Property("ShowGuildLevel") + .HasColumnType("boolean"); + + b.Property("ShowGuildRank") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.ToTable("TemplateGuild"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.TemplateUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("FontSize") + .HasColumnType("integer"); + + b.Property("IconSizeX") + .HasColumnType("integer"); + + b.Property("IconSizeY") + .HasColumnType("integer"); + + b.Property("IconX") + .HasColumnType("integer"); + + b.Property("IconY") + .HasColumnType("integer"); + + b.Property("ShowIcon") + .HasColumnType("boolean"); + + b.Property("ShowText") + .HasColumnType("boolean"); + + b.Property("TextColor") + .HasColumnType("text"); + + b.Property("TextX") + .HasColumnType("integer"); + + b.Property("TextY") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("TemplateUser"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.TransactionHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Amount") + .HasColumnType("bigint"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("TransactionHistory"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.UnbanTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("UnbanAt") + .HasColumnType("timestamp without time zone"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("UnbanTimer"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.UnmuteTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("UnmuteAt") + .HasColumnType("timestamp without time zone"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("UnmuteTimer"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.UnroleTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.Property("UnbanAt") + .HasColumnType("timestamp without time zone"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("UnroleTimer"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.UserRoleStates", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("SavedRoles") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserName") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("UserRoleStates"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.UserXpStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AwardedXp") + .HasColumnType("integer"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("LastLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp without time zone") + .HasDefaultValue(new DateTime(2017, 9, 21, 20, 53, 13, 307, DateTimeKind.Local)); + + b.Property("NotifyOnLevelUp") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.Property("Xp") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("AwardedXp"); + + b.HasIndex("GuildId"); + + b.HasIndex("UserId"); + + b.HasIndex("Xp"); + + b.HasIndex("UserId", "GuildId") + .IsUnique(); + + b.ToTable("UserXpStats"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.VcRoleInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.Property("VoiceChannelId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("VcRoleInfo"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.VoteRoles", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.Property("Timer") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("VoteRoles"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Votes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BotId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("Votes"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Warning", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Forgiven") + .HasColumnType("boolean"); + + b.Property("ForgivenBy") + .HasColumnType("text"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("Moderator") + .HasColumnType("text"); + + b.Property("Reason") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("DateAdded"); + + b.HasIndex("GuildId"); + + b.HasIndex("UserId"); + + b.ToTable("Warnings"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Warning2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Forgiven") + .HasColumnType("boolean"); + + b.Property("ForgivenBy") + .HasColumnType("text"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("Moderator") + .HasColumnType("text"); + + b.Property("Reason") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("Warnings2"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.WarningPunishment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Count") + .HasColumnType("integer"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("Punishment") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.Property("Time") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("WarningPunishment"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.WarningPunishment2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Count") + .HasColumnType("integer"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("Punishment") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.Property("Time") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("WarningPunishment2"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.XpCurrencyReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Amount") + .HasColumnType("integer"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Level") + .HasColumnType("integer"); + + b.Property("XpSettingsId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("XpSettingsId"); + + b.ToTable("XpCurrencyReward"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.XpRoleReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Level") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.Property("XpSettingsId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("XpSettingsId", "Level") + .IsUnique(); + + b.ToTable("XpRoleReward"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.XpSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("NotifyMessage") + .HasColumnType("text"); + + b.Property("ServerExcluded") + .HasColumnType("boolean"); + + b.Property("XpRoleRewardExclusive") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId") + .IsUnique(); + + b.ToTable("XpSettings"); + }); + + modelBuilder.Entity("TicketButton", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Emoji") + .IsRequired() + .HasColumnType("text"); + + b.Property("Label") + .IsRequired() + .HasColumnType("text"); + + b.Property("OpenMessage") + .IsRequired() + .HasColumnType("text"); + + b.Property("TicketPanelId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TicketPanelId"); + + b.ToTable("TicketButtons"); + }); + + modelBuilder.Entity("TicketPanel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("TicketPanels"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AntiAltSetting", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithOne("AntiAltSetting") + .HasForeignKey("Mewdeko.Database.Models.AntiAltSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AntiRaidSetting", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithOne("AntiRaidSetting") + .HasForeignKey("Mewdeko.Database.Models.AntiRaidSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AntiSpamIgnore", b => + { + b.HasOne("Mewdeko.Database.Models.AntiSpamSetting", null) + .WithMany("IgnoredChannels") + .HasForeignKey("AntiSpamSettingId"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AntiSpamSetting", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithOne("AntiSpamSetting") + .HasForeignKey("Mewdeko.Database.Models.AntiSpamSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.CommandAlias", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("CommandAliases") + .HasForeignKey("GuildConfigId"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.CommandCooldown", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("CommandCooldowns") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.DelMsgOnCmdChannel", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("DelMsgOnCmdChannels") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.ExcludedItem", b => + { + b.HasOne("Mewdeko.Database.Models.XpSettings", null) + .WithMany("ExclusionList") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FeedSub", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("FeedSubs") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FilterInvitesChannelIds", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("FilterInvitesChannelIds") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FilterLinksChannelId", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("FilterLinksChannelIds") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FilterWordsChannelIds", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("FilterWordsChannelIds") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FilteredWord", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("FilteredWords") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FollowedStream", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("FollowedStreams") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.GroupName", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("SelfAssignableRoleGroupNames") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.GuildConfig", b => + { + b.HasOne("Mewdeko.Database.Models.LogSetting", "LogSetting") + .WithMany() + .HasForeignKey("LogSettingId"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.IgnoredLogChannel", b => + { + b.HasOne("Mewdeko.Database.Models.LogSetting", null) + .WithMany("IgnoredChannels") + .HasForeignKey("LogSettingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.MutedUserId", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("MutedUsers") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.NsfwBlacklitedTag", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("NsfwBlacklistedTags") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Permission", b => + { + b.HasOne("Mewdeko.Database.Models.Permission", "Next") + .WithOne("Previous") + .HasForeignKey("Mewdeko.Database.Models.Permission", "NextId"); + + b.Navigation("Next"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Permissionv2", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("Permissions") + .HasForeignKey("GuildConfigId"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.PlaylistSong", b => + { + b.HasOne("Mewdeko.Database.Models.MusicPlaylist", null) + .WithMany("Songs") + .HasForeignKey("MusicPlaylistId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.PollAnswers", b => + { + b.HasOne("Mewdeko.Database.Models.Polls", null) + .WithMany("Answers") + .HasForeignKey("PollsId"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.PollVote", b => + { + b.HasOne("Mewdeko.Database.Models.Polls", null) + .WithMany("Votes") + .HasForeignKey("PollsId"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.ReactionRole", b => + { + b.HasOne("Mewdeko.Database.Models.ReactionRoleMessage", null) + .WithMany("ReactionRoles") + .HasForeignKey("ReactionRoleMessageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.ReactionRoleMessage", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("ReactionRoleMessages") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Repeater", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("GuildRepeaters") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.StreamRoleBlacklistedUser", b => + { + b.HasOne("Mewdeko.Database.Models.StreamRoleSettings", null) + .WithMany("Blacklist") + .HasForeignKey("StreamRoleSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.StreamRoleSettings", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithOne("StreamRole") + .HasForeignKey("Mewdeko.Database.Models.StreamRoleSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.StreamRoleWhitelistedUser", b => + { + b.HasOne("Mewdeko.Database.Models.StreamRoleSettings", null) + .WithMany("Whitelist") + .HasForeignKey("StreamRoleSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Template", b => + { + b.HasOne("Mewdeko.Database.Models.TemplateBar", "TemplateBar") + .WithMany() + .HasForeignKey("TemplateBarId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mewdeko.Database.Models.TemplateClub", "TemplateClub") + .WithMany() + .HasForeignKey("TemplateClubId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mewdeko.Database.Models.TemplateGuild", "TemplateGuild") + .WithMany() + .HasForeignKey("TemplateGuildId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mewdeko.Database.Models.TemplateUser", "TemplateUser") + .WithMany() + .HasForeignKey("TemplateUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("TemplateBar"); + + b.Navigation("TemplateClub"); + + b.Navigation("TemplateGuild"); + + b.Navigation("TemplateUser"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.UnbanTimer", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("UnbanTimer") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.UnmuteTimer", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("UnmuteTimers") + .HasForeignKey("GuildConfigId"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.UnroleTimer", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("UnroleTimer") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.VcRoleInfo", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("VcRoleInfos") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.WarningPunishment", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("WarnPunishments") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.WarningPunishment2", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("WarnPunishments2") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.XpCurrencyReward", b => + { + b.HasOne("Mewdeko.Database.Models.XpSettings", "XpSettings") + .WithMany("CurrencyRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.XpRoleReward", b => + { + b.HasOne("Mewdeko.Database.Models.XpSettings", "XpSettings") + .WithMany("RoleRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.XpSettings", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithOne("XpSettings") + .HasForeignKey("Mewdeko.Database.Models.XpSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("TicketButton", b => + { + b.HasOne("TicketPanel", null) + .WithMany("Buttons") + .HasForeignKey("TicketPanelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AntiSpamSetting", b => + { + b.Navigation("IgnoredChannels"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.GuildConfig", b => + { + b.Navigation("AntiAltSetting") + .IsRequired(); + + b.Navigation("AntiRaidSetting") + .IsRequired(); + + b.Navigation("AntiSpamSetting") + .IsRequired(); + + b.Navigation("CommandAliases"); + + b.Navigation("CommandCooldowns"); + + b.Navigation("DelMsgOnCmdChannels"); + + b.Navigation("FeedSubs"); + + b.Navigation("FilterInvitesChannelIds"); + + b.Navigation("FilterLinksChannelIds"); + + b.Navigation("FilterWordsChannelIds"); + + b.Navigation("FilteredWords"); + + b.Navigation("FollowedStreams"); + + b.Navigation("GuildRepeaters"); + + b.Navigation("MutedUsers"); + + b.Navigation("NsfwBlacklistedTags"); + + b.Navigation("Permissions"); + + b.Navigation("ReactionRoleMessages"); + + b.Navigation("SelfAssignableRoleGroupNames"); + + b.Navigation("StreamRole"); + + b.Navigation("UnbanTimer"); + + b.Navigation("UnmuteTimers"); + + b.Navigation("UnroleTimer"); + + b.Navigation("VcRoleInfos"); + + b.Navigation("WarnPunishments"); + + b.Navigation("WarnPunishments2"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.LogSetting", b => + { + b.Navigation("IgnoredChannels"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.MusicPlaylist", b => + { + b.Navigation("Songs"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Permission", b => + { + b.Navigation("Previous") + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Polls", b => + { + b.Navigation("Answers"); + + b.Navigation("Votes"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.ReactionRoleMessage", b => + { + b.Navigation("ReactionRoles"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.StreamRoleSettings", b => + { + b.Navigation("Blacklist"); + + b.Navigation("Whitelist"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.XpSettings", b => + { + b.Navigation("CurrencyRewards"); + + b.Navigation("ExclusionList"); + + b.Navigation("RoleRewards"); + }); + + modelBuilder.Entity("TicketPanel", b => + { + b.Navigation("Buttons"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Mewdeko/Database/Migrations/PostgreSql/20240810050710_Tickets.cs b/src/Mewdeko/Database/Migrations/PostgreSql/20240810050710_Tickets.cs new file mode 100644 index 000000000..a9f774399 --- /dev/null +++ b/src/Mewdeko/Database/Migrations/PostgreSql/20240810050710_Tickets.cs @@ -0,0 +1,71 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Mewdeko.Database.Migrations.PostgreSql +{ + /// + public partial class Tickets : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "TicketPanels", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + GuildId = table.Column(type: "numeric(20,0)", nullable: false), + ChannelId = table.Column(type: "numeric(20,0)", nullable: false), + Title = table.Column(type: "text", nullable: false), + Description = table.Column(type: "text", nullable: false), + DateAdded = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_TicketPanels", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "TicketButtons", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + TicketPanelId = table.Column(type: "integer", nullable: false), + Label = table.Column(type: "text", nullable: false), + Emoji = table.Column(type: "text", nullable: false), + OpenMessage = table.Column(type: "text", nullable: false), + DateAdded = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_TicketButtons", x => x.Id); + table.ForeignKey( + name: "FK_TicketButtons_TicketPanels_TicketPanelId", + column: x => x.TicketPanelId, + principalTable: "TicketPanels", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_TicketButtons_TicketPanelId", + table: "TicketButtons", + column: "TicketPanelId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "TicketButtons"); + + migrationBuilder.DropTable( + name: "TicketPanels"); + } + } +} diff --git a/src/Mewdeko/Database/Migrations/PostgreSql/20240814024523_MessageCounts.Designer.cs b/src/Mewdeko/Database/Migrations/PostgreSql/20240814024523_MessageCounts.Designer.cs new file mode 100644 index 000000000..33af97a17 --- /dev/null +++ b/src/Mewdeko/Database/Migrations/PostgreSql/20240814024523_MessageCounts.Designer.cs @@ -0,0 +1,4217 @@ +// +using System; +using Mewdeko.Database; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Mewdeko.Database.Migrations.PostgreSql +{ + [DbContext(typeof(MewdekoPostgresContext))] + [Migration("20240814024523_MessageCounts")] + partial class MessageCounts + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Mewdeko.Database.Models.Afk", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("Message") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.Property("WasTimed") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("When") + .HasColumnType("timestamp without time zone"); + + b.HasKey("Id"); + + b.ToTable("AFK"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AntiAltSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("ActionDurationMinutes") + .HasColumnType("integer"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("MinAge") + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId") + .IsUnique(); + + b.ToTable("AntiAltSetting"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AntiRaidSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("PunishDuration") + .HasColumnType("integer"); + + b.Property("Seconds") + .HasColumnType("integer"); + + b.Property("UserThreshold") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId") + .IsUnique(); + + b.ToTable("AntiRaidSetting"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AntiSpamIgnore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AntiSpamSettingId") + .HasColumnType("integer"); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.HasKey("Id"); + + b.HasIndex("AntiSpamSettingId"); + + b.ToTable("AntiSpamIgnore"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AntiSpamSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("MessageThreshold") + .HasColumnType("integer"); + + b.Property("MuteTime") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId") + .IsUnique(); + + b.ToTable("AntiSpamSetting"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AutoBanEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("Word") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("AutoBanWords"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AutoBanRoles", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("AutoBanRoles"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AutoCommand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("ChannelName") + .HasColumnType("text"); + + b.Property("CommandText") + .HasColumnType("text"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("GuildName") + .HasColumnType("text"); + + b.Property("Interval") + .HasColumnType("integer"); + + b.Property("VoiceChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("VoiceChannelName") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("AutoCommands"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AutoPublish", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BlacklistedUsers") + .HasColumnType("numeric(20,0)"); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("AutoPublish"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.BanTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("Text") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GuildId") + .IsUnique(); + + b.ToTable("BanTemplates"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.BlacklistEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("ItemId") + .HasColumnType("numeric(20,0)"); + + b.Property("Reason") + .HasColumnType("text"); + + b.Property("Type") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Blacklist"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.ChatTriggers", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AllowTarget") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("ApplicationCommandDescription") + .HasColumnType("text"); + + b.Property("ApplicationCommandId") + .HasColumnType("numeric(20,0)"); + + b.Property("ApplicationCommandName") + .HasColumnType("text"); + + b.Property("ApplicationCommandType") + .HasColumnType("integer"); + + b.Property("AutoDeleteTrigger") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("ContainsAnywhere") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("CrosspostingChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("CrosspostingWebhookUrl") + .HasColumnType("text"); + + b.Property("CustomPrefix") + .HasColumnType("text"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("DmResponse") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("EphemeralResponse") + .HasColumnType("boolean"); + + b.Property("GrantedRoles") + .HasColumnType("text"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("IsRegex") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("NoRespond") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("OwnerOnly") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("PrefixType") + .HasColumnType("integer"); + + b.Property("ReactToTrigger") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("Reactions") + .HasColumnType("text"); + + b.Property("RemovedRoles") + .HasColumnType("text"); + + b.Property("Response") + .HasColumnType("text"); + + b.Property("RoleGrantType") + .HasColumnType("integer"); + + b.Property("Trigger") + .HasColumnType("text"); + + b.Property("UseCount") + .HasColumnType("numeric(20,0)"); + + b.Property("ValidTriggerTypes") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("ChatTriggers"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.CommandAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("Mapping") + .HasColumnType("text"); + + b.Property("Trigger") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("CommandAlias"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.CommandCooldown", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CommandName") + .HasColumnType("text"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("Seconds") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("CommandCooldown"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.CommandStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("IsSlash") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("Module") + .ValueGeneratedOnAdd() + .HasColumnType("text") + .HasDefaultValue(""); + + b.Property("NameOrId") + .HasColumnType("text"); + + b.Property("Trigger") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("CommandStats"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Confessions", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("ConfessNumber") + .HasColumnType("numeric(20,0)"); + + b.Property("Confession") + .HasColumnType("text"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("MessageId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("Confessions"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.DelMsgOnCmdChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("State") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(true); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("DelMsgOnCmdChannel"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.DiscordPermOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Command") + .HasColumnType("text"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("Perm") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("GuildId", "Command") + .IsUnique(); + + b.ToTable("DiscordPermOverrides"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.DiscordUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AvatarId") + .HasColumnType("text"); + + b.Property("Bio") + .HasColumnType("text"); + + b.Property("Birthday") + .HasColumnType("timestamp without time zone"); + + b.Property("BirthdayDisplayMode") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Discriminator") + .HasColumnType("text"); + + b.Property("IsClubAdmin") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("IsDragon") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("LastLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp without time zone") + .HasDefaultValue(new DateTime(2017, 9, 21, 20, 53, 13, 305, DateTimeKind.Local)); + + b.Property("NotifyOnLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0); + + b.Property("ProfileColor") + .HasColumnType("bigint"); + + b.Property("ProfileImageUrl") + .HasColumnType("text"); + + b.Property("ProfilePrivacy") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0); + + b.Property("Pronouns") + .HasColumnType("text"); + + b.Property("PronounsClearedReason") + .HasColumnType("text"); + + b.Property("PronounsDisabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("StatsOptOut") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("SwitchFriendCode") + .HasColumnType("text"); + + b.Property("TotalXp") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.Property("Username") + .HasColumnType("text"); + + b.Property("ZodiacSign") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasAlternateKey("UserId"); + + b.HasIndex("TotalXp"); + + b.HasIndex("UserId"); + + b.ToTable("DiscordUser"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.ExcludedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("ItemId") + .HasColumnType("numeric(20,0)"); + + b.Property("ItemType") + .HasColumnType("integer"); + + b.Property("XpSettingsId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("XpSettingsId"); + + b.ToTable("ExcludedItem"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FeedSub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("Message") + .HasColumnType("text"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasAlternateKey("GuildConfigId", "Url"); + + b.ToTable("FeedSub"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FilterInvitesChannelIds", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("FilterInvitesChannelIds"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FilterLinksChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("FilterLinksChannelId"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FilterWordsChannelIds", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("FilterWordsChannelIds"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FilteredWord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("Word") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("FilteredWord"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FollowedStream", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("Message") + .HasColumnType("text"); + + b.Property("Type") + .HasColumnType("integer"); + + b.Property("Username") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("FollowedStream"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.GiveawayUsers", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GiveawayId") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("GiveawayUsers"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Giveaways", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BlacklistRoles") + .HasColumnType("text"); + + b.Property("BlacklistUsers") + .HasColumnType("text"); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Emote") + .HasColumnType("text"); + + b.Property("Ended") + .HasColumnType("integer"); + + b.Property("Item") + .HasColumnType("text"); + + b.Property("MessageId") + .HasColumnType("numeric(20,0)"); + + b.Property("RestrictTo") + .HasColumnType("text"); + + b.Property("ServerId") + .HasColumnType("numeric(20,0)"); + + b.Property("UseButton") + .HasColumnType("boolean"); + + b.Property("UseCaptcha") + .HasColumnType("boolean"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.Property("When") + .HasColumnType("timestamp without time zone"); + + b.Property("Winners") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Giveaways"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.GlobalUserBalance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Balance") + .HasColumnType("bigint"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("GlobalUserBalance"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.GroupName", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Number") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId", "Number") + .IsUnique(); + + b.ToTable("GroupName"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.GuildConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AcceptChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("AcceptMessage") + .HasColumnType("text"); + + b.Property("AfkDel") + .HasColumnType("text"); + + b.Property("AfkDisabledChannels") + .HasColumnType("text"); + + b.Property("AfkLength") + .HasColumnType("integer"); + + b.Property("AfkMessage") + .HasColumnType("text"); + + b.Property("AfkTimeout") + .HasColumnType("integer"); + + b.Property("AfkType") + .HasColumnType("integer"); + + b.Property("ArchiveOnAccept") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("ArchiveOnConsider") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("ArchiveOnDeny") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("ArchiveOnImplement") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("AutoAssignRoleId") + .HasColumnType("text"); + + b.Property("AutoBotRoleIds") + .HasColumnType("text"); + + b.Property("AutoDeleteByeMessages") + .HasColumnType("boolean"); + + b.Property("AutoDeleteByeMessagesTimer") + .HasColumnType("integer"); + + b.Property("AutoDeleteGreetMessages") + .HasColumnType("boolean"); + + b.Property("AutoDeleteGreetMessagesTimer") + .HasColumnType("integer"); + + b.Property("AutoDeleteSelfAssignedRoleMessages") + .HasColumnType("boolean"); + + b.Property("BoostMessage") + .HasColumnType("text"); + + b.Property("BoostMessageChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("BoostMessageDeleteAfter") + .HasColumnType("integer"); + + b.Property("ButtonRepostThreshold") + .HasColumnType("integer"); + + b.Property("ByeMessageChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("ChannelByeMessageText") + .HasColumnType("text"); + + b.Property("ChannelGreetMessageText") + .HasColumnType("text"); + + b.Property("CleverbotChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("CommandLogChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("ConfessionBlacklist") + .HasColumnType("text"); + + b.Property("ConfessionChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("ConfessionLogChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("ConsiderChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("ConsiderMessage") + .HasColumnType("text"); + + b.Property("CurrencyEmoji") + .HasColumnType("text"); + + b.Property("CurrencyName") + .HasColumnType("text"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("DeleteMessageOnCommand") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("DenyChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("DenyMessage") + .HasColumnType("text"); + + b.Property("DmGreetMessageText") + .HasColumnType("text"); + + b.Property("DmOnGiveawayWin") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(true); + + b.Property("Emote1Style") + .HasColumnType("integer"); + + b.Property("Emote2Style") + .HasColumnType("integer"); + + b.Property("Emote3Style") + .HasColumnType("integer"); + + b.Property("Emote4Style") + .HasColumnType("integer"); + + b.Property("Emote5Style") + .HasColumnType("integer"); + + b.Property("EmoteMode") + .HasColumnType("integer"); + + b.Property("ExclusiveSelfAssignedRoles") + .HasColumnType("boolean"); + + b.Property("FilterInvites") + .HasColumnType("boolean"); + + b.Property("FilterLinks") + .HasColumnType("boolean"); + + b.Property("FilterWords") + .HasColumnType("boolean"); + + b.Property("GBAction") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("GBEnabled") + .HasColumnType("integer"); + + b.Property("GEndMessage") + .HasColumnType("text"); + + b.Property("GRolesBlacklist") + .HasColumnType("text"); + + b.Property("GStartMessage") + .HasColumnType("text"); + + b.Property("GUsersBlacklist") + .HasColumnType("text"); + + b.Property("GWinMessage") + .HasColumnType("text"); + + b.Property("GameMasterRole") + .HasColumnType("numeric(20,0)"); + + b.Property("GameVoiceChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("GiveawayBanner") + .HasColumnType("text"); + + b.Property("GiveawayEmbedColor") + .HasColumnType("text"); + + b.Property("GiveawayEmote") + .HasColumnType("text"); + + b.Property("GiveawayEndMessage") + .HasColumnType("text"); + + b.Property("GiveawayPingRole") + .HasColumnType("numeric(20,0)"); + + b.Property("GiveawayWinEmbedColor") + .HasColumnType("text"); + + b.Property("GreetHook") + .HasColumnType("text"); + + b.Property("GreetMessageChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("ImplementChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("ImplementMessage") + .HasColumnType("text"); + + b.Property("JoinGraphColor") + .HasColumnType("bigint"); + + b.Property("Joins") + .HasColumnType("numeric(20,0)"); + + b.Property("LeaveGraphColor") + .HasColumnType("bigint"); + + b.Property("LeaveHook") + .HasColumnType("text"); + + b.Property("Leaves") + .HasColumnType("numeric(20,0)"); + + b.Property("Locale") + .HasColumnType("text"); + + b.Property("LogSettingId") + .HasColumnType("integer"); + + b.Property("MaxSuggestLength") + .HasColumnType("integer"); + + b.Property("MemberRole") + .HasColumnType("numeric(20,0)"); + + b.Property("MinSuggestLength") + .HasColumnType("integer"); + + b.Property("MiniWarnlogChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("MultiGreetType") + .HasColumnType("integer"); + + b.Property("MuteRoleName") + .HasColumnType("text"); + + b.Property("NotifyStreamOffline") + .HasColumnType("boolean"); + + b.Property("PermissionRole") + .HasColumnType("text"); + + b.Property("Prefix") + .HasColumnType("text"); + + b.Property("PreviewLinks") + .HasColumnType("integer"); + + b.Property("ReactChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("RepostThreshold") + .HasColumnType("integer"); + + b.Property("RewardAmount") + .HasColumnType("integer"); + + b.Property("RewardTimeoutSeconds") + .HasColumnType("integer"); + + b.Property("SendBoostMessage") + .HasColumnType("boolean"); + + b.Property("SendChannelByeMessage") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("SendChannelGreetMessage") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("SendDmGreetMessage") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("StaffRole") + .HasColumnType("numeric(20,0)"); + + b.Property("Star2") + .HasColumnType("text"); + + b.Property("StarboardAllowBots") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("StarboardChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("StarboardCheckChannels") + .HasColumnType("text"); + + b.Property("StarboardRemoveOnBelowThreshold") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(true); + + b.Property("StarboardRemoveOnDelete") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("StarboardRemoveOnReactionsClear") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("Stars") + .HasColumnType("integer"); + + b.Property("StatsOptOut") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("SuggestButtonChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("SuggestButtonColor") + .HasColumnType("integer"); + + b.Property("SuggestButtonEmote") + .HasColumnType("text"); + + b.Property("SuggestButtonMessage") + .HasColumnType("text"); + + b.Property("SuggestButtonMessageId") + .HasColumnType("numeric(20,0)"); + + b.Property("SuggestButtonName") + .HasColumnType("text"); + + b.Property("SuggestButtonRepostThreshold") + .HasColumnType("integer"); + + b.Property("SuggestCommandsType") + .HasColumnType("integer"); + + b.Property("SuggestEmotes") + .HasColumnType("text"); + + b.Property("SuggestMessage") + .HasColumnType("text"); + + b.Property("SuggestionThreadType") + .HasColumnType("integer"); + + b.Property("TOpenMessage") + .HasColumnType("text"); + + b.Property("TicketCategory") + .HasColumnType("numeric(20,0)"); + + b.Property("TicketChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("TimeZoneId") + .HasColumnType("text"); + + b.Property("UseMessageCount") + .HasColumnType("boolean"); + + b.Property("UseStarboardBlacklist") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(true); + + b.Property("VerboseErrors") + .HasColumnType("boolean"); + + b.Property("VerbosePermissions") + .HasColumnType("boolean"); + + b.Property("VoteEmbed") + .HasColumnType("text"); + + b.Property("VotesChannel") + .HasColumnType("numeric(20,0)"); + + b.Property("VotesPassword") + .HasColumnType("text"); + + b.Property("WarnExpireAction") + .HasColumnType("integer"); + + b.Property("WarnExpireHours") + .HasColumnType("integer"); + + b.Property("WarnMessage") + .HasColumnType("text"); + + b.Property("WarningsInitialized") + .HasColumnType("boolean"); + + b.Property("WarnlogChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("XpImgUrl") + .HasColumnType("text"); + + b.Property("XpTxtRate") + .HasColumnType("integer"); + + b.Property("XpTxtTimeout") + .HasColumnType("integer"); + + b.Property("XpVoiceRate") + .HasColumnType("integer"); + + b.Property("XpVoiceTimeout") + .HasColumnType("integer"); + + b.Property("fwarn") + .HasColumnType("integer"); + + b.Property("invwarn") + .HasColumnType("integer"); + + b.Property("removeroles") + .HasColumnType("integer"); + + b.Property("snipeset") + .HasColumnType("boolean"); + + b.Property("sugchan") + .HasColumnType("numeric(20,0)"); + + b.Property("sugnum") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("GuildId") + .IsUnique(); + + b.HasIndex("LogSettingId"); + + b.HasIndex("WarnExpireHours"); + + b.ToTable("GuildConfigs"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.GuildUserBalance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Balance") + .HasColumnType("bigint"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("GuildUserBalance"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.HighlightSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("HighlightsOn") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("IgnoredChannels") + .HasColumnType("text"); + + b.Property("IgnoredUsers") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("HighlightSettings"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Highlights", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.Property("Word") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Highlights"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.IgnoredLogChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("LogSettingId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("LogSettingId"); + + b.ToTable("IgnoredLogChannels"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.JoinLeaveLogs", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("IsJoin") + .HasColumnType("boolean"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("JoinLeaveLogs"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.LogSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AvatarUpdatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("ChannelCreated") + .HasColumnType("bigint"); + + b.Property("ChannelCreatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("ChannelDestroyed") + .HasColumnType("bigint"); + + b.Property("ChannelDestroyedId") + .HasColumnType("numeric(20,0)"); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("ChannelUpdated") + .HasColumnType("bigint"); + + b.Property("ChannelUpdatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("EventCreatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("IsLogging") + .HasColumnType("bigint"); + + b.Property("LogOtherId") + .HasColumnType("numeric(20,0)"); + + b.Property("LogUserPresence") + .HasColumnType("bigint"); + + b.Property("LogUserPresenceId") + .HasColumnType("numeric(20,0)"); + + b.Property("LogVoicePresence") + .HasColumnType("bigint"); + + b.Property("LogVoicePresenceId") + .HasColumnType("numeric(20,0)"); + + b.Property("LogVoicePresenceTTSId") + .HasColumnType("numeric(20,0)"); + + b.Property("MessageDeleted") + .HasColumnType("bigint"); + + b.Property("MessageDeletedId") + .HasColumnType("numeric(20,0)"); + + b.Property("MessageUpdated") + .HasColumnType("bigint"); + + b.Property("MessageUpdatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("NicknameUpdatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("RoleCreatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("RoleDeletedId") + .HasColumnType("numeric(20,0)"); + + b.Property("RoleUpdatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("ServerUpdatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("ThreadCreatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("ThreadDeletedId") + .HasColumnType("numeric(20,0)"); + + b.Property("ThreadUpdatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserBanned") + .HasColumnType("bigint"); + + b.Property("UserBannedId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserJoined") + .HasColumnType("bigint"); + + b.Property("UserJoinedId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserLeft") + .HasColumnType("bigint"); + + b.Property("UserLeftId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserMutedId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserPresenceChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserRoleAddedId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserRoleRemovedId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserUnbanned") + .HasColumnType("bigint"); + + b.Property("UserUnbannedId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserUpdated") + .HasColumnType("bigint"); + + b.Property("UserUpdatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("UsernameUpdatedId") + .HasColumnType("numeric(20,0)"); + + b.Property("VoicePresenceChannelId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("LogSettings"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.MessageCount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("Count") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("MessageCounts"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.MultiGreet", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("DeleteTime") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(1); + + b.Property("Disabled") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("GreetBots") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("Message") + .HasColumnType("text"); + + b.Property("WebhookUrl") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("MultiGreets"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.MusicPlayerSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AutoDisconnect") + .HasColumnType("integer"); + + b.Property("AutoPlay") + .HasColumnType("integer"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("MusicChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("PlayerRepeat") + .HasColumnType("integer"); + + b.Property("Volume") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(100); + + b.HasKey("Id"); + + b.HasIndex("GuildId") + .IsUnique(); + + b.ToTable("MusicPlayerSettings"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.MusicPlaylist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Author") + .HasColumnType("text"); + + b.Property("AuthorId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("IsDefault") + .HasColumnType("boolean"); + + b.Property("Name") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("MusicPlaylists"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.MutedUserId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.Property("roles") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("MutedUserId"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.NsfwBlacklitedTag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("Tag") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("NsfwBlacklitedTag"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.OwnerOnly", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CurrencyEmote") + .HasColumnType("text"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GptTokensUsed") + .HasColumnType("integer"); + + b.Property("Owners") + .HasColumnType("text"); + + b.Property("RewardAmount") + .HasColumnType("integer"); + + b.Property("RewardTimeoutSeconds") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("OwnerOnly"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Permission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("NextId") + .HasColumnType("integer"); + + b.Property("PrimaryTarget") + .HasColumnType("integer"); + + b.Property("PrimaryTargetId") + .HasColumnType("numeric(20,0)"); + + b.Property("SecondaryTarget") + .HasColumnType("integer"); + + b.Property("SecondaryTargetName") + .HasColumnType("text"); + + b.Property("State") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("NextId") + .IsUnique(); + + b.ToTable("Permission"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Permissionv2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("Index") + .HasColumnType("integer"); + + b.Property("IsCustomCommand") + .HasColumnType("boolean"); + + b.Property("PrimaryTarget") + .HasColumnType("integer"); + + b.Property("PrimaryTargetId") + .HasColumnType("numeric(20,0)"); + + b.Property("SecondaryTarget") + .HasColumnType("integer"); + + b.Property("SecondaryTargetName") + .HasColumnType("text"); + + b.Property("State") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("Permissionv2"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.PlaylistSong", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("MusicPlaylistId") + .HasColumnType("integer"); + + b.Property("Provider") + .HasColumnType("text"); + + b.Property("ProviderType") + .HasColumnType("integer"); + + b.Property("Query") + .HasColumnType("text"); + + b.Property("Title") + .HasColumnType("text"); + + b.Property("Uri") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("MusicPlaylistId"); + + b.ToTable("PlaylistSong"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.PollAnswers", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Index") + .HasColumnType("integer"); + + b.Property("PollsId") + .HasColumnType("integer"); + + b.Property("Text") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("PollsId"); + + b.ToTable("PollAnswer"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.PollVote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("PollId") + .HasColumnType("integer"); + + b.Property("PollsId") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.Property("VoteIndex") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("PollsId"); + + b.ToTable("PollVote"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Polls", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("PollType") + .HasColumnType("integer"); + + b.Property("Question") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GuildId") + .IsUnique(); + + b.ToTable("Poll"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.PublishUserBlacklist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("User") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("PublishUserBlacklist"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.PublishWordBlacklist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Word") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("PublishWordBlacklist"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Quote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AuthorId") + .HasColumnType("numeric(20,0)"); + + b.Property("AuthorName") + .IsRequired() + .HasColumnType("text"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("Keyword") + .IsRequired() + .HasColumnType("text"); + + b.Property("Text") + .IsRequired() + .HasColumnType("text"); + + b.Property("UseCount") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("GuildId"); + + b.HasIndex("Keyword"); + + b.ToTable("Quotes"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.ReactionRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("EmoteName") + .HasColumnType("text"); + + b.Property("ReactionRoleMessageId") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("ReactionRoleMessageId"); + + b.ToTable("ReactionRole"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.ReactionRoleMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Exclusive") + .HasColumnType("boolean"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("Index") + .HasColumnType("integer"); + + b.Property("MessageId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("ReactionRoleMessage"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Reminder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("IsPrivate") + .HasColumnType("boolean"); + + b.Property("Message") + .HasColumnType("text"); + + b.Property("ServerId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.Property("When") + .HasColumnType("timestamp without time zone"); + + b.HasKey("Id"); + + b.HasIndex("When"); + + b.ToTable("Reminders"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Repeater", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("Interval") + .HasColumnType("text"); + + b.Property("LastMessageId") + .HasColumnType("numeric(20,0)"); + + b.Property("Message") + .HasColumnType("text"); + + b.Property("NoRedundant") + .HasColumnType("boolean"); + + b.Property("StartTimeOfDay") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("GuildRepeater"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.RoleConnectionAuthStorage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("ExpiresAt") + .HasColumnType("timestamp without time zone"); + + b.Property("RefreshToken") + .HasColumnType("text"); + + b.Property("Scopes") + .HasColumnType("text"); + + b.Property("Token") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("AuthCodes"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.RoleGreet", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("DeleteTime") + .HasColumnType("integer"); + + b.Property("Disabled") + .HasColumnType("boolean"); + + b.Property("GreetBots") + .HasColumnType("boolean"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("Message") + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.Property("WebhookUrl") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("RoleGreets"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.RoleStateSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClearOnBan") + .HasColumnType("boolean"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("DeniedRoles") + .HasColumnType("text"); + + b.Property("DeniedUsers") + .HasColumnType("text"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("IgnoreBots") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.ToTable("RoleStateSettings"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.RotatingPlayingStatus", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Status") + .HasColumnType("text"); + + b.Property("Type") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("RotatingStatus"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.SelfAssignedRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Group") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("LevelRequirement") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("GuildId", "RoleId") + .IsUnique(); + + b.ToTable("SelfAssignableRoles"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.ServerRecoveryStore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("RecoveryKey") + .HasColumnType("text"); + + b.Property("TwoFactorKey") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("ServerRecoveryStore"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.StarboardPosts", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("MessageId") + .HasColumnType("numeric(20,0)"); + + b.Property("PostId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("Starboard"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.StatusRolesTable", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("ReaddRemoved") + .HasColumnType("boolean"); + + b.Property("RemoveAdded") + .HasColumnType("boolean"); + + b.Property("Status") + .HasColumnType("text"); + + b.Property("StatusChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("StatusEmbed") + .HasColumnType("text"); + + b.Property("ToAdd") + .HasColumnType("text"); + + b.Property("ToRemove") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("StatusRoles"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.StreamRoleBlacklistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.Property("Username") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("StreamRoleSettingsId"); + + b.ToTable("StreamRoleBlacklistedUser"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.StreamRoleSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AddRoleId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("FromRoleId") + .HasColumnType("numeric(20,0)"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("Keyword") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId") + .IsUnique(); + + b.ToTable("StreamRoleSettings"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.StreamRoleWhitelistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.Property("Username") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("StreamRoleSettingsId"); + + b.ToTable("StreamRoleWhitelistedUser"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.SuggestThreads", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("MessageId") + .HasColumnType("numeric(20,0)"); + + b.Property("ThreadChannelId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("SuggestThreads"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.SuggestVotes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("EmotePicked") + .HasColumnType("integer"); + + b.Property("MessageId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("SuggestVotes"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.SuggestionsModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CurrentState") + .HasColumnType("integer"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("EmoteCount1") + .HasColumnType("integer"); + + b.Property("EmoteCount2") + .HasColumnType("integer"); + + b.Property("EmoteCount3") + .HasColumnType("integer"); + + b.Property("EmoteCount4") + .HasColumnType("integer"); + + b.Property("EmoteCount5") + .HasColumnType("integer"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("MessageId") + .HasColumnType("numeric(20,0)"); + + b.Property("StateChangeCount") + .HasColumnType("numeric(20,0)"); + + b.Property("StateChangeMessageId") + .HasColumnType("numeric(20,0)"); + + b.Property("StateChangeUser") + .HasColumnType("numeric(20,0)"); + + b.Property("Suggestion") + .HasColumnType("text"); + + b.Property("SuggestionId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("Suggestions"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Template", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AwardedColor") + .HasColumnType("text"); + + b.Property("AwardedFontSize") + .HasColumnType("integer"); + + b.Property("AwardedX") + .HasColumnType("integer"); + + b.Property("AwardedY") + .HasColumnType("integer"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("OutputSizeX") + .HasColumnType("integer"); + + b.Property("OutputSizeY") + .HasColumnType("integer"); + + b.Property("ShowAwarded") + .HasColumnType("boolean"); + + b.Property("ShowTimeOnLevel") + .HasColumnType("boolean"); + + b.Property("TemplateBarId") + .HasColumnType("integer"); + + b.Property("TemplateClubId") + .HasColumnType("integer"); + + b.Property("TemplateGuildId") + .HasColumnType("integer"); + + b.Property("TemplateUserId") + .HasColumnType("integer"); + + b.Property("TimeOnLevelColor") + .HasColumnType("text"); + + b.Property("TimeOnLevelFontSize") + .HasColumnType("integer"); + + b.Property("TimeOnLevelFormat") + .HasColumnType("text"); + + b.Property("TimeOnLevelX") + .HasColumnType("integer"); + + b.Property("TimeOnLevelY") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TemplateBarId"); + + b.HasIndex("TemplateClubId"); + + b.HasIndex("TemplateGuildId"); + + b.HasIndex("TemplateUserId"); + + b.ToTable("Template"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.TemplateBar", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BarColor") + .HasColumnType("text"); + + b.Property("BarDirection") + .HasColumnType("integer"); + + b.Property("BarLength") + .HasColumnType("integer"); + + b.Property("BarPointAx") + .HasColumnType("integer"); + + b.Property("BarPointAy") + .HasColumnType("integer"); + + b.Property("BarPointBx") + .HasColumnType("integer"); + + b.Property("BarPointBy") + .HasColumnType("integer"); + + b.Property("BarTransparency") + .HasColumnType("smallint"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("ShowBar") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.ToTable("TemplateBar"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.TemplateClub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClubIconSizeX") + .HasColumnType("integer"); + + b.Property("ClubIconSizeY") + .HasColumnType("integer"); + + b.Property("ClubIconX") + .HasColumnType("integer"); + + b.Property("ClubIconY") + .HasColumnType("integer"); + + b.Property("ClubNameColor") + .HasColumnType("text"); + + b.Property("ClubNameFontSize") + .HasColumnType("integer"); + + b.Property("ClubNameX") + .HasColumnType("integer"); + + b.Property("ClubNameY") + .HasColumnType("integer"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("ShowClubIcon") + .HasColumnType("boolean"); + + b.Property("ShowClubName") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.ToTable("TemplateClub"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.TemplateGuild", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildLevelColor") + .HasColumnType("text"); + + b.Property("GuildLevelFontSize") + .HasColumnType("integer"); + + b.Property("GuildLevelX") + .HasColumnType("integer"); + + b.Property("GuildLevelY") + .HasColumnType("integer"); + + b.Property("GuildRankColor") + .HasColumnType("text"); + + b.Property("GuildRankFontSize") + .HasColumnType("integer"); + + b.Property("GuildRankX") + .HasColumnType("integer"); + + b.Property("GuildRankY") + .HasColumnType("integer"); + + b.Property("ShowGuildLevel") + .HasColumnType("boolean"); + + b.Property("ShowGuildRank") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.ToTable("TemplateGuild"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.TemplateUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("FontSize") + .HasColumnType("integer"); + + b.Property("IconSizeX") + .HasColumnType("integer"); + + b.Property("IconSizeY") + .HasColumnType("integer"); + + b.Property("IconX") + .HasColumnType("integer"); + + b.Property("IconY") + .HasColumnType("integer"); + + b.Property("ShowIcon") + .HasColumnType("boolean"); + + b.Property("ShowText") + .HasColumnType("boolean"); + + b.Property("TextColor") + .HasColumnType("text"); + + b.Property("TextX") + .HasColumnType("integer"); + + b.Property("TextY") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("TemplateUser"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.TransactionHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Amount") + .HasColumnType("bigint"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Description") + .HasColumnType("text"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("TransactionHistory"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.UnbanTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("UnbanAt") + .HasColumnType("timestamp without time zone"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("UnbanTimer"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.UnmuteTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("UnmuteAt") + .HasColumnType("timestamp without time zone"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("UnmuteTimer"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.UnroleTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.Property("UnbanAt") + .HasColumnType("timestamp without time zone"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("UnroleTimer"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.UserRoleStates", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("SavedRoles") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserName") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("UserRoleStates"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.UserXpStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AwardedXp") + .HasColumnType("integer"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("LastLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp without time zone") + .HasDefaultValue(new DateTime(2017, 9, 21, 20, 53, 13, 307, DateTimeKind.Local)); + + b.Property("NotifyOnLevelUp") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.Property("Xp") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("AwardedXp"); + + b.HasIndex("GuildId"); + + b.HasIndex("UserId"); + + b.HasIndex("Xp"); + + b.HasIndex("UserId", "GuildId") + .IsUnique(); + + b.ToTable("UserXpStats"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.VcRoleInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.Property("VoiceChannelId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("VcRoleInfo"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.VoteRoles", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.Property("Timer") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("VoteRoles"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Votes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BotId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("Votes"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Warning", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Forgiven") + .HasColumnType("boolean"); + + b.Property("ForgivenBy") + .HasColumnType("text"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("Moderator") + .HasColumnType("text"); + + b.Property("Reason") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.HasIndex("DateAdded"); + + b.HasIndex("GuildId"); + + b.HasIndex("UserId"); + + b.ToTable("Warnings"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Warning2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Forgiven") + .HasColumnType("boolean"); + + b.Property("ForgivenBy") + .HasColumnType("text"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("Moderator") + .HasColumnType("text"); + + b.Property("Reason") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("Warnings2"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.WarningPunishment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Count") + .HasColumnType("integer"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("Punishment") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.Property("Time") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("WarningPunishment"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.WarningPunishment2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Count") + .HasColumnType("integer"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("Punishment") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.Property("Time") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId"); + + b.ToTable("WarningPunishment2"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.XpCurrencyReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Amount") + .HasColumnType("integer"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Level") + .HasColumnType("integer"); + + b.Property("XpSettingsId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("XpSettingsId"); + + b.ToTable("XpCurrencyReward"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.XpRoleReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Level") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("numeric(20,0)"); + + b.Property("XpSettingsId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("XpSettingsId", "Level") + .IsUnique(); + + b.ToTable("XpRoleReward"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.XpSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildConfigId") + .HasColumnType("integer"); + + b.Property("NotifyMessage") + .HasColumnType("text"); + + b.Property("ServerExcluded") + .HasColumnType("boolean"); + + b.Property("XpRoleRewardExclusive") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("GuildConfigId") + .IsUnique(); + + b.ToTable("XpSettings"); + }); + + modelBuilder.Entity("TicketButton", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Emoji") + .IsRequired() + .HasColumnType("text"); + + b.Property("Label") + .IsRequired() + .HasColumnType("text"); + + b.Property("OpenMessage") + .IsRequired() + .HasColumnType("text"); + + b.Property("TicketPanelId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TicketPanelId"); + + b.ToTable("TicketButtons"); + }); + + modelBuilder.Entity("TicketPanel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("MessageJson") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("TicketPanels"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AntiAltSetting", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithOne("AntiAltSetting") + .HasForeignKey("Mewdeko.Database.Models.AntiAltSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AntiRaidSetting", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithOne("AntiRaidSetting") + .HasForeignKey("Mewdeko.Database.Models.AntiRaidSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AntiSpamIgnore", b => + { + b.HasOne("Mewdeko.Database.Models.AntiSpamSetting", null) + .WithMany("IgnoredChannels") + .HasForeignKey("AntiSpamSettingId"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AntiSpamSetting", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithOne("AntiSpamSetting") + .HasForeignKey("Mewdeko.Database.Models.AntiSpamSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.CommandAlias", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("CommandAliases") + .HasForeignKey("GuildConfigId"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.CommandCooldown", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("CommandCooldowns") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.DelMsgOnCmdChannel", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("DelMsgOnCmdChannels") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.ExcludedItem", b => + { + b.HasOne("Mewdeko.Database.Models.XpSettings", null) + .WithMany("ExclusionList") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FeedSub", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("FeedSubs") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FilterInvitesChannelIds", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("FilterInvitesChannelIds") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FilterLinksChannelId", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("FilterLinksChannelIds") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FilterWordsChannelIds", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("FilterWordsChannelIds") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FilteredWord", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("FilteredWords") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.FollowedStream", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("FollowedStreams") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.GroupName", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("SelfAssignableRoleGroupNames") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.GuildConfig", b => + { + b.HasOne("Mewdeko.Database.Models.LogSetting", "LogSetting") + .WithMany() + .HasForeignKey("LogSettingId"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.IgnoredLogChannel", b => + { + b.HasOne("Mewdeko.Database.Models.LogSetting", null) + .WithMany("IgnoredChannels") + .HasForeignKey("LogSettingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.MutedUserId", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("MutedUsers") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.NsfwBlacklitedTag", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("NsfwBlacklistedTags") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Permission", b => + { + b.HasOne("Mewdeko.Database.Models.Permission", "Next") + .WithOne("Previous") + .HasForeignKey("Mewdeko.Database.Models.Permission", "NextId"); + + b.Navigation("Next"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Permissionv2", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("Permissions") + .HasForeignKey("GuildConfigId"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.PlaylistSong", b => + { + b.HasOne("Mewdeko.Database.Models.MusicPlaylist", null) + .WithMany("Songs") + .HasForeignKey("MusicPlaylistId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.PollAnswers", b => + { + b.HasOne("Mewdeko.Database.Models.Polls", null) + .WithMany("Answers") + .HasForeignKey("PollsId"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.PollVote", b => + { + b.HasOne("Mewdeko.Database.Models.Polls", null) + .WithMany("Votes") + .HasForeignKey("PollsId"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.ReactionRole", b => + { + b.HasOne("Mewdeko.Database.Models.ReactionRoleMessage", null) + .WithMany("ReactionRoles") + .HasForeignKey("ReactionRoleMessageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.ReactionRoleMessage", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("ReactionRoleMessages") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Repeater", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("GuildRepeaters") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.StreamRoleBlacklistedUser", b => + { + b.HasOne("Mewdeko.Database.Models.StreamRoleSettings", null) + .WithMany("Blacklist") + .HasForeignKey("StreamRoleSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.StreamRoleSettings", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithOne("StreamRole") + .HasForeignKey("Mewdeko.Database.Models.StreamRoleSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.StreamRoleWhitelistedUser", b => + { + b.HasOne("Mewdeko.Database.Models.StreamRoleSettings", null) + .WithMany("Whitelist") + .HasForeignKey("StreamRoleSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Template", b => + { + b.HasOne("Mewdeko.Database.Models.TemplateBar", "TemplateBar") + .WithMany() + .HasForeignKey("TemplateBarId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mewdeko.Database.Models.TemplateClub", "TemplateClub") + .WithMany() + .HasForeignKey("TemplateClubId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mewdeko.Database.Models.TemplateGuild", "TemplateGuild") + .WithMany() + .HasForeignKey("TemplateGuildId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Mewdeko.Database.Models.TemplateUser", "TemplateUser") + .WithMany() + .HasForeignKey("TemplateUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("TemplateBar"); + + b.Navigation("TemplateClub"); + + b.Navigation("TemplateGuild"); + + b.Navigation("TemplateUser"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.UnbanTimer", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("UnbanTimer") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.UnmuteTimer", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("UnmuteTimers") + .HasForeignKey("GuildConfigId"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.UnroleTimer", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("UnroleTimer") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.VcRoleInfo", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("VcRoleInfos") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.WarningPunishment", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("WarnPunishments") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.WarningPunishment2", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithMany("WarnPunishments2") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.XpCurrencyReward", b => + { + b.HasOne("Mewdeko.Database.Models.XpSettings", "XpSettings") + .WithMany("CurrencyRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.XpRoleReward", b => + { + b.HasOne("Mewdeko.Database.Models.XpSettings", "XpSettings") + .WithMany("RoleRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.XpSettings", b => + { + b.HasOne("Mewdeko.Database.Models.GuildConfig", null) + .WithOne("XpSettings") + .HasForeignKey("Mewdeko.Database.Models.XpSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("TicketButton", b => + { + b.HasOne("TicketPanel", null) + .WithMany("Buttons") + .HasForeignKey("TicketPanelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.AntiSpamSetting", b => + { + b.Navigation("IgnoredChannels"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.GuildConfig", b => + { + b.Navigation("AntiAltSetting") + .IsRequired(); + + b.Navigation("AntiRaidSetting") + .IsRequired(); + + b.Navigation("AntiSpamSetting") + .IsRequired(); + + b.Navigation("CommandAliases"); + + b.Navigation("CommandCooldowns"); + + b.Navigation("DelMsgOnCmdChannels"); + + b.Navigation("FeedSubs"); + + b.Navigation("FilterInvitesChannelIds"); + + b.Navigation("FilterLinksChannelIds"); + + b.Navigation("FilterWordsChannelIds"); + + b.Navigation("FilteredWords"); + + b.Navigation("FollowedStreams"); + + b.Navigation("GuildRepeaters"); + + b.Navigation("MutedUsers"); + + b.Navigation("NsfwBlacklistedTags"); + + b.Navigation("Permissions"); + + b.Navigation("ReactionRoleMessages"); + + b.Navigation("SelfAssignableRoleGroupNames"); + + b.Navigation("StreamRole"); + + b.Navigation("UnbanTimer"); + + b.Navigation("UnmuteTimers"); + + b.Navigation("UnroleTimer"); + + b.Navigation("VcRoleInfos"); + + b.Navigation("WarnPunishments"); + + b.Navigation("WarnPunishments2"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.LogSetting", b => + { + b.Navigation("IgnoredChannels"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.MusicPlaylist", b => + { + b.Navigation("Songs"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Permission", b => + { + b.Navigation("Previous") + .IsRequired(); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.Polls", b => + { + b.Navigation("Answers"); + + b.Navigation("Votes"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.ReactionRoleMessage", b => + { + b.Navigation("ReactionRoles"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.StreamRoleSettings", b => + { + b.Navigation("Blacklist"); + + b.Navigation("Whitelist"); + }); + + modelBuilder.Entity("Mewdeko.Database.Models.XpSettings", b => + { + b.Navigation("CurrencyRewards"); + + b.Navigation("ExclusionList"); + + b.Navigation("RoleRewards"); + }); + + modelBuilder.Entity("TicketPanel", b => + { + b.Navigation("Buttons"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Mewdeko/Database/Migrations/PostgreSql/20240814024523_MessageCounts.cs b/src/Mewdeko/Database/Migrations/PostgreSql/20240814024523_MessageCounts.cs new file mode 100644 index 000000000..01d633c33 --- /dev/null +++ b/src/Mewdeko/Database/Migrations/PostgreSql/20240814024523_MessageCounts.cs @@ -0,0 +1,83 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Mewdeko.Database.Migrations.PostgreSql +{ + /// + public partial class MessageCounts : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Description", + table: "TicketPanels"); + + migrationBuilder.DropColumn( + name: "Title", + table: "TicketPanels"); + + migrationBuilder.AddColumn( + name: "MessageJson", + table: "TicketPanels", + type: "text", + nullable: true); + + migrationBuilder.AddColumn( + name: "UseMessageCount", + table: "GuildConfigs", + type: "boolean", + nullable: false, + defaultValue: true); + + migrationBuilder.CreateTable( + name: "MessageCounts", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + GuildId = table.Column(type: "numeric(20,0)", nullable: false), + ChannelId = table.Column(type: "numeric(20,0)", nullable: false), + UserId = table.Column(type: "numeric(20,0)", nullable: false), + Count = table.Column(type: "numeric(20,0)", nullable: false), + DateAdded = table.Column(type: "timestamp without time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_MessageCounts", x => x.Id); + }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "MessageCounts"); + + migrationBuilder.DropColumn( + name: "MessageJson", + table: "TicketPanels"); + + migrationBuilder.DropColumn( + name: "UseMessageCount", + table: "GuildConfigs"); + + migrationBuilder.AddColumn( + name: "Description", + table: "TicketPanels", + type: "text", + nullable: false, + defaultValue: ""); + + migrationBuilder.AddColumn( + name: "Title", + table: "TicketPanels", + type: "text", + nullable: false, + defaultValue: ""); + } + } +} diff --git a/src/Mewdeko/Database/Migrations/PostgreSql/MewdekoPostgresContextModelSnapshot.cs b/src/Mewdeko/Database/Migrations/PostgreSql/MewdekoPostgresContextModelSnapshot.cs index c85d56bf6..9e93f6b1d 100644 --- a/src/Mewdeko/Database/Migrations/PostgreSql/MewdekoPostgresContextModelSnapshot.cs +++ b/src/Mewdeko/Database/Migrations/PostgreSql/MewdekoPostgresContextModelSnapshot.cs @@ -1457,6 +1457,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("TimeZoneId") .HasColumnType("text"); + b.Property("UseMessageCount") + .HasColumnType("boolean"); + b.Property("UseStarboardBlacklist") .ValueGeneratedOnAdd() .HasColumnType("boolean") @@ -1817,6 +1820,34 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("LogSettings"); }); + modelBuilder.Entity("Mewdeko.Database.Models.MessageCount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("Count") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("UserId") + .HasColumnType("numeric(20,0)"); + + b.HasKey("Id"); + + b.ToTable("MessageCounts"); + }); + modelBuilder.Entity("Mewdeko.Database.Models.MultiGreet", b => { b.Property("Id") @@ -3621,6 +3652,64 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("XpSettings"); }); + modelBuilder.Entity("TicketButton", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("Emoji") + .IsRequired() + .HasColumnType("text"); + + b.Property("Label") + .IsRequired() + .HasColumnType("text"); + + b.Property("OpenMessage") + .IsRequired() + .HasColumnType("text"); + + b.Property("TicketPanelId") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("TicketPanelId"); + + b.ToTable("TicketButtons"); + }); + + modelBuilder.Entity("TicketPanel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("numeric(20,0)"); + + b.Property("DateAdded") + .HasColumnType("timestamp without time zone"); + + b.Property("GuildId") + .HasColumnType("numeric(20,0)"); + + b.Property("MessageJson") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("TicketPanels"); + }); + modelBuilder.Entity("Mewdeko.Database.Models.AntiAltSetting", b => { b.HasOne("Mewdeko.Database.Models.GuildConfig", null) @@ -3999,6 +4088,15 @@ protected override void BuildModel(ModelBuilder modelBuilder) .IsRequired(); }); + modelBuilder.Entity("TicketButton", b => + { + b.HasOne("TicketPanel", null) + .WithMany("Buttons") + .HasForeignKey("TicketPanelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + modelBuilder.Entity("Mewdeko.Database.Models.AntiSpamSetting", b => { b.Navigation("IgnoredChannels"); @@ -4105,6 +4203,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("RoleRewards"); }); + + modelBuilder.Entity("TicketPanel", b => + { + b.Navigation("Buttons"); + }); #pragma warning restore 612, 618 } } diff --git a/src/Mewdeko/Database/Models/Giveaways.cs b/src/Mewdeko/Database/Models/Giveaways.cs index 7ae7e8eb2..2d7620668 100644 --- a/src/Mewdeko/Database/Models/Giveaways.cs +++ b/src/Mewdeko/Database/Models/Giveaways.cs @@ -78,5 +78,10 @@ public class Giveaways : DbEntity /// public bool UseCaptcha { get; set; } + /// + /// The number of messages required for users before entering a giveaway + /// + public ulong MessageCountReq = 0; + } } \ No newline at end of file diff --git a/src/Mewdeko/Database/Models/GuildConfig.cs b/src/Mewdeko/Database/Models/GuildConfig.cs index 493d3b0f0..7480f9690 100644 --- a/src/Mewdeko/Database/Models/GuildConfig.cs +++ b/src/Mewdeko/Database/Models/GuildConfig.cs @@ -1,861 +1,868 @@ - using System.ComponentModel.DataAnnotations.Schema; - using Mewdeko.Database.Common; - - #pragma warning disable CS8632 // The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. - - // ReSharper disable InconsistentNaming - - namespace Mewdeko.Database.Models - { - /// - /// Represents the configuration settings for a guild. - /// - public class GuildConfig : DbEntity - { - /// - /// Gets or sets the guild ID. - /// - public ulong GuildId { get; set; } - - /// - /// Gets or sets the command prefix for the guild. - /// - public string? Prefix { get; set; } = ""; - - /// - /// Gets or sets the role ID for staff members. - /// - public ulong StaffRole { get; set; } - - /// - /// Gets or sets the role ID for game masters. - /// - public ulong GameMasterRole { get; set; } - - /// - /// Gets or sets the channel ID for command logs. - /// - public ulong CommandLogChannel { get; set; } = 0; - - /// - /// Gets or sets a value indicating whether to delete messages after a command is issued. - /// - public bool DeleteMessageOnCommand { get; set; } = false; - - /// - /// Gets or sets the message for warnings. - /// - public string? WarnMessage { get; set; } = "-"; - - /// - /// Gets or sets the channels where messages are deleted after a command is issued. - /// - public HashSet DelMsgOnCmdChannels { get; set; } = []; - - /// - /// Gets or sets the role ID to auto-assign to new members. - /// - public string? AutoAssignRoleId { get; set; } = "0"; - - /// - /// Gets or sets the URL for the XP image. - /// - public string? XpImgUrl { get; set; } - - /// - /// Gets or sets a value indicating whether to opt out of statistics tracking. - /// - public bool StatsOptOut { get; set; } = false; - - /// - /// Gets or sets the name of the guild currency. - /// - public string? CurrencyName { get; set; } = "Coins"; - - /// - /// Gets or sets the emoji used for the guild currency. - /// - public string? CurrencyEmoji { get; set; } = "💰"; - - /// - /// Gets or sets the reward amount for certain actions. - /// - public int RewardAmount { get; set; } = 200; - - /// - /// Gets or sets the reward timeout in seconds. - /// - public int RewardTimeoutSeconds { get; set; } = 86400; - - /// - /// Gets or sets the URL for the giveaway banner. - /// - public string? GiveawayBanner { get; set; } = ""; - - /// - /// Gets or sets the color for the giveaway embed. - /// - public string? GiveawayEmbedColor { get; set; } = ""; - - /// - /// Gets or sets the color for the giveaway win embed. - /// - public string? GiveawayWinEmbedColor { get; set; } = ""; - - /// - /// Gets or sets a value indicating whether to send a direct message to the winner of a giveaway. - /// - public bool DmOnGiveawayWin { get; set; } = true; - - /// - /// Gets or sets the end message for giveaways. - /// - public string? GiveawayEndMessage { get; set; } = ""; - - /// - /// Gets or sets the role to ping for giveaways. - /// - public ulong GiveawayPingRole { get; set; } = 0; - - /// - /// Gets or sets a value indicating whether bots are allowed in the starboard. - /// - public bool StarboardAllowBots { get; set; } = true; - - /// - /// Gets or sets a value indicating whether to remove starboard entries when the original message is deleted. - /// - public bool StarboardRemoveOnDelete { get; set; } = false; - - /// - /// Gets or sets a value indicating whether to remove starboard entries when reactions are cleared. - /// - public bool StarboardRemoveOnReactionsClear { get; set; } = false; - - /// - /// Gets or sets a value indicating whether to remove starboard entries when they fall below the threshold. - /// - public bool StarboardRemoveOnBelowThreshold { get; set; } = true; - - /// - /// Gets or sets a value indicating whether to use a blacklist for the starboard. - /// - public bool UseStarboardBlacklist { get; set; } = true; - - /// - /// Gets or sets the channels to check for starboard entries. - /// - public string? StarboardCheckChannels { get; set; } = "0"; - - /// - /// Gets or sets the password for voting. - /// - public string? VotesPassword { get; set; } - - /// - /// Gets or sets the channel ID for votes. - /// - public ulong VotesChannel { get; set; } - - /// - /// Gets or sets the embed for votes. - /// - public string? VoteEmbed { get; set; } - - /// - /// Gets or sets the type of suggestion threads. - /// - public int SuggestionThreadType { get; set; } = 0; - - /// - /// Gets or sets a value indicating whether to archive suggestions on denial. - /// - public bool ArchiveOnDeny { get; set; } = false; - - /// - /// Gets or sets a value indicating whether to archive suggestions on acceptance. - /// - public bool ArchiveOnAccept { get; set; } = false; - - /// - /// Gets or sets a value indicating whether to archive suggestions on consideration. - /// - public bool ArchiveOnConsider { get; set; } = false; - - /// - /// Gets or sets a value indicating whether to archive suggestions on implementation. - /// - public bool ArchiveOnImplement { get; set; } = false; - - /// - /// Gets or sets the message for the suggestion button. - /// - public string? SuggestButtonMessage { get; set; } = "-"; - - /// - /// Gets or sets the name for the suggestion button. - /// - public string? SuggestButtonName { get; set; } = "-"; - - /// - /// Gets or sets the emote for the suggestion button. - /// - public string? SuggestButtonEmote { get; set; } = "-"; - - /// - /// Gets or sets the repost threshold for the button. - /// - public int ButtonRepostThreshold { get; set; } = 5; - - /// - /// Gets or sets the type for suggestion commands. - /// - public int SuggestCommandsType { get; set; } = 0; - - /// - /// Gets or sets the channel ID for accepted suggestions. - /// - public ulong AcceptChannel { get; set; } = 0; - - /// - /// Gets or sets the channel ID for denied suggestions. - /// - public ulong DenyChannel { get; set; } = 0; - - /// - /// Gets or sets the channel ID for considered suggestions. - /// - public ulong ConsiderChannel { get; set; } = 0; - - /// - /// Gets or sets the channel ID for implemented suggestions. - /// - public ulong ImplementChannel { get; set; } = 0; - - /// - /// Gets or sets the mode for emotes. - /// - public int EmoteMode { get; set; } = 0; - - /// - /// Gets or sets the message for suggestions. - /// - public string? SuggestMessage { get; set; } = ""; - - /// - /// Gets or sets the message for denied suggestions. - /// - public string? DenyMessage { get; set; } = ""; - - /// - /// Gets or sets the message for accepted suggestions. - /// - public string? AcceptMessage { get; set; } = ""; - - /// - /// Gets or sets the message for implemented suggestions. - /// - public string? ImplementMessage { get; set; } = ""; - - /// - /// Gets or sets the message for considered suggestions. - /// - public string? ConsiderMessage { get; set; } = ""; - - /// - /// Gets or sets the minimum length for suggestions. - /// - public int MinSuggestLength { get; set; } = 0; - - /// - /// Gets or sets the maximum length for suggestions. - /// - public int MaxSuggestLength { get; set; } = 4098; - - /// - /// Gets or sets the emotes for suggestions. - /// - public string? SuggestEmotes { get; set; } - - /// - /// Gets or sets the suggestion number. - /// - public ulong sugnum { get; set; } = 1; - - /// - /// Gets or sets the suggestion channel ID. - /// - public ulong sugchan { get; set; } - - /// - /// Gets or sets the channel ID for the suggestion button. - /// - public ulong SuggestButtonChannel { get; set; } = 0; - - /// - /// Gets or sets the style for the first emote. - /// - public int Emote1Style { get; set; } = 2; - - /// - /// Gets or sets the style for the second emote. - /// - public int Emote2Style { get; set; } = 2; - - /// - /// Gets or sets the style for the third emote. - /// - public int Emote3Style { get; set; } = 2; - - /// - /// Gets or sets the style for the fourth emote. - /// - public int Emote4Style { get; set; } = 2; - - /// - /// Gets or sets the style for the fifth emote. - /// - public int Emote5Style { get; set; } = 2; - - /// - /// Gets or sets the message ID for the suggestion button. - /// - public ulong SuggestButtonMessageId { get; set; } = 0; - - /// - /// Gets or sets the repost threshold for the suggestion button. - /// - public int SuggestButtonRepostThreshold { get; set; } = 5; - - /// - /// Gets or sets the color for the suggestion button. - /// - public int SuggestButtonColor { get; set; } = 2; - - /// - /// Gets or sets the AFK message. - /// - public string? AfkMessage { get; set; } = "-"; - - /// - /// Gets or sets the auto bot role IDs. - /// - public string? AutoBotRoleIds { get; set; } - - /// - /// Gets or sets a value indicating whether the guild bot is enabled. - /// - public int GBEnabled { get; set; } = 1; - - /// - /// Gets or sets a value indicating the action for the guild bot. - /// - public bool GBAction { get; set; } = false; - - /// - /// Gets or sets the channel ID for confession logs. - /// - public ulong ConfessionLogChannel { get; set; } = 0; - - /// - /// Gets or sets the channel ID for confessions. - /// - public ulong ConfessionChannel { get; set; } = 0; - - /// - /// Gets or sets the blacklist for confessions. - /// - public string? ConfessionBlacklist { get; set; } = "0"; - - /// - /// Gets or sets the type for multi-greet. - /// - public int MultiGreetType { get; set; } = 0; - - /// - /// Gets or sets the member role ID. - /// - public ulong MemberRole { get; set; } = 0; - - /// - /// Gets or sets the open message for tickets. - /// - public string? TOpenMessage { get; set; } = "none"; - - /// - /// Gets or sets the start message for giveaways. - /// - public string? GStartMessage { get; set; } = "none"; - - /// - /// Gets or sets the end message for giveaways. - /// - public string? GEndMessage { get; set; } = "none"; - - /// - /// Gets or sets the win message for giveaways. - /// - public string? GWinMessage { get; set; } = "none"; - - /// - /// Gets or sets the channel ID for warning logs. - /// - public ulong WarnlogChannelId { get; set; } = 0; - - /// - /// Gets or sets the channel ID for mini warning logs. - /// - public ulong MiniWarnlogChannelId { get; set; } = 0; - - /// - /// Gets or sets a value indicating whether to send a message when the server is boosted. - /// - public bool SendBoostMessage { get; set; } = false; - - /// - /// Gets or sets the blacklist for roles for the guild bot. - /// - public string? GRolesBlacklist { get; set; } = "-"; - - /// - /// Gets or sets the blacklist for users for the guild bot. - /// - public string? GUsersBlacklist { get; set; } = "-"; - - /// - /// Gets or sets the message for when the server is boosted. - /// - public string? BoostMessage { get; set; } = "%user% just boosted this server!"; - - /// - /// Gets or sets the channel ID for boost messages. - /// - public ulong BoostMessageChannelId { get; set; } - - /// - /// Gets or sets the time in seconds after which the boost message is deleted. - /// - public int BoostMessageDeleteAfter { get; set; } - - /// - /// Gets or sets the emote for giveaways. - /// - public string? GiveawayEmote { get; set; } = "🎉"; - - /// - /// Gets or sets the channel ID for tickets. - /// - public ulong TicketChannel { get; set; } = 0; - - /// - /// Gets or sets the category ID for tickets. - /// - public ulong TicketCategory { get; set; } = 0; - - /// - /// Gets or sets a value indicating whether the snipe feature is enabled. - /// - public bool snipeset { get; set; } = false; - - /// - /// Gets or sets the length of time in seconds after which a user is considered AFK. - /// - public int AfkLength { get; set; } = 250; - - /// - /// Gets or sets the timeout for XP in text channels. - /// - public int XpTxtTimeout { get; set; } - - /// - /// Gets or sets the rate of XP gain in text channels. - /// - public int XpTxtRate { get; set; } - - /// - /// Gets or sets the rate of XP gain in voice channels. - /// - public int XpVoiceRate { get; set; } - - /// - /// Gets or sets the timeout for XP in voice channels. - /// - public int XpVoiceTimeout { get; set; } - - /// - /// Gets or sets the warning punishments. - /// - public List WarnPunishments2 { get; set; } = []; - - /// - /// Gets or sets the number of stars for the guild. - /// - public int Stars { get; set; } = 3; - - /// - /// Gets or sets the AFK type. - /// - public int AfkType { get; set; } = 2; - - /// - /// Gets or sets the anti-alt settings. - /// - public AntiAltSetting AntiAltSetting { get; set; } - - /// - /// Gets or sets the channels where AFK is disabled. - /// - public string? AfkDisabledChannels { get; set; } - - /// - /// Gets or sets the AFK delete message. - /// - public string? AfkDel { get; set; } - - /// - /// Gets or sets the AFK timeout in seconds. - /// - public int AfkTimeout { get; set; } = 20; - - /// - /// Gets or sets the number of joins for the guild. - /// - public ulong Joins { get; set; } - - /// - /// Gets or sets the number of leaves for the guild. - /// - public ulong Leaves { get; set; } - - /// - /// Gets or sets the star emote for the guild. - /// - public string? Star2 { get; set; } = "⭐"; - - /// - /// Gets or sets the channel ID for the starboard. - /// - public ulong StarboardChannel { get; set; } - - /// - /// Gets or sets the repost threshold for the starboard. - /// - public int RepostThreshold { get; set; } - - /// - /// Gets or sets the preview links setting. - /// - public int PreviewLinks { get; set; } - - /// - /// Gets or sets the channel ID for reactions. - /// - public ulong ReactChannel { get; set; } - - /// - /// Gets or sets the warning count for filter warnings. - /// - public int fwarn { get; set; } - - /// - /// Gets or sets the warning count for invite filter warnings. - /// - public int invwarn { get; set; } - - /// - /// Gets or sets the number of roles to remove. - /// - public int removeroles { get; set; } - - /// - /// Gets or sets a value indicating whether to automatically delete greet messages. - /// - public bool AutoDeleteGreetMessages { get; set; } = false; - - /// - /// Gets or sets a value indicating whether to automatically delete bye messages. - /// - public bool AutoDeleteByeMessages { get; set; } = false; - - /// - /// Gets or sets the timer for automatically deleting greet messages. - /// - public int AutoDeleteGreetMessagesTimer { get; set; } = 30; - - /// - /// Gets or sets the timer for automatically deleting bye messages. - /// - public int AutoDeleteByeMessagesTimer { get; set; } = 30; - - /// - /// Gets or sets the channel ID for greet messages. - /// - public ulong GreetMessageChannelId { get; set; } - - /// - /// Gets or sets the channel ID for bye messages. - /// - public ulong ByeMessageChannelId { get; set; } - - /// - /// Gets or sets the webhook URL for greet messages. - /// - public string? GreetHook { get; set; } = ""; - - /// - /// Gets or sets the webhook URL for leave messages. - /// - public string? LeaveHook { get; set; } = ""; - - /// - /// Gets or sets a value indicating whether to send a direct message for greet messages. - /// - public bool SendDmGreetMessage { get; set; } = false; - - /// - /// Gets or sets the text for direct message greet messages. - /// - public string? DmGreetMessageText { get; set; } = "Welcome to the %server% server, %user%!"; - - /// - /// Gets or sets a value indicating whether to send a channel greet message. - /// - public bool SendChannelGreetMessage { get; set; } = false; - - /// - /// Gets or sets the text for channel greet messages. - /// - public string? ChannelGreetMessageText { get; set; } = "Welcome to the %server% server, %user%!"; - - /// - /// Gets or sets a value indicating whether to send a channel bye message. - /// - public bool SendChannelByeMessage { get; set; } = false; - - /// - /// Gets or sets the text for channel bye messages. - /// - public string? ChannelByeMessageText { get; set; } = "%user% has left!"; - - /// - /// Gets or sets the log settings for the guild. - /// - public LogSetting LogSetting { get; set; } = new(); - - /// - /// Gets or sets a value indicating whether to restrict self-assigned roles to be exclusive. - /// - public bool ExclusiveSelfAssignedRoles { get; set; } = false; - - /// - /// Gets or sets a value indicating whether to automatically delete self-assigned role messages. - /// - public bool AutoDeleteSelfAssignedRoleMessages { get; set; } = false; - - /// - /// Gets or sets the ID for the log setting. - /// - [ForeignKey("LogSettingId")] - public int? LogSettingId { get; set; } - - /// - /// Gets or sets the followed streams for the guild. - /// - public HashSet FollowedStreams { get; set; } = []; - - /// - /// Gets or sets the permissions for the guild. - /// - public List? Permissions { get; set; } - - /// - /// Gets or sets a value indicating whether to use verbose permissions. - /// - public bool VerbosePermissions { get; set; } = true; - - /// - /// Gets or sets the role for permissions. - /// - public string? PermissionRole { get; set; } = null; - - /// - /// Gets or sets the command cooldowns for the guild. - /// - public HashSet CommandCooldowns { get; set; } = []; - - /// - /// Gets or sets a value indicating whether to filter invites. - /// - public bool FilterInvites { get; set; } = false; - - /// - /// Gets or sets a value indicating whether to filter links. - /// - public bool FilterLinks { get; set; } = false; - - /// - /// Gets or sets the channel IDs for filtering invites. - /// - public HashSet FilterInvitesChannelIds { get; set; } = []; - - /// - /// Gets or sets the channel IDs for filtering links. - /// - public HashSet FilterLinksChannelIds { get; set; } = []; - - /// - /// Gets or sets a value indicating whether to filter words. - /// - public bool FilterWords { get; set; } = false; - - /// - /// Gets or sets the words to be filtered. - /// - public HashSet FilteredWords { get; set; } = []; - - /// - /// Gets or sets the channel IDs for filtering words. - /// - public HashSet FilterWordsChannelIds { get; set; } = []; - - /// - /// Gets or sets the muted users for the guild. - /// - public HashSet MutedUsers { get; set; } = []; - - /// - /// Gets or sets the name of the mute role. - /// - public string? MuteRoleName { get; set; } - - /// - /// Gets or sets the channel ID for Cleverbot. - /// - public ulong CleverbotChannel { get; set; } - - /// - /// Gets or sets the repeaters for the guild. - /// - public List GuildRepeaters { get; set; } = []; - - /// - /// Gets or sets the anti-raid settings for the guild. - /// - public AntiRaidSetting AntiRaidSetting { get; set; } - - /// - /// Gets or sets the anti-spam settings for the guild. - /// - public AntiSpamSetting AntiSpamSetting { get; set; } - - /// - /// Gets or sets the locale for the guild. - /// - public string? Locale { get; set; } = null; - - /// - /// Gets or sets the time zone ID for the guild. - /// - public string? TimeZoneId { get; set; } = null; - - /// - /// Gets or sets the unmute timers for the guild. - /// - public HashSet UnmuteTimers { get; set; } = []; - - /// - /// Gets or sets the unban timers for the guild. - /// - public HashSet UnbanTimer { get; set; } = []; - - /// - /// Gets or sets the unrole timers for the guild. - /// - public HashSet UnroleTimer { get; set; } = []; - - /// - /// Gets or sets the voice channel role information for the guild. - /// - public HashSet VcRoleInfos { get; set; } - - /// - /// Gets or sets the command aliases for the guild. - /// - public HashSet CommandAliases { get; set; } = []; - - /// - /// Gets or sets the warning punishments for the guild. - /// - public List WarnPunishments { get; set; } = []; - - /// - /// Gets or sets a value indicating whether warnings have been initialized. - /// - public bool WarningsInitialized { get; set; } = false; - - /// - /// Gets or sets the NSFW blacklisted tags for the guild. - /// - public HashSet NsfwBlacklistedTags { get; set; } = []; - - /// - /// Gets or sets the game voice channel ID. - /// - public ulong? GameVoiceChannel { get; set; } = null; - - /// - /// Gets or sets a value indicating whether to use verbose errors. - /// - public bool VerboseErrors { get; set; } = true; - - /// - /// Gets or sets the stream role settings for the guild. - /// - public StreamRoleSettings? StreamRole { get; set; } - - /// - /// Gets or sets the XP settings for the guild. - /// - public XpSettings? XpSettings { get; set; } - - /// - /// Gets or sets the feed subscriptions for the guild. - /// - public List FeedSubs { get; set; } = []; - - /// - /// Gets or sets the reaction role messages for the guild. - /// - public IndexedCollection ReactionRoleMessages { get; set; } = []; - - /// - /// Gets or sets a value indicating whether to notify when the stream goes offline. - /// - public bool NotifyStreamOffline { get; set; } = false; - - /// - /// Gets or sets the self-assignable role group names for the guild. - /// - public List SelfAssignableRoleGroupNames { get; set; } - - /// - /// Gets or sets the number of hours after which warnings expire. - /// - public int WarnExpireHours { get; set; } = 0; - - /// - /// Gets or sets the action to take when warnings expire. - /// - public WarnExpireAction WarnExpireAction { get; set; } = WarnExpireAction.Clear; - - /// - /// Gets or sets the color for the join graph. - /// - public uint JoinGraphColor { get; set; } = 4294956800; - - /// - /// Gets or sets the color for the leave graph. - /// - public uint LeaveGraphColor { get; set; } = 4294956800; - } - } \ No newline at end of file +using System.ComponentModel; +using System.ComponentModel.DataAnnotations.Schema; +using Mewdeko.Database.Common; + +#pragma warning disable CS8632 // The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. + +// ReSharper disable InconsistentNaming + +namespace Mewdeko.Database.Models +{ + /// + /// Represents the configuration settings for a guild. + /// + public class GuildConfig : DbEntity + { + /// + /// Gets or sets the guild ID. + /// + public ulong GuildId { get; set; } + + /// + /// Gets or sets the command prefix for the guild. + /// + public string? Prefix { get; set; } = ""; + + /// + /// Gets or sets the role ID for staff members. + /// + public ulong StaffRole { get; set; } + + /// + /// Gets or sets the role ID for game masters. + /// + public ulong GameMasterRole { get; set; } + + /// + /// Whether message counting is enabled in the guild + /// + [DefaultValue(true)] + public bool UseMessageCount { get; set; } = true; + + /// + /// Gets or sets the channel ID for command logs. + /// + public ulong CommandLogChannel { get; set; } = 0; + + /// + /// Gets or sets a value indicating whether to delete messages after a command is issued. + /// + public bool DeleteMessageOnCommand { get; set; } = false; + + /// + /// Gets or sets the message for warnings. + /// + public string? WarnMessage { get; set; } = "-"; + + /// + /// Gets or sets the channels where messages are deleted after a command is issued. + /// + public HashSet DelMsgOnCmdChannels { get; set; } = []; + + /// + /// Gets or sets the role ID to auto-assign to new members. + /// + public string? AutoAssignRoleId { get; set; } = "0"; + + /// + /// Gets or sets the URL for the XP image. + /// + public string? XpImgUrl { get; set; } + + /// + /// Gets or sets a value indicating whether to opt out of statistics tracking. + /// + public bool StatsOptOut { get; set; } = false; + + /// + /// Gets or sets the name of the guild currency. + /// + public string? CurrencyName { get; set; } = "Coins"; + + /// + /// Gets or sets the emoji used for the guild currency. + /// + public string? CurrencyEmoji { get; set; } = "💰"; + + /// + /// Gets or sets the reward amount for certain actions. + /// + public int RewardAmount { get; set; } = 200; + + /// + /// Gets or sets the reward timeout in seconds. + /// + public int RewardTimeoutSeconds { get; set; } = 86400; + + /// + /// Gets or sets the URL for the giveaway banner. + /// + public string? GiveawayBanner { get; set; } = ""; + + /// + /// Gets or sets the color for the giveaway embed. + /// + public string? GiveawayEmbedColor { get; set; } = ""; + + /// + /// Gets or sets the color for the giveaway win embed. + /// + public string? GiveawayWinEmbedColor { get; set; } = ""; + + /// + /// Gets or sets a value indicating whether to send a direct message to the winner of a giveaway. + /// + public bool DmOnGiveawayWin { get; set; } = true; + + /// + /// Gets or sets the end message for giveaways. + /// + public string? GiveawayEndMessage { get; set; } = ""; + + /// + /// Gets or sets the role to ping for giveaways. + /// + public ulong GiveawayPingRole { get; set; } = 0; + + /// + /// Gets or sets a value indicating whether bots are allowed in the starboard. + /// + public bool StarboardAllowBots { get; set; } = true; + + /// + /// Gets or sets a value indicating whether to remove starboard entries when the original message is deleted. + /// + public bool StarboardRemoveOnDelete { get; set; } = false; + + /// + /// Gets or sets a value indicating whether to remove starboard entries when reactions are cleared. + /// + public bool StarboardRemoveOnReactionsClear { get; set; } = false; + + /// + /// Gets or sets a value indicating whether to remove starboard entries when they fall below the threshold. + /// + public bool StarboardRemoveOnBelowThreshold { get; set; } = true; + + /// + /// Gets or sets a value indicating whether to use a blacklist for the starboard. + /// + public bool UseStarboardBlacklist { get; set; } = true; + + /// + /// Gets or sets the channels to check for starboard entries. + /// + public string? StarboardCheckChannels { get; set; } = "0"; + + /// + /// Gets or sets the password for voting. + /// + public string? VotesPassword { get; set; } + + /// + /// Gets or sets the channel ID for votes. + /// + public ulong VotesChannel { get; set; } + + /// + /// Gets or sets the embed for votes. + /// + public string? VoteEmbed { get; set; } + + /// + /// Gets or sets the type of suggestion threads. + /// + public int SuggestionThreadType { get; set; } = 0; + + /// + /// Gets or sets a value indicating whether to archive suggestions on denial. + /// + public bool ArchiveOnDeny { get; set; } = false; + + /// + /// Gets or sets a value indicating whether to archive suggestions on acceptance. + /// + public bool ArchiveOnAccept { get; set; } = false; + + /// + /// Gets or sets a value indicating whether to archive suggestions on consideration. + /// + public bool ArchiveOnConsider { get; set; } = false; + + /// + /// Gets or sets a value indicating whether to archive suggestions on implementation. + /// + public bool ArchiveOnImplement { get; set; } = false; + + /// + /// Gets or sets the message for the suggestion button. + /// + public string? SuggestButtonMessage { get; set; } = "-"; + + /// + /// Gets or sets the name for the suggestion button. + /// + public string? SuggestButtonName { get; set; } = "-"; + + /// + /// Gets or sets the emote for the suggestion button. + /// + public string? SuggestButtonEmote { get; set; } = "-"; + + /// + /// Gets or sets the repost threshold for the button. + /// + public int ButtonRepostThreshold { get; set; } = 5; + + /// + /// Gets or sets the type for suggestion commands. + /// + public int SuggestCommandsType { get; set; } = 0; + + /// + /// Gets or sets the channel ID for accepted suggestions. + /// + public ulong AcceptChannel { get; set; } = 0; + + /// + /// Gets or sets the channel ID for denied suggestions. + /// + public ulong DenyChannel { get; set; } = 0; + + /// + /// Gets or sets the channel ID for considered suggestions. + /// + public ulong ConsiderChannel { get; set; } = 0; + + /// + /// Gets or sets the channel ID for implemented suggestions. + /// + public ulong ImplementChannel { get; set; } = 0; + + /// + /// Gets or sets the mode for emotes. + /// + public int EmoteMode { get; set; } = 0; + + /// + /// Gets or sets the message for suggestions. + /// + public string? SuggestMessage { get; set; } = ""; + + /// + /// Gets or sets the message for denied suggestions. + /// + public string? DenyMessage { get; set; } = ""; + + /// + /// Gets or sets the message for accepted suggestions. + /// + public string? AcceptMessage { get; set; } = ""; + + /// + /// Gets or sets the message for implemented suggestions. + /// + public string? ImplementMessage { get; set; } = ""; + + /// + /// Gets or sets the message for considered suggestions. + /// + public string? ConsiderMessage { get; set; } = ""; + + /// + /// Gets or sets the minimum length for suggestions. + /// + public int MinSuggestLength { get; set; } = 0; + + /// + /// Gets or sets the maximum length for suggestions. + /// + public int MaxSuggestLength { get; set; } = 4098; + + /// + /// Gets or sets the emotes for suggestions. + /// + public string? SuggestEmotes { get; set; } + + /// + /// Gets or sets the suggestion number. + /// + public ulong sugnum { get; set; } = 1; + + /// + /// Gets or sets the suggestion channel ID. + /// + public ulong sugchan { get; set; } + + /// + /// Gets or sets the channel ID for the suggestion button. + /// + public ulong SuggestButtonChannel { get; set; } = 0; + + /// + /// Gets or sets the style for the first emote. + /// + public int Emote1Style { get; set; } = 2; + + /// + /// Gets or sets the style for the second emote. + /// + public int Emote2Style { get; set; } = 2; + + /// + /// Gets or sets the style for the third emote. + /// + public int Emote3Style { get; set; } = 2; + + /// + /// Gets or sets the style for the fourth emote. + /// + public int Emote4Style { get; set; } = 2; + + /// + /// Gets or sets the style for the fifth emote. + /// + public int Emote5Style { get; set; } = 2; + + /// + /// Gets or sets the message ID for the suggestion button. + /// + public ulong SuggestButtonMessageId { get; set; } = 0; + + /// + /// Gets or sets the repost threshold for the suggestion button. + /// + public int SuggestButtonRepostThreshold { get; set; } = 5; + + /// + /// Gets or sets the color for the suggestion button. + /// + public int SuggestButtonColor { get; set; } = 2; + + /// + /// Gets or sets the AFK message. + /// + public string? AfkMessage { get; set; } = "-"; + + /// + /// Gets or sets the auto bot role IDs. + /// + public string? AutoBotRoleIds { get; set; } + + /// + /// Gets or sets a value indicating whether the guild bot is enabled. + /// + public int GBEnabled { get; set; } = 1; + + /// + /// Gets or sets a value indicating the action for the guild bot. + /// + public bool GBAction { get; set; } = false; + + /// + /// Gets or sets the channel ID for confession logs. + /// + public ulong ConfessionLogChannel { get; set; } = 0; + + /// + /// Gets or sets the channel ID for confessions. + /// + public ulong ConfessionChannel { get; set; } = 0; + + /// + /// Gets or sets the blacklist for confessions. + /// + public string? ConfessionBlacklist { get; set; } = "0"; + + /// + /// Gets or sets the type for multi-greet. + /// + public int MultiGreetType { get; set; } = 0; + + /// + /// Gets or sets the member role ID. + /// + public ulong MemberRole { get; set; } = 0; + + /// + /// Gets or sets the open message for tickets. + /// + public string? TOpenMessage { get; set; } = "none"; + + /// + /// Gets or sets the start message for giveaways. + /// + public string? GStartMessage { get; set; } = "none"; + + /// + /// Gets or sets the end message for giveaways. + /// + public string? GEndMessage { get; set; } = "none"; + + /// + /// Gets or sets the win message for giveaways. + /// + public string? GWinMessage { get; set; } = "none"; + + /// + /// Gets or sets the channel ID for warning logs. + /// + public ulong WarnlogChannelId { get; set; } = 0; + + /// + /// Gets or sets the channel ID for mini warning logs. + /// + public ulong MiniWarnlogChannelId { get; set; } = 0; + + /// + /// Gets or sets a value indicating whether to send a message when the server is boosted. + /// + public bool SendBoostMessage { get; set; } = false; + + /// + /// Gets or sets the blacklist for roles for the guild bot. + /// + public string? GRolesBlacklist { get; set; } = "-"; + + /// + /// Gets or sets the blacklist for users for the guild bot. + /// + public string? GUsersBlacklist { get; set; } = "-"; + + /// + /// Gets or sets the message for when the server is boosted. + /// + public string? BoostMessage { get; set; } = "%user% just boosted this server!"; + + /// + /// Gets or sets the channel ID for boost messages. + /// + public ulong BoostMessageChannelId { get; set; } + + /// + /// Gets or sets the time in seconds after which the boost message is deleted. + /// + public int BoostMessageDeleteAfter { get; set; } + + /// + /// Gets or sets the emote for giveaways. + /// + public string? GiveawayEmote { get; set; } = "🎉"; + + /// + /// Gets or sets the channel ID for tickets. + /// + public ulong TicketChannel { get; set; } = 0; + + /// + /// Gets or sets the category ID for tickets. + /// + public ulong TicketCategory { get; set; } = 0; + + /// + /// Gets or sets a value indicating whether the snipe feature is enabled. + /// + public bool snipeset { get; set; } = false; + + /// + /// Gets or sets the length of time in seconds after which a user is considered AFK. + /// + public int AfkLength { get; set; } = 250; + + /// + /// Gets or sets the timeout for XP in text channels. + /// + public int XpTxtTimeout { get; set; } + + /// + /// Gets or sets the rate of XP gain in text channels. + /// + public int XpTxtRate { get; set; } + + /// + /// Gets or sets the rate of XP gain in voice channels. + /// + public int XpVoiceRate { get; set; } + + /// + /// Gets or sets the timeout for XP in voice channels. + /// + public int XpVoiceTimeout { get; set; } + + /// + /// Gets or sets the warning punishments. + /// + public List WarnPunishments2 { get; set; } = []; + + /// + /// Gets or sets the number of stars for the guild. + /// + public int Stars { get; set; } = 3; + + /// + /// Gets or sets the AFK type. + /// + public int AfkType { get; set; } = 2; + + /// + /// Gets or sets the anti-alt settings. + /// + public AntiAltSetting AntiAltSetting { get; set; } + + /// + /// Gets or sets the channels where AFK is disabled. + /// + public string? AfkDisabledChannels { get; set; } + + /// + /// Gets or sets the AFK delete message. + /// + public string? AfkDel { get; set; } + + /// + /// Gets or sets the AFK timeout in seconds. + /// + public int AfkTimeout { get; set; } = 20; + + /// + /// Gets or sets the number of joins for the guild. + /// + public ulong Joins { get; set; } + + /// + /// Gets or sets the number of leaves for the guild. + /// + public ulong Leaves { get; set; } + + /// + /// Gets or sets the star emote for the guild. + /// + public string? Star2 { get; set; } = "⭐"; + + /// + /// Gets or sets the channel ID for the starboard. + /// + public ulong StarboardChannel { get; set; } + + /// + /// Gets or sets the repost threshold for the starboard. + /// + public int RepostThreshold { get; set; } + + /// + /// Gets or sets the preview links setting. + /// + public int PreviewLinks { get; set; } + + /// + /// Gets or sets the channel ID for reactions. + /// + public ulong ReactChannel { get; set; } + + /// + /// Gets or sets the warning count for filter warnings. + /// + public int fwarn { get; set; } + + /// + /// Gets or sets the warning count for invite filter warnings. + /// + public int invwarn { get; set; } + + /// + /// Gets or sets the number of roles to remove. + /// + public int removeroles { get; set; } + + /// + /// Gets or sets a value indicating whether to automatically delete greet messages. + /// + public bool AutoDeleteGreetMessages { get; set; } = false; + + /// + /// Gets or sets a value indicating whether to automatically delete bye messages. + /// + public bool AutoDeleteByeMessages { get; set; } = false; + + /// + /// Gets or sets the timer for automatically deleting greet messages. + /// + public int AutoDeleteGreetMessagesTimer { get; set; } = 30; + + /// + /// Gets or sets the timer for automatically deleting bye messages. + /// + public int AutoDeleteByeMessagesTimer { get; set; } = 30; + + /// + /// Gets or sets the channel ID for greet messages. + /// + public ulong GreetMessageChannelId { get; set; } + + /// + /// Gets or sets the channel ID for bye messages. + /// + public ulong ByeMessageChannelId { get; set; } + + /// + /// Gets or sets the webhook URL for greet messages. + /// + public string? GreetHook { get; set; } = ""; + + /// + /// Gets or sets the webhook URL for leave messages. + /// + public string? LeaveHook { get; set; } = ""; + + /// + /// Gets or sets a value indicating whether to send a direct message for greet messages. + /// + public bool SendDmGreetMessage { get; set; } = false; + + /// + /// Gets or sets the text for direct message greet messages. + /// + public string? DmGreetMessageText { get; set; } = "Welcome to the %server% server, %user%!"; + + /// + /// Gets or sets a value indicating whether to send a channel greet message. + /// + public bool SendChannelGreetMessage { get; set; } = false; + + /// + /// Gets or sets the text for channel greet messages. + /// + public string? ChannelGreetMessageText { get; set; } = "Welcome to the %server% server, %user%!"; + + /// + /// Gets or sets a value indicating whether to send a channel bye message. + /// + public bool SendChannelByeMessage { get; set; } = false; + + /// + /// Gets or sets the text for channel bye messages. + /// + public string? ChannelByeMessageText { get; set; } = "%user% has left!"; + + /// + /// Gets or sets the log settings for the guild. + /// + public LogSetting LogSetting { get; set; } = new(); + + /// + /// Gets or sets a value indicating whether to restrict self-assigned roles to be exclusive. + /// + public bool ExclusiveSelfAssignedRoles { get; set; } = false; + + /// + /// Gets or sets a value indicating whether to automatically delete self-assigned role messages. + /// + public bool AutoDeleteSelfAssignedRoleMessages { get; set; } = false; + + /// + /// Gets or sets the ID for the log setting. + /// + [ForeignKey("LogSettingId")] + public int? LogSettingId { get; set; } + + /// + /// Gets or sets the followed streams for the guild. + /// + public HashSet FollowedStreams { get; set; } = []; + + /// + /// Gets or sets the permissions for the guild. + /// + public List? Permissions { get; set; } + + /// + /// Gets or sets a value indicating whether to use verbose permissions. + /// + public bool VerbosePermissions { get; set; } = true; + + /// + /// Gets or sets the role for permissions. + /// + public string? PermissionRole { get; set; } = null; + + /// + /// Gets or sets the command cooldowns for the guild. + /// + public HashSet CommandCooldowns { get; set; } = []; + + /// + /// Gets or sets a value indicating whether to filter invites. + /// + public bool FilterInvites { get; set; } = false; + + /// + /// Gets or sets a value indicating whether to filter links. + /// + public bool FilterLinks { get; set; } = false; + + /// + /// Gets or sets the channel IDs for filtering invites. + /// + public HashSet FilterInvitesChannelIds { get; set; } = []; + + /// + /// Gets or sets the channel IDs for filtering links. + /// + public HashSet FilterLinksChannelIds { get; set; } = []; + + /// + /// Gets or sets a value indicating whether to filter words. + /// + public bool FilterWords { get; set; } = false; + + /// + /// Gets or sets the words to be filtered. + /// + public HashSet FilteredWords { get; set; } = []; + + /// + /// Gets or sets the channel IDs for filtering words. + /// + public HashSet FilterWordsChannelIds { get; set; } = []; + + /// + /// Gets or sets the muted users for the guild. + /// + public HashSet MutedUsers { get; set; } = []; + + /// + /// Gets or sets the name of the mute role. + /// + public string? MuteRoleName { get; set; } + + /// + /// Gets or sets the channel ID for Cleverbot. + /// + public ulong CleverbotChannel { get; set; } + + /// + /// Gets or sets the repeaters for the guild. + /// + public List GuildRepeaters { get; set; } = []; + + /// + /// Gets or sets the anti-raid settings for the guild. + /// + public AntiRaidSetting AntiRaidSetting { get; set; } + + /// + /// Gets or sets the anti-spam settings for the guild. + /// + public AntiSpamSetting AntiSpamSetting { get; set; } + + /// + /// Gets or sets the locale for the guild. + /// + public string? Locale { get; set; } = null; + + /// + /// Gets or sets the time zone ID for the guild. + /// + public string? TimeZoneId { get; set; } = null; + + /// + /// Gets or sets the unmute timers for the guild. + /// + public HashSet UnmuteTimers { get; set; } = []; + + /// + /// Gets or sets the unban timers for the guild. + /// + public HashSet UnbanTimer { get; set; } = []; + + /// + /// Gets or sets the unrole timers for the guild. + /// + public HashSet UnroleTimer { get; set; } = []; + + /// + /// Gets or sets the voice channel role information for the guild. + /// + public HashSet VcRoleInfos { get; set; } + + /// + /// Gets or sets the command aliases for the guild. + /// + public HashSet CommandAliases { get; set; } = []; + + /// + /// Gets or sets the warning punishments for the guild. + /// + public List WarnPunishments { get; set; } = []; + + /// + /// Gets or sets a value indicating whether warnings have been initialized. + /// + public bool WarningsInitialized { get; set; } = false; + + /// + /// Gets or sets the NSFW blacklisted tags for the guild. + /// + public HashSet NsfwBlacklistedTags { get; set; } = []; + + /// + /// Gets or sets the game voice channel ID. + /// + public ulong? GameVoiceChannel { get; set; } = null; + + /// + /// Gets or sets a value indicating whether to use verbose errors. + /// + public bool VerboseErrors { get; set; } = true; + + /// + /// Gets or sets the stream role settings for the guild. + /// + public StreamRoleSettings? StreamRole { get; set; } + + /// + /// Gets or sets the XP settings for the guild. + /// + public XpSettings? XpSettings { get; set; } + + /// + /// Gets or sets the feed subscriptions for the guild. + /// + public List FeedSubs { get; set; } = []; + + /// + /// Gets or sets the reaction role messages for the guild. + /// + public IndexedCollection ReactionRoleMessages { get; set; } = []; + + /// + /// Gets or sets a value indicating whether to notify when the stream goes offline. + /// + public bool NotifyStreamOffline { get; set; } = false; + + /// + /// Gets or sets the self-assignable role group names for the guild. + /// + public List SelfAssignableRoleGroupNames { get; set; } + + /// + /// Gets or sets the number of hours after which warnings expire. + /// + public int WarnExpireHours { get; set; } = 0; + + /// + /// Gets or sets the action to take when warnings expire. + /// + public WarnExpireAction WarnExpireAction { get; set; } = WarnExpireAction.Clear; + + /// + /// Gets or sets the color for the join graph. + /// + public uint JoinGraphColor { get; set; } = 4294956800; + + /// + /// Gets or sets the color for the leave graph. + /// + public uint LeaveGraphColor { get; set; } = 4294956800; + } +} \ No newline at end of file diff --git a/src/Mewdeko/Database/Models/MessageCount.cs b/src/Mewdeko/Database/Models/MessageCount.cs new file mode 100644 index 000000000..a40b579d9 --- /dev/null +++ b/src/Mewdeko/Database/Models/MessageCount.cs @@ -0,0 +1,27 @@ +namespace Mewdeko.Database.Models; + +/// +/// Count of messages per user, channel, etc +/// +public class MessageCount : DbEntity +{ + /// + /// The guild to be able to look up count + /// + public ulong GuildId { get; set; } + + /// + /// The channel for the message + /// + public ulong ChannelId { get; set; } + + /// + /// The UserId for lookups + /// + public ulong UserId { get; set; } + + /// + /// The count for this combination + /// + public ulong Count { get; set; } +} \ No newline at end of file diff --git a/src/Mewdeko/Database/Models/TicketButton.cs b/src/Mewdeko/Database/Models/TicketButton.cs new file mode 100644 index 000000000..4653ba1fe --- /dev/null +++ b/src/Mewdeko/Database/Models/TicketButton.cs @@ -0,0 +1,22 @@ +/// +/// Button +/// +public class TicketButton : DbEntity +{ + /// + /// Id + /// + public int TicketPanelId { get; set; } + /// + /// + /// + public string Label { get; set; } + /// + /// + /// + public string Emoji { get; set; } + /// + /// + /// + public string OpenMessage { get; set; } +} \ No newline at end of file diff --git a/src/Mewdeko/Database/Models/TicketPanel.cs b/src/Mewdeko/Database/Models/TicketPanel.cs new file mode 100644 index 000000000..2a53ba61b --- /dev/null +++ b/src/Mewdeko/Database/Models/TicketPanel.cs @@ -0,0 +1,25 @@ +using System.ComponentModel; + +/// +/// +/// +public class TicketPanel : DbEntity +{ + /// + /// The servers id + /// + public ulong GuildId { get; set; } + /// + /// The channel where the ticket panel is + /// + public ulong ChannelId { get; set; } + /// + /// The json for the panel + /// + [DefaultValue("")] + public string? MessageJson { get; set; } + /// + /// A list of buttons associated with this panel + /// + public List Buttons { get; set; } = []; +} \ No newline at end of file diff --git a/src/Mewdeko/Mewdeko.csproj b/src/Mewdeko/Mewdeko.csproj index 30e5167e4..02a52e2a0 100644 --- a/src/Mewdeko/Mewdeko.csproj +++ b/src/Mewdeko/Mewdeko.csproj @@ -25,6 +25,7 @@ + diff --git a/src/Mewdeko/Modules/Games/CleverBotCommands.cs b/src/Mewdeko/Modules/Games/CleverBotCommands.cs deleted file mode 100644 index c1506371c..000000000 --- a/src/Mewdeko/Modules/Games/CleverBotCommands.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Discord.Commands; -using Mewdeko.Common.Attributes.TextCommands; -using Mewdeko.Modules.Games.Services; - -namespace Mewdeko.Modules.Games -{ - public partial class Games - { - /// - /// Command group for Cleverbot settings. - /// - [Group] - public class ChatterBotCommands : MewdekoSubmodule - { - /// - /// Toggles Cleverbot for the current or specified text channel. - /// - /// The text channel to toggle Cleverbot for. - /// .cleverbot #general - [Cmd, Aliases, RequireContext(ContextType.Guild), UserPerm(GuildPermission.ManageMessages)] - public async Task Cleverbot(ITextChannel? chan = null) - { - var channel = chan ?? (ITextChannel)ctx.Channel; - var cbid = await Service.GetCleverbotChannel(ctx.Guild.Id); - if (cbid != 0 && cbid == channel.Id) - { - await Service.SetCleverbotChannel(ctx.Guild, 0); - await ctx.Channel.SendConfirmAsync("Cleverbot has been switched off!"); - return; - } - - if (cbid != 0 && cbid != channel.Id) - { - await Service.SetCleverbotChannel(ctx.Guild, channel.Id); - await ctx.Channel.SendConfirmAsync( - $"Cleverbot channel has been switched to {channel.Mention}! Just remember that commands do not work in there while its enabled."); - } - - if (cbid == 0) - { - await Service.SetCleverbotChannel(ctx.Guild, channel.Id); - await ctx.Channel.SendConfirmAsync( - $"Cleverbot has been enabled and the channel set to {channel.Mention}! Just remember that commmands dont work in that channel while its enabled."); - } - } - } - } -} \ No newline at end of file diff --git a/src/Mewdeko/Modules/Games/Common/ChatterBot/ChatterBotResponse.cs b/src/Mewdeko/Modules/Games/Common/ChatterBot/ChatterBotResponse.cs deleted file mode 100644 index 22763a3c1..000000000 --- a/src/Mewdeko/Modules/Games/Common/ChatterBot/ChatterBotResponse.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace Mewdeko.Modules.Games.Common.ChatterBot -{ - /// - /// Represents a response from a ChatterBot. - /// - public class ChatterBotResponse - { - /// - /// Gets or sets the conversation ID associated with the response. - /// - public string ConvoId { get; set; } - - /// - /// Gets or sets the response from the ChatterBot. - /// - public string BotSay { get; set; } - } -} \ No newline at end of file diff --git a/src/Mewdeko/Modules/Games/Common/ChatterBot/ChatterBotSession.cs b/src/Mewdeko/Modules/Games/Common/ChatterBot/ChatterBotSession.cs deleted file mode 100644 index 085bf78c6..000000000 --- a/src/Mewdeko/Modules/Games/Common/ChatterBot/ChatterBotSession.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.Net.Http; -using Newtonsoft.Json; - -namespace Mewdeko.Modules.Games.Common.ChatterBot -{ - /// - /// Represents a session with Cleverbot. - /// - public class ChatterBotSession : IChatterBotSession - { - private const int BotId = 6; - - private readonly string chatterBotId; - private readonly IHttpClientFactory httpFactory; - - /// - /// Initializes a new instance of the class. - /// - /// The HTTP client factory. - public ChatterBotSession(IHttpClientFactory httpFactory) - { - chatterBotId = Rng.Next(0, 1000000).ToString().ToBase64(); - this.httpFactory = httpFactory; - } - - private static MewdekoRandom Rng { get; } = new(); - - private string ApiEndpoint => - $"https://api.program-o.com/v2/chatbot/?bot_id={BotId}&say={{0}}&convo_id=Mewdeko_{chatterBotId}&format=json"; - - /// - /// Sends a message to Cleverbot and retrieves its response. - /// - /// The message to send to the ChatterBot. - /// The response from the Cleverbot. - public async Task Think(string message) - { - using var http = httpFactory.CreateClient(); - var res = await http.GetStringAsync(string.Format(ApiEndpoint, message)).ConfigureAwait(false); - var cbr = JsonConvert.DeserializeObject(res); - return cbr.BotSay.Replace("
", "\n", StringComparison.InvariantCulture); - } - } -} \ No newline at end of file diff --git a/src/Mewdeko/Modules/Games/Common/ChatterBot/CleverbotResponse.cs b/src/Mewdeko/Modules/Games/Common/ChatterBot/CleverbotResponse.cs deleted file mode 100644 index 028414b8c..000000000 --- a/src/Mewdeko/Modules/Games/Common/ChatterBot/CleverbotResponse.cs +++ /dev/null @@ -1,50 +0,0 @@ -namespace Mewdeko.Modules.Games.Common.ChatterBot -{ - /// - /// Represents a response from Cleverbot. - /// - public class CleverbotResponse - { - /// - /// Gets or sets the conversation state. - /// - public string Cs { get; set; } - - /// - /// Gets or sets the output from Cleverbot. - /// - public string Output { get; set; } - } - - /// - /// Represents a response from Cleverbot.io when creating a bot. - /// - public class CleverbotIoCreateResponse - { - /// - /// Gets or sets the status of the response. - /// - public string Status { get; set; } - - /// - /// Gets or sets the nickname of the created bot. - /// - public string Nick { get; set; } - } - - /// - /// Represents a response from Cleverbot.io when asking a question. - /// - public class CleverbotIoAskResponse - { - /// - /// Gets or sets the status of the response. - /// - public string Status { get; set; } - - /// - /// Gets or sets the response from Cleverbot. - /// - public string Response { get; set; } - } -} \ No newline at end of file diff --git a/src/Mewdeko/Modules/Games/Common/ChatterBot/IChatterBotSession.cs b/src/Mewdeko/Modules/Games/Common/ChatterBot/IChatterBotSession.cs deleted file mode 100644 index cdc0d5976..000000000 --- a/src/Mewdeko/Modules/Games/Common/ChatterBot/IChatterBotSession.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Mewdeko.Modules.Games.Common.ChatterBot -{ - /// - /// Interface for interacting with a CleverBot session. - /// - public interface IChatterBotSession - { - /// - /// Sends an input message to the Cleverbot and receives its response. - /// - /// The input message to send to the CleverBot. - /// The response from CleverBot. - Task Think(string input); - } -} \ No newline at end of file diff --git a/src/Mewdeko/Modules/Games/Common/ChatterBot/OfficialCleverbotSession.cs b/src/Mewdeko/Modules/Games/Common/ChatterBot/OfficialCleverbotSession.cs deleted file mode 100644 index be7e8a179..000000000 --- a/src/Mewdeko/Modules/Games/Common/ChatterBot/OfficialCleverbotSession.cs +++ /dev/null @@ -1,112 +0,0 @@ -using System.Net.Http; -using Newtonsoft.Json; -using Serilog; - -namespace Mewdeko.Modules.Games.Common.ChatterBot -{ - /// - /// Represents a session with the official Cleverbot API. - /// - public class OfficialCleverbotSession : IChatterBotSession - { - private string cs; - private readonly string key; - - private string QueryString => - $"https://www.cleverbot.com/getreply?key={{apiKey}}&wrapper=Mewdeko&input={{input}}&cs={{cs}}"; - - private readonly IHttpClientFactory factory; - - /// - /// Initializes a new instance of the class with the specified API key and HTTP client factory. - /// - /// The API key for accessing the Cleverbot API. - /// The factory for creating HTTP clients. - public OfficialCleverbotSession(string apiKey, IHttpClientFactory factory) - { - this.factory = factory; - key = apiKey; - } - - /// - public async Task? Think(string input) - { - using var http = factory.CreateClient(); - var dataString = await http - .GetStringAsync(QueryString.Replace("{apiKey}", key).Replace("{input}", input).Replace("{cs}", cs)) - .ConfigureAwait(false); - try - { - var data = JsonConvert.DeserializeObject(dataString); - - cs = data?.Cs; - return data?.Output; - } - catch - { - Log.Warning("Unexpected cleverbot response received: "); - Log.Warning(dataString); - return null; - } - } - } - - /// - /// Represents a session with the Cleverbot.io API. - /// - public class CleverbotIoSession : IChatterBotSession - { - private readonly string askEndpoint = "https://cleverbot.io/1.0/ask"; - private readonly string createEndpoint = "https://cleverbot.io/1.0/create"; - private readonly IHttpClientFactory httpFactory; - private readonly string key; - private readonly AsyncLazy nick; - private readonly string user; - - /// - /// Initializes a new instance of the class with the specified user, API key, and HTTP client factory. - /// - /// The user for the Cleverbot.io session. - /// The API key for accessing the Cleverbot.io API. - /// The factory for creating HTTP clients. - public CleverbotIoSession(string user, string key, IHttpClientFactory factory) - { - this.user = user; - this.key = key; - httpFactory = factory; - nick = new AsyncLazy(GetNick); - } - - /// - public async Task Think(string input) - { - using var http = httpFactory.CreateClient(); - using var msg = new FormUrlEncodedContent([ - new KeyValuePair("user", user), new KeyValuePair("key", key), - new KeyValuePair("nick", await nick), new KeyValuePair("text", input) - ]); - using var data = await http.PostAsync(askEndpoint, msg).ConfigureAwait(false); - var str = await data.Content.ReadAsStringAsync().ConfigureAwait(false); - var obj = JsonConvert.DeserializeObject(str); - if (obj.Status != "success") - throw new OperationCanceledException(obj.Status); - - return obj.Response; - } - - private async Task GetNick() - { - using var http = httpFactory.CreateClient(); - using var msg = new FormUrlEncodedContent([ - new KeyValuePair("user", user), new KeyValuePair("key", key) - ]); - using var data = await http.PostAsync(createEndpoint, msg).ConfigureAwait(false); - var str = await data.Content.ReadAsStringAsync().ConfigureAwait(false); - var obj = JsonConvert.DeserializeObject(str); - if (obj.Status != "success") - throw new OperationCanceledException(obj.Status); - - return obj.Nick; - } - } -} \ No newline at end of file diff --git a/src/Mewdeko/Modules/Games/Services/ChatterbotService.cs b/src/Mewdeko/Modules/Games/Services/ChatterbotService.cs deleted file mode 100644 index 644993754..000000000 --- a/src/Mewdeko/Modules/Games/Services/ChatterbotService.cs +++ /dev/null @@ -1,227 +0,0 @@ -using System.Net.Http; -using Mewdeko.Common.Configs; -using Mewdeko.Common.ModuleBehaviors; -using Mewdeko.Database.DbContextStuff; -using Mewdeko.Modules.Games.Common.ChatterBot; -using Mewdeko.Modules.Permissions.Services; -using Serilog; - -namespace Mewdeko.Modules.Games.Services; - -/// -/// Represents a service for interacting with the Cleverbot API. -/// -public class ChatterBotService : INService -{ - private readonly BlacklistService blacklistService; - - /// - /// Dictionary to store the Cleverbot sessions for users. - /// - public readonly ConcurrentDictionary> CleverbotUsers = new(); - - private readonly DiscordShardedClient client; - private readonly BotConfig config; - private readonly IBotCredentials creds; - private readonly DbContextProvider dbProvider; - private readonly GuildSettingsService guildSettings; - private readonly IHttpClientFactory httpFactory; - - /// - /// Initializes a new instance of the class. - /// - /// The Discord socket client. - /// The HTTP client factory. - /// The bot credentials. - /// The database service. - /// The blacklist service. - /// The guild settings service. - /// The event handler. - /// Bot config service - public ChatterBotService(DiscordShardedClient client, IHttpClientFactory factory, - IBotCredentials creds, DbContextProvider dbProvider, - BlacklistService blacklistService, - GuildSettingsService guildSettings, EventHandler eventHandler, BotConfig config) - { - this.dbProvider = dbProvider; - this.blacklistService = blacklistService; - this.guildSettings = guildSettings; - this.config = config; - this.client = client; - this.creds = creds; - httpFactory = factory; - eventHandler.MessageReceived += MessageReceived; - } - - - /// - /// Gets the priority of the chatterbot service. - /// - public static int Priority => -1; - - /// - /// Gets the behavior type of the chatterbot service. - /// - public static ModuleBehaviorType BehaviorType => ModuleBehaviorType.Executor; - - /// - /// Sets the Cleverbot channel for a guild. - /// - /// The guild. - /// The ID of the channel. - public async Task SetCleverbotChannel(IGuild guild, ulong id) - { - - await using var db = await dbProvider.GetContextAsync(); - var gc = await db.ForGuildId(guild.Id, set => set); - gc.CleverbotChannel = id; - await guildSettings.UpdateGuildConfig(guild.Id, gc); - } - - /// - /// Gets the Cleverbot channel ID for a guild. - /// - /// The ID of the guild. - /// The Cleverbot channel ID. - public async Task GetCleverbotChannel(ulong id) => (await guildSettings.GetGuildConfig(id)).CleverbotChannel; - - /// - /// Handles received messages for Cleverbot interactions. - /// - /// The received message. - public async Task MessageReceived(SocketMessage msg) - { - if (msg.Author.IsBot) - return; - if (msg.Channel is not ITextChannel chan) - return; - try - { - if (msg is not IUserMessage usrMsg) - return; - (string, IChatterBotSession) message; - try - { - message = await PrepareMessage(usrMsg); - } - catch - { - return; - } - - if (string.IsNullOrEmpty(message.Item1) || message.Item2.Equals(default)) - return; - var cleverbotExecuted = await TryAsk(message.Item2, (ITextChannel)usrMsg.Channel, message.Item1, usrMsg) - .ConfigureAwait(false); - if (cleverbotExecuted) - { - Log.Information( - $@"CleverBot Executed - Server: {chan.Guild.Name} {chan.Guild.Name}] - Channel: {usrMsg.Channel?.Name} [{usrMsg.Channel?.Id}] - UserId: {usrMsg.Author} [{usrMsg.Author.Id}] - Message: {usrMsg.Content}"); - } - } - catch (Exception ex) - { - Log.Warning(ex, "Error in Cleverbot"); - } - } - - /// - /// Creates a new session for Cleverbot interactions. - /// - /// A new Cleverbot session. - public IChatterBotSession CreateSession() - { - if (!string.IsNullOrWhiteSpace(creds.CleverbotApiKey)) - return new OfficialCleverbotSession(creds.CleverbotApiKey, httpFactory); - return new CleverbotIoSession("GAh3wUfzDCpDpdpT", "RStKgqn7tcO9blbrv4KbXM8NDlb7H37C", httpFactory); - } - - - /// - /// Prepares the message for Cleverbot interaction. - /// - /// The received message. - /// A tuple containing the message content and the Cleverbot session. - private async Task<(string, IChatterBotSession)> PrepareMessage(IMessage? msg) - { - if (msg?.Channel is not ITextChannel channel) - return (null, null); - if (await GetCleverbotChannel(channel.Guild.Id) == 0) - return (null, null); - if (await GetCleverbotChannel(channel.Guild.Id) != channel.Id) - return (null, null); - - if (blacklistService.BlacklistEntries.Select(x => x.ItemId).Contains(channel.Guild.Id)) - { - await channel.SendErrorAsync( - "This server is blacklisted. Please join using the button below for an explanation or to appeal.", - config); - return (null, null); - } - - if (blacklistService.BlacklistEntries.Select(x => x.ItemId).Contains(msg.Author.Id)) - { - (msg as IUserMessage).ReplyError( - "You are blacklisted from Mewdeko, join using the button below to get more info or appeal."); - return (null, null); - } - - if (!CleverbotUsers.TryGetValue(msg.Author.Id, out var lazyCleverbot)) - { - CleverbotUsers.TryAdd(msg.Author.Id, new Lazy(CreateSession, true)); - CleverbotUsers.TryGetValue(msg.Author.Id, out lazyCleverbot); - } - - - var mewdekoId = client.CurrentUser.Id; - var normalMention = $"<@{mewdekoId}> "; - var nickMention = $"<@!{mewdekoId}> "; - string message; - - if (msg.Content.StartsWith(normalMention, StringComparison.InvariantCulture)) - message = msg.Content[normalMention.Length..].Trim(); - else if (msg.Content.StartsWith(nickMention, StringComparison.InvariantCulture)) - message = msg.Content[nickMention.Length..].Trim(); - else if (msg.Content.StartsWith(await guildSettings.GetPrefix(channel.Guild))) - return (null, null); - else - message = msg.Content; - return (message, lazyCleverbot.Value); - } - - /// - /// Tries to ask Cleverbot a question and sends the response. - /// - /// The Cleverbot session. - /// The text channel to send the response to. - /// The message to ask Cleverbot. - /// The original user message. - /// A task representing the asynchronous operation. - private async Task TryAsk(IChatterBotSession cleverbot, ITextChannel channel, string message, - IUserMessage msg) - { - await channel.TriggerTypingAsync().ConfigureAwait(false); - string response; - try - { - response = await cleverbot.Think(message).ConfigureAwait(false); - } - catch - { - await channel.SendErrorAsync( - "Cleverbot is paid and I cannot pay for it right now! If you want to support Mewdeko and reenable this please donate so it'll be available!\nhttps://ko-fi.com/mewdeko\nThis is not a premium feature and never will be!", - config) - .ConfigureAwait(false); - return false; - } - - await msg.ReplyAsync(embed: new EmbedBuilder().WithOkColor().WithDescription(response.SanitizeMentions(true)) - .Build()).ConfigureAwait(false); - - return true; - } -} \ No newline at end of file diff --git a/src/Mewdeko/Modules/Giveaways/Giveaways.cs b/src/Mewdeko/Modules/Giveaways/Giveaways.cs index 3c45a49fb..5fb060e77 100644 --- a/src/Mewdeko/Modules/Giveaways/Giveaways.cs +++ b/src/Mewdeko/Modules/Giveaways/Giveaways.cs @@ -339,6 +339,7 @@ await ctx.Channel.SendErrorAsync( IRole pingrole = null; //string blacklistroles; //string blacklistusers; + ulong messageCount = 0; IUser host; TimeSpan time; bool useCaptcha = false; @@ -452,6 +453,22 @@ await msg.ModifyAsync(x => return; } } + await msg.ModifyAsync(x => + x.Embed = eb.WithDescription("Would you like to set a message requirement?").Build()).ConfigureAwait(false); + next = await NextMessageAsync(ctx.Channel.Id, ctx.User.Id).ConfigureAwait(false); + + if (next.ToLower() is "yes" or "y") + { + await msg.ModifyAsync(x => + x.Embed = eb.WithDescription("How many messages is the user required to send?").Build()).ConfigureAwait(false); + next = await NextMessageAsync(ctx.Channel.Id, ctx.User.Id).ConfigureAwait(false); + if (!ulong.TryParse(next, out messageCount)) + { + await msg.DeleteAsync(); + await ctx.Channel.SendErrorAsync("That is not a valid number! Start over.", Config); + return; + } + } await msg.ModifyAsync(x => x.Embed = eb.WithDescription("Would you like to set a banner?").Build()).ConfigureAwait(false); @@ -593,7 +610,7 @@ await msg.ModifyAsync(x => x.Embed = eb var reqroles = string.Join(" ", parsed.Select(x => x.Id)); await msg.DeleteAsync().ConfigureAwait(false); await Service.GiveawaysInternal(chan, time, prize, winners, host.Id, ctx.Guild.Id, ctx.Channel as ITextChannel, - ctx.Guild, reqroles, pingROle: pingrole, banner: banner, useButton: useButton, useCaptcha: useCaptcha).ConfigureAwait(false); + ctx.Guild, reqroles, pingROle: pingrole, banner: banner, useButton: useButton, useCaptcha: useCaptcha, messageCount: messageCount).ConfigureAwait(false); } /// diff --git a/src/Mewdeko/Modules/Giveaways/Services/GiveawayService.cs b/src/Mewdeko/Modules/Giveaways/Services/GiveawayService.cs index 7163eedea..3069e96ad 100644 --- a/src/Mewdeko/Modules/Giveaways/Services/GiveawayService.cs +++ b/src/Mewdeko/Modules/Giveaways/Services/GiveawayService.cs @@ -2,6 +2,7 @@ using LinqToDB.EntityFrameworkCore; using Mewdeko.Common.Configs; using Mewdeko.Database.DbContextStuff; +using Mewdeko.Modules.Utility.Services; using Mewdeko.Services.Impl; using Serilog; using Swan; @@ -19,6 +20,7 @@ public class GiveawayService : INService private readonly BotConfig config1; private readonly ConcurrentDictionary giveawayTimers = new(); private readonly BotCredentials credentials; + private readonly MessageCountService msgCntService; /// /// Service for handling giveaways. @@ -29,13 +31,14 @@ public class GiveawayService : INService public GiveawayService(DiscordShardedClient client, DbContextProvider dbProvider, GuildSettingsService guildSettings, - BotConfig config, BotCredentials credentials) + BotConfig config, BotCredentials credentials, MessageCountService msgCntService) { client1 = client; this.dbProvider = dbProvider; guildSettings1 = guildSettings; config1 = config; this.credentials = credentials; + this.msgCntService = msgCntService; _ = InitializeGiveawaysAsync(); } @@ -199,7 +202,7 @@ public async Task GiveawaysInternal(ITextChannel chan, TimeSpan ts, string item, ulong serverId, ITextChannel currentChannel, IGuild guild, string? reqroles = null, string? blacklistusers = null, string? blacklistroles = null, IDiscordInteraction? interaction = null, string banner = null, - IRole pingROle = null, bool useButton = false, bool useCaptcha = false) + IRole pingROle = null, bool useButton = false, bool useCaptcha = false, ulong messageCount = 0) { var gconfig = await guildSettings1.GetGuildConfig(serverId).ConfigureAwait(false); IRole role = null; @@ -249,6 +252,11 @@ public async Task GiveawaysInternal(ITextChannel chan, TimeSpan ts, string item, } } + if (messageCount > 0) + { + eb.WithDescription(eb.Description + $"\n{messageCount} Messages Required."); + } + if (!string.IsNullOrEmpty(gconfig.GiveawayEmbedColor)) { var colorStr = gconfig.GiveawayEmbedColor; @@ -294,7 +302,8 @@ public async Task GiveawaysInternal(ITextChannel chan, TimeSpan ts, string item, Winners = winners, Emote = emote.ToString(), UseButton = useButton, - UseCaptcha = useCaptcha + UseCaptcha = useCaptcha, + MessageCountReq = messageCount }; if (!string.IsNullOrWhiteSpace(reqroles)) rem.RestrictTo = reqroles; @@ -470,11 +479,24 @@ await ch.ModifyAsync(x => } } + if (r.MessageCountReq > 0 && users.Count!=0) + { + var count = new Dictionary(); + foreach (var i in users) + { + var retrieved = await msgCntService.GetMessageCount(MessageCountService.CountQueryType.User, + r.ServerId, i.Id); + count.Add(i, retrieved); + } + + users = count.Where(x => x.Value >= r.MessageCountReq).Select(x => x.Key).ToList(); + } + if (users.Count == 0) { var eb1 = new EmbedBuilder().WithErrorColor() .WithDescription( - "Looks like nobody that actually met the role requirements joined..") + "Looks like nobody that actually met the requirements joined..") .Build(); await ch.ModifyAsync(x => { diff --git a/src/Mewdeko/Modules/OwnerOnly/Services/OwnerOnlyService.cs b/src/Mewdeko/Modules/OwnerOnly/Services/OwnerOnlyService.cs index cb9bf687a..bf1ce5af9 100644 --- a/src/Mewdeko/Modules/OwnerOnly/Services/OwnerOnlyService.cs +++ b/src/Mewdeko/Modules/OwnerOnly/Services/OwnerOnlyService.cs @@ -54,7 +54,7 @@ public class OwnerOnlyService : ILateExecutor, IReadyExecutor, INService /// /// The Discord client used for interacting with the Discord API. /// Handles command processing and execution. - /// Provides access to the database for data persistence. + /// Provides access to the database for data persistence. /// Provides access to localized bot strings. /// Contains the bot's credentials and configuration. /// Provides caching functionalities. @@ -422,7 +422,9 @@ private async Task StreamResponseAndUpdateEmbedAsync(string apiKey, string model if (!((DateTimeOffset.UtcNow - lastUpdate).TotalSeconds >= 1)) continue; lastUpdate = DateTimeOffset.UtcNow; var embeds = BuildEmbeds(responseBuilder.ToString(), author, - chatResponse.Usage is not null ? toUpdate.actualItem.GptTokensUsed + chatResponse.Usage.TotalTokens : toUpdate.actualItem.GptTokensUsed); + chatResponse.Usage is not null + ? toUpdate.actualItem.GptTokensUsed + chatResponse.Usage.TotalTokens + : toUpdate.actualItem.GptTokensUsed); if (chatResponse.Usage is not null) totalTokens += chatResponse.Usage.TotalTokens; await loadingMsg.ModifyAsync(m => m.Embeds = embeds.ToArray()); @@ -1065,6 +1067,4 @@ private class Message public string Role { get; set; } public string Content { get; set; } } - - } \ No newline at end of file diff --git a/src/Mewdeko/Modules/Tickets/Services/TicketService.cs b/src/Mewdeko/Modules/Tickets/Services/TicketService.cs new file mode 100644 index 000000000..f2bdb58dc --- /dev/null +++ b/src/Mewdeko/Modules/Tickets/Services/TicketService.cs @@ -0,0 +1,134 @@ +using Mewdeko.Database.DbContextStuff; +using Microsoft.EntityFrameworkCore; + +namespace Mewdeko.Modules.Tickets.Services +{ + /// + /// Tickets + /// + public class TicketService : INService + { + private readonly DbContextProvider dbProvider; + private readonly DiscordShardedClient client; + private readonly GuildSettingsService guildSettings; + + /// + /// Tickets + /// + /// + /// + /// + public TicketService( + DbContextProvider dbProvider, + DiscordShardedClient client, + GuildSettingsService guildSettings) + { + this.dbProvider = dbProvider; + this.client = client; + this.guildSettings = guildSettings; + } + + /// + /// Creates a ticket panel + /// + /// + /// + /// + /// + /// + /// + public async Task CreateTicketPanel(ulong guildId, ulong channelId, string messageCode) + { + await using var db = await dbProvider.GetContextAsync(); + var panels = await db.TicketPanels.FirstOrDefaultAsync(x => x.ChannelId == channelId); + if (panels is not null) + return null; + var ticketPanel = new TicketPanel + { + GuildId = guildId, + ChannelId = channelId, + MessageJson = messageCode + }; + + db.TicketPanels.Add(ticketPanel); + await db.SaveChangesAsync(); + + return ticketPanel; + } + + /// + /// Chanel + /// + /// + /// + /// + /// + public async Task CreateTicketChannel(IGuild guild, IGuildUser user, TicketButton button) + { + var channelName = $"ticket-{user.Username.ToLower()}-{DateTime.Now:yyyyMMddHHmmss}"; + var ticketChannel = await guild.CreateTextChannelAsync(channelName, properties => + { + properties.Topic = $"Ticket for {user.Username} - {button.Label}"; + }); + + await ticketChannel.AddPermissionOverwriteAsync(user, OverwritePermissions.AllowAll(ticketChannel)); + await ticketChannel.AddPermissionOverwriteAsync(guild.EveryoneRole, + OverwritePermissions.DenyAll(ticketChannel)); + + var embed = new EmbedBuilder() + .WithTitle($"New Ticket - {button.Label}") + .WithDescription(button.OpenMessage) + .WithColor(Color.Green) + .WithFooter($"Ticket ID: {ticketChannel.Id}") + .Build(); + + await ticketChannel.SendMessageAsync(embed: embed); + + return ticketChannel; + } + + /// + /// Gets panels + /// + /// + /// + public async Task> GetTicketPanels(ulong guildId) + { + await using var db = await dbProvider.GetContextAsync(); + return await db.TicketPanels + .Where(tp => tp.GuildId == guildId) + .Include(tp => tp.Buttons) + .ToListAsync(); + } + + /// + /// Yeets a panel + /// + /// + /// + public async Task DeleteTicketPanel(ulong guildId, int panelId) + { + await using var db = await dbProvider.GetContextAsync(); + var panel = await db.TicketPanels + .Where(tp => tp.GuildId == guildId && tp.Id == panelId) + .FirstOrDefaultAsync(); + + if (panel != null) + { + db.TicketPanels.Remove(panel); + await db.SaveChangesAsync(); + } + } + + /// + /// getButtons lel + /// + /// + /// + public async Task GetTicketButton(int buttonId) + { + await using var db = await dbProvider.GetContextAsync(); + return await db.TicketButtons.FindAsync(buttonId); + } + } +} \ No newline at end of file diff --git a/src/Mewdeko/Modules/Tickets/SlashTickets.cs b/src/Mewdeko/Modules/Tickets/SlashTickets.cs new file mode 100644 index 000000000..e904e0378 --- /dev/null +++ b/src/Mewdeko/Modules/Tickets/SlashTickets.cs @@ -0,0 +1,143 @@ +using Discord.Interactions; +using Mewdeko.Common.Attributes.InteractionCommands; +using Mewdeko.Database.DbContextStuff; +using Mewdeko.Modules.Tickets.Services; + +namespace Mewdeko.Modules.Tickets; + +/// +[Group("tickets", "Manage ticket panels and tickets")] +public class TicketInteractionModule(DbContextProvider dbProvider) : MewdekoSlashModuleBase +{ + /// + /// + /// + /// + /// + /// + [SlashCommand("createpanel", "Create a new ticket panel")] + [RequireContext(ContextType.Guild)] + [SlashUserPerm(GuildPermission.ManageGuild)] + public async Task CreateTicketPanel() + { + //var channel = + } + + /// + /// + /// + /// + /// + /// + /// + [SlashCommand("addbutton", "Add a button to a ticket panel")] + [RequireContext(ContextType.Guild)] + [SlashUserPerm(GuildPermission.ManageGuild)] + public async Task AddButton( + [Summary(description: "The ID of the panel to add the button to")] int panelId, + string label, + string emoji, + string openMessage) + { + await DeferAsync(); + var panels = await Service.GetTicketPanels(ctx.Guild.Id); + var panel = panels.FirstOrDefault(p => p.Id == panelId); + + if (panel == null) + { + await ErrorLocalizedAsync("ticket_panel_not_found"); + return; + } + + if (panel.Buttons.Count >= 5) + { + await ErrorLocalizedAsync("ticket_panel_max_buttons"); + return; + } + + panel.Buttons.Add(new TicketButton + { + Label = label, + Emoji = emoji, + OpenMessage = openMessage + }); + + await using var db = await dbProvider.GetContextAsync(); + db.Update(panel); + await db.SaveChangesAsync(); + + await UpdateTicketPanelMessage(panel); + await ConfirmLocalizedAsync("ticket_button_added"); + } + + private async Task UpdateTicketPanelMessage(TicketPanel panel) + { + // var channel = await ctx.Guild.GetTextChannelAsync(panel.ChannelId); + // if (channel == null) return; + // + // var messages = await channel.GetMessagesAsync(1).FlattenAsync(); + // var message = messages.FirstOrDefault(); + // + // var embed = new EmbedBuilder() + // .WithTitle(panel.Title) + // .WithDescription(panel.Description) + // .WithColor(Color.Blue) + // .Build(); + // + // var componentBuilder = new ComponentBuilder(); + // foreach (var button in panel.Buttons) + // { + // componentBuilder.WithButton(button.Label, $"ticket:{button.Id}", ButtonStyle.Primary, Emote.Parse(button.Emoji)); + // } + // + // if (message != null) + // { + // await channel.ModifyMessageAsync(message.Id, properties => + // { + // properties.Embed = embed; + // properties.Components = componentBuilder.Build(); + // }); + // } + // else + // { + // await channel.SendMessageAsync(embed: embed, components: componentBuilder.Build()); + // } + } + + /// + /// + /// + /// + [ComponentInteraction("ticket:*")] + public async Task HandleTicketButton(string buttonId) + { + await DeferAsync(ephemeral: true); + + var guildUser = (IGuildUser)ctx.User; + var button = await Service.GetTicketButton(int.Parse(buttonId)); + + if (button != null) + { + var ticketChannel = await Service.CreateTicketChannel(ctx.Guild, guildUser, button); + await ConfirmLocalizedAsync("ticket_created", ticketChannel.Mention); + } + else + { + await ErrorLocalizedAsync("ticket_button_not_found"); + } + } + + /// + /// + /// + /// + [SlashCommand("deletepanel", "Delete a ticket panel")] + [RequireContext(ContextType.Guild)] + [SlashUserPerm(GuildPermission.ManageGuild)] + public async Task DeletePanel(int panelId) + { + await DeferAsync(); + await Service.DeleteTicketPanel(ctx.Guild.Id, panelId); + await ConfirmLocalizedAsync("ticket_panel_deleted", panelId); + } +} \ No newline at end of file diff --git a/src/Mewdeko/Modules/Utility/MessageCountCommands.cs b/src/Mewdeko/Modules/Utility/MessageCountCommands.cs new file mode 100644 index 000000000..81aff9313 --- /dev/null +++ b/src/Mewdeko/Modules/Utility/MessageCountCommands.cs @@ -0,0 +1,49 @@ +using Mewdeko.Common.Attributes.TextCommands; +using Mewdeko.Modules.Utility.Services; + +namespace Mewdeko.Modules.Utility; + +public partial class Utility +{ + /// + /// Commands for message counts + /// + public class MessageCountCommands : MewdekoSubmodule + { + /// + /// Gets the count of messages for that query type + /// + /// + /// + [Cmd, Aliases] + public async Task Messages( + MessageCountService.CountQueryType queryType = MessageCountService.CountQueryType.User, + ulong snowflakeId = 0) + { + snowflakeId = queryType switch + { + MessageCountService.CountQueryType.Guild => ctx.Guild.Id, + MessageCountService.CountQueryType.User when snowflakeId == 0 => ctx.User.Id, + MessageCountService.CountQueryType.Channel when snowflakeId == 0 => ctx.Channel.Id, + _ => snowflakeId + }; + + var count = await Service.GetMessageCount(queryType, ctx.Guild.Id, snowflakeId); + + switch (queryType) + { + case MessageCountService.CountQueryType.User: + await ctx.Channel.SendConfirmAsync($"The message count for that user is {count}"); + break; + case MessageCountService.CountQueryType.Guild: + await ctx.Channel.SendConfirmAsync($"The total message count in this server is {count}"); + break; + case MessageCountService.CountQueryType.Channel: + await ctx.Channel.SendConfirmAsync($"The total message count in that channel is {count}"); + break; + default: + throw new ArgumentOutOfRangeException(nameof(queryType), queryType, null); + } + } + } +} \ No newline at end of file diff --git a/src/Mewdeko/Modules/Utility/Services/MessageCountService.cs b/src/Mewdeko/Modules/Utility/Services/MessageCountService.cs new file mode 100644 index 000000000..7170a5d09 --- /dev/null +++ b/src/Mewdeko/Modules/Utility/Services/MessageCountService.cs @@ -0,0 +1,152 @@ +using System.Threading; +using LinqToDB.EntityFrameworkCore; +using Mewdeko.Common.ModuleBehaviors; +using Mewdeko.Database.DbContextStuff; +using Microsoft.EntityFrameworkCore; +using Serilog; + +namespace Mewdeko.Modules.Utility.Services; + +/// +/// Service for counting messages +/// +public class MessageCountService : INService, IReadyExecutor +{ + + private HashSet countGuilds = []; + private readonly DbContextProvider dbContext; + private ConcurrentDictionary<(ulong GuildId, ulong UserId, ulong ChannelId), MessageCount> messageCounts = new(); + private Timer updateTimer; + + /// + /// + /// + public MessageCountService(DbContextProvider dbContext, EventHandler handler) + { + this.dbContext = dbContext; + handler.MessageReceived += HandleCount; + } + + private async Task HandleCount(SocketMessage args) + { + await Task.CompletedTask; + + if (countGuilds.Count == 0 || args.Channel is IDMChannel || args.Channel is not IGuildChannel channel) + return; + + var key = (channel.GuildId, args.Author.Id, channel.Id); + messageCounts.AddOrUpdate( + key, + _ => new MessageCount { GuildId = channel.GuildId, UserId = args.Author.Id, ChannelId = channel.Id, Count = 1 }, + (_, existingCount) => + { + existingCount.Count++; + return existingCount; + } + ); + } + + /// + /// Gets a count for the specified type + /// + /// The type of query, + /// The id related to the query type + /// AN ulong count + /// + public async Task GetMessageCount(CountQueryType queryType, ulong guildId, ulong snowflakeId) + { + await Task.CompletedTask; + var count = queryType switch + { + CountQueryType.Guild => messageCounts.Values + .Where(x => x.GuildId == guildId) + .Aggregate(0UL, (total, next) => total + next.Count), + + CountQueryType.Channel => messageCounts.Values + .Where(x => x.ChannelId == snowflakeId && x.GuildId == guildId) + .Aggregate(0UL, (total, next) => total + next.Count), + + CountQueryType.User => messageCounts.Values + .Where(x => x.UserId == snowflakeId && x.GuildId == guildId) + .Aggregate(0UL, (total, next) => total + next.Count), + + _ => throw new ArgumentException("Invalid query type", nameof(queryType)) + }; + + return count; + } + + /// + public async Task OnReadyAsync() + { + Log.Information("Loading Message Count Cache"); + await using var db = await dbContext.GetContextAsync(); + countGuilds = (await db.GuildConfigs + .Where(x => x.UseMessageCount) + .Select(x => x.GuildId).ToListAsyncEF()) + .ToHashSet(); + + var dbMessageCounts = await db.MessageCounts.ToListAsync(); + messageCounts = new ConcurrentDictionary<(ulong GuildId, ulong UserId, ulong ChannelId), MessageCount>( + dbMessageCounts.ToDictionary( + mc => (mc.GuildId, mc.UserId, mc.ChannelId), + mc => mc + ) + ); + + updateTimer = new Timer(async _ => await UpdateDatabase(), null, TimeSpan.Zero, TimeSpan.FromSeconds(30)); + } + + private async Task UpdateDatabase() + { + try + { + Log.Information("Starting batch update of message counts"); + await using var db = await dbContext.GetContextAsync(); + + var countsToUpdate = messageCounts.Values.ToList(); + + await db.BulkMergeAsync(countsToUpdate, options => + { + options.ColumnPrimaryKeyExpression = c => new { c.GuildId, c.UserId, c.ChannelId }; + options.IgnoreOnMergeUpdateExpression = c => c.Id; + options.MergeKeepIdentity = true; + options.InsertIfNotExists = true; + options.ColumnInputExpression = c => new + { + c.GuildId, + c.UserId, + c.ChannelId, + c.Count + }; + options.ColumnOutputExpression = c => c.Id; + options.ColumnSynchronizeDeleteKeySubsetExpression = c => new { c.GuildId, c.UserId, c.ChannelId }; + }); + + Log.Information("Batch update completed. Updated/Added {Count} entries", countsToUpdate.Count); + } + catch (Exception ex) + { + Log.Error(ex, "Error occurred during batch update of message counts"); + } + } + + /// + /// Whether the query is for a channel, user, or guild + /// + public enum CountQueryType + { + /// + /// Guild + /// + Guild, + /// + /// Channel + /// + Channel, + /// + /// User + /// + User + } +} \ No newline at end of file