diff --git a/CHANGELOG.md b/CHANGELOG.md index e565936..73e815f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,207 +2,20 @@ Mostly based on [keepachangelog](https://keepachangelog.com/en/1.1.0/) except date format. a-c-f-r-o -## [5.1.20] - 13.11.2024 - -### Added - -- Added `.rakeback` command, get a % of house edge back as claimable currency -- Added `.snipe` command to quickly get a copy of a posted message as an embed - - You can reply to a message to snipe that message - - Or just type .snipe and the bot will snipe the last message in the channel with content or image -- Added `.betstatsreset` / `.bsreset` command to reset your stats for a fee -- Added `.gamblestatsreset` / `.gsreset` owner-only command to reset bot stats for all games -- Added `.waifuclaims` command which lists all of your claimed waifus -- Added and changed `%bot.time%` and `%bot.date%` placeholders. They use timestamp tags now - -### Changed - -- `.divorce` no longer has a cooldown -- `.betroll` has a 2% better payout -- `.slot` payout balanced out (less volatile), reduced jackpot win but increased other wins, - - now has a new symbol, wheat - - worse around 1% in total (now shares the top spot with .bf) - -## [5.1.19] - 05.11.2024 - -### Added - -- Added `.betstats` - - See your own stats with .betstats - - Target someone else: .betstats @mai_lanfiel - - You can also specify a game .betstats lula - - Or both! .betstats mai_lanfiel br -- `.timely` can now have a server boost bonus - - Configure server ids and reward amount in data/gambling.yml - - anyone who boosts one of the sepcified servers gets the amount as base timely bonus - -### Changed - -- `.plant/pick` password font size will be slightly bigger -- `.race` will now have 82-94% payout rate based on the number of players playing (1-12, x0.01 per player). -- Any player over 12 won't increase payout - -### Fixed - -- `.xplb` and `.xpglb` now have proper ranks after page 1 -- Fixed boost bonus on shards different than the specified servers' shard - -## [5.1.18] - 04.11.2024 - -### Added - -- Added `.translateflags` / `.trfl` command. - - Enable on a per-channel basis. - - Reacting on any message in that channel with a flag emoji will post the translation of that message in the - language of that country - - 5 second cooldown per user - - The message can only be translated once per language (counter resets every 24h) -- `.timely` now has a button. Togglable via `.conf gambling` it's called pass because previously it was a captcha, but captchas are too annoying - -## Changed - -- [public bot] Patreon reward bonus for flowers reduced. Timely bonuses stay the same -- discriminators removed from the databases. All users who had ???? as discriminator have been renamed to ??username. - - all new unknown users will have ??Unknown as their name -- Flower currency generation will now have a strikeout to try combat the pickbots. This is the weakest but easiest protection to implement. There may be more options in the future - -## Fixed - -- nunchi join game message is now ok color instead of error color - -## [5.1.17] - 29.10.2024 - -### Fixed - -- fix: Bot will now not accept .aar Role if that Role is higher than or equal to bot's role. Previously bot would just - fail silently, now there is a proper error message. - -## [5.1.16] - 28.10.2024 - -## Added - -- Added .ncanvas and related commands. - - You can set pixel colors (and text) on a 500x350 canvas, pepega version of r/place - - You use currency to set pixels. - - Commands: - - see the entire canvas: `.nc` - - zoom: `.ncz ` or `.ncz x y` - - set pixel: `.ncsp ` - - get pixel: `.ncp ` - - Owners can use .ncsetimg to set a starting image, use `.h .setimg` for instructions - - Owners can reset the whole canvas via `.ncreset` - -## [5.1.15] - 21.10.2024 - -## Added - -- Added -c option for `.xpglb` - -## Change - -- Leaderboards will now show 10 users per page -- A lot of internal changes and improvements - -## Fixed - -- Fixed a big issue which caused several features to not get loaded on bot restart -- Alias collision fix `.qse` is now quotesearch, `.qs` will stay `.queuesearch` -- Fixed some migrations which would prevent users from updating from ancient versions -- Waifulb will no longer show #0000 discrims -- More `.greet` command fixes -- Author name will now be counted as content in embeds. Embeds can now only have author fields and still be valid -- Grpc api fixes, and additions - -## [5.1.14] - 03.10.2024 - -## Changed - -- Improved `.xplb -c`, it will now correctly only show users who are still in the server with no count limit - -## Fixed - -- Fixed marmalade load error on startup - -## [5.1.13] - 03.10.2024 - -### Fixed - -- Grpc api server will no longer start unless enabled in creds -- Seq comment in creds fixed - -## [5.1.12] - 03.10.2024 - -### Added - -- Added support for `seq` for logging. If you fill in seq url and apiKey in creds.yml, bot will sends logs to it - -### Fixed - -- Fixed the Check for updates service not using the right URL and spitting an error in the console. -- Fixed another bug in `.greet` / `.bye` system, which caused it to show wrong message on a wrong server occasionally - -## [5.1.11] - 03.10.2024 - -### Added - -- Added `%user.displayname%` placeholder. It will show users nickname, if there is one, otherwise it will show the - username. - - Nickname won't be shown in bye messages. -- Added initial version of grpc api. Beta - -### Fixed - -- Fixed a bug which caused `.bye` and `.greet` messages to be randomly disabled -- Fixed `.lb -c` breaking sometimes, and fixed pagination - -### Changed - -- Youtube now always uses `yt-dlp`. Dropped support for `youtube-dl` - - If you've previously renamed your yt-dlp file to youtube-dl, please rename it back. -- ytProvider in data/searches.yml now also controls where you're getting your song streams from. - - (Invidious support added for .q) - -## [5.1.10] - 24.09.2024 - -### Fixed - -- Fixed claimed waifu decay in `games.yml` - -### Changed - -- Added some logs for greet service in case there are unforeseen issues, for easier debugging - -## [5.1.9] - 21.09.2024 - -### Fixed - -- Fixed `.greettest`, and other `.*test` commands if you didn't have them enabled. -- Fixed `.greetdmtest` sending messages twice. -- Fixed a serious bug which caused greet messages to be jumbled up, and wrong ones to be sent for the wrong events. - - There is no database issue, all greet messages are safe, the cache was caching any setting every 3 seconds with no - regard for the type of the event - - This also caused `.greetdm` messages to not be sent if `.greet` is enabled - - This bug was introduced in 5.1.8. PLEASE UPDATE if you are on 5.1.8 -- Selfhosters only: Fixed marmalade dependency loading - - Note: Make sure to not publish any other DLLs besides the ones you are sure you will need, as there can be version - conflicts which didn't happen before. - -## [5.1.8] - 20.09.2024 +## [5.1.8] ### Added - Added `.leaveunkeptservers` which will make the bot leave all servers on all shards whose owners didn't run `.keep` command. - - This is a dangerous and irreversible command, don't use it. Meant for use on the public bot. -- `.adpl` now supports custom statuses (you no longer need to specify Playing, Watching, etc...) + - This is a dangerous and irreversible command, don't use it. Meant for use on the public bot. ### Changed - `.quote` commands cleaned up and improved - - All quote commands now start with `.q` and follow the same naming pattern as Expression commands - - `.liqu` renamed to `.qli` - - `.quotesearch` / `.qse` is now paginated for easier searching + - All quote commands now start with `.q` and follow the same naming pattern as Expression commands + - `.liqu` renamed to `.qli` + - `.quotesearch` / `.qse` is now paginated for easier searching - `.whosplaying` is now paginated -- `.img` is now paginated - `.setgame` renamed to`.setactivity` and now supports custom text activity. You don't have to specify playing, listening etc before the activity - Clarified and added some embed / placeholder links to command help where needed - dev: A lot of code cleanup and internal improvements @@ -213,14 +26,6 @@ Mostly based on [keepachangelog](https://keepachangelog.com/en/1.1.0/) except da - Fixed a bug in `.gatari` command - Fixed some waifu related strings - Fixed `.quoteshow` and `.quoteid` commands -- Fixed some placeholders not working in `.greetdm` -- Fixed postgres support -- Fixed and clarified some command strings/parameter descriptions - -### Removed - -- Removed mysql support as it didn't work for a while, and requires some special handling/maintenance - - Sqlite and Postgres support stays ## [5.1.7] - 09.08.2024 @@ -242,18 +47,17 @@ Mostly based on [keepachangelog](https://keepachangelog.com/en/1.1.0/) except da - `.afk` messages can no longer ping, and the response is moved to DMs to avoid abuse - Possible fix for `.remind` timestamp - + ### Removed - -- Removed old bloat / semi broken / dumb commands - - `.memelist` / `.memegen` (too inconvenient to use) - - `.activity` (useless owner-only command) - - `.rafflecur` (Just use raffle and then award manually instead) - - `.rollduel` (we had this command?) +- Removed old bloat / semi broken / dumb commands + - `.memelist` / `.memegen` (too inconvenient to use) + - `.activity` (useless owner-only command) + - `.rafflecur` (Just use raffle and then award manually instead) + - `.rollduel` (we had this command?) - You can no longer bet on `.connect4` - `.economy` Removed. - - Was buggy and didn't really show the real state of the economy. - - It might come back improved in the future + - Was buggy and didn.t really show the real state of the economy. + - It might come back improved in the future - `.mal` Removed. Useless information / semi broken ## [5.1.5] - 01.08.2024 @@ -261,9 +65,9 @@ Mostly based on [keepachangelog](https://keepachangelog.com/en/1.1.0/) except da ### Added - Added: Added a `.afk ?` command which sets an afk message which will trigger whenever someone pings you - - Message will when you type a message in any channel that the bot sees, or after 8 hours, whichever comes first - - The specified message will be prefixed with "The user is afk: " - - The afk message will disappear 30 seconds after being triggered + - Message will when you type a message in any channel that the bot sees, or after 8 hours, whichever comes first + - The specified message will be prefixed with "The user is afk: " + - The afk message will disappear 30 seconds after being triggered ### Changed @@ -271,7 +75,7 @@ Mostly based on [keepachangelog](https://keepachangelog.com/en/1.1.0/) except da - Updated some bet descriptions to include 'all' 'half' usage instructions - Updated some command strings - dev: Vastly simplified marmalade creation using dotnet templates, docs updated -- Slight refactor of .wiki, time, .catfact, .wikia, .define, .bible and .quran commands, no significant change in functionality +- Slight refactor of .wiki, .time, .catfact, .wikia, .define, .bible and .quran commands, no significant change in functionality ### Fixed @@ -290,10 +94,8 @@ Mostly based on [keepachangelog](https://keepachangelog.com/en/1.1.0/) except da - Added Clubs rank in the leaderboard to `.clubinfo` - Bot owners can now check other people's bank balance (Not server owners, only bot owner, the person who is hosting the bot) - You can now send multiple waifu gifts at once to waifus. For example `.waifugift 3xRose @user` will give that user 3 roses - - The format is `x`, no spaces + - The format is `x`, no spaces - Added `.boosttest` command -- Added support for any openai compatible api for the chatterbot feature change: - - Changed games.yml to allow input of the apiUrl (needs to be openai compatible) and modelName as a string. ### Changed @@ -335,9 +137,9 @@ Mostly based on [keepachangelog](https://keepachangelog.com/en/1.1.0/) except da ### Added - Added `.honeypot` command, which automatically softbans (ban and immediate unban) any user who posts in that channel. - - Useful to auto softban bots who spam every channel upon joining - - Users who run commands or expressions won't be softbanned. - - Users who have ban member permissions are also excluded. + - Useful to auto softban bots who spam every channel upon joining + - Users who run commands or expressions won't be softbanned. + - Users who have ban member permissions are also excluded. ### Fixed @@ -351,6 +153,7 @@ Mostly based on [keepachangelog](https://keepachangelog.com/en/1.1.0/) except da - Added support for `gpt-4o` in `data/games.yml` - Added EllieAiToken to `creds.yml` + ### Changed - Remind will now show a timestamp tag for durations @@ -363,8 +166,8 @@ Mostly based on [keepachangelog](https://keepachangelog.com/en/1.1.0/) except da - Fixed xp bg buy button not working, and possibly some other buttons too - Fixed shopbuy %user% placeholders and updated help text -- All .feed overloads should now work" -- `.xpexclude` should will now work with forums too. If you exclude a forum you won't be able to gain xp in any of the threads. +- All 'feed overloads should now work" +- `'xpexclude` should will now work with forums too. If you exclude a forum you won't be able to gain xp in any of the threads. - Fixed remind not showing correct time ### Removed @@ -376,14 +179,12 @@ Mostly based on [keepachangelog](https://keepachangelog.com/en/1.1.0/) except da ### Added -- Added `.setserverbanner` and `.setservericon` commands -- Added overloads section to `.h command` which will show you all versions of command usage with param names -- You can now check commands for submodules, for example `.cmds SelfAssignedRoles` will show brief help for each of the - commands in that submodule -- Added dropdown menus for .mdls and .cmds (both module and group versions) which will give you the option to see more - detailed help for each specific module, group or command respectively +- Added `'setserverbanner` and `'setservericon` commands +- Added overloads section to `'h command` which will show you all versions of command usage with param names +- You can now check commands for submodules, for example `'cmds SelfAssignedRoles` will show brief help for each of the commands in that submodule +- Added dropdown menus for 'mdls and 'cmds (both module and group versions) which will give you the option to see more detailed help for each specific module, group or command respectively - Self-Hosters only: - - Added a dangerous cleanup command that you don't have to know about + - Added a dangerous cleanup command that you don't have to know about ### Changed @@ -391,7 +192,7 @@ Mostly based on [keepachangelog](https://keepachangelog.com/en/1.1.0/) except da ### Fixed -- `.verbose` will now be respected for expression errors -- Using `.pick` will now correctly show the name of the user who picked the currency -- Fixed `.h` not working on some commands -- `.langset` and `.langsetd` should no longer allow unsupported languages and nonsense to be typed in +- `'verbose` will now be respected for expression errors +- Using `'pick` will now correctly show the name of the user who picked the currency +- Fixed `'h` not working on some commands +- `'langset` and `'langsetd` should no longer allow unsupported languages and nonsense to be typed in \ No newline at end of file diff --git a/EllieBot.sln b/EllieBot.sln index 47179ff..306d678 100644 --- a/EllieBot.sln +++ b/EllieBot.sln @@ -11,7 +11,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Dockerfile = Dockerfile ellie-menu.ps1 = ellie-menu.ps1 LICENSE = LICENSE + migrate.ps1 = migrate.ps1 README.md = README.md + remove-migrations.ps1 = remove-migrations.ps1 EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EllieBot", "src\EllieBot\EllieBot.csproj", "{4D9001F7-B3E8-48FE-97AA-CFD36DA65A64}" @@ -28,8 +30,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ellie.Marmalade", "src\Elli EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EllieBot.Voice", "src\EllieBot.Voice\EllieBot.Voice.csproj", "{1D93CE3C-80B4-49C7-A9A2-99988920AAEC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EllieBot.GrpcApiBase", "src\EllieBot.GrpcApiBase\EllieBot.GrpcApiBase.csproj", "{3B71F0BF-AE6C-480C-AB88-FCE23EDC7D91}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -64,10 +64,6 @@ Global {1D93CE3C-80B4-49C7-A9A2-99988920AAEC}.Debug|Any CPU.Build.0 = Debug|Any CPU {1D93CE3C-80B4-49C7-A9A2-99988920AAEC}.Release|Any CPU.ActiveCfg = Release|Any CPU {1D93CE3C-80B4-49C7-A9A2-99988920AAEC}.Release|Any CPU.Build.0 = Release|Any CPU - {3B71F0BF-AE6C-480C-AB88-FCE23EDC7D91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3B71F0BF-AE6C-480C-AB88-FCE23EDC7D91}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3B71F0BF-AE6C-480C-AB88-FCE23EDC7D91}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3B71F0BF-AE6C-480C-AB88-FCE23EDC7D91}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -80,7 +76,6 @@ Global {F1A77F56-71B0-430E-AE46-94CDD7D43874} = {B28FB883-9688-41EB-BF5A-945F4A4EB628} {76AC715D-12FF-4CBE-9585-A861139A2D0C} = {B28FB883-9688-41EB-BF5A-945F4A4EB628} {1D93CE3C-80B4-49C7-A9A2-99988920AAEC} = {B28FB883-9688-41EB-BF5A-945F4A4EB628} - {3B71F0BF-AE6C-480C-AB88-FCE23EDC7D91} = {B28FB883-9688-41EB-BF5A-945F4A4EB628} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {79F61C2C-CDBB-4361-A234-91A0B334CFE4} diff --git a/migrate.ps1 b/migrate.ps1 new file mode 100644 index 0000000..a5d5685 --- /dev/null +++ b/migrate.ps1 @@ -0,0 +1,9 @@ +if ($args.Length -eq 0) { + Write-Host "Please provide a migration name." -ForegroundColor Red +} +else { + $migrationName = $args[0] + dotnet ef migrations add $migrationName -o Migrations/Mysql -c SqliteContext -p src/EllieBot/EllieBot.csproj + dotnet ef migrations add $migrationName -o Migrations/PostgreSql -c PostgreSqlContext -p src/EllieBot/EllieBot.csproj + dotnet ef migrations add $migrationName -o Migrations/Sqlite -c MysqlContext -p src/EllieBot/EllieBot.csproj +} \ No newline at end of file diff --git a/src/EllieBot/remove-migrations.ps1 b/remove-migrations.ps1 similarity index 59% rename from src/EllieBot/remove-migrations.ps1 rename to remove-migrations.ps1 index 56fc594..5445dbb 100644 --- a/src/EllieBot/remove-migrations.ps1 +++ b/remove-migrations.ps1 @@ -1,2 +1,3 @@ dotnet ef migrations remove -c SqliteContext -f -p src/EllieBot/EllieBot.csproj -dotnet ef migrations remove -c PostgreSqlContext -f -p src/EllieBot/EllieBot.csproj \ No newline at end of file +dotnet ef migrations remove -c PostgreSqlContext -f -p src/EllieBot/EllieBot.csproj +dotnet ef migrations remove -c MysqlContext -f -p src/EllieBot/EllieBot.csproj \ No newline at end of file diff --git a/src/EllieBot.Generators/EllieBot.Generators.csproj b/src/EllieBot.Generators/EllieBot.Generators.csproj index 4e94449..1dbbc1d 100644 --- a/src/EllieBot.Generators/EllieBot.Generators.csproj +++ b/src/EllieBot.Generators/EllieBot.Generators.csproj @@ -9,7 +9,7 @@ - + diff --git a/src/EllieBot.Generators/GrpcApiPermGenerator.cs b/src/EllieBot.Generators/GrpcApiPermGenerator.cs deleted file mode 100644 index 34d66bc..0000000 --- a/src/EllieBot.Generators/GrpcApiPermGenerator.cs +++ /dev/null @@ -1,184 +0,0 @@ -#nullable enable -using System.CodeDom.Compiler; -using System.Collections.Immutable; -using System.Diagnostics; -using System.Text; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using Microsoft.CodeAnalysis.Text; -using Newtonsoft.Json; - -namespace EllieBot.Generators -{ - public readonly record struct MethodPermData - { - public readonly ImmutableArray<(string Name, string Value)> MethodPerms; - public readonly ImmutableArray NoAuthRequired; - - public MethodPermData(ImmutableArray<(string Name, string Value)> methodPerms, - ImmutableArray noAuthRequired) - { - MethodPerms = methodPerms; - NoAuthRequired = noAuthRequired; - } - } - - - [Generator] - public class GrpcApiPermGenerator : IIncrementalGenerator - { - public const string GRPC_API_PERM_ATTRIBUTE = - """ - namespace EllieBot.GrpcApi; - - [System.AttributeUsage(System.AttributeTargets.Method)] - public class GrpcApiPermAttribute : System.Attribute - { - public GuildPerm Value { get; } - public GrpcApiPermAttribute(GuildPerm value) => Value = value; - } - """; - - public const string GRPC_NO_AUTH_REQUIRED_ATTRIBUTE = - """ - namespace EllieBot.GrpcApi; - - [System.AttributeUsage(System.AttributeTargets.Method)] - public class GrpcNoAuthRequiredAttribute : System.Attribute - { - } - """; - - public void Initialize(IncrementalGeneratorInitializationContext context) - { - context.RegisterPostInitializationOutput(ctx => ctx.AddSource("GrpcApiPermAttribute.cs", - SourceText.From(GRPC_API_PERM_ATTRIBUTE, Encoding.UTF8))); - - context.RegisterPostInitializationOutput(ctx => ctx.AddSource("GrpcNoAuthRequiredAttribute.cs", - SourceText.From(GRPC_NO_AUTH_REQUIRED_ATTRIBUTE, Encoding.UTF8))); - - var perms = context.SyntaxProvider - .ForAttributeWithMetadataName( - "EllieBot.GrpcApi.GrpcApiPermAttribute", - predicate: static (s, _) => s is MethodDeclarationSyntax, - transform: static (ctx, _) => GetMethodSemanticTargets(ctx.SemanticModel, ctx.TargetNode)) - .Where(static m => m is not null) - .Select(static (x, _) => x!.Value) - .Collect(); - - - var all = context.SyntaxProvider - .ForAttributeWithMetadataName( - "EllieBot.GrpcApi.GrpcNoAuthRequiredAttribute", - predicate: static (s, _) => s is MethodDeclarationSyntax, - transform: static (ctx, _) => GetNoAuthMethodName(ctx.SemanticModel, ctx.TargetNode)) - .Collect() - .Combine(perms) - .Select((x, _) => new MethodPermData(x.Right, x.Left)); - - context.RegisterSourceOutput(all, - static (spc, source) => Execute(source, spc)); - } - - private static string GetNoAuthMethodName(SemanticModel model, SyntaxNode node) - => ((MethodDeclarationSyntax)node).Identifier.Text; - - private static (string Name, string Value)? GetMethodSemanticTargets(SemanticModel model, SyntaxNode node) - { - var method = (MethodDeclarationSyntax)node; - - var name = method.Identifier.Text; - var attr = method.AttributeLists - .SelectMany(x => x.Attributes) - .FirstOrDefault(); - - if (attr is null) - return null; - - return (name, attr.ArgumentList?.Arguments[0].ToString() ?? "__missing_perm__"); - } - - private static void Execute(MethodPermData data, SourceProductionContext ctx) - { - using (var stringWriter = new StringWriter()) - using (var sw = new IndentedTextWriter(stringWriter)) - { - sw.WriteLine("using System.Collections.Frozen;"); - sw.WriteLine(); - sw.WriteLine("namespace EllieBot.GrpcApi;"); - sw.WriteLine(); - - sw.WriteLine("public partial class GrpcApiPermsInterceptor"); - sw.WriteLine("{"); - - sw.Indent++; - - sw.WriteLine( - "private static FrozenDictionary _perms = new Dictionary()"); - sw.WriteLine("{"); - - sw.Indent++; - foreach (var field in data.MethodPerms) - { - sw.WriteLine("{{ \"{0}\", {1} }},", field.Name, field.Value); - } - - sw.Indent--; - sw.WriteLine("}.ToFrozenDictionary();"); - - sw.WriteLine(); - sw.WriteLine("private static FrozenSet _noAuthRequired = new HashSet()"); - sw.WriteLine("{"); - - sw.Indent++; - foreach (var noauth in data.NoAuthRequired) - { - sw.WriteLine("{{ \"{0}\" }},", noauth); - } - - sw.WriteLine(""); - - sw.Indent--; - sw.WriteLine("}.ToFrozenSet();"); - - sw.Indent--; - sw.WriteLine("}"); - - sw.Flush(); - ctx.AddSource("GrpcApiInterceptor.g.cs", stringWriter.ToString()); - } - } - - private List GetFields(string? dataText) - { - if (string.IsNullOrWhiteSpace(dataText)) - return new(); - - Dictionary data; - try - { - var output = JsonConvert.DeserializeObject>(dataText!); - if (output is null) - return new(); - - data = output; - } - catch - { - Debug.WriteLine("Failed parsing responses file."); - return new(); - } - - var list = new List(); - foreach (var entry in data) - { - list.Add(new( - entry.Key, - entry.Value - )); - } - - return list; - } - } -} \ No newline at end of file diff --git a/src/EllieBot.GrpcApiBase/EllieBot.GrpcApiBase.csproj b/src/EllieBot.GrpcApiBase/EllieBot.GrpcApiBase.csproj deleted file mode 100644 index c941779..0000000 --- a/src/EllieBot.GrpcApiBase/EllieBot.GrpcApiBase.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - net8.0 - enable - enable - - - - - - - - - - - Server - - - - \ No newline at end of file diff --git a/src/EllieBot.GrpcApiBase/protos/canvas.proto b/src/EllieBot.GrpcApiBase/protos/canvas.proto deleted file mode 100644 index e2ea366..0000000 --- a/src/EllieBot.GrpcApiBase/protos/canvas.proto +++ /dev/null @@ -1,47 +0,0 @@ -syntax = "proto3"; - -option csharp_namespace = "EllieBot.GrpcApi"; - -import "google/protobuf/empty.proto"; - -package ncanvas; - -service GrpcNCanvas { - rpc GetCanvas(google.protobuf.Empty) returns (CanvasReply); - rpc GetPixel(GetPixelRequest) returns (GetPixelReply); - rpc SetPixel(SetPixelRequest) returns (SetPixelReply); -} - -message CanvasReply { - repeated uint32 pixels = 1; - int32 width = 2; - int32 height = 3; -} - -message GetPixelRequest { - int32 x = 1; - int32 y = 2; -} - -message GetPixelReply { - string color = 1; - uint32 packedColor = 2; - int32 positionX = 3; - int32 positionY = 4; - int64 price = 5; - string text = 6; - string position = 7; -} - -message SetPixelRequest { - string position = 1; - string color = 2; - string text = 3; - int64 price = 4; -} - -message SetPixelReply { - string error = 1; - bool success = 2; - optional GetPixelReply pixel = 3; -} \ No newline at end of file diff --git a/src/EllieBot.GrpcApiBase/protos/exprs.proto b/src/EllieBot.GrpcApiBase/protos/exprs.proto deleted file mode 100644 index 056d4a5..0000000 --- a/src/EllieBot.GrpcApiBase/protos/exprs.proto +++ /dev/null @@ -1,89 +0,0 @@ -syntax = "proto3"; - -option csharp_namespace = "EllieBot.GrpcApi"; - -import "google/protobuf/empty.proto"; - -package exprs; - -service GrpcExprs { - rpc GetExprs(GetExprsRequest) returns (GetExprsReply); - rpc AddExpr(AddExprRequest) returns (AddExprReply); - rpc DeleteExpr(DeleteExprRequest) returns (google.protobuf.Empty); - - rpc GetQuotes(GetQuotesRequest) returns (GetQuotesReply); - rpc AddQuote(AddQuoteRequest) returns (AddQuoteReply); - rpc DeleteQuote(DeleteQuoteRequest) returns (google.protobuf.Empty); -} - -message DeleteExprRequest { - string id = 1; - uint64 guildId = 2; -} - -message GetExprsRequest { - uint64 guildId = 1; - string query = 2; - int32 page = 3; -} - -message GetExprsReply { - repeated ExprDto expressions = 1; - int32 totalCount = 2; -} - -message ExprDto { - string id = 1; - string trigger = 2; - string response = 3; - - bool ca = 4; - bool ad = 5; - bool dm = 6; - bool at = 7; -} - -message AddExprRequest { - uint64 guildId = 1; - ExprDto expr = 2; -} - -message AddExprReply { - string id = 1; - bool success = 2; -} - -message GetQuotesRequest { - uint64 guildId = 1; - string query = 2; - int32 page = 3; -} - -message GetQuotesReply { - repeated QuoteDto quotes = 1; - int32 totalCount = 2; -} - -message QuoteDto { - string id = 1; - string trigger = 2; - string response = 3; - - uint64 authorId = 4; - string authorName = 5; -} - -message AddQuoteRequest { - uint64 guildId = 1; - QuoteDto quote = 2; -} - -message AddQuoteReply { - string id = 1; - bool success = 2; -} - -message DeleteQuoteRequest { - string id = 1; - uint64 guildId = 2; -} \ No newline at end of file diff --git a/src/EllieBot.GrpcApiBase/protos/fin.proto b/src/EllieBot.GrpcApiBase/protos/fin.proto deleted file mode 100644 index 03c15be..0000000 --- a/src/EllieBot.GrpcApiBase/protos/fin.proto +++ /dev/null @@ -1,60 +0,0 @@ -syntax = "proto3"; - -option csharp_namespace = "EllieBot.GrpcApi"; - -import "google/protobuf/timestamp.proto"; - -package fin; - -service GrpcFin { - rpc GetTransactions(GetTransactionsRequest) returns (GetTransactionsReply); - rpc GetHoldings(GetHoldingsRequest) returns (GetHoldingsReply); - rpc Withdraw(WithdrawRequest) returns (WithdrawReply); - rpc Deposit(DepositRequest) returns (DepositReply); -} - -message GetTransactionsRequest { - int32 page = 1; - uint64 userId = 2; -} - -message GetTransactionsReply { - repeated TransactionReply transactions = 1; - int32 total = 2; -} - -message TransactionReply { - int64 amount = 1; - string note = 2; - string type = 3; - string extra = 4; - google.protobuf.Timestamp timestamp = 5; - string id = 6; -} - -message GetHoldingsRequest { - uint64 userId = 1; -} - -message GetHoldingsReply { - int64 cash = 1; - int64 bank = 2; -} - -message WithdrawRequest { - uint64 userId = 1; - int64 amount = 2; -} - -message WithdrawReply { - bool success = 1; -} - -message DepositRequest { - uint64 userId = 1; - int64 amount = 2; -} - -message DepositReply { - bool success = 1; -} diff --git a/src/EllieBot.GrpcApiBase/protos/greet.proto b/src/EllieBot.GrpcApiBase/protos/greet.proto deleted file mode 100644 index 8f6be8a..0000000 --- a/src/EllieBot.GrpcApiBase/protos/greet.proto +++ /dev/null @@ -1,51 +0,0 @@ -syntax = "proto3"; - -option csharp_namespace = "EllieBot.GrpcApi"; - -package greet; - -service GrpcGreet { - rpc GetGreetSettings (GetGreetRequest) returns (GrpcGreetSettings); - rpc UpdateGreet (UpdateGreetRequest) returns (UpdateGreetReply); - rpc TestGreet (TestGreetRequest) returns (TestGreetReply); -} - -message GrpcGreetSettings { - string channelId = 1; - string message = 2; - bool isEnabled = 3; - GrpcGreetType type = 4; -} - -message GetGreetRequest { - uint64 guildId = 1; - GrpcGreetType type = 2; -} - -message UpdateGreetRequest { - uint64 guildId = 1; - GrpcGreetSettings settings = 2; -} - -enum GrpcGreetType { - Greet = 0; - GreetDm = 1; - Bye = 2; - Boost = 3; -} - -message UpdateGreetReply { - bool Success = 1; -} - -message TestGreetRequest { - uint64 guildId = 1; - uint64 channelId = 2; - uint64 userId = 3; - GrpcGreetType type = 4; -} - -message TestGreetReply { - bool success = 1; - string error = 2; -} diff --git a/src/EllieBot.GrpcApiBase/protos/other.proto b/src/EllieBot.GrpcApiBase/protos/other.proto deleted file mode 100644 index 64a3170..0000000 --- a/src/EllieBot.GrpcApiBase/protos/other.proto +++ /dev/null @@ -1,144 +0,0 @@ -syntax = "proto3"; - -option csharp_namespace = "EllieBot.GrpcApi"; - -import "google/protobuf/empty.proto"; - -package other; - -service GrpcOther { - rpc BotOnGuild(BotOnGuildRequest) returns (BotOnGuildReply); - rpc GetTextChannels(GetTextChannelsRequest) returns (GetTextChannelsReply); - rpc GetRoles(GetRolesRequest) returns (GetRolesReply); - - rpc GetCurrencyLb(GetLbRequest) returns (CurrencyLbReply); - rpc GetXpLb(GetLbRequest) returns (XpLbReply); - rpc GetWaifuLb(GetLbRequest) returns (WaifuLbReply); - - rpc GetShardStats(google.protobuf.Empty) returns (stream ShardStatsReply); - rpc GetCommandFeed(google.protobuf.Empty) returns (stream CommandFeedEntry); - rpc GetServerInfo(ServerInfoRequest) returns (GetServerInfoReply); -} - -message CommandFeedEntry { - string command = 1; -} - -message GetRolesRequest { - uint64 guildId = 1; -} - -message GetRolesReply { - repeated RoleReply roles = 1; -} - -message BotOnGuildRequest { - uint64 guildId = 1; -} - -message BotOnGuildReply { - bool success = 1; -} - -message ShardStatsReply { - int32 id = 1; - string status = 2; - - int32 guildCount = 3; - string uptime = 4; - int64 commands = 5; -} - -message GetTextChannelsRequest{ - uint64 guildId = 1; -} - -message GetTextChannelsReply { - repeated TextChannelReply textChannels = 1; -} - -message TextChannelReply { - uint64 id = 1; - string name = 2; -} - -message CurrencyLbReply { - repeated CurrencyLbEntryReply entries = 1; -} - -message CurrencyLbEntryReply { - string user = 1; - uint64 userId = 2; - int64 amount = 3; - string avatar = 4; -} - -message GetLbRequest { - int32 page = 1; - int32 perPage = 2; -} - -message XpLbReply { - repeated XpLbEntryReply entries = 1; -} - -message XpLbEntryReply { - string user = 1; - uint64 userId = 2; - int64 totalXp = 3; - int64 level = 4; -} - -message WaifuLbReply { - repeated WaifuLbEntry entries = 1; -} - -message WaifuLbEntry { - string user = 1; - string claimedBy = 2; - int64 value = 3; - bool isMutual = 4; -} - -message ServerInfoRequest { - uint64 guildId = 1; -} - -message GetServerInfoReply { - uint64 id = 1; - string name = 2; - string iconUrl = 3; - uint64 ownerId = 4; - string ownerName = 5; - repeated RoleReply roles = 6; - repeated EmojiReply emojis = 7; - repeated string features = 8; - int32 textChannels = 9; - int32 voiceChannels = 10; - int32 memberCount = 11; - int64 createdAt = 12; -} - -message RoleReply { - uint64 id = 1; - string name = 2; - string iconUrl = 3; - string color = 4; -} - -message EmojiReply { - string name = 1; - string url = 2; - string code = 3; -} - -message ChannelReply { - uint64 id = 1; - string name = 2; - ChannelType type = 3; -} - -enum ChannelType { - Text = 0; - Voice = 1; -} diff --git a/src/EllieBot.GrpcApiBase/protos/warn.proto b/src/EllieBot.GrpcApiBase/protos/warn.proto deleted file mode 100644 index 9b591a2..0000000 --- a/src/EllieBot.GrpcApiBase/protos/warn.proto +++ /dev/null @@ -1,107 +0,0 @@ -syntax = "proto3"; - -option csharp_namespace = "EllieBot.GrpcApi"; - -package warn; - -service GrpcWarn { - rpc GetWarnSettings (WarnSettingsRequest) returns (WarnSettingsReply); - - rpc SetWarnExpiry(SetWarnExpiryRequest) returns (SetWarnExpiryReply); - rpc AddWarnp (AddWarnpRequest) returns (AddWarnpReply); - rpc DeleteWarnp (DeleteWarnpRequest) returns (DeleteWarnpReply); - - rpc GetLatestWarnings(GetLatestWarningsRequest) returns (GetLatestWarningsReply); - rpc GetUserWarnings(GetUserWarningsRequest) returns (GetUserWarningsReply); - - rpc ForgiveWarning(ForgiveWarningRequest) returns (ForgiveWarningReply); - rpc DeleteWarning(ForgiveWarningRequest) returns (ForgiveWarningReply); - -} -message WarnSettingsRequest { - uint64 guildId = 1; -} - -message WarnPunishment { - int32 threshold = 1; - string action = 2; - int32 duration = 3; - string role = 4; -} - -message WarnSettingsReply { - repeated WarnPunishment punishments = 1; - int32 expiryDays = 2; - bool deleteOnExpire = 3; -} - -message AddWarnpRequest { - uint64 guildId = 1; - WarnPunishment punishment = 2; -} - -message AddWarnpReply { - bool success = 1; -} - -message DeleteWarnpRequest { - uint64 guildId = 1; - int32 threshold = 2; -} - -message DeleteWarnpReply { - bool success = 1; -} - -message GetUserWarningsRequest { - uint64 guildId = 1; - string user = 2; - int32 page = 3; -} - -message GetUserWarningsReply { - repeated Warning warnings = 1; - int32 totalCount = 2; -} - -message Warning { - string id = 1; - string reason = 2; - int64 timestamp = 3; - int64 weight = 4; - bool forgiven = 5; - string forgivenBy = 6; - string user = 7; - uint64 userId = 8; - string moderator = 9; -} - -message ForgiveWarningRequest { - uint64 guildId = 1; - string warnId = 2; - string modName = 3; -} - -message ForgiveWarningReply { - bool success = 1; -} - -message SetWarnExpiryRequest { - uint64 guildId = 1; - int32 expiryDays = 2; - bool deleteOnExpire = 3; -} - -message SetWarnExpiryReply { - bool success = 1; -} - -message GetLatestWarningsRequest { - uint64 guildId = 1; - int32 page = 2; -} - -message GetLatestWarningsReply { - repeated Warning warnings = 1; - int32 totalCount = 2; -} \ No newline at end of file diff --git a/src/EllieBot.GrpcApiBase/protos/xp.proto b/src/EllieBot.GrpcApiBase/protos/xp.proto deleted file mode 100644 index 72bcba9..0000000 --- a/src/EllieBot.GrpcApiBase/protos/xp.proto +++ /dev/null @@ -1,120 +0,0 @@ -syntax = "proto3"; - -option csharp_namespace = "EllieBot.GrpcApi"; - -package xp; - -service GrpcXp { - rpc GetXpLb(GetXpLbRequest) returns (GetXpLbReply); - rpc ResetUserXp(ResetUserXpRequest) returns (ResetUserXpReply); - - rpc GetXpSettings(GetXpSettingsRequest) returns (GetXpSettingsReply); - - rpc AddExclusion(AddExclusionRequest) returns (AddExclusionReply); - rpc DeleteExclusion(DeleteExclusionRequest) returns (DeleteExclusionReply); - - rpc AddReward(AddRewardRequest) returns (AddRewardReply); - rpc DeleteReward(DeleteRewardRequest) returns (DeleteRewardReply); - - rpc SetServerExclusion(SetServerExclusionRequest) returns (SetServerExclusionReply); -} - -message SetServerExclusionRequest { - uint64 guildId = 1; - bool serverExcluded = 2; -} - -message SetServerExclusionReply { - bool success = 1; -} - -message GetXpLbRequest { - uint64 guildId = 1; - int32 page = 2; -} - -message GetXpLbReply { - repeated XpLbUserReply users = 1; - int32 total = 2; -} - -message XpLbUserReply { - uint64 userId = 1; - string username = 2; - int64 xp = 3; - int64 level = 4; - int64 levelPercent = 5; - string avatar = 6; -} - -message ResetUserXpRequest { - uint64 guildId = 1; - uint64 userId = 2; -} - -message ResetUserXpReply { - bool success = 1; -} - -message GetXpSettingsReply { - repeated ExclItemReply exclusions = 1; - repeated RewItemReply rewards = 2; - bool serverExcluded = 3; -} - -message GetXpSettingsRequest { - uint64 guildId = 1; -} - -message ExclItemReply { - string type = 1; - uint64 id = 2; - string name = 3; -} - -message RewItemReply { - int32 level = 1; - string type = 2; - string value = 3; -} - -message AddExclusionRequest { - uint64 guildId = 1; - string type = 2; - uint64 id = 3; -} - -message AddExclusionReply { - bool success = 1; -} - -message DeleteExclusionRequest { - uint64 guildId = 1; - string type = 2; - uint64 id = 3; -} - -message DeleteExclusionReply { - bool success = 1; -} - -message AddRewardRequest { - uint64 guildId = 1; - int32 level = 2; - string type = 3; - string value = 4; -} - -message AddRewardReply { - bool success = 1; -} - -message DeleteRewardRequest { - uint64 guildId = 1; - int32 level = 2; - string type = 3; -} - -message DeleteRewardReply { - bool success = 1; -} \ No newline at end of file diff --git a/src/EllieBot/Bot.cs b/src/EllieBot/Bot.cs index a98ebcd..af69cee 100644 --- a/src/EllieBot/Bot.cs +++ b/src/EllieBot/Bot.cs @@ -25,7 +25,7 @@ public sealed class Bot : IBot public bool IsReady { get; private set; } public int ShardId { get; set; } - private readonly IBotCreds _creds; + private readonly IBotCredentials _creds; private readonly CommandService _commandService; private readonly DbService _db; @@ -42,9 +42,6 @@ public sealed class Bot : IBot _credsProvider = new BotCredsProvider(totalShards, credPath); _creds = _credsProvider.GetCreds(); - LogSetup.SetupLogger(shardId, _creds); - Log.Information("Pid: {ProcessId}", Environment.ProcessId); - _db = new EllieDbService(_credsProvider); var messageCacheSize = @@ -118,7 +115,7 @@ public sealed class Bot : IBot // svcs.Components.Remove(); // svcs.Components.Add(); - svcs.AddSingleton(_ => _credsProvider.GetCreds()); + svcs.AddSingleton(_ => _credsProvider.GetCreds()); svcs.AddSingleton(_db); svcs.AddSingleton(_credsProvider); svcs.AddSingleton(Client); diff --git a/src/EllieBot/Db/EllieContext.cs b/src/EllieBot/Db/EllieContext.cs index b0bc0a8..11a3d65 100644 --- a/src/EllieBot/Db/EllieContext.cs +++ b/src/EllieBot/Db/EllieContext.cs @@ -62,7 +62,7 @@ public abstract class EllieContext : DbContext public DbSet TodosArchive { get; set; } public DbSet HoneyPotChannels { get; set; } - + // todo add guild colors // public DbSet GuildColors { get; set; } @@ -74,40 +74,6 @@ public abstract class EllieContext : DbContext protected override void OnModelCreating(ModelBuilder modelBuilder) { - #region Rakeback - - modelBuilder.Entity() - .HasKey(x => x.UserId); - - #endregion - - #region UserBetStats - - modelBuilder.Entity() - .HasIndex(x => new { x.UserId, x.Game }) - .IsUnique(); - - - #endregion - - #region Flag Translate - - modelBuilder.Entity() - .HasIndex(x => new { x.GuildId, x.ChannelId }) - .IsUnique(); - - #endregion - - #region NCanvas - - modelBuilder.Entity() - .HasAlternateKey(x => x.Position); - - modelBuilder.Entity() - .HasIndex(x => x.OwnerId); - - #endregion - #region QUOTES var quoteEntity = modelBuilder.Entity(); @@ -229,6 +195,11 @@ public abstract class EllieContext : DbContext .WithOne() .OnDelete(DeleteBehavior.Cascade); + modelBuilder.Entity() + .HasMany(x => x.WarnPunishments) + .WithOne() + .OnDelete(DeleteBehavior.Cascade); + modelBuilder.Entity() .HasMany(x => x.SlowmodeIgnoredRoles) .WithOne() @@ -306,18 +277,6 @@ public abstract class EllieContext : DbContext #endregion - #region WarningPunishments - - var warnpunishmentEntity = modelBuilder.Entity(b => - { - b.HasAlternateKey(x => new - { - x.GuildId, - x.Count - }); - }); - - #endregion #region Self Assignable Roles @@ -380,7 +339,6 @@ public abstract class EllieContext : DbContext du.HasIndex(x => x.TotalXp); du.HasIndex(x => x.CurrencyAmount); du.HasIndex(x => x.UserId); - du.HasIndex(x => x.Username); }); #endregion @@ -730,7 +688,7 @@ public abstract class EllieContext : DbContext x.GuildId, x.GreetType }) - .IsUnique()); + .IsUnique()); modelBuilder.Entity(gs => { diff --git a/src/EllieBot/Db/EllieDbService.cs b/src/EllieBot/Db/EllieDbService.cs index 6106072..d117c86 100644 --- a/src/EllieBot/Db/EllieDbService.cs +++ b/src/EllieBot/Db/EllieDbService.cs @@ -4,14 +4,14 @@ using Microsoft.EntityFrameworkCore; namespace EllieBot.Db; -public sealed class EllieDbService : DbService +public sealed class EllieDbService : DbService { private readonly IBotCredsProvider _creds; // these are props because creds can change at runtime private string DbType => _creds.GetCreds().Db.Type.ToLowerInvariant().Trim(); private string ConnString => _creds.GetCreds().Db.ConnectionString; - + public EllieDbService(IBotCredsProvider creds) { LinqToDBForEFTools.Initialize(); @@ -26,13 +26,13 @@ public sealed class EllieDbService : DbService var connString = ConnString; await using var context = CreateRawDbContext(dbType, connString); - + // make sure sqlite db is in wal journal mode if (context is SqliteContext) { await context.Database.ExecuteSqlRawAsync("PRAGMA journal_mode=WAL"); } - + await context.Database.MigrateAsync(); } @@ -50,7 +50,7 @@ public sealed class EllieDbService : DbService throw new NotSupportedException($"The database provide type of '{dbType}' is not supported."); } } - + private EllieContext GetDbContextInternal() { var dbType = DbType; diff --git a/src/EllieBot/Db/Extensions/DiscordUserExtensions.cs b/src/EllieBot/Db/Extensions/DiscordUserExtensions.cs index ab2b46f..bdf3c05 100644 --- a/src/EllieBot/Db/Extensions/DiscordUserExtensions.cs +++ b/src/EllieBot/Db/Extensions/DiscordUserExtensions.cs @@ -25,6 +25,7 @@ public static class DiscordUserExtensions { UserId = userId, Username = username, + Discriminator = discrim, AvatarId = avatarId, TotalXp = 0, CurrencyAmount = 0 @@ -32,6 +33,7 @@ public static class DiscordUserExtensions old => new() { Username = username, + Discriminator = discrim, AvatarId = avatarId }, () => new() @@ -47,7 +49,8 @@ public static class DiscordUserExtensions () => new() { UserId = userId, - Username = "??Unknown", + Username = "Unknown", + Discriminator = "????", AvatarId = string.Empty, TotalXp = 0, CurrencyAmount = 0 @@ -85,6 +88,13 @@ public static class DiscordUserExtensions .Count() + 1; + public static async Task> GetUsersXpLeaderboardFor(this DbSet users, int page, int perPage) + => await users.ToLinqToDBTable() + .OrderByDescending(x => x.TotalXp) + .Skip(page * perPage) + .Take(perPage) + .ToArrayAsyncLinqToDB(); + public static Task> GetTopRichest( this DbSet users, ulong botId, diff --git a/src/EllieBot/Db/Extensions/GuildConfigExtensions.cs b/src/EllieBot/Db/Extensions/GuildConfigExtensions.cs index 86d22be..e7fb6ad 100644 --- a/src/EllieBot/Db/Extensions/GuildConfigExtensions.cs +++ b/src/EllieBot/Db/Extensions/GuildConfigExtensions.cs @@ -1,6 +1,7 @@ #nullable disable using LinqToDB.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; +using LinqToDB.EntityFrameworkCore; using EllieBot.Db.Models; namespace EllieBot.Db; @@ -57,7 +58,8 @@ public static class GuildConfigExtensions List availableGuilds) { var result = await configs - .IncludeEverything() + .AsQueryable() + .Include(x => x.CommandCooldowns) .Where(x => availableGuilds.Contains(x.GuildId)) .AsNoTracking() .ToArrayAsync(); @@ -95,6 +97,7 @@ public static class GuildConfigExtensions GuildId = guildId, Permissions = Permissionv2.GetDefaultPermlist, WarningsInitialized = true, + WarnPunishments = DefaultWarnPunishments }); ctx.SaveChanges(); } @@ -102,6 +105,7 @@ public static class GuildConfigExtensions if (!config.WarningsInitialized) { config.WarningsInitialized = true; + config.WarnPunishments = DefaultWarnPunishments; } return config; diff --git a/src/EllieBot/Db/Extensions/UserXpExtensions.cs b/src/EllieBot/Db/Extensions/UserXpExtensions.cs index b06d98b..ab3e8bb 100644 --- a/src/EllieBot/Db/Extensions/UserXpExtensions.cs +++ b/src/EllieBot/Db/Extensions/UserXpExtensions.cs @@ -26,6 +26,17 @@ public static class UserXpExtensions return usr; } + public static async Task> GetUsersFor( + this DbSet xps, + ulong guildId, + int page) + => await xps.ToLinqToDBTable() + .Where(x => x.GuildId == guildId) + .OrderByDescending(x => x.Xp + x.AwardedXp) + .Skip(page * 9) + .Take(9) + .ToArrayAsyncLinqToDB(); + public static async Task> GetTopUserXps(this DbSet xps, ulong guildId, int count) => await xps.ToLinqToDBTable() .Where(x => x.GuildId == guildId) @@ -44,6 +55,9 @@ public static class UserXpExtensions .CountAsyncLinqToDB() + 1; + public static void ResetGuildUserXp(this DbSet xps, ulong userId, ulong guildId) + => xps.Delete(x => x.UserId == userId && x.GuildId == guildId); + public static void ResetGuildXp(this DbSet xps, ulong guildId) => xps.Delete(x => x.GuildId == guildId); diff --git a/src/EllieBot/Db/LevelStats.cs b/src/EllieBot/Db/LevelStats.cs index 0f3e02c..25a3936 100644 --- a/src/EllieBot/Db/LevelStats.cs +++ b/src/EllieBot/Db/LevelStats.cs @@ -1,4 +1,5 @@ #nullable disable + namespace EllieBot.Db; public readonly struct LevelStats diff --git a/src/EllieBot/Db/Models/DiscordUser.cs b/src/EllieBot/Db/Models/DiscordUser.cs index 3ac3f5c..69eecb6 100644 --- a/src/EllieBot/Db/Models/DiscordUser.cs +++ b/src/EllieBot/Db/Models/DiscordUser.cs @@ -1,12 +1,13 @@ #nullable disable namespace EllieBot.Db.Models; + // FUTURE remove LastLevelUp from here and UserXpStats public class DiscordUser : DbEntity { public ulong UserId { get; set; } public string Username { get; set; } - // public string Discriminator { get; set; } + public string Discriminator { get; set; } public string AvatarId { get; set; } public int? ClubId { get; set; } @@ -26,6 +27,9 @@ public class DiscordUser : DbEntity public override string ToString() { - return Username; + if (string.IsNullOrWhiteSpace(Discriminator) || Discriminator == "0000") + return Username; + + return Username + "#" + Discriminator; } } \ No newline at end of file diff --git a/src/EllieBot/Db/Models/FlagTranslateChannel.cs b/src/EllieBot/Db/Models/FlagTranslateChannel.cs deleted file mode 100644 index 1fe04d7..0000000 --- a/src/EllieBot/Db/Models/FlagTranslateChannel.cs +++ /dev/null @@ -1,8 +0,0 @@ -#nullable disable -namespace EllieBot.Db.Models; - -public class FlagTranslateChannel : DbEntity -{ - public ulong GuildId { get; set; } - public ulong ChannelId { get; set; } -} \ No newline at end of file diff --git a/src/EllieBot/Db/Models/GuildConfig.cs b/src/EllieBot/Db/Models/GuildConfig.cs index c703000..20f42b3 100644 --- a/src/EllieBot/Db/Models/GuildConfig.cs +++ b/src/EllieBot/Db/Models/GuildConfig.cs @@ -77,6 +77,7 @@ public class GuildConfig : DbEntity public HashSet UnroleTimer { get; set; } = new(); public HashSet VcRoleInfos { get; set; } public HashSet CommandAliases { get; set; } = new(); + public List WarnPunishments { get; set; } = new(); public bool WarningsInitialized { get; set; } public HashSet SlowmodeIgnoredUsers { get; set; } public HashSet SlowmodeIgnoredRoles { get; set; } diff --git a/src/EllieBot/Db/Models/NCanvas/NCanvas.cs b/src/EllieBot/Db/Models/NCanvas/NCanvas.cs deleted file mode 100644 index 8de17cb..0000000 --- a/src/EllieBot/Db/Models/NCanvas/NCanvas.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace EllieBot.Db.Models; - -public class NCPixel -{ - [Key] - public int Id { get; set; } - - public required int Position { get; init; } - - public required long Price { get; init; } - - public required ulong OwnerId { get; init; } - public required uint Color { get; init; } - - [MaxLength(256)] - public required string Text { get; init; } -} \ No newline at end of file diff --git a/src/EllieBot/Db/Models/punish/WarningPunishment.cs b/src/EllieBot/Db/Models/punish/WarningPunishment.cs index 1b4479f..5368938 100644 --- a/src/EllieBot/Db/Models/punish/WarningPunishment.cs +++ b/src/EllieBot/Db/Models/punish/WarningPunishment.cs @@ -3,7 +3,6 @@ namespace EllieBot.Db.Models; public class WarningPunishment : DbEntity { - public ulong GuildId { get; set; } public int Count { get; set; } public PunishmentAction Punishment { get; set; } public int Time { get; set; } diff --git a/src/EllieBot/Db/Models/support/PatronQuota.cs b/src/EllieBot/Db/Models/support/PatronQuota.cs index 5cb1a15..d493807 100644 --- a/src/EllieBot/Db/Models/support/PatronQuota.cs +++ b/src/EllieBot/Db/Models/support/PatronQuota.cs @@ -1,12 +1,8 @@ #nullable disable -using System.ComponentModel.DataAnnotations; - namespace EllieBot.Db.Models; public class PatronUser { - // [Key] - // public int Id { get; set; } public string UniquePlatformUserId { get; set; } public ulong UserId { get; set; } public int AmountCents { get; set; } diff --git a/src/EllieBot/Db/Models/xp/XpNotificationLocation.cs b/src/EllieBot/Db/Models/xp/XpNotificationLocation.cs index b410fcd..e5c24c7 100644 --- a/src/EllieBot/Db/Models/xp/XpNotificationLocation.cs +++ b/src/EllieBot/Db/Models/xp/XpNotificationLocation.cs @@ -1,4 +1,4 @@ -namespace EllieBot.Db.Models; +namespace EllieBot.Db.Models; public enum XpNotificationLocation { diff --git a/src/EllieBot/EllieBot.csproj b/src/EllieBot/EllieBot.csproj index 0dec0f1..ebcd4b2 100644 --- a/src/EllieBot/EllieBot.csproj +++ b/src/EllieBot/EllieBot.csproj @@ -4,7 +4,7 @@ enable true en - 5.1.20 + 5.1.7 $(MSBuildProjectDirectory) @@ -34,12 +34,13 @@ - - - - - - + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + @@ -102,7 +103,6 @@ - @@ -113,6 +113,9 @@ + + Protos\coordinator.proto + true PreserveNewest @@ -126,13 +129,6 @@ Always - - - - _common\CoordinatorProtos\coordinator.proto - - - diff --git a/src/EllieBot/Migrations/MigrationQueries.cs b/src/EllieBot/Migrations/MigrationQueries.cs index f35dbc8..93f4249 100644 --- a/src/EllieBot/Migrations/MigrationQueries.cs +++ b/src/EllieBot/Migrations/MigrationQueries.cs @@ -5,11 +5,6 @@ namespace EllieBot.Migrations; public static class MigrationQueries { - public static void UpdateUsernames(MigrationBuilder migrationBuilder) - { - migrationBuilder.Sql("UPDATE DiscordUser SET Username = '??' || Username WHERE Discriminator = '????';"); - } - public static void MigrateRero(MigrationBuilder migrationBuilder) { if (migrationBuilder.IsSqlite()) @@ -43,7 +38,6 @@ left join guildconfigs on reactionrolemessage.guildconfigid = guildconfigs.id;") DELETE FROM "DelMsgOnCmdChannel" WHERE "GuildConfigId" is NULL; DELETE FROM "WarningPunishment" WHERE "GuildConfigId" NOT IN (SELECT "Id" from "GuildConfigs"); DELETE FROM "StreamRoleBlacklistedUser" WHERE "StreamRoleSettingsId" is NULL; - DELETE FROM "Permissions" WHERE "GuildConfigId" NOT IN (SELECT "Id" from "GuildConfigs"); """); } @@ -71,20 +65,4 @@ left join guildconfigs on reactionrolemessage.guildconfigid = guildconfigs.id;") WHERE SendBoostMessage = TRUE; """); } - - public static void AddGuildIdsToWarningPunishment(MigrationBuilder builder) - { - builder.Sql(""" - DELETE FROM WarningPunishment WHERE GuildConfigId IS NULL OR GuildConfigId NOT IN (SELECT Id FROM GuildConfigs); - UPDATE WarningPunishment - SET GuildId = (SELECT GuildId FROM GuildConfigs WHERE Id = GuildConfigId); - - DELETE FROM WarningPunishment as wp - WHERE (wp.Count, wp.GuildConfigId) in ( - SELECT wp2.Count, wp2.GuildConfigId FROM WarningPunishment as wp2 - GROUP BY wp2.Count, wp2.GuildConfigId - HAVING COUNT(id) > 1 - ); - """); - } } \ No newline at end of file diff --git a/src/EllieBot/Migrations/PostgreSql/20240627033522_honeypot.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20240627033522_honeypot.Designer.cs index 471ac16..b0380ea 100644 --- a/src/EllieBot/Migrations/PostgreSql/20240627033522_honeypot.Designer.cs +++ b/src/EllieBot/Migrations/PostgreSql/20240627033522_honeypot.Designer.cs @@ -3795,4 +3795,4 @@ namespace EllieBot.Migrations.PostgreSql #pragma warning restore 612, 618 } } -} +} \ No newline at end of file diff --git a/src/EllieBot/Migrations/PostgreSql/20241102022956_no-discrim-and-flag-translate.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20240911104857_greet-settings.Designer.cs similarity index 97% rename from src/EllieBot/Migrations/PostgreSql/20241102022956_no-discrim-and-flag-translate.Designer.cs rename to src/EllieBot/Migrations/PostgreSql/20240911104857_greet-settings.Designer.cs index 8109046..8a2c51c 100644 --- a/src/EllieBot/Migrations/PostgreSql/20241102022956_no-discrim-and-flag-translate.Designer.cs +++ b/src/EllieBot/Migrations/PostgreSql/20240911104857_greet-settings.Designer.cs @@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace EllieBot.Migrations.PostgreSql { [DbContext(typeof(PostgreSqlContext))] - [Migration("20241102022956_no-discrim-and-flag-translate")] - partial class nodiscrimandflagtranslate + [Migration("20240911104857_greet-settings")] + partial class greetsettings { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -754,6 +754,10 @@ namespace EllieBot.Migrations.PostgreSql .HasColumnType("timestamp without time zone") .HasColumnName("dateadded"); + b.Property("Discriminator") + .HasColumnType("text") + .HasColumnName("discriminator"); + b.Property("IsClubAdmin") .ValueGeneratedOnAdd() .HasColumnType("boolean") @@ -798,9 +802,6 @@ namespace EllieBot.Migrations.PostgreSql b.HasIndex("UserId") .HasDatabaseName("ix_discorduser_userid"); - b.HasIndex("Username") - .HasDatabaseName("ix_discorduser_username"); - b.ToTable("discorduser", (string)null); }); @@ -997,37 +998,6 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("filteredword", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.FlagTranslateChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.HasKey("Id") - .HasName("pk_flagtranslatechannel"); - - b.HasIndex("GuildId", "ChannelId") - .IsUnique() - .HasDatabaseName("ix_flagtranslatechannel_guildid_channelid"); - - b.ToTable("flagtranslatechannel", (string)null); - }); - modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => { b.Property("Id") @@ -1660,49 +1630,6 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("muteduserid", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.NCPixel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Color") - .HasColumnType("bigint") - .HasColumnName("color"); - - b.Property("OwnerId") - .HasColumnType("numeric(20,0)") - .HasColumnName("ownerid"); - - b.Property("Position") - .HasColumnType("integer") - .HasColumnName("position"); - - b.Property("Price") - .HasColumnType("bigint") - .HasColumnName("price"); - - b.Property("Text") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("text"); - - b.HasKey("Id") - .HasName("pk_ncpixel"); - - b.HasAlternateKey("Position") - .HasName("ak_ncpixel_position"); - - b.HasIndex("OwnerId") - .HasDatabaseName("ix_ncpixel_ownerid"); - - b.ToTable("ncpixel", (string)null); - }); - modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => { b.Property("Id") @@ -3014,9 +2941,9 @@ namespace EllieBot.Migrations.PostgreSql .HasColumnType("timestamp without time zone") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); b.Property("Punishment") .HasColumnType("integer") @@ -3033,8 +2960,8 @@ namespace EllieBot.Migrations.PostgreSql b.HasKey("Id") .HasName("pk_warningpunishment"); - b.HasAlternateKey("GuildId", "Count") - .HasName("ak_warningpunishment_guildid_count"); + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_warningpunishment_guildconfigid"); b.ToTable("warningpunishment", (string)null); }); @@ -3193,9 +3120,7 @@ namespace EllieBot.Migrations.PostgreSql NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("AutoDeleteTimer") - .ValueGeneratedOnAdd() .HasColumnType("integer") - .HasDefaultValue(0) .HasColumnName("autodeletetimer"); b.Property("ChannelId") @@ -3211,9 +3136,7 @@ namespace EllieBot.Migrations.PostgreSql .HasColumnName("guildid"); b.Property("IsEnabled") - .ValueGeneratedOnAdd() .HasColumnType("boolean") - .HasDefaultValue(false) .HasColumnName("isenabled"); b.Property("MessageText") @@ -3692,6 +3615,15 @@ namespace EllieBot.Migrations.PostgreSql b.Navigation("User"); }); + modelBuilder.Entity("EllieBot.Db.Models.WarningPunishment", b => + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("WarnPunishments") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_warningpunishment_guildconfigs_guildconfigid"); + }); + modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => { b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") @@ -3807,6 +3739,8 @@ namespace EllieBot.Migrations.PostgreSql b.Navigation("VcRoleInfos"); + b.Navigation("WarnPunishments"); + b.Navigation("XpSettings"); }); diff --git a/src/EllieBot/Migrations/PostgreSql/20240912124719_greet-settings.cs b/src/EllieBot/Migrations/PostgreSql/20240911104857_greet-settings.cs similarity index 95% rename from src/EllieBot/Migrations/PostgreSql/20240912124719_greet-settings.cs rename to src/EllieBot/Migrations/PostgreSql/20240911104857_greet-settings.cs index 1b4dd19..afa0de2 100644 --- a/src/EllieBot/Migrations/PostgreSql/20240912124719_greet-settings.cs +++ b/src/EllieBot/Migrations/PostgreSql/20240911104857_greet-settings.cs @@ -11,33 +11,6 @@ namespace EllieBot.Migrations.PostgreSql /// protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.CreateTable( - name: "greetsettings", - columns: table => new - { - id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", - NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - guildid = table.Column(type: "numeric(20,0)", nullable: false), - greettype = table.Column(type: "integer", nullable: false), - messagetext = table.Column(type: "text", nullable: true), - isenabled = table.Column(type: "boolean", nullable: false, defaultValue: false), - channelid = table.Column(type: "numeric(20,0)", nullable: true), - autodeletetimer = table.Column(type: "integer", nullable: false, defaultValue: 0) - }, - constraints: table => - { - table.PrimaryKey("pk_greetsettings", x => x.id); - }); - - migrationBuilder.CreateIndex( - name: "ix_greetsettings_guildid_greettype", - table: "greetsettings", - columns: new[] { "guildid", "greettype" }, - unique: true); - - MigrationQueries.GreetSettingsCopy(migrationBuilder); - migrationBuilder.DropColumn( name: "autodeletebyemessagestimer", table: "guildconfigs"); @@ -93,6 +66,30 @@ namespace EllieBot.Migrations.PostgreSql migrationBuilder.DropColumn( name: "senddmgreetmessage", table: "guildconfigs"); + + migrationBuilder.CreateTable( + name: "greetsettings", + columns: table => new + { + id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + guildid = table.Column(type: "numeric(20,0)", nullable: false), + greettype = table.Column(type: "integer", nullable: false), + messagetext = table.Column(type: "text", nullable: true), + isenabled = table.Column(type: "boolean", nullable: false), + channelid = table.Column(type: "numeric(20,0)", nullable: true), + autodeletetimer = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_greetsettings", x => x.id); + }); + + migrationBuilder.CreateIndex( + name: "ix_greetsettings_guildid_greettype", + table: "greetsettings", + columns: new[] { "guildid", "greettype" }, + unique: true); } /// @@ -196,4 +193,4 @@ namespace EllieBot.Migrations.PostgreSql defaultValue: false); } } -} \ No newline at end of file +} diff --git a/src/EllieBot/Migrations/PostgreSql/20240912124719_greet-settings.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20240912124719_greet-settings.Designer.cs deleted file mode 100644 index bb3e2f5..0000000 --- a/src/EllieBot/Migrations/PostgreSql/20240912124719_greet-settings.Designer.cs +++ /dev/null @@ -1,3789 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using EllieBot.Db; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace EllieBot.Migrations.PostgreSql -{ - [DbContext(typeof(PostgreSqlContext))] - [Migration("20240912124719_greet-settings")] - partial class greetsettings - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.8") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .HasColumnType("integer") - .HasColumnName("action"); - - b.Property("ActionDurationMinutes") - .HasColumnType("integer") - .HasColumnName("actiondurationminutes"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("MinAge") - .HasColumnType("interval") - .HasColumnName("minage"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_antialtsetting"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_antialtsetting_guildconfigid"); - - b.ToTable("antialtsetting", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .HasColumnType("integer") - .HasColumnName("action"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("PunishDuration") - .HasColumnType("integer") - .HasColumnName("punishduration"); - - b.Property("Seconds") - .HasColumnType("integer") - .HasColumnName("seconds"); - - b.Property("UserThreshold") - .HasColumnType("integer") - .HasColumnName("userthreshold"); - - b.HasKey("Id") - .HasName("pk_antiraidsetting"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_antiraidsetting_guildconfigid"); - - b.ToTable("antiraidsetting", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AntiSpamSettingId") - .HasColumnType("integer") - .HasColumnName("antispamsettingid"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.HasKey("Id") - .HasName("pk_antispamignore"); - - b.HasIndex("AntiSpamSettingId") - .HasDatabaseName("ix_antispamignore_antispamsettingid"); - - b.ToTable("antispamignore", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .HasColumnType("integer") - .HasColumnName("action"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("MessageThreshold") - .HasColumnType("integer") - .HasColumnName("messagethreshold"); - - b.Property("MuteTime") - .HasColumnType("integer") - .HasColumnName("mutetime"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_antispamsetting"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_antispamsetting_guildconfigid"); - - b.ToTable("antispamsetting", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_todosarchive"); - - b.ToTable("todosarchive", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoCommand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("ChannelName") - .HasColumnType("text") - .HasColumnName("channelname"); - - b.Property("CommandText") - .HasColumnType("text") - .HasColumnName("commandtext"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("GuildName") - .HasColumnType("text") - .HasColumnName("guildname"); - - b.Property("Interval") - .HasColumnType("integer") - .HasColumnName("interval"); - - b.Property("VoiceChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("voicechannelid"); - - b.Property("VoiceChannelName") - .HasColumnType("text") - .HasColumnName("voicechannelname"); - - b.HasKey("Id") - .HasName("pk_autocommands"); - - b.ToTable("autocommands", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoPublishChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.HasKey("Id") - .HasName("pk_autopublishchannel"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_autopublishchannel_guildid"); - - b.ToTable("autopublishchannel", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoDelete") - .HasColumnType("boolean") - .HasColumnName("autodelete"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.HasKey("Id") - .HasName("pk_autotranslatechannels"); - - b.HasIndex("ChannelId") - .IsUnique() - .HasDatabaseName("ix_autotranslatechannels_channelid"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_autotranslatechannels_guildid"); - - b.ToTable("autotranslatechannels", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("integer") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Source") - .HasColumnType("text") - .HasColumnName("source"); - - b.Property("Target") - .HasColumnType("text") - .HasColumnName("target"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_autotranslateusers"); - - b.HasAlternateKey("ChannelId", "UserId") - .HasName("ak_autotranslateusers_channelid_userid"); - - b.ToTable("autotranslateusers", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BanTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("PruneDays") - .HasColumnType("integer") - .HasColumnName("prunedays"); - - b.Property("Text") - .HasColumnType("text") - .HasColumnName("text"); - - b.HasKey("Id") - .HasName("pk_bantemplates"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_bantemplates_guildid"); - - b.ToTable("bantemplates", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Balance") - .HasColumnType("bigint") - .HasColumnName("balance"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_bankusers"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("ix_bankusers_userid"); - - b.ToTable("bankusers", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BlacklistEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ItemId") - .HasColumnType("numeric(20,0)") - .HasColumnName("itemid"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_blacklist"); - - b.ToTable("blacklist", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.Property("ClubId") - .HasColumnType("integer") - .HasColumnName("clubid"); - - b.Property("UserId") - .HasColumnType("integer") - .HasColumnName("userid"); - - b.HasKey("ClubId", "UserId") - .HasName("pk_clubapplicants"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_clubapplicants_userid"); - - b.ToTable("clubapplicants", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.Property("ClubId") - .HasColumnType("integer") - .HasColumnName("clubid"); - - b.Property("UserId") - .HasColumnType("integer") - .HasColumnName("userid"); - - b.HasKey("ClubId", "UserId") - .HasName("pk_clubbans"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_clubbans_userid"); - - b.ToTable("clubbans", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Description") - .HasColumnType("text") - .HasColumnName("description"); - - b.Property("ImageUrl") - .HasColumnType("text") - .HasColumnName("imageurl"); - - b.Property("Name") - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("name"); - - b.Property("OwnerId") - .HasColumnType("integer") - .HasColumnName("ownerid"); - - b.Property("Xp") - .HasColumnType("integer") - .HasColumnName("xp"); - - b.HasKey("Id") - .HasName("pk_clubs"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_clubs_name"); - - b.HasIndex("OwnerId") - .IsUnique() - .HasDatabaseName("ix_clubs_ownerid"); - - b.ToTable("clubs", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Mapping") - .HasColumnType("text") - .HasColumnName("mapping"); - - b.Property("Trigger") - .HasColumnType("text") - .HasColumnName("trigger"); - - b.HasKey("Id") - .HasName("pk_commandalias"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_commandalias_guildconfigid"); - - b.ToTable("commandalias", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandCooldown", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CommandName") - .HasColumnType("text") - .HasColumnName("commandname"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Seconds") - .HasColumnType("integer") - .HasColumnName("seconds"); - - b.HasKey("Id") - .HasName("pk_commandcooldown"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_commandcooldown_guildconfigid"); - - b.ToTable("commandcooldown", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CurrencyTransaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("bigint") - .HasColumnName("amount"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Extra") - .IsRequired() - .HasColumnType("text") - .HasColumnName("extra"); - - b.Property("Note") - .HasColumnType("text") - .HasColumnName("note"); - - b.Property("OtherId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") - .HasColumnName("otherid") - .HasDefaultValueSql("NULL"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text") - .HasColumnName("type"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_currencytransactions"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_currencytransactions_userid"); - - b.ToTable("currencytransactions", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("State") - .HasColumnType("boolean") - .HasColumnName("state"); - - b.HasKey("Id") - .HasName("pk_delmsgoncmdchannel"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); - - b.ToTable("delmsgoncmdchannel", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordPermOverride", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Command") - .HasColumnType("text") - .HasColumnName("command"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Perm") - .HasColumnType("numeric(20,0)") - .HasColumnName("perm"); - - b.HasKey("Id") - .HasName("pk_discordpermoverrides"); - - b.HasIndex("GuildId", "Command") - .IsUnique() - .HasDatabaseName("ix_discordpermoverrides_guildid_command"); - - b.ToTable("discordpermoverrides", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AvatarId") - .HasColumnType("text") - .HasColumnName("avatarid"); - - b.Property("ClubId") - .HasColumnType("integer") - .HasColumnName("clubid"); - - b.Property("CurrencyAmount") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasDefaultValue(0L) - .HasColumnName("currencyamount"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Discriminator") - .HasColumnType("text") - .HasColumnName("discriminator"); - - b.Property("IsClubAdmin") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("isclubadmin"); - - b.Property("NotifyOnLevelUp") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("notifyonlevelup"); - - b.Property("TotalXp") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasDefaultValue(0L) - .HasColumnName("totalxp"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); - - b.HasKey("Id") - .HasName("pk_discorduser"); - - b.HasAlternateKey("UserId") - .HasName("ak_discorduser_userid"); - - b.HasIndex("ClubId") - .HasDatabaseName("ix_discorduser_clubid"); - - b.HasIndex("CurrencyAmount") - .HasDatabaseName("ix_discorduser_currencyamount"); - - b.HasIndex("TotalXp") - .HasDatabaseName("ix_discorduser_totalxp"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_discorduser_userid"); - - b.ToTable("discorduser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ItemId") - .HasColumnType("numeric(20,0)") - .HasColumnName("itemid"); - - b.Property("ItemType") - .HasColumnType("integer") - .HasColumnName("itemtype"); - - b.Property("XpSettingsId") - .HasColumnType("integer") - .HasColumnName("xpsettingsid"); - - b.HasKey("Id") - .HasName("pk_excludeditem"); - - b.HasIndex("XpSettingsId") - .HasDatabaseName("ix_excludeditem_xpsettingsid"); - - b.ToTable("excludeditem", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text") - .HasColumnName("url"); - - b.HasKey("Id") - .HasName("pk_feedsub"); - - b.HasAlternateKey("GuildConfigId", "Url") - .HasName("ak_feedsub_guildconfigid_url"); - - b.ToTable("feedsub", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.HasKey("Id") - .HasName("pk_filterchannelid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filterchannelid_guildconfigid"); - - b.ToTable("filterchannelid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.HasKey("Id") - .HasName("pk_filterlinkschannelid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); - - b.ToTable("filterlinkschannelid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.HasKey("Id") - .HasName("pk_filterwordschannelid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); - - b.ToTable("filterwordschannelid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Word") - .HasColumnType("text") - .HasColumnName("word"); - - b.HasKey("Id") - .HasName("pk_filteredword"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filteredword_guildconfigid"); - - b.ToTable("filteredword", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); - - b.HasKey("Id") - .HasName("pk_followedstream"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_followedstream_guildconfigid"); - - b.ToTable("followedstream", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GCChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.HasKey("Id") - .HasName("pk_gcchannelid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_gcchannelid_guildconfigid"); - - b.ToTable("gcchannelid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GamblingStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Bet") - .HasColumnType("numeric") - .HasColumnName("bet"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Feature") - .HasColumnType("text") - .HasColumnName("feature"); - - b.Property("PaidOut") - .HasColumnType("numeric") - .HasColumnName("paidout"); - - b.HasKey("Id") - .HasName("pk_gamblingstats"); - - b.HasIndex("Feature") - .IsUnique() - .HasDatabaseName("ix_gamblingstats_feature"); - - b.ToTable("gamblingstats", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("EndsAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("endsat"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); - - b.HasKey("Id") - .HasName("pk_giveawaymodel"); - - b.ToTable("giveawaymodel", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("GiveawayId") - .HasColumnType("integer") - .HasColumnName("giveawayid"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_giveawayuser"); - - b.HasIndex("GiveawayId", "UserId") - .IsUnique() - .HasDatabaseName("ix_giveawayuser_giveawayid_userid"); - - b.ToTable("giveawayuser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("Number") - .HasColumnType("integer") - .HasColumnName("number"); - - b.HasKey("Id") - .HasName("pk_groupname"); - - b.HasIndex("GuildConfigId", "Number") - .IsUnique() - .HasDatabaseName("ix_groupname_guildconfigid_number"); - - b.ToTable("groupname", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GuildConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoAssignRoleIds") - .HasColumnType("text") - .HasColumnName("autoassignroleids"); - - b.Property("AutoDeleteSelfAssignedRoleMessages") - .HasColumnType("boolean") - .HasColumnName("autodeleteselfassignedrolemessages"); - - b.Property("CleverbotEnabled") - .HasColumnType("boolean") - .HasColumnName("cleverbotenabled"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("DeleteMessageOnCommand") - .HasColumnType("boolean") - .HasColumnName("deletemessageoncommand"); - - b.Property("DeleteStreamOnlineMessage") - .HasColumnType("boolean") - .HasColumnName("deletestreamonlinemessage"); - - b.Property("DisableGlobalExpressions") - .HasColumnType("boolean") - .HasColumnName("disableglobalexpressions"); - - b.Property("ExclusiveSelfAssignedRoles") - .HasColumnType("boolean") - .HasColumnName("exclusiveselfassignedroles"); - - b.Property("FilterInvites") - .HasColumnType("boolean") - .HasColumnName("filterinvites"); - - b.Property("FilterLinks") - .HasColumnType("boolean") - .HasColumnName("filterlinks"); - - b.Property("FilterWords") - .HasColumnType("boolean") - .HasColumnName("filterwords"); - - b.Property("GameVoiceChannel") - .HasColumnType("numeric(20,0)") - .HasColumnName("gamevoicechannel"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Locale") - .HasColumnType("text") - .HasColumnName("locale"); - - b.Property("MuteRoleName") - .HasColumnType("text") - .HasColumnName("muterolename"); - - b.Property("NotifyStreamOffline") - .HasColumnType("boolean") - .HasColumnName("notifystreamoffline"); - - b.Property("PermissionRole") - .HasColumnType("text") - .HasColumnName("permissionrole"); - - b.Property("Prefix") - .HasColumnType("text") - .HasColumnName("prefix"); - - b.Property("StickyRoles") - .HasColumnType("boolean") - .HasColumnName("stickyroles"); - - b.Property("TimeZoneId") - .HasColumnType("text") - .HasColumnName("timezoneid"); - - b.Property("VerboseErrors") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(true) - .HasColumnName("verboseerrors"); - - b.Property("VerbosePermissions") - .HasColumnType("boolean") - .HasColumnName("verbosepermissions"); - - b.Property("WarnExpireAction") - .HasColumnType("integer") - .HasColumnName("warnexpireaction"); - - b.Property("WarnExpireHours") - .HasColumnType("integer") - .HasColumnName("warnexpirehours"); - - b.Property("WarningsInitialized") - .HasColumnType("boolean") - .HasColumnName("warningsinitialized"); - - b.HasKey("Id") - .HasName("pk_guildconfigs"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_guildconfigs_guildid"); - - b.HasIndex("WarnExpireHours") - .HasDatabaseName("ix_guildconfigs_warnexpirehours"); - - b.ToTable("guildconfigs", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.HoneypotChannel", b => - { - b.Property("GuildId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.HasKey("GuildId") - .HasName("pk_honeypotchannels"); - - b.ToTable("honeypotchannels", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ItemType") - .HasColumnType("integer") - .HasColumnName("itemtype"); - - b.Property("LogItemId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logitemid"); - - b.Property("LogSettingId") - .HasColumnType("integer") - .HasColumnName("logsettingid"); - - b.HasKey("Id") - .HasName("pk_ignoredlogchannels"); - - b.HasIndex("LogSettingId", "LogItemId", "ItemType") - .IsUnique() - .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype"); - - b.ToTable("ignoredlogchannels", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ImageOnlyChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_imageonlychannels"); - - b.HasIndex("ChannelId") - .IsUnique() - .HasDatabaseName("ix_imageonlychannels_channelid"); - - b.ToTable("imageonlychannels", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelCreatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelcreatedid"); - - b.Property("ChannelDestroyedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channeldestroyedid"); - - b.Property("ChannelUpdatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelupdatedid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("LogOtherId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logotherid"); - - b.Property("LogUserPresenceId") - .HasColumnType("numeric(20,0)") - .HasColumnName("loguserpresenceid"); - - b.Property("LogVoicePresenceId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logvoicepresenceid"); - - b.Property("LogVoicePresenceTTSId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logvoicepresencettsid"); - - b.Property("LogWarnsId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logwarnsid"); - - b.Property("MessageDeletedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messagedeletedid"); - - b.Property("MessageUpdatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageupdatedid"); - - b.Property("ThreadCreatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("threadcreatedid"); - - b.Property("ThreadDeletedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("threaddeletedid"); - - b.Property("UserBannedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userbannedid"); - - b.Property("UserJoinedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userjoinedid"); - - b.Property("UserLeftId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userleftid"); - - b.Property("UserMutedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("usermutedid"); - - b.Property("UserUnbannedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userunbannedid"); - - b.Property("UserUpdatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userupdatedid"); - - b.HasKey("Id") - .HasName("pk_logsettings"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_logsettings_guildid"); - - b.ToTable("logsettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlayerSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoDisconnect") - .HasColumnType("boolean") - .HasColumnName("autodisconnect"); - - b.Property("AutoPlay") - .HasColumnType("boolean") - .HasColumnName("autoplay"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("MusicChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("musicchannelid"); - - b.Property("PlayerRepeat") - .HasColumnType("integer") - .HasColumnName("playerrepeat"); - - b.Property("QualityPreset") - .HasColumnType("integer") - .HasColumnName("qualitypreset"); - - b.Property("Volume") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(100) - .HasColumnName("volume"); - - b.HasKey("Id") - .HasName("pk_musicplayersettings"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_musicplayersettings_guildid"); - - b.ToTable("musicplayersettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Author") - .HasColumnType("text") - .HasColumnName("author"); - - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") - .HasColumnName("authorid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_musicplaylists"); - - b.ToTable("musicplaylists", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_muteduserid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_muteduserid_guildconfigid"); - - b.ToTable("muteduserid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AllowTarget") - .HasColumnType("boolean") - .HasColumnName("allowtarget"); - - b.Property("AutoDeleteTrigger") - .HasColumnType("boolean") - .HasColumnName("autodeletetrigger"); - - b.Property("ContainsAnywhere") - .HasColumnType("boolean") - .HasColumnName("containsanywhere"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("DmResponse") - .HasColumnType("boolean") - .HasColumnName("dmresponse"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Reactions") - .HasColumnType("text") - .HasColumnName("reactions"); - - b.Property("Response") - .HasColumnType("text") - .HasColumnName("response"); - - b.Property("Trigger") - .HasColumnType("text") - .HasColumnName("trigger"); - - b.HasKey("Id") - .HasName("pk_expressions"); - - b.ToTable("expressions", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("AmountCents") - .HasColumnType("integer") - .HasColumnName("amountcents"); - - b.Property("LastCharge") - .HasColumnType("timestamp without time zone") - .HasColumnName("lastcharge"); - - b.Property("UniquePlatformUserId") - .HasColumnType("text") - .HasColumnName("uniqueplatformuserid"); - - b.Property("ValidThru") - .HasColumnType("timestamp without time zone") - .HasColumnName("validthru"); - - b.HasKey("UserId") - .HasName("pk_patrons"); - - b.HasIndex("UniquePlatformUserId") - .IsUnique() - .HasDatabaseName("ix_patrons_uniqueplatformuserid"); - - b.ToTable("patrons", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Index") - .HasColumnType("integer") - .HasColumnName("index"); - - b.Property("IsCustomCommand") - .HasColumnType("boolean") - .HasColumnName("iscustomcommand"); - - b.Property("PrimaryTarget") - .HasColumnType("integer") - .HasColumnName("primarytarget"); - - b.Property("PrimaryTargetId") - .HasColumnType("numeric(20,0)") - .HasColumnName("primarytargetid"); - - b.Property("SecondaryTarget") - .HasColumnType("integer") - .HasColumnName("secondarytarget"); - - b.Property("SecondaryTargetName") - .HasColumnType("text") - .HasColumnName("secondarytargetname"); - - b.Property("State") - .HasColumnType("boolean") - .HasColumnName("state"); - - b.HasKey("Id") - .HasName("pk_permissions"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_permissions_guildconfigid"); - - b.ToTable("permissions", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlantedCurrency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("bigint") - .HasColumnName("amount"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); - - b.Property("Password") - .HasColumnType("text") - .HasColumnName("password"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_plantedcurrency"); - - b.HasIndex("ChannelId") - .HasDatabaseName("ix_plantedcurrency_channelid"); - - b.HasIndex("MessageId") - .IsUnique() - .HasDatabaseName("ix_plantedcurrency_messageid"); - - b.ToTable("plantedcurrency", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("MusicPlaylistId") - .HasColumnType("integer") - .HasColumnName("musicplaylistid"); - - b.Property("Provider") - .HasColumnType("text") - .HasColumnName("provider"); - - b.Property("ProviderType") - .HasColumnType("integer") - .HasColumnName("providertype"); - - b.Property("Query") - .HasColumnType("text") - .HasColumnName("query"); - - b.Property("Title") - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("Uri") - .HasColumnType("text") - .HasColumnName("uri"); - - b.HasKey("Id") - .HasName("pk_playlistsong"); - - b.HasIndex("MusicPlaylistId") - .HasDatabaseName("ix_playlistsong_musicplaylistid"); - - b.ToTable("playlistsong", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Quote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") - .HasColumnName("authorid"); - - b.Property("AuthorName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("authorname"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("text") - .HasColumnName("keyword"); - - b.Property("Text") - .IsRequired() - .HasColumnType("text") - .HasColumnName("text"); - - b.HasKey("Id") - .HasName("pk_quotes"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_quotes_guildid"); - - b.HasIndex("Keyword") - .HasDatabaseName("ix_quotes_keyword"); - - b.ToTable("quotes", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ReactionRoleV2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Emote") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("emote"); - - b.Property("Group") - .HasColumnType("integer") - .HasColumnName("group"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("LevelReq") - .HasColumnType("integer") - .HasColumnName("levelreq"); - - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_reactionroles"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_reactionroles_guildid"); - - b.HasIndex("MessageId", "Emote") - .IsUnique() - .HasDatabaseName("ix_reactionroles_messageid_emote"); - - b.ToTable("reactionroles", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Reminder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("IsPrivate") - .HasColumnType("boolean") - .HasColumnName("isprivate"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("ServerId") - .HasColumnType("numeric(20,0)") - .HasColumnName("serverid"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("When") - .HasColumnType("timestamp without time zone") - .HasColumnName("when"); - - b.HasKey("Id") - .HasName("pk_reminders"); - - b.HasIndex("When") - .HasDatabaseName("ix_reminders_when"); - - b.ToTable("reminders", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Repeater", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Interval") - .HasColumnType("interval") - .HasColumnName("interval"); - - b.Property("LastMessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("lastmessageid"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("NoRedundant") - .HasColumnType("boolean") - .HasColumnName("noredundant"); - - b.Property("StartTimeOfDay") - .HasColumnType("interval") - .HasColumnName("starttimeofday"); - - b.HasKey("Id") - .HasName("pk_repeaters"); - - b.ToTable("repeaters", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.RewardedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AmountRewardedThisMonth") - .HasColumnType("bigint") - .HasColumnName("amountrewardedthismonth"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("LastReward") - .HasColumnType("timestamp without time zone") - .HasColumnName("lastreward"); - - b.Property("PlatformUserId") - .HasColumnType("text") - .HasColumnName("platformuserid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_rewardedusers"); - - b.HasIndex("PlatformUserId") - .IsUnique() - .HasDatabaseName("ix_rewardedusers_platformuserid"); - - b.ToTable("rewardedusers", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.RotatingPlayingStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Status") - .HasColumnType("text") - .HasColumnName("status"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_rotatingstatus"); - - b.ToTable("rotatingstatus", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SelfAssignedRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Group") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("group"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("LevelRequirement") - .HasColumnType("integer") - .HasColumnName("levelrequirement"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_selfassignableroles"); - - b.HasIndex("GuildId", "RoleId") - .IsUnique() - .HasDatabaseName("ix_selfassignableroles_guildid_roleid"); - - b.ToTable("selfassignableroles", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") - .HasColumnName("authorid"); - - b.Property("Command") - .HasColumnType("text") - .HasColumnName("command"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Index") - .HasColumnType("integer") - .HasColumnName("index"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("Price") - .HasColumnType("integer") - .HasColumnName("price"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("RoleName") - .HasColumnType("text") - .HasColumnName("rolename"); - - b.Property("RoleRequirement") - .HasColumnType("numeric(20,0)") - .HasColumnName("rolerequirement"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_shopentry"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_shopentry_guildconfigid"); - - b.ToTable("shopentry", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ShopEntryId") - .HasColumnType("integer") - .HasColumnName("shopentryid"); - - b.Property("Text") - .HasColumnType("text") - .HasColumnName("text"); - - b.HasKey("Id") - .HasName("pk_shopentryitem"); - - b.HasIndex("ShopEntryId") - .HasDatabaseName("ix_shopentryitem_shopentryid"); - - b.ToTable("shopentryitem", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_slowmodeignoredrole"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_slowmodeignoredrole_guildconfigid"); - - b.ToTable("slowmodeignoredrole", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_slowmodeignoreduser"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_slowmodeignoreduser_guildconfigid"); - - b.ToTable("slowmodeignoreduser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StickyRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("RoleIds") - .HasColumnType("text") - .HasColumnName("roleids"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_stickyroles"); - - b.HasIndex("GuildId", "UserId") - .IsUnique() - .HasDatabaseName("ix_stickyroles_guildid_userid"); - - b.ToTable("stickyroles", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamOnlineMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_streamonlinemessages"); - - b.ToTable("streamonlinemessages", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("StreamRoleSettingsId") - .HasColumnType("integer") - .HasColumnName("streamrolesettingsid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); - - b.HasKey("Id") - .HasName("pk_streamroleblacklisteduser"); - - b.HasIndex("StreamRoleSettingsId") - .HasDatabaseName("ix_streamroleblacklisteduser_streamrolesettingsid"); - - b.ToTable("streamroleblacklisteduser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddRoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("addroleid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Enabled") - .HasColumnType("boolean") - .HasColumnName("enabled"); - - b.Property("FromRoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("fromroleid"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Keyword") - .HasColumnType("text") - .HasColumnName("keyword"); - - b.HasKey("Id") - .HasName("pk_streamrolesettings"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_streamrolesettings_guildconfigid"); - - b.ToTable("streamrolesettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("StreamRoleSettingsId") - .HasColumnType("integer") - .HasColumnName("streamrolesettingsid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); - - b.HasKey("Id") - .HasName("pk_streamrolewhitelisteduser"); - - b.HasIndex("StreamRoleSettingsId") - .HasDatabaseName("ix_streamrolewhitelisteduser_streamrolesettingsid"); - - b.ToTable("streamrolewhitelisteduser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ArchiveId") - .HasColumnType("integer") - .HasColumnName("archiveid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("IsDone") - .HasColumnType("boolean") - .HasColumnName("isdone"); - - b.Property("Todo") - .HasColumnType("text") - .HasColumnName("todo"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_todos"); - - b.HasIndex("ArchiveId") - .HasDatabaseName("ix_todos_archiveid"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_todos_userid"); - - b.ToTable("todos", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("UnbanAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("unbanat"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_unbantimer"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_unbantimer_guildconfigid"); - - b.ToTable("unbantimer", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("UnmuteAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("unmuteat"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_unmutetimer"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_unmutetimer_guildconfigid"); - - b.ToTable("unmutetimer", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("UnbanAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("unbanat"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_unroletimer"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_unroletimer_guildconfigid"); - - b.ToTable("unroletimer", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UserXpStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AwardedXp") - .HasColumnType("bigint") - .HasColumnName("awardedxp"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("NotifyOnLevelUp") - .HasColumnType("integer") - .HasColumnName("notifyonlevelup"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Xp") - .HasColumnType("bigint") - .HasColumnName("xp"); - - b.HasKey("Id") - .HasName("pk_userxpstats"); - - b.HasIndex("AwardedXp") - .HasDatabaseName("ix_userxpstats_awardedxp"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_userxpstats_guildid"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_userxpstats_userid"); - - b.HasIndex("Xp") - .HasDatabaseName("ix_userxpstats_xp"); - - b.HasIndex("UserId", "GuildId") - .IsUnique() - .HasDatabaseName("ix_userxpstats_userid_guildid"); - - b.ToTable("userxpstats", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.VcRoleInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("VoiceChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("voicechannelid"); - - b.HasKey("Id") - .HasName("pk_vcroleinfo"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_vcroleinfo_guildconfigid"); - - b.ToTable("vcroleinfo", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AffinityId") - .HasColumnType("integer") - .HasColumnName("affinityid"); - - b.Property("ClaimerId") - .HasColumnType("integer") - .HasColumnName("claimerid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Price") - .HasColumnType("bigint") - .HasColumnName("price"); - - b.Property("WaifuId") - .HasColumnType("integer") - .HasColumnName("waifuid"); - - b.HasKey("Id") - .HasName("pk_waifuinfo"); - - b.HasIndex("AffinityId") - .HasDatabaseName("ix_waifuinfo_affinityid"); - - b.HasIndex("ClaimerId") - .HasDatabaseName("ix_waifuinfo_claimerid"); - - b.HasIndex("Price") - .HasDatabaseName("ix_waifuinfo_price"); - - b.HasIndex("WaifuId") - .IsUnique() - .HasDatabaseName("ix_waifuinfo_waifuid"); - - b.ToTable("waifuinfo", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ItemEmoji") - .HasColumnType("text") - .HasColumnName("itememoji"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("WaifuInfoId") - .HasColumnType("integer") - .HasColumnName("waifuinfoid"); - - b.HasKey("Id") - .HasName("pk_waifuitem"); - - b.HasIndex("WaifuInfoId") - .HasDatabaseName("ix_waifuitem_waifuinfoid"); - - b.ToTable("waifuitem", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("NewId") - .HasColumnType("integer") - .HasColumnName("newid"); - - b.Property("OldId") - .HasColumnType("integer") - .HasColumnName("oldid"); - - b.Property("UpdateType") - .HasColumnType("integer") - .HasColumnName("updatetype"); - - b.Property("UserId") - .HasColumnType("integer") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_waifuupdates"); - - b.HasIndex("NewId") - .HasDatabaseName("ix_waifuupdates_newid"); - - b.HasIndex("OldId") - .HasDatabaseName("ix_waifuupdates_oldid"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_waifuupdates_userid"); - - b.ToTable("waifuupdates", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Warning", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Forgiven") - .HasColumnType("boolean") - .HasColumnName("forgiven"); - - b.Property("ForgivenBy") - .HasColumnType("text") - .HasColumnName("forgivenby"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Moderator") - .HasColumnType("text") - .HasColumnName("moderator"); - - b.Property("Reason") - .HasColumnType("text") - .HasColumnName("reason"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Weight") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasDefaultValue(1L) - .HasColumnName("weight"); - - b.HasKey("Id") - .HasName("pk_warnings"); - - b.HasIndex("DateAdded") - .HasDatabaseName("ix_warnings_dateadded"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_warnings_guildid"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_warnings_userid"); - - b.ToTable("warnings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WarningPunishment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Count") - .HasColumnType("integer") - .HasColumnName("count"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Punishment") - .HasColumnType("integer") - .HasColumnName("punishment"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("Time") - .HasColumnType("integer") - .HasColumnName("time"); - - b.HasKey("Id") - .HasName("pk_warningpunishment"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_warningpunishment_guildconfigid"); - - b.ToTable("warningpunishment", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("integer") - .HasColumnName("amount"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property("XpSettingsId") - .HasColumnType("integer") - .HasColumnName("xpsettingsid"); - - b.HasKey("Id") - .HasName("pk_xpcurrencyreward"); - - b.HasIndex("XpSettingsId") - .HasDatabaseName("ix_xpcurrencyreward_xpsettingsid"); - - b.ToTable("xpcurrencyreward", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property("Remove") - .HasColumnType("boolean") - .HasColumnName("remove"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("XpSettingsId") - .HasColumnType("integer") - .HasColumnName("xpsettingsid"); - - b.HasKey("Id") - .HasName("pk_xprolereward"); - - b.HasIndex("XpSettingsId", "Level") - .IsUnique() - .HasDatabaseName("ix_xprolereward_xpsettingsid_level"); - - b.ToTable("xprolereward", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("ServerExcluded") - .HasColumnType("boolean") - .HasColumnName("serverexcluded"); - - b.HasKey("Id") - .HasName("pk_xpsettings"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_xpsettings_guildconfigid"); - - b.ToTable("xpsettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpShopOwnedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("IsUsing") - .HasColumnType("boolean") - .HasColumnName("isusing"); - - b.Property("ItemKey") - .IsRequired() - .HasColumnType("text") - .HasColumnName("itemkey"); - - b.Property("ItemType") - .HasColumnType("integer") - .HasColumnName("itemtype"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_xpshopowneditem"); - - b.HasIndex("UserId", "ItemType", "ItemKey") - .IsUnique() - .HasDatabaseName("ix_xpshopowneditem_userid_itemtype_itemkey"); - - b.ToTable("xpshopowneditem", (string)null); - }); - - modelBuilder.Entity("EllieBot.Services.GreetSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoDeleteTimer") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("autodeletetimer"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("GreetType") - .HasColumnType("integer") - .HasColumnName("greettype"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("isenabled"); - - b.Property("MessageText") - .HasColumnType("text") - .HasColumnName("messagetext"); - - b.HasKey("Id") - .HasName("pk_greetsettings"); - - b.HasIndex("GuildId", "GreetType") - .IsUnique() - .HasDatabaseName("ix_greetsettings_guildid_greettype"); - - b.ToTable("greetsettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiAltSetting") - .HasForeignKey("EllieBot.Db.Models.AntiAltSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiRaidSetting") - .HasForeignKey("EllieBot.Db.Models.AntiRaidSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.HasOne("EllieBot.Db.Models.AntiSpamSetting", null) - .WithMany("IgnoredChannels") - .HasForeignKey("AntiSpamSettingId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiSpamSetting") - .HasForeignKey("EllieBot.Db.Models.AntiSpamSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.HasOne("EllieBot.Db.Models.AutoTranslateChannel", "Channel") - .WithMany("Users") - .HasForeignKey("ChannelId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); - - b.Navigation("Channel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Applicants") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubapplicants_clubs_clubid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubapplicants_discorduser_userid"); - - b.Navigation("Club"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Bans") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubbans_clubs_clubid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubbans_discorduser_userid"); - - b.Navigation("Club"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Owner") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.ClubInfo", "OwnerId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("fk_clubs_discorduser_ownerid"); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandAliases") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandCooldown", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandCooldowns") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("DelMsgOnCmdChannels") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Members") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.NoAction) - .HasConstraintName("fk_discorduser_clubs_clubid"); - - b.Navigation("Club"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("ExclusionList") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("FeedSubs") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_feedsub_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterInvitesChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterLinksChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterWordsChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilteredWords") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FollowedStreams") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GCChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("GenerateCurrencyChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.HasOne("EllieBot.Db.Models.GiveawayModel", null) - .WithMany("Participants") - .HasForeignKey("GiveawayId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_giveawayuser_giveawaymodel_giveawayid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("SelfAssignableRoleGroupNames") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_groupname_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.HasOne("EllieBot.Db.Models.LogSetting", "LogSetting") - .WithMany("LogIgnores") - .HasForeignKey("LogSettingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_ignoredlogchannels_logsettings_logsettingid"); - - b.Navigation("LogSetting"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("MutedUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("Permissions") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.HasOne("EllieBot.Db.Models.MusicPlaylist", null) - .WithMany("Songs") - .HasForeignKey("MusicPlaylistId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("ShopEntries") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.HasOne("EllieBot.Db.Models.ShopEntry", null) - .WithMany("Items") - .HasForeignKey("ShopEntryId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredRoles") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Blacklist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesett~"); - - b.Navigation("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("StreamRole") - .HasForeignKey("EllieBot.Db.Models.StreamRoleSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Whitelist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesett~"); - - b.Navigation("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.HasOne("EllieBot.Db.Models.ArchivedTodoListModel", null) - .WithMany("Items") - .HasForeignKey("ArchiveId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_todos_todosarchive_archiveid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnbanTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnmuteTimers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnroleTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.VcRoleInfo", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("VcRoleInfos") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Affinity") - .WithMany() - .HasForeignKey("AffinityId") - .HasConstraintName("fk_waifuinfo_discorduser_affinityid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Claimer") - .WithMany() - .HasForeignKey("ClaimerId") - .HasConstraintName("fk_waifuinfo_discorduser_claimerid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Waifu") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.WaifuInfo", "WaifuId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); - - b.Navigation("Affinity"); - - b.Navigation("Claimer"); - - b.Navigation("Waifu"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.HasOne("EllieBot.Db.Models.WaifuInfo", "WaifuInfo") - .WithMany("Items") - .HasForeignKey("WaifuInfoId") - .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); - - b.Navigation("WaifuInfo"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "New") - .WithMany() - .HasForeignKey("NewId") - .HasConstraintName("fk_waifuupdates_discorduser_newid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Old") - .WithMany() - .HasForeignKey("OldId") - .HasConstraintName("fk_waifuupdates_discorduser_oldid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_waifuupdates_discorduser_userid"); - - b.Navigation("New"); - - b.Navigation("Old"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WarningPunishment", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("WarnPunishments") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_warningpunishment_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("CurrencyRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_xpcurrencyreward_xpsettings_xpsettingsid"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("RoleRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_xprolereward_xpsettings_xpsettingsid"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("XpSettings") - .HasForeignKey("EllieBot.Db.Models.XpSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Navigation("IgnoredChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Navigation("Users"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Navigation("Applicants"); - - b.Navigation("Bans"); - - b.Navigation("Members"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Navigation("Participants"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GuildConfig", b => - { - b.Navigation("AntiAltSetting"); - - b.Navigation("AntiRaidSetting"); - - b.Navigation("AntiSpamSetting"); - - 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("GenerateCurrencyChannelIds"); - - b.Navigation("MutedUsers"); - - b.Navigation("Permissions"); - - b.Navigation("SelfAssignableRoleGroupNames"); - - b.Navigation("ShopEntries"); - - b.Navigation("SlowmodeIgnoredRoles"); - - b.Navigation("SlowmodeIgnoredUsers"); - - b.Navigation("StreamRole"); - - b.Navigation("UnbanTimer"); - - b.Navigation("UnmuteTimers"); - - b.Navigation("UnroleTimer"); - - b.Navigation("VcRoleInfos"); - - b.Navigation("WarnPunishments"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Navigation("LogIgnores"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Navigation("Songs"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Navigation("Blacklist"); - - b.Navigation("Whitelist"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Navigation("CurrencyRewards"); - - b.Navigation("ExclusionList"); - - b.Navigation("RoleRewards"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/EllieBot/Migrations/PostgreSql/20241018004623_warn-split.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20241018004623_warn-split.Designer.cs deleted file mode 100644 index 2326a13..0000000 --- a/src/EllieBot/Migrations/PostgreSql/20241018004623_warn-split.Designer.cs +++ /dev/null @@ -1,3778 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using EllieBot.Db; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace EllieBot.Migrations.PostgreSql -{ - [DbContext(typeof(PostgreSqlContext))] - [Migration("20241018004623_warn-split")] - partial class warnsplit - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.8") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .HasColumnType("integer") - .HasColumnName("action"); - - b.Property("ActionDurationMinutes") - .HasColumnType("integer") - .HasColumnName("actiondurationminutes"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("MinAge") - .HasColumnType("interval") - .HasColumnName("minage"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_antialtsetting"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_antialtsetting_guildconfigid"); - - b.ToTable("antialtsetting", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .HasColumnType("integer") - .HasColumnName("action"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("PunishDuration") - .HasColumnType("integer") - .HasColumnName("punishduration"); - - b.Property("Seconds") - .HasColumnType("integer") - .HasColumnName("seconds"); - - b.Property("UserThreshold") - .HasColumnType("integer") - .HasColumnName("userthreshold"); - - b.HasKey("Id") - .HasName("pk_antiraidsetting"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_antiraidsetting_guildconfigid"); - - b.ToTable("antiraidsetting", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AntiSpamSettingId") - .HasColumnType("integer") - .HasColumnName("antispamsettingid"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.HasKey("Id") - .HasName("pk_antispamignore"); - - b.HasIndex("AntiSpamSettingId") - .HasDatabaseName("ix_antispamignore_antispamsettingid"); - - b.ToTable("antispamignore", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .HasColumnType("integer") - .HasColumnName("action"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("MessageThreshold") - .HasColumnType("integer") - .HasColumnName("messagethreshold"); - - b.Property("MuteTime") - .HasColumnType("integer") - .HasColumnName("mutetime"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_antispamsetting"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_antispamsetting_guildconfigid"); - - b.ToTable("antispamsetting", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_todosarchive"); - - b.ToTable("todosarchive", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoCommand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("ChannelName") - .HasColumnType("text") - .HasColumnName("channelname"); - - b.Property("CommandText") - .HasColumnType("text") - .HasColumnName("commandtext"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("GuildName") - .HasColumnType("text") - .HasColumnName("guildname"); - - b.Property("Interval") - .HasColumnType("integer") - .HasColumnName("interval"); - - b.Property("VoiceChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("voicechannelid"); - - b.Property("VoiceChannelName") - .HasColumnType("text") - .HasColumnName("voicechannelname"); - - b.HasKey("Id") - .HasName("pk_autocommands"); - - b.ToTable("autocommands", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoPublishChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.HasKey("Id") - .HasName("pk_autopublishchannel"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_autopublishchannel_guildid"); - - b.ToTable("autopublishchannel", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoDelete") - .HasColumnType("boolean") - .HasColumnName("autodelete"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.HasKey("Id") - .HasName("pk_autotranslatechannels"); - - b.HasIndex("ChannelId") - .IsUnique() - .HasDatabaseName("ix_autotranslatechannels_channelid"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_autotranslatechannels_guildid"); - - b.ToTable("autotranslatechannels", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("integer") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Source") - .HasColumnType("text") - .HasColumnName("source"); - - b.Property("Target") - .HasColumnType("text") - .HasColumnName("target"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_autotranslateusers"); - - b.HasAlternateKey("ChannelId", "UserId") - .HasName("ak_autotranslateusers_channelid_userid"); - - b.ToTable("autotranslateusers", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BanTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("PruneDays") - .HasColumnType("integer") - .HasColumnName("prunedays"); - - b.Property("Text") - .HasColumnType("text") - .HasColumnName("text"); - - b.HasKey("Id") - .HasName("pk_bantemplates"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_bantemplates_guildid"); - - b.ToTable("bantemplates", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Balance") - .HasColumnType("bigint") - .HasColumnName("balance"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_bankusers"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("ix_bankusers_userid"); - - b.ToTable("bankusers", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BlacklistEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ItemId") - .HasColumnType("numeric(20,0)") - .HasColumnName("itemid"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_blacklist"); - - b.ToTable("blacklist", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.Property("ClubId") - .HasColumnType("integer") - .HasColumnName("clubid"); - - b.Property("UserId") - .HasColumnType("integer") - .HasColumnName("userid"); - - b.HasKey("ClubId", "UserId") - .HasName("pk_clubapplicants"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_clubapplicants_userid"); - - b.ToTable("clubapplicants", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.Property("ClubId") - .HasColumnType("integer") - .HasColumnName("clubid"); - - b.Property("UserId") - .HasColumnType("integer") - .HasColumnName("userid"); - - b.HasKey("ClubId", "UserId") - .HasName("pk_clubbans"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_clubbans_userid"); - - b.ToTable("clubbans", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Description") - .HasColumnType("text") - .HasColumnName("description"); - - b.Property("ImageUrl") - .HasColumnType("text") - .HasColumnName("imageurl"); - - b.Property("Name") - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("name"); - - b.Property("OwnerId") - .HasColumnType("integer") - .HasColumnName("ownerid"); - - b.Property("Xp") - .HasColumnType("integer") - .HasColumnName("xp"); - - b.HasKey("Id") - .HasName("pk_clubs"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_clubs_name"); - - b.HasIndex("OwnerId") - .IsUnique() - .HasDatabaseName("ix_clubs_ownerid"); - - b.ToTable("clubs", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Mapping") - .HasColumnType("text") - .HasColumnName("mapping"); - - b.Property("Trigger") - .HasColumnType("text") - .HasColumnName("trigger"); - - b.HasKey("Id") - .HasName("pk_commandalias"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_commandalias_guildconfigid"); - - b.ToTable("commandalias", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandCooldown", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CommandName") - .HasColumnType("text") - .HasColumnName("commandname"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Seconds") - .HasColumnType("integer") - .HasColumnName("seconds"); - - b.HasKey("Id") - .HasName("pk_commandcooldown"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_commandcooldown_guildconfigid"); - - b.ToTable("commandcooldown", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CurrencyTransaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("bigint") - .HasColumnName("amount"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Extra") - .IsRequired() - .HasColumnType("text") - .HasColumnName("extra"); - - b.Property("Note") - .HasColumnType("text") - .HasColumnName("note"); - - b.Property("OtherId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") - .HasColumnName("otherid") - .HasDefaultValueSql("NULL"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text") - .HasColumnName("type"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_currencytransactions"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_currencytransactions_userid"); - - b.ToTable("currencytransactions", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("State") - .HasColumnType("boolean") - .HasColumnName("state"); - - b.HasKey("Id") - .HasName("pk_delmsgoncmdchannel"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); - - b.ToTable("delmsgoncmdchannel", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordPermOverride", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Command") - .HasColumnType("text") - .HasColumnName("command"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Perm") - .HasColumnType("numeric(20,0)") - .HasColumnName("perm"); - - b.HasKey("Id") - .HasName("pk_discordpermoverrides"); - - b.HasIndex("GuildId", "Command") - .IsUnique() - .HasDatabaseName("ix_discordpermoverrides_guildid_command"); - - b.ToTable("discordpermoverrides", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AvatarId") - .HasColumnType("text") - .HasColumnName("avatarid"); - - b.Property("ClubId") - .HasColumnType("integer") - .HasColumnName("clubid"); - - b.Property("CurrencyAmount") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasDefaultValue(0L) - .HasColumnName("currencyamount"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Discriminator") - .HasColumnType("text") - .HasColumnName("discriminator"); - - b.Property("IsClubAdmin") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("isclubadmin"); - - b.Property("NotifyOnLevelUp") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("notifyonlevelup"); - - b.Property("TotalXp") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasDefaultValue(0L) - .HasColumnName("totalxp"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); - - b.HasKey("Id") - .HasName("pk_discorduser"); - - b.HasAlternateKey("UserId") - .HasName("ak_discorduser_userid"); - - b.HasIndex("ClubId") - .HasDatabaseName("ix_discorduser_clubid"); - - b.HasIndex("CurrencyAmount") - .HasDatabaseName("ix_discorduser_currencyamount"); - - b.HasIndex("TotalXp") - .HasDatabaseName("ix_discorduser_totalxp"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_discorduser_userid"); - - b.ToTable("discorduser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ItemId") - .HasColumnType("numeric(20,0)") - .HasColumnName("itemid"); - - b.Property("ItemType") - .HasColumnType("integer") - .HasColumnName("itemtype"); - - b.Property("XpSettingsId") - .HasColumnType("integer") - .HasColumnName("xpsettingsid"); - - b.HasKey("Id") - .HasName("pk_excludeditem"); - - b.HasIndex("XpSettingsId") - .HasDatabaseName("ix_excludeditem_xpsettingsid"); - - b.ToTable("excludeditem", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text") - .HasColumnName("url"); - - b.HasKey("Id") - .HasName("pk_feedsub"); - - b.HasAlternateKey("GuildConfigId", "Url") - .HasName("ak_feedsub_guildconfigid_url"); - - b.ToTable("feedsub", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.HasKey("Id") - .HasName("pk_filterchannelid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filterchannelid_guildconfigid"); - - b.ToTable("filterchannelid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.HasKey("Id") - .HasName("pk_filterlinkschannelid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); - - b.ToTable("filterlinkschannelid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.HasKey("Id") - .HasName("pk_filterwordschannelid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); - - b.ToTable("filterwordschannelid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Word") - .HasColumnType("text") - .HasColumnName("word"); - - b.HasKey("Id") - .HasName("pk_filteredword"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filteredword_guildconfigid"); - - b.ToTable("filteredword", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); - - b.HasKey("Id") - .HasName("pk_followedstream"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_followedstream_guildconfigid"); - - b.ToTable("followedstream", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GCChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.HasKey("Id") - .HasName("pk_gcchannelid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_gcchannelid_guildconfigid"); - - b.ToTable("gcchannelid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GamblingStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Bet") - .HasColumnType("numeric") - .HasColumnName("bet"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Feature") - .HasColumnType("text") - .HasColumnName("feature"); - - b.Property("PaidOut") - .HasColumnType("numeric") - .HasColumnName("paidout"); - - b.HasKey("Id") - .HasName("pk_gamblingstats"); - - b.HasIndex("Feature") - .IsUnique() - .HasDatabaseName("ix_gamblingstats_feature"); - - b.ToTable("gamblingstats", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("EndsAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("endsat"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); - - b.HasKey("Id") - .HasName("pk_giveawaymodel"); - - b.ToTable("giveawaymodel", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("GiveawayId") - .HasColumnType("integer") - .HasColumnName("giveawayid"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_giveawayuser"); - - b.HasIndex("GiveawayId", "UserId") - .IsUnique() - .HasDatabaseName("ix_giveawayuser_giveawayid_userid"); - - b.ToTable("giveawayuser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("Number") - .HasColumnType("integer") - .HasColumnName("number"); - - b.HasKey("Id") - .HasName("pk_groupname"); - - b.HasIndex("GuildConfigId", "Number") - .IsUnique() - .HasDatabaseName("ix_groupname_guildconfigid_number"); - - b.ToTable("groupname", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GuildConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoAssignRoleIds") - .HasColumnType("text") - .HasColumnName("autoassignroleids"); - - b.Property("AutoDeleteSelfAssignedRoleMessages") - .HasColumnType("boolean") - .HasColumnName("autodeleteselfassignedrolemessages"); - - b.Property("CleverbotEnabled") - .HasColumnType("boolean") - .HasColumnName("cleverbotenabled"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("DeleteMessageOnCommand") - .HasColumnType("boolean") - .HasColumnName("deletemessageoncommand"); - - b.Property("DeleteStreamOnlineMessage") - .HasColumnType("boolean") - .HasColumnName("deletestreamonlinemessage"); - - b.Property("DisableGlobalExpressions") - .HasColumnType("boolean") - .HasColumnName("disableglobalexpressions"); - - b.Property("ExclusiveSelfAssignedRoles") - .HasColumnType("boolean") - .HasColumnName("exclusiveselfassignedroles"); - - b.Property("FilterInvites") - .HasColumnType("boolean") - .HasColumnName("filterinvites"); - - b.Property("FilterLinks") - .HasColumnType("boolean") - .HasColumnName("filterlinks"); - - b.Property("FilterWords") - .HasColumnType("boolean") - .HasColumnName("filterwords"); - - b.Property("GameVoiceChannel") - .HasColumnType("numeric(20,0)") - .HasColumnName("gamevoicechannel"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Locale") - .HasColumnType("text") - .HasColumnName("locale"); - - b.Property("MuteRoleName") - .HasColumnType("text") - .HasColumnName("muterolename"); - - b.Property("NotifyStreamOffline") - .HasColumnType("boolean") - .HasColumnName("notifystreamoffline"); - - b.Property("PermissionRole") - .HasColumnType("text") - .HasColumnName("permissionrole"); - - b.Property("Prefix") - .HasColumnType("text") - .HasColumnName("prefix"); - - b.Property("StickyRoles") - .HasColumnType("boolean") - .HasColumnName("stickyroles"); - - b.Property("TimeZoneId") - .HasColumnType("text") - .HasColumnName("timezoneid"); - - b.Property("VerboseErrors") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(true) - .HasColumnName("verboseerrors"); - - b.Property("VerbosePermissions") - .HasColumnType("boolean") - .HasColumnName("verbosepermissions"); - - b.Property("WarnExpireAction") - .HasColumnType("integer") - .HasColumnName("warnexpireaction"); - - b.Property("WarnExpireHours") - .HasColumnType("integer") - .HasColumnName("warnexpirehours"); - - b.Property("WarningsInitialized") - .HasColumnType("boolean") - .HasColumnName("warningsinitialized"); - - b.HasKey("Id") - .HasName("pk_guildconfigs"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_guildconfigs_guildid"); - - b.HasIndex("WarnExpireHours") - .HasDatabaseName("ix_guildconfigs_warnexpirehours"); - - b.ToTable("guildconfigs", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.HoneypotChannel", b => - { - b.Property("GuildId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.HasKey("GuildId") - .HasName("pk_honeypotchannels"); - - b.ToTable("honeypotchannels", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ItemType") - .HasColumnType("integer") - .HasColumnName("itemtype"); - - b.Property("LogItemId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logitemid"); - - b.Property("LogSettingId") - .HasColumnType("integer") - .HasColumnName("logsettingid"); - - b.HasKey("Id") - .HasName("pk_ignoredlogchannels"); - - b.HasIndex("LogSettingId", "LogItemId", "ItemType") - .IsUnique() - .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype"); - - b.ToTable("ignoredlogchannels", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ImageOnlyChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_imageonlychannels"); - - b.HasIndex("ChannelId") - .IsUnique() - .HasDatabaseName("ix_imageonlychannels_channelid"); - - b.ToTable("imageonlychannels", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelCreatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelcreatedid"); - - b.Property("ChannelDestroyedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channeldestroyedid"); - - b.Property("ChannelUpdatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelupdatedid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("LogOtherId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logotherid"); - - b.Property("LogUserPresenceId") - .HasColumnType("numeric(20,0)") - .HasColumnName("loguserpresenceid"); - - b.Property("LogVoicePresenceId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logvoicepresenceid"); - - b.Property("LogVoicePresenceTTSId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logvoicepresencettsid"); - - b.Property("LogWarnsId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logwarnsid"); - - b.Property("MessageDeletedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messagedeletedid"); - - b.Property("MessageUpdatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageupdatedid"); - - b.Property("ThreadCreatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("threadcreatedid"); - - b.Property("ThreadDeletedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("threaddeletedid"); - - b.Property("UserBannedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userbannedid"); - - b.Property("UserJoinedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userjoinedid"); - - b.Property("UserLeftId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userleftid"); - - b.Property("UserMutedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("usermutedid"); - - b.Property("UserUnbannedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userunbannedid"); - - b.Property("UserUpdatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userupdatedid"); - - b.HasKey("Id") - .HasName("pk_logsettings"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_logsettings_guildid"); - - b.ToTable("logsettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlayerSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoDisconnect") - .HasColumnType("boolean") - .HasColumnName("autodisconnect"); - - b.Property("AutoPlay") - .HasColumnType("boolean") - .HasColumnName("autoplay"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("MusicChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("musicchannelid"); - - b.Property("PlayerRepeat") - .HasColumnType("integer") - .HasColumnName("playerrepeat"); - - b.Property("QualityPreset") - .HasColumnType("integer") - .HasColumnName("qualitypreset"); - - b.Property("Volume") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(100) - .HasColumnName("volume"); - - b.HasKey("Id") - .HasName("pk_musicplayersettings"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_musicplayersettings_guildid"); - - b.ToTable("musicplayersettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Author") - .HasColumnType("text") - .HasColumnName("author"); - - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") - .HasColumnName("authorid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_musicplaylists"); - - b.ToTable("musicplaylists", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_muteduserid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_muteduserid_guildconfigid"); - - b.ToTable("muteduserid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AllowTarget") - .HasColumnType("boolean") - .HasColumnName("allowtarget"); - - b.Property("AutoDeleteTrigger") - .HasColumnType("boolean") - .HasColumnName("autodeletetrigger"); - - b.Property("ContainsAnywhere") - .HasColumnType("boolean") - .HasColumnName("containsanywhere"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("DmResponse") - .HasColumnType("boolean") - .HasColumnName("dmresponse"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Reactions") - .HasColumnType("text") - .HasColumnName("reactions"); - - b.Property("Response") - .HasColumnType("text") - .HasColumnName("response"); - - b.Property("Trigger") - .HasColumnType("text") - .HasColumnName("trigger"); - - b.HasKey("Id") - .HasName("pk_expressions"); - - b.ToTable("expressions", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("AmountCents") - .HasColumnType("integer") - .HasColumnName("amountcents"); - - b.Property("LastCharge") - .HasColumnType("timestamp without time zone") - .HasColumnName("lastcharge"); - - b.Property("UniquePlatformUserId") - .HasColumnType("text") - .HasColumnName("uniqueplatformuserid"); - - b.Property("ValidThru") - .HasColumnType("timestamp without time zone") - .HasColumnName("validthru"); - - b.HasKey("UserId") - .HasName("pk_patrons"); - - b.HasIndex("UniquePlatformUserId") - .IsUnique() - .HasDatabaseName("ix_patrons_uniqueplatformuserid"); - - b.ToTable("patrons", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Index") - .HasColumnType("integer") - .HasColumnName("index"); - - b.Property("IsCustomCommand") - .HasColumnType("boolean") - .HasColumnName("iscustomcommand"); - - b.Property("PrimaryTarget") - .HasColumnType("integer") - .HasColumnName("primarytarget"); - - b.Property("PrimaryTargetId") - .HasColumnType("numeric(20,0)") - .HasColumnName("primarytargetid"); - - b.Property("SecondaryTarget") - .HasColumnType("integer") - .HasColumnName("secondarytarget"); - - b.Property("SecondaryTargetName") - .HasColumnType("text") - .HasColumnName("secondarytargetname"); - - b.Property("State") - .HasColumnType("boolean") - .HasColumnName("state"); - - b.HasKey("Id") - .HasName("pk_permissions"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_permissions_guildconfigid"); - - b.ToTable("permissions", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlantedCurrency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("bigint") - .HasColumnName("amount"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); - - b.Property("Password") - .HasColumnType("text") - .HasColumnName("password"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_plantedcurrency"); - - b.HasIndex("ChannelId") - .HasDatabaseName("ix_plantedcurrency_channelid"); - - b.HasIndex("MessageId") - .IsUnique() - .HasDatabaseName("ix_plantedcurrency_messageid"); - - b.ToTable("plantedcurrency", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("MusicPlaylistId") - .HasColumnType("integer") - .HasColumnName("musicplaylistid"); - - b.Property("Provider") - .HasColumnType("text") - .HasColumnName("provider"); - - b.Property("ProviderType") - .HasColumnType("integer") - .HasColumnName("providertype"); - - b.Property("Query") - .HasColumnType("text") - .HasColumnName("query"); - - b.Property("Title") - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("Uri") - .HasColumnType("text") - .HasColumnName("uri"); - - b.HasKey("Id") - .HasName("pk_playlistsong"); - - b.HasIndex("MusicPlaylistId") - .HasDatabaseName("ix_playlistsong_musicplaylistid"); - - b.ToTable("playlistsong", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Quote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") - .HasColumnName("authorid"); - - b.Property("AuthorName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("authorname"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("text") - .HasColumnName("keyword"); - - b.Property("Text") - .IsRequired() - .HasColumnType("text") - .HasColumnName("text"); - - b.HasKey("Id") - .HasName("pk_quotes"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_quotes_guildid"); - - b.HasIndex("Keyword") - .HasDatabaseName("ix_quotes_keyword"); - - b.ToTable("quotes", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ReactionRoleV2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Emote") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("emote"); - - b.Property("Group") - .HasColumnType("integer") - .HasColumnName("group"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("LevelReq") - .HasColumnType("integer") - .HasColumnName("levelreq"); - - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_reactionroles"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_reactionroles_guildid"); - - b.HasIndex("MessageId", "Emote") - .IsUnique() - .HasDatabaseName("ix_reactionroles_messageid_emote"); - - b.ToTable("reactionroles", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Reminder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("IsPrivate") - .HasColumnType("boolean") - .HasColumnName("isprivate"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("ServerId") - .HasColumnType("numeric(20,0)") - .HasColumnName("serverid"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("When") - .HasColumnType("timestamp without time zone") - .HasColumnName("when"); - - b.HasKey("Id") - .HasName("pk_reminders"); - - b.HasIndex("When") - .HasDatabaseName("ix_reminders_when"); - - b.ToTable("reminders", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Repeater", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Interval") - .HasColumnType("interval") - .HasColumnName("interval"); - - b.Property("LastMessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("lastmessageid"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("NoRedundant") - .HasColumnType("boolean") - .HasColumnName("noredundant"); - - b.Property("StartTimeOfDay") - .HasColumnType("interval") - .HasColumnName("starttimeofday"); - - b.HasKey("Id") - .HasName("pk_repeaters"); - - b.ToTable("repeaters", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.RewardedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AmountRewardedThisMonth") - .HasColumnType("bigint") - .HasColumnName("amountrewardedthismonth"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("LastReward") - .HasColumnType("timestamp without time zone") - .HasColumnName("lastreward"); - - b.Property("PlatformUserId") - .HasColumnType("text") - .HasColumnName("platformuserid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_rewardedusers"); - - b.HasIndex("PlatformUserId") - .IsUnique() - .HasDatabaseName("ix_rewardedusers_platformuserid"); - - b.ToTable("rewardedusers", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.RotatingPlayingStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Status") - .HasColumnType("text") - .HasColumnName("status"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_rotatingstatus"); - - b.ToTable("rotatingstatus", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SelfAssignedRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Group") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("group"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("LevelRequirement") - .HasColumnType("integer") - .HasColumnName("levelrequirement"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_selfassignableroles"); - - b.HasIndex("GuildId", "RoleId") - .IsUnique() - .HasDatabaseName("ix_selfassignableroles_guildid_roleid"); - - b.ToTable("selfassignableroles", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") - .HasColumnName("authorid"); - - b.Property("Command") - .HasColumnType("text") - .HasColumnName("command"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Index") - .HasColumnType("integer") - .HasColumnName("index"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("Price") - .HasColumnType("integer") - .HasColumnName("price"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("RoleName") - .HasColumnType("text") - .HasColumnName("rolename"); - - b.Property("RoleRequirement") - .HasColumnType("numeric(20,0)") - .HasColumnName("rolerequirement"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_shopentry"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_shopentry_guildconfigid"); - - b.ToTable("shopentry", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ShopEntryId") - .HasColumnType("integer") - .HasColumnName("shopentryid"); - - b.Property("Text") - .HasColumnType("text") - .HasColumnName("text"); - - b.HasKey("Id") - .HasName("pk_shopentryitem"); - - b.HasIndex("ShopEntryId") - .HasDatabaseName("ix_shopentryitem_shopentryid"); - - b.ToTable("shopentryitem", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_slowmodeignoredrole"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_slowmodeignoredrole_guildconfigid"); - - b.ToTable("slowmodeignoredrole", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_slowmodeignoreduser"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_slowmodeignoreduser_guildconfigid"); - - b.ToTable("slowmodeignoreduser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StickyRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("RoleIds") - .HasColumnType("text") - .HasColumnName("roleids"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_stickyroles"); - - b.HasIndex("GuildId", "UserId") - .IsUnique() - .HasDatabaseName("ix_stickyroles_guildid_userid"); - - b.ToTable("stickyroles", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamOnlineMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_streamonlinemessages"); - - b.ToTable("streamonlinemessages", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("StreamRoleSettingsId") - .HasColumnType("integer") - .HasColumnName("streamrolesettingsid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); - - b.HasKey("Id") - .HasName("pk_streamroleblacklisteduser"); - - b.HasIndex("StreamRoleSettingsId") - .HasDatabaseName("ix_streamroleblacklisteduser_streamrolesettingsid"); - - b.ToTable("streamroleblacklisteduser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddRoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("addroleid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Enabled") - .HasColumnType("boolean") - .HasColumnName("enabled"); - - b.Property("FromRoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("fromroleid"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Keyword") - .HasColumnType("text") - .HasColumnName("keyword"); - - b.HasKey("Id") - .HasName("pk_streamrolesettings"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_streamrolesettings_guildconfigid"); - - b.ToTable("streamrolesettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("StreamRoleSettingsId") - .HasColumnType("integer") - .HasColumnName("streamrolesettingsid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); - - b.HasKey("Id") - .HasName("pk_streamrolewhitelisteduser"); - - b.HasIndex("StreamRoleSettingsId") - .HasDatabaseName("ix_streamrolewhitelisteduser_streamrolesettingsid"); - - b.ToTable("streamrolewhitelisteduser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ArchiveId") - .HasColumnType("integer") - .HasColumnName("archiveid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("IsDone") - .HasColumnType("boolean") - .HasColumnName("isdone"); - - b.Property("Todo") - .HasColumnType("text") - .HasColumnName("todo"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_todos"); - - b.HasIndex("ArchiveId") - .HasDatabaseName("ix_todos_archiveid"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_todos_userid"); - - b.ToTable("todos", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("UnbanAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("unbanat"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_unbantimer"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_unbantimer_guildconfigid"); - - b.ToTable("unbantimer", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("UnmuteAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("unmuteat"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_unmutetimer"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_unmutetimer_guildconfigid"); - - b.ToTable("unmutetimer", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("UnbanAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("unbanat"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_unroletimer"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_unroletimer_guildconfigid"); - - b.ToTable("unroletimer", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UserXpStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AwardedXp") - .HasColumnType("bigint") - .HasColumnName("awardedxp"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("NotifyOnLevelUp") - .HasColumnType("integer") - .HasColumnName("notifyonlevelup"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Xp") - .HasColumnType("bigint") - .HasColumnName("xp"); - - b.HasKey("Id") - .HasName("pk_userxpstats"); - - b.HasIndex("AwardedXp") - .HasDatabaseName("ix_userxpstats_awardedxp"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_userxpstats_guildid"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_userxpstats_userid"); - - b.HasIndex("Xp") - .HasDatabaseName("ix_userxpstats_xp"); - - b.HasIndex("UserId", "GuildId") - .IsUnique() - .HasDatabaseName("ix_userxpstats_userid_guildid"); - - b.ToTable("userxpstats", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.VcRoleInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("VoiceChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("voicechannelid"); - - b.HasKey("Id") - .HasName("pk_vcroleinfo"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_vcroleinfo_guildconfigid"); - - b.ToTable("vcroleinfo", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AffinityId") - .HasColumnType("integer") - .HasColumnName("affinityid"); - - b.Property("ClaimerId") - .HasColumnType("integer") - .HasColumnName("claimerid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Price") - .HasColumnType("bigint") - .HasColumnName("price"); - - b.Property("WaifuId") - .HasColumnType("integer") - .HasColumnName("waifuid"); - - b.HasKey("Id") - .HasName("pk_waifuinfo"); - - b.HasIndex("AffinityId") - .HasDatabaseName("ix_waifuinfo_affinityid"); - - b.HasIndex("ClaimerId") - .HasDatabaseName("ix_waifuinfo_claimerid"); - - b.HasIndex("Price") - .HasDatabaseName("ix_waifuinfo_price"); - - b.HasIndex("WaifuId") - .IsUnique() - .HasDatabaseName("ix_waifuinfo_waifuid"); - - b.ToTable("waifuinfo", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ItemEmoji") - .HasColumnType("text") - .HasColumnName("itememoji"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("WaifuInfoId") - .HasColumnType("integer") - .HasColumnName("waifuinfoid"); - - b.HasKey("Id") - .HasName("pk_waifuitem"); - - b.HasIndex("WaifuInfoId") - .HasDatabaseName("ix_waifuitem_waifuinfoid"); - - b.ToTable("waifuitem", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("NewId") - .HasColumnType("integer") - .HasColumnName("newid"); - - b.Property("OldId") - .HasColumnType("integer") - .HasColumnName("oldid"); - - b.Property("UpdateType") - .HasColumnType("integer") - .HasColumnName("updatetype"); - - b.Property("UserId") - .HasColumnType("integer") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_waifuupdates"); - - b.HasIndex("NewId") - .HasDatabaseName("ix_waifuupdates_newid"); - - b.HasIndex("OldId") - .HasDatabaseName("ix_waifuupdates_oldid"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_waifuupdates_userid"); - - b.ToTable("waifuupdates", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Warning", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Forgiven") - .HasColumnType("boolean") - .HasColumnName("forgiven"); - - b.Property("ForgivenBy") - .HasColumnType("text") - .HasColumnName("forgivenby"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Moderator") - .HasColumnType("text") - .HasColumnName("moderator"); - - b.Property("Reason") - .HasColumnType("text") - .HasColumnName("reason"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Weight") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasDefaultValue(1L) - .HasColumnName("weight"); - - b.HasKey("Id") - .HasName("pk_warnings"); - - b.HasIndex("DateAdded") - .HasDatabaseName("ix_warnings_dateadded"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_warnings_guildid"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_warnings_userid"); - - b.ToTable("warnings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WarningPunishment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Count") - .HasColumnType("integer") - .HasColumnName("count"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Punishment") - .HasColumnType("integer") - .HasColumnName("punishment"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("Time") - .HasColumnType("integer") - .HasColumnName("time"); - - b.HasKey("Id") - .HasName("pk_warningpunishment"); - - b.HasAlternateKey("GuildId", "Count") - .HasName("ak_warningpunishment_guildid_count"); - - b.ToTable("warningpunishment", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("integer") - .HasColumnName("amount"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property("XpSettingsId") - .HasColumnType("integer") - .HasColumnName("xpsettingsid"); - - b.HasKey("Id") - .HasName("pk_xpcurrencyreward"); - - b.HasIndex("XpSettingsId") - .HasDatabaseName("ix_xpcurrencyreward_xpsettingsid"); - - b.ToTable("xpcurrencyreward", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property("Remove") - .HasColumnType("boolean") - .HasColumnName("remove"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("XpSettingsId") - .HasColumnType("integer") - .HasColumnName("xpsettingsid"); - - b.HasKey("Id") - .HasName("pk_xprolereward"); - - b.HasIndex("XpSettingsId", "Level") - .IsUnique() - .HasDatabaseName("ix_xprolereward_xpsettingsid_level"); - - b.ToTable("xprolereward", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("ServerExcluded") - .HasColumnType("boolean") - .HasColumnName("serverexcluded"); - - b.HasKey("Id") - .HasName("pk_xpsettings"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_xpsettings_guildconfigid"); - - b.ToTable("xpsettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpShopOwnedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("IsUsing") - .HasColumnType("boolean") - .HasColumnName("isusing"); - - b.Property("ItemKey") - .IsRequired() - .HasColumnType("text") - .HasColumnName("itemkey"); - - b.Property("ItemType") - .HasColumnType("integer") - .HasColumnName("itemtype"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_xpshopowneditem"); - - b.HasIndex("UserId", "ItemType", "ItemKey") - .IsUnique() - .HasDatabaseName("ix_xpshopowneditem_userid_itemtype_itemkey"); - - b.ToTable("xpshopowneditem", (string)null); - }); - - modelBuilder.Entity("EllieBot.Services.GreetSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoDeleteTimer") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("autodeletetimer"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("GreetType") - .HasColumnType("integer") - .HasColumnName("greettype"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("isenabled"); - - b.Property("MessageText") - .HasColumnType("text") - .HasColumnName("messagetext"); - - b.HasKey("Id") - .HasName("pk_greetsettings"); - - b.HasIndex("GuildId", "GreetType") - .IsUnique() - .HasDatabaseName("ix_greetsettings_guildid_greettype"); - - b.ToTable("greetsettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiAltSetting") - .HasForeignKey("EllieBot.Db.Models.AntiAltSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiRaidSetting") - .HasForeignKey("EllieBot.Db.Models.AntiRaidSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.HasOne("EllieBot.Db.Models.AntiSpamSetting", null) - .WithMany("IgnoredChannels") - .HasForeignKey("AntiSpamSettingId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiSpamSetting") - .HasForeignKey("EllieBot.Db.Models.AntiSpamSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.HasOne("EllieBot.Db.Models.AutoTranslateChannel", "Channel") - .WithMany("Users") - .HasForeignKey("ChannelId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); - - b.Navigation("Channel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Applicants") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubapplicants_clubs_clubid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubapplicants_discorduser_userid"); - - b.Navigation("Club"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Bans") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubbans_clubs_clubid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubbans_discorduser_userid"); - - b.Navigation("Club"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Owner") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.ClubInfo", "OwnerId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("fk_clubs_discorduser_ownerid"); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandAliases") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandCooldown", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandCooldowns") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("DelMsgOnCmdChannels") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Members") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.NoAction) - .HasConstraintName("fk_discorduser_clubs_clubid"); - - b.Navigation("Club"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("ExclusionList") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("FeedSubs") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_feedsub_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterInvitesChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterLinksChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterWordsChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilteredWords") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FollowedStreams") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GCChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("GenerateCurrencyChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.HasOne("EllieBot.Db.Models.GiveawayModel", null) - .WithMany("Participants") - .HasForeignKey("GiveawayId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_giveawayuser_giveawaymodel_giveawayid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("SelfAssignableRoleGroupNames") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_groupname_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.HasOne("EllieBot.Db.Models.LogSetting", "LogSetting") - .WithMany("LogIgnores") - .HasForeignKey("LogSettingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_ignoredlogchannels_logsettings_logsettingid"); - - b.Navigation("LogSetting"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("MutedUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("Permissions") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.HasOne("EllieBot.Db.Models.MusicPlaylist", null) - .WithMany("Songs") - .HasForeignKey("MusicPlaylistId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("ShopEntries") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.HasOne("EllieBot.Db.Models.ShopEntry", null) - .WithMany("Items") - .HasForeignKey("ShopEntryId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredRoles") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Blacklist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesett~"); - - b.Navigation("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("StreamRole") - .HasForeignKey("EllieBot.Db.Models.StreamRoleSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Whitelist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesett~"); - - b.Navigation("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.HasOne("EllieBot.Db.Models.ArchivedTodoListModel", null) - .WithMany("Items") - .HasForeignKey("ArchiveId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_todos_todosarchive_archiveid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnbanTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnmuteTimers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnroleTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.VcRoleInfo", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("VcRoleInfos") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Affinity") - .WithMany() - .HasForeignKey("AffinityId") - .HasConstraintName("fk_waifuinfo_discorduser_affinityid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Claimer") - .WithMany() - .HasForeignKey("ClaimerId") - .HasConstraintName("fk_waifuinfo_discorduser_claimerid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Waifu") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.WaifuInfo", "WaifuId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); - - b.Navigation("Affinity"); - - b.Navigation("Claimer"); - - b.Navigation("Waifu"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.HasOne("EllieBot.Db.Models.WaifuInfo", "WaifuInfo") - .WithMany("Items") - .HasForeignKey("WaifuInfoId") - .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); - - b.Navigation("WaifuInfo"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "New") - .WithMany() - .HasForeignKey("NewId") - .HasConstraintName("fk_waifuupdates_discorduser_newid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Old") - .WithMany() - .HasForeignKey("OldId") - .HasConstraintName("fk_waifuupdates_discorduser_oldid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_waifuupdates_discorduser_userid"); - - b.Navigation("New"); - - b.Navigation("Old"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("CurrencyRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_xpcurrencyreward_xpsettings_xpsettingsid"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("RoleRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_xprolereward_xpsettings_xpsettingsid"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("XpSettings") - .HasForeignKey("EllieBot.Db.Models.XpSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Navigation("IgnoredChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Navigation("Users"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Navigation("Applicants"); - - b.Navigation("Bans"); - - b.Navigation("Members"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Navigation("Participants"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GuildConfig", b => - { - b.Navigation("AntiAltSetting"); - - b.Navigation("AntiRaidSetting"); - - b.Navigation("AntiSpamSetting"); - - 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("GenerateCurrencyChannelIds"); - - b.Navigation("MutedUsers"); - - b.Navigation("Permissions"); - - b.Navigation("SelfAssignableRoleGroupNames"); - - b.Navigation("ShopEntries"); - - b.Navigation("SlowmodeIgnoredRoles"); - - b.Navigation("SlowmodeIgnoredUsers"); - - b.Navigation("StreamRole"); - - b.Navigation("UnbanTimer"); - - b.Navigation("UnmuteTimers"); - - b.Navigation("UnroleTimer"); - - b.Navigation("VcRoleInfos"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Navigation("LogIgnores"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Navigation("Songs"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Navigation("Blacklist"); - - b.Navigation("Whitelist"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Navigation("CurrencyRewards"); - - b.Navigation("ExclusionList"); - - b.Navigation("RoleRewards"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/EllieBot/Migrations/PostgreSql/20241018004623_warn-split.cs b/src/EllieBot/Migrations/PostgreSql/20241018004623_warn-split.cs deleted file mode 100644 index cde80a2..0000000 --- a/src/EllieBot/Migrations/PostgreSql/20241018004623_warn-split.cs +++ /dev/null @@ -1,71 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace EllieBot.Migrations.PostgreSql -{ - /// - public partial class warnsplit : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "guildid", - table: "warningpunishment", - type: "numeric(20,0)", - nullable: false, - defaultValue: 0m); - - MigrationQueries.AddGuildIdsToWarningPunishment(migrationBuilder); - - migrationBuilder.DropForeignKey( - name: "fk_warningpunishment_guildconfigs_guildconfigid", - table: "warningpunishment"); - - migrationBuilder.DropIndex( - name: "ix_warningpunishment_guildconfigid", - table: "warningpunishment"); - - migrationBuilder.DropColumn( - name: "guildconfigid", - table: "warningpunishment"); - - migrationBuilder.AddUniqueConstraint( - name: "ak_warningpunishment_guildid_count", - table: "warningpunishment", - columns: new[] { "guildid", "count" }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropUniqueConstraint( - name: "ak_warningpunishment_guildid_count", - table: "warningpunishment"); - - migrationBuilder.DropColumn( - name: "guildid", - table: "warningpunishment"); - - migrationBuilder.AddColumn( - name: "guildconfigid", - table: "warningpunishment", - type: "integer", - nullable: true); - - migrationBuilder.CreateIndex( - name: "ix_warningpunishment_guildconfigid", - table: "warningpunishment", - column: "guildconfigid"); - - migrationBuilder.AddForeignKey( - name: "fk_warningpunishment_guildconfigs_guildconfigid", - table: "warningpunishment", - column: "guildconfigid", - principalTable: "guildconfigs", - principalColumn: "id", - onDelete: ReferentialAction.Cascade); - } - } -} \ No newline at end of file diff --git a/src/EllieBot/Migrations/PostgreSql/20241028033704_ncanvas.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20241028033704_ncanvas.Designer.cs deleted file mode 100644 index 995fd46..0000000 --- a/src/EllieBot/Migrations/PostgreSql/20241028033704_ncanvas.Designer.cs +++ /dev/null @@ -1,3824 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using EllieBot.Db; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace EllieBot.Migrations.PostgreSql -{ - [DbContext(typeof(PostgreSqlContext))] - [Migration("20241028033704_ncanvas")] - partial class ncanvas - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.8") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .HasColumnType("integer") - .HasColumnName("action"); - - b.Property("ActionDurationMinutes") - .HasColumnType("integer") - .HasColumnName("actiondurationminutes"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("MinAge") - .HasColumnType("interval") - .HasColumnName("minage"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_antialtsetting"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_antialtsetting_guildconfigid"); - - b.ToTable("antialtsetting", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .HasColumnType("integer") - .HasColumnName("action"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("PunishDuration") - .HasColumnType("integer") - .HasColumnName("punishduration"); - - b.Property("Seconds") - .HasColumnType("integer") - .HasColumnName("seconds"); - - b.Property("UserThreshold") - .HasColumnType("integer") - .HasColumnName("userthreshold"); - - b.HasKey("Id") - .HasName("pk_antiraidsetting"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_antiraidsetting_guildconfigid"); - - b.ToTable("antiraidsetting", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AntiSpamSettingId") - .HasColumnType("integer") - .HasColumnName("antispamsettingid"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.HasKey("Id") - .HasName("pk_antispamignore"); - - b.HasIndex("AntiSpamSettingId") - .HasDatabaseName("ix_antispamignore_antispamsettingid"); - - b.ToTable("antispamignore", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .HasColumnType("integer") - .HasColumnName("action"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("MessageThreshold") - .HasColumnType("integer") - .HasColumnName("messagethreshold"); - - b.Property("MuteTime") - .HasColumnType("integer") - .HasColumnName("mutetime"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_antispamsetting"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_antispamsetting_guildconfigid"); - - b.ToTable("antispamsetting", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_todosarchive"); - - b.ToTable("todosarchive", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoCommand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("ChannelName") - .HasColumnType("text") - .HasColumnName("channelname"); - - b.Property("CommandText") - .HasColumnType("text") - .HasColumnName("commandtext"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("GuildName") - .HasColumnType("text") - .HasColumnName("guildname"); - - b.Property("Interval") - .HasColumnType("integer") - .HasColumnName("interval"); - - b.Property("VoiceChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("voicechannelid"); - - b.Property("VoiceChannelName") - .HasColumnType("text") - .HasColumnName("voicechannelname"); - - b.HasKey("Id") - .HasName("pk_autocommands"); - - b.ToTable("autocommands", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoPublishChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.HasKey("Id") - .HasName("pk_autopublishchannel"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_autopublishchannel_guildid"); - - b.ToTable("autopublishchannel", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoDelete") - .HasColumnType("boolean") - .HasColumnName("autodelete"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.HasKey("Id") - .HasName("pk_autotranslatechannels"); - - b.HasIndex("ChannelId") - .IsUnique() - .HasDatabaseName("ix_autotranslatechannels_channelid"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_autotranslatechannels_guildid"); - - b.ToTable("autotranslatechannels", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("integer") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Source") - .HasColumnType("text") - .HasColumnName("source"); - - b.Property("Target") - .HasColumnType("text") - .HasColumnName("target"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_autotranslateusers"); - - b.HasAlternateKey("ChannelId", "UserId") - .HasName("ak_autotranslateusers_channelid_userid"); - - b.ToTable("autotranslateusers", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BanTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("PruneDays") - .HasColumnType("integer") - .HasColumnName("prunedays"); - - b.Property("Text") - .HasColumnType("text") - .HasColumnName("text"); - - b.HasKey("Id") - .HasName("pk_bantemplates"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_bantemplates_guildid"); - - b.ToTable("bantemplates", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Balance") - .HasColumnType("bigint") - .HasColumnName("balance"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_bankusers"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("ix_bankusers_userid"); - - b.ToTable("bankusers", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BlacklistEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ItemId") - .HasColumnType("numeric(20,0)") - .HasColumnName("itemid"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_blacklist"); - - b.ToTable("blacklist", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.Property("ClubId") - .HasColumnType("integer") - .HasColumnName("clubid"); - - b.Property("UserId") - .HasColumnType("integer") - .HasColumnName("userid"); - - b.HasKey("ClubId", "UserId") - .HasName("pk_clubapplicants"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_clubapplicants_userid"); - - b.ToTable("clubapplicants", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.Property("ClubId") - .HasColumnType("integer") - .HasColumnName("clubid"); - - b.Property("UserId") - .HasColumnType("integer") - .HasColumnName("userid"); - - b.HasKey("ClubId", "UserId") - .HasName("pk_clubbans"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_clubbans_userid"); - - b.ToTable("clubbans", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Description") - .HasColumnType("text") - .HasColumnName("description"); - - b.Property("ImageUrl") - .HasColumnType("text") - .HasColumnName("imageurl"); - - b.Property("Name") - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("name"); - - b.Property("OwnerId") - .HasColumnType("integer") - .HasColumnName("ownerid"); - - b.Property("Xp") - .HasColumnType("integer") - .HasColumnName("xp"); - - b.HasKey("Id") - .HasName("pk_clubs"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_clubs_name"); - - b.HasIndex("OwnerId") - .IsUnique() - .HasDatabaseName("ix_clubs_ownerid"); - - b.ToTable("clubs", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Mapping") - .HasColumnType("text") - .HasColumnName("mapping"); - - b.Property("Trigger") - .HasColumnType("text") - .HasColumnName("trigger"); - - b.HasKey("Id") - .HasName("pk_commandalias"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_commandalias_guildconfigid"); - - b.ToTable("commandalias", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandCooldown", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CommandName") - .HasColumnType("text") - .HasColumnName("commandname"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Seconds") - .HasColumnType("integer") - .HasColumnName("seconds"); - - b.HasKey("Id") - .HasName("pk_commandcooldown"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_commandcooldown_guildconfigid"); - - b.ToTable("commandcooldown", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CurrencyTransaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("bigint") - .HasColumnName("amount"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Extra") - .IsRequired() - .HasColumnType("text") - .HasColumnName("extra"); - - b.Property("Note") - .HasColumnType("text") - .HasColumnName("note"); - - b.Property("OtherId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") - .HasColumnName("otherid") - .HasDefaultValueSql("NULL"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text") - .HasColumnName("type"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_currencytransactions"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_currencytransactions_userid"); - - b.ToTable("currencytransactions", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("State") - .HasColumnType("boolean") - .HasColumnName("state"); - - b.HasKey("Id") - .HasName("pk_delmsgoncmdchannel"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); - - b.ToTable("delmsgoncmdchannel", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordPermOverride", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Command") - .HasColumnType("text") - .HasColumnName("command"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Perm") - .HasColumnType("numeric(20,0)") - .HasColumnName("perm"); - - b.HasKey("Id") - .HasName("pk_discordpermoverrides"); - - b.HasIndex("GuildId", "Command") - .IsUnique() - .HasDatabaseName("ix_discordpermoverrides_guildid_command"); - - b.ToTable("discordpermoverrides", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AvatarId") - .HasColumnType("text") - .HasColumnName("avatarid"); - - b.Property("ClubId") - .HasColumnType("integer") - .HasColumnName("clubid"); - - b.Property("CurrencyAmount") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasDefaultValue(0L) - .HasColumnName("currencyamount"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Discriminator") - .HasColumnType("text") - .HasColumnName("discriminator"); - - b.Property("IsClubAdmin") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("isclubadmin"); - - b.Property("NotifyOnLevelUp") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("notifyonlevelup"); - - b.Property("TotalXp") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasDefaultValue(0L) - .HasColumnName("totalxp"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); - - b.HasKey("Id") - .HasName("pk_discorduser"); - - b.HasAlternateKey("UserId") - .HasName("ak_discorduser_userid"); - - b.HasIndex("ClubId") - .HasDatabaseName("ix_discorduser_clubid"); - - b.HasIndex("CurrencyAmount") - .HasDatabaseName("ix_discorduser_currencyamount"); - - b.HasIndex("TotalXp") - .HasDatabaseName("ix_discorduser_totalxp"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_discorduser_userid"); - - b.HasIndex("Username") - .HasDatabaseName("ix_discorduser_username"); - - b.ToTable("discorduser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ItemId") - .HasColumnType("numeric(20,0)") - .HasColumnName("itemid"); - - b.Property("ItemType") - .HasColumnType("integer") - .HasColumnName("itemtype"); - - b.Property("XpSettingsId") - .HasColumnType("integer") - .HasColumnName("xpsettingsid"); - - b.HasKey("Id") - .HasName("pk_excludeditem"); - - b.HasIndex("XpSettingsId") - .HasDatabaseName("ix_excludeditem_xpsettingsid"); - - b.ToTable("excludeditem", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text") - .HasColumnName("url"); - - b.HasKey("Id") - .HasName("pk_feedsub"); - - b.HasAlternateKey("GuildConfigId", "Url") - .HasName("ak_feedsub_guildconfigid_url"); - - b.ToTable("feedsub", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.HasKey("Id") - .HasName("pk_filterchannelid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filterchannelid_guildconfigid"); - - b.ToTable("filterchannelid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.HasKey("Id") - .HasName("pk_filterlinkschannelid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); - - b.ToTable("filterlinkschannelid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.HasKey("Id") - .HasName("pk_filterwordschannelid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); - - b.ToTable("filterwordschannelid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Word") - .HasColumnType("text") - .HasColumnName("word"); - - b.HasKey("Id") - .HasName("pk_filteredword"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filteredword_guildconfigid"); - - b.ToTable("filteredword", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); - - b.HasKey("Id") - .HasName("pk_followedstream"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_followedstream_guildconfigid"); - - b.ToTable("followedstream", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GCChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.HasKey("Id") - .HasName("pk_gcchannelid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_gcchannelid_guildconfigid"); - - b.ToTable("gcchannelid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GamblingStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Bet") - .HasColumnType("numeric") - .HasColumnName("bet"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Feature") - .HasColumnType("text") - .HasColumnName("feature"); - - b.Property("PaidOut") - .HasColumnType("numeric") - .HasColumnName("paidout"); - - b.HasKey("Id") - .HasName("pk_gamblingstats"); - - b.HasIndex("Feature") - .IsUnique() - .HasDatabaseName("ix_gamblingstats_feature"); - - b.ToTable("gamblingstats", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("EndsAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("endsat"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); - - b.HasKey("Id") - .HasName("pk_giveawaymodel"); - - b.ToTable("giveawaymodel", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("GiveawayId") - .HasColumnType("integer") - .HasColumnName("giveawayid"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_giveawayuser"); - - b.HasIndex("GiveawayId", "UserId") - .IsUnique() - .HasDatabaseName("ix_giveawayuser_giveawayid_userid"); - - b.ToTable("giveawayuser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("Number") - .HasColumnType("integer") - .HasColumnName("number"); - - b.HasKey("Id") - .HasName("pk_groupname"); - - b.HasIndex("GuildConfigId", "Number") - .IsUnique() - .HasDatabaseName("ix_groupname_guildconfigid_number"); - - b.ToTable("groupname", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GuildConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoAssignRoleIds") - .HasColumnType("text") - .HasColumnName("autoassignroleids"); - - b.Property("AutoDeleteSelfAssignedRoleMessages") - .HasColumnType("boolean") - .HasColumnName("autodeleteselfassignedrolemessages"); - - b.Property("CleverbotEnabled") - .HasColumnType("boolean") - .HasColumnName("cleverbotenabled"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("DeleteMessageOnCommand") - .HasColumnType("boolean") - .HasColumnName("deletemessageoncommand"); - - b.Property("DeleteStreamOnlineMessage") - .HasColumnType("boolean") - .HasColumnName("deletestreamonlinemessage"); - - b.Property("DisableGlobalExpressions") - .HasColumnType("boolean") - .HasColumnName("disableglobalexpressions"); - - b.Property("ExclusiveSelfAssignedRoles") - .HasColumnType("boolean") - .HasColumnName("exclusiveselfassignedroles"); - - b.Property("FilterInvites") - .HasColumnType("boolean") - .HasColumnName("filterinvites"); - - b.Property("FilterLinks") - .HasColumnType("boolean") - .HasColumnName("filterlinks"); - - b.Property("FilterWords") - .HasColumnType("boolean") - .HasColumnName("filterwords"); - - b.Property("GameVoiceChannel") - .HasColumnType("numeric(20,0)") - .HasColumnName("gamevoicechannel"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Locale") - .HasColumnType("text") - .HasColumnName("locale"); - - b.Property("MuteRoleName") - .HasColumnType("text") - .HasColumnName("muterolename"); - - b.Property("NotifyStreamOffline") - .HasColumnType("boolean") - .HasColumnName("notifystreamoffline"); - - b.Property("PermissionRole") - .HasColumnType("text") - .HasColumnName("permissionrole"); - - b.Property("Prefix") - .HasColumnType("text") - .HasColumnName("prefix"); - - b.Property("StickyRoles") - .HasColumnType("boolean") - .HasColumnName("stickyroles"); - - b.Property("TimeZoneId") - .HasColumnType("text") - .HasColumnName("timezoneid"); - - b.Property("VerboseErrors") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(true) - .HasColumnName("verboseerrors"); - - b.Property("VerbosePermissions") - .HasColumnType("boolean") - .HasColumnName("verbosepermissions"); - - b.Property("WarnExpireAction") - .HasColumnType("integer") - .HasColumnName("warnexpireaction"); - - b.Property("WarnExpireHours") - .HasColumnType("integer") - .HasColumnName("warnexpirehours"); - - b.Property("WarningsInitialized") - .HasColumnType("boolean") - .HasColumnName("warningsinitialized"); - - b.HasKey("Id") - .HasName("pk_guildconfigs"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_guildconfigs_guildid"); - - b.HasIndex("WarnExpireHours") - .HasDatabaseName("ix_guildconfigs_warnexpirehours"); - - b.ToTable("guildconfigs", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.HoneypotChannel", b => - { - b.Property("GuildId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.HasKey("GuildId") - .HasName("pk_honeypotchannels"); - - b.ToTable("honeypotchannels", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ItemType") - .HasColumnType("integer") - .HasColumnName("itemtype"); - - b.Property("LogItemId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logitemid"); - - b.Property("LogSettingId") - .HasColumnType("integer") - .HasColumnName("logsettingid"); - - b.HasKey("Id") - .HasName("pk_ignoredlogchannels"); - - b.HasIndex("LogSettingId", "LogItemId", "ItemType") - .IsUnique() - .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype"); - - b.ToTable("ignoredlogchannels", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ImageOnlyChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_imageonlychannels"); - - b.HasIndex("ChannelId") - .IsUnique() - .HasDatabaseName("ix_imageonlychannels_channelid"); - - b.ToTable("imageonlychannels", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelCreatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelcreatedid"); - - b.Property("ChannelDestroyedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channeldestroyedid"); - - b.Property("ChannelUpdatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelupdatedid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("LogOtherId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logotherid"); - - b.Property("LogUserPresenceId") - .HasColumnType("numeric(20,0)") - .HasColumnName("loguserpresenceid"); - - b.Property("LogVoicePresenceId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logvoicepresenceid"); - - b.Property("LogVoicePresenceTTSId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logvoicepresencettsid"); - - b.Property("LogWarnsId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logwarnsid"); - - b.Property("MessageDeletedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messagedeletedid"); - - b.Property("MessageUpdatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageupdatedid"); - - b.Property("ThreadCreatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("threadcreatedid"); - - b.Property("ThreadDeletedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("threaddeletedid"); - - b.Property("UserBannedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userbannedid"); - - b.Property("UserJoinedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userjoinedid"); - - b.Property("UserLeftId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userleftid"); - - b.Property("UserMutedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("usermutedid"); - - b.Property("UserUnbannedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userunbannedid"); - - b.Property("UserUpdatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userupdatedid"); - - b.HasKey("Id") - .HasName("pk_logsettings"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_logsettings_guildid"); - - b.ToTable("logsettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlayerSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoDisconnect") - .HasColumnType("boolean") - .HasColumnName("autodisconnect"); - - b.Property("AutoPlay") - .HasColumnType("boolean") - .HasColumnName("autoplay"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("MusicChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("musicchannelid"); - - b.Property("PlayerRepeat") - .HasColumnType("integer") - .HasColumnName("playerrepeat"); - - b.Property("QualityPreset") - .HasColumnType("integer") - .HasColumnName("qualitypreset"); - - b.Property("Volume") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(100) - .HasColumnName("volume"); - - b.HasKey("Id") - .HasName("pk_musicplayersettings"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_musicplayersettings_guildid"); - - b.ToTable("musicplayersettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Author") - .HasColumnType("text") - .HasColumnName("author"); - - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") - .HasColumnName("authorid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_musicplaylists"); - - b.ToTable("musicplaylists", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_muteduserid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_muteduserid_guildconfigid"); - - b.ToTable("muteduserid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.NCPixel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Color") - .HasColumnType("bigint") - .HasColumnName("color"); - - b.Property("OwnerId") - .HasColumnType("numeric(20,0)") - .HasColumnName("ownerid"); - - b.Property("Position") - .HasColumnType("integer") - .HasColumnName("position"); - - b.Property("Price") - .HasColumnType("bigint") - .HasColumnName("price"); - - b.Property("Text") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("text"); - - b.HasKey("Id") - .HasName("pk_ncpixel"); - - b.HasAlternateKey("Position") - .HasName("ak_ncpixel_position"); - - b.HasIndex("OwnerId") - .HasDatabaseName("ix_ncpixel_ownerid"); - - b.ToTable("ncpixel", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AllowTarget") - .HasColumnType("boolean") - .HasColumnName("allowtarget"); - - b.Property("AutoDeleteTrigger") - .HasColumnType("boolean") - .HasColumnName("autodeletetrigger"); - - b.Property("ContainsAnywhere") - .HasColumnType("boolean") - .HasColumnName("containsanywhere"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("DmResponse") - .HasColumnType("boolean") - .HasColumnName("dmresponse"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Reactions") - .HasColumnType("text") - .HasColumnName("reactions"); - - b.Property("Response") - .HasColumnType("text") - .HasColumnName("response"); - - b.Property("Trigger") - .HasColumnType("text") - .HasColumnName("trigger"); - - b.HasKey("Id") - .HasName("pk_expressions"); - - b.ToTable("expressions", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("AmountCents") - .HasColumnType("integer") - .HasColumnName("amountcents"); - - b.Property("LastCharge") - .HasColumnType("timestamp without time zone") - .HasColumnName("lastcharge"); - - b.Property("UniquePlatformUserId") - .HasColumnType("text") - .HasColumnName("uniqueplatformuserid"); - - b.Property("ValidThru") - .HasColumnType("timestamp without time zone") - .HasColumnName("validthru"); - - b.HasKey("UserId") - .HasName("pk_patrons"); - - b.HasIndex("UniquePlatformUserId") - .IsUnique() - .HasDatabaseName("ix_patrons_uniqueplatformuserid"); - - b.ToTable("patrons", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Index") - .HasColumnType("integer") - .HasColumnName("index"); - - b.Property("IsCustomCommand") - .HasColumnType("boolean") - .HasColumnName("iscustomcommand"); - - b.Property("PrimaryTarget") - .HasColumnType("integer") - .HasColumnName("primarytarget"); - - b.Property("PrimaryTargetId") - .HasColumnType("numeric(20,0)") - .HasColumnName("primarytargetid"); - - b.Property("SecondaryTarget") - .HasColumnType("integer") - .HasColumnName("secondarytarget"); - - b.Property("SecondaryTargetName") - .HasColumnType("text") - .HasColumnName("secondarytargetname"); - - b.Property("State") - .HasColumnType("boolean") - .HasColumnName("state"); - - b.HasKey("Id") - .HasName("pk_permissions"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_permissions_guildconfigid"); - - b.ToTable("permissions", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlantedCurrency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("bigint") - .HasColumnName("amount"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); - - b.Property("Password") - .HasColumnType("text") - .HasColumnName("password"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_plantedcurrency"); - - b.HasIndex("ChannelId") - .HasDatabaseName("ix_plantedcurrency_channelid"); - - b.HasIndex("MessageId") - .IsUnique() - .HasDatabaseName("ix_plantedcurrency_messageid"); - - b.ToTable("plantedcurrency", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("MusicPlaylistId") - .HasColumnType("integer") - .HasColumnName("musicplaylistid"); - - b.Property("Provider") - .HasColumnType("text") - .HasColumnName("provider"); - - b.Property("ProviderType") - .HasColumnType("integer") - .HasColumnName("providertype"); - - b.Property("Query") - .HasColumnType("text") - .HasColumnName("query"); - - b.Property("Title") - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("Uri") - .HasColumnType("text") - .HasColumnName("uri"); - - b.HasKey("Id") - .HasName("pk_playlistsong"); - - b.HasIndex("MusicPlaylistId") - .HasDatabaseName("ix_playlistsong_musicplaylistid"); - - b.ToTable("playlistsong", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Quote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") - .HasColumnName("authorid"); - - b.Property("AuthorName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("authorname"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("text") - .HasColumnName("keyword"); - - b.Property("Text") - .IsRequired() - .HasColumnType("text") - .HasColumnName("text"); - - b.HasKey("Id") - .HasName("pk_quotes"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_quotes_guildid"); - - b.HasIndex("Keyword") - .HasDatabaseName("ix_quotes_keyword"); - - b.ToTable("quotes", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ReactionRoleV2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Emote") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("emote"); - - b.Property("Group") - .HasColumnType("integer") - .HasColumnName("group"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("LevelReq") - .HasColumnType("integer") - .HasColumnName("levelreq"); - - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_reactionroles"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_reactionroles_guildid"); - - b.HasIndex("MessageId", "Emote") - .IsUnique() - .HasDatabaseName("ix_reactionroles_messageid_emote"); - - b.ToTable("reactionroles", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Reminder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("IsPrivate") - .HasColumnType("boolean") - .HasColumnName("isprivate"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("ServerId") - .HasColumnType("numeric(20,0)") - .HasColumnName("serverid"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("When") - .HasColumnType("timestamp without time zone") - .HasColumnName("when"); - - b.HasKey("Id") - .HasName("pk_reminders"); - - b.HasIndex("When") - .HasDatabaseName("ix_reminders_when"); - - b.ToTable("reminders", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Repeater", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Interval") - .HasColumnType("interval") - .HasColumnName("interval"); - - b.Property("LastMessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("lastmessageid"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("NoRedundant") - .HasColumnType("boolean") - .HasColumnName("noredundant"); - - b.Property("StartTimeOfDay") - .HasColumnType("interval") - .HasColumnName("starttimeofday"); - - b.HasKey("Id") - .HasName("pk_repeaters"); - - b.ToTable("repeaters", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.RewardedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AmountRewardedThisMonth") - .HasColumnType("bigint") - .HasColumnName("amountrewardedthismonth"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("LastReward") - .HasColumnType("timestamp without time zone") - .HasColumnName("lastreward"); - - b.Property("PlatformUserId") - .HasColumnType("text") - .HasColumnName("platformuserid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_rewardedusers"); - - b.HasIndex("PlatformUserId") - .IsUnique() - .HasDatabaseName("ix_rewardedusers_platformuserid"); - - b.ToTable("rewardedusers", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.RotatingPlayingStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Status") - .HasColumnType("text") - .HasColumnName("status"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_rotatingstatus"); - - b.ToTable("rotatingstatus", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SelfAssignedRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Group") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("group"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("LevelRequirement") - .HasColumnType("integer") - .HasColumnName("levelrequirement"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_selfassignableroles"); - - b.HasIndex("GuildId", "RoleId") - .IsUnique() - .HasDatabaseName("ix_selfassignableroles_guildid_roleid"); - - b.ToTable("selfassignableroles", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") - .HasColumnName("authorid"); - - b.Property("Command") - .HasColumnType("text") - .HasColumnName("command"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Index") - .HasColumnType("integer") - .HasColumnName("index"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("Price") - .HasColumnType("integer") - .HasColumnName("price"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("RoleName") - .HasColumnType("text") - .HasColumnName("rolename"); - - b.Property("RoleRequirement") - .HasColumnType("numeric(20,0)") - .HasColumnName("rolerequirement"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_shopentry"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_shopentry_guildconfigid"); - - b.ToTable("shopentry", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ShopEntryId") - .HasColumnType("integer") - .HasColumnName("shopentryid"); - - b.Property("Text") - .HasColumnType("text") - .HasColumnName("text"); - - b.HasKey("Id") - .HasName("pk_shopentryitem"); - - b.HasIndex("ShopEntryId") - .HasDatabaseName("ix_shopentryitem_shopentryid"); - - b.ToTable("shopentryitem", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_slowmodeignoredrole"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_slowmodeignoredrole_guildconfigid"); - - b.ToTable("slowmodeignoredrole", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_slowmodeignoreduser"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_slowmodeignoreduser_guildconfigid"); - - b.ToTable("slowmodeignoreduser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StickyRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("RoleIds") - .HasColumnType("text") - .HasColumnName("roleids"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_stickyroles"); - - b.HasIndex("GuildId", "UserId") - .IsUnique() - .HasDatabaseName("ix_stickyroles_guildid_userid"); - - b.ToTable("stickyroles", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamOnlineMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_streamonlinemessages"); - - b.ToTable("streamonlinemessages", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("StreamRoleSettingsId") - .HasColumnType("integer") - .HasColumnName("streamrolesettingsid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); - - b.HasKey("Id") - .HasName("pk_streamroleblacklisteduser"); - - b.HasIndex("StreamRoleSettingsId") - .HasDatabaseName("ix_streamroleblacklisteduser_streamrolesettingsid"); - - b.ToTable("streamroleblacklisteduser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddRoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("addroleid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Enabled") - .HasColumnType("boolean") - .HasColumnName("enabled"); - - b.Property("FromRoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("fromroleid"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Keyword") - .HasColumnType("text") - .HasColumnName("keyword"); - - b.HasKey("Id") - .HasName("pk_streamrolesettings"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_streamrolesettings_guildconfigid"); - - b.ToTable("streamrolesettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("StreamRoleSettingsId") - .HasColumnType("integer") - .HasColumnName("streamrolesettingsid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); - - b.HasKey("Id") - .HasName("pk_streamrolewhitelisteduser"); - - b.HasIndex("StreamRoleSettingsId") - .HasDatabaseName("ix_streamrolewhitelisteduser_streamrolesettingsid"); - - b.ToTable("streamrolewhitelisteduser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ArchiveId") - .HasColumnType("integer") - .HasColumnName("archiveid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("IsDone") - .HasColumnType("boolean") - .HasColumnName("isdone"); - - b.Property("Todo") - .HasColumnType("text") - .HasColumnName("todo"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_todos"); - - b.HasIndex("ArchiveId") - .HasDatabaseName("ix_todos_archiveid"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_todos_userid"); - - b.ToTable("todos", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("UnbanAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("unbanat"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_unbantimer"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_unbantimer_guildconfigid"); - - b.ToTable("unbantimer", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("UnmuteAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("unmuteat"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_unmutetimer"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_unmutetimer_guildconfigid"); - - b.ToTable("unmutetimer", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("UnbanAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("unbanat"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_unroletimer"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_unroletimer_guildconfigid"); - - b.ToTable("unroletimer", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UserXpStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AwardedXp") - .HasColumnType("bigint") - .HasColumnName("awardedxp"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("NotifyOnLevelUp") - .HasColumnType("integer") - .HasColumnName("notifyonlevelup"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Xp") - .HasColumnType("bigint") - .HasColumnName("xp"); - - b.HasKey("Id") - .HasName("pk_userxpstats"); - - b.HasIndex("AwardedXp") - .HasDatabaseName("ix_userxpstats_awardedxp"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_userxpstats_guildid"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_userxpstats_userid"); - - b.HasIndex("Xp") - .HasDatabaseName("ix_userxpstats_xp"); - - b.HasIndex("UserId", "GuildId") - .IsUnique() - .HasDatabaseName("ix_userxpstats_userid_guildid"); - - b.ToTable("userxpstats", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.VcRoleInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("VoiceChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("voicechannelid"); - - b.HasKey("Id") - .HasName("pk_vcroleinfo"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_vcroleinfo_guildconfigid"); - - b.ToTable("vcroleinfo", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AffinityId") - .HasColumnType("integer") - .HasColumnName("affinityid"); - - b.Property("ClaimerId") - .HasColumnType("integer") - .HasColumnName("claimerid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Price") - .HasColumnType("bigint") - .HasColumnName("price"); - - b.Property("WaifuId") - .HasColumnType("integer") - .HasColumnName("waifuid"); - - b.HasKey("Id") - .HasName("pk_waifuinfo"); - - b.HasIndex("AffinityId") - .HasDatabaseName("ix_waifuinfo_affinityid"); - - b.HasIndex("ClaimerId") - .HasDatabaseName("ix_waifuinfo_claimerid"); - - b.HasIndex("Price") - .HasDatabaseName("ix_waifuinfo_price"); - - b.HasIndex("WaifuId") - .IsUnique() - .HasDatabaseName("ix_waifuinfo_waifuid"); - - b.ToTable("waifuinfo", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ItemEmoji") - .HasColumnType("text") - .HasColumnName("itememoji"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("WaifuInfoId") - .HasColumnType("integer") - .HasColumnName("waifuinfoid"); - - b.HasKey("Id") - .HasName("pk_waifuitem"); - - b.HasIndex("WaifuInfoId") - .HasDatabaseName("ix_waifuitem_waifuinfoid"); - - b.ToTable("waifuitem", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("NewId") - .HasColumnType("integer") - .HasColumnName("newid"); - - b.Property("OldId") - .HasColumnType("integer") - .HasColumnName("oldid"); - - b.Property("UpdateType") - .HasColumnType("integer") - .HasColumnName("updatetype"); - - b.Property("UserId") - .HasColumnType("integer") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_waifuupdates"); - - b.HasIndex("NewId") - .HasDatabaseName("ix_waifuupdates_newid"); - - b.HasIndex("OldId") - .HasDatabaseName("ix_waifuupdates_oldid"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_waifuupdates_userid"); - - b.ToTable("waifuupdates", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Warning", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Forgiven") - .HasColumnType("boolean") - .HasColumnName("forgiven"); - - b.Property("ForgivenBy") - .HasColumnType("text") - .HasColumnName("forgivenby"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Moderator") - .HasColumnType("text") - .HasColumnName("moderator"); - - b.Property("Reason") - .HasColumnType("text") - .HasColumnName("reason"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Weight") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasDefaultValue(1L) - .HasColumnName("weight"); - - b.HasKey("Id") - .HasName("pk_warnings"); - - b.HasIndex("DateAdded") - .HasDatabaseName("ix_warnings_dateadded"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_warnings_guildid"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_warnings_userid"); - - b.ToTable("warnings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WarningPunishment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Count") - .HasColumnType("integer") - .HasColumnName("count"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Punishment") - .HasColumnType("integer") - .HasColumnName("punishment"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("Time") - .HasColumnType("integer") - .HasColumnName("time"); - - b.HasKey("Id") - .HasName("pk_warningpunishment"); - - b.HasAlternateKey("GuildId", "Count") - .HasName("ak_warningpunishment_guildid_count"); - - b.ToTable("warningpunishment", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("integer") - .HasColumnName("amount"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property("XpSettingsId") - .HasColumnType("integer") - .HasColumnName("xpsettingsid"); - - b.HasKey("Id") - .HasName("pk_xpcurrencyreward"); - - b.HasIndex("XpSettingsId") - .HasDatabaseName("ix_xpcurrencyreward_xpsettingsid"); - - b.ToTable("xpcurrencyreward", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property("Remove") - .HasColumnType("boolean") - .HasColumnName("remove"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("XpSettingsId") - .HasColumnType("integer") - .HasColumnName("xpsettingsid"); - - b.HasKey("Id") - .HasName("pk_xprolereward"); - - b.HasIndex("XpSettingsId", "Level") - .IsUnique() - .HasDatabaseName("ix_xprolereward_xpsettingsid_level"); - - b.ToTable("xprolereward", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("ServerExcluded") - .HasColumnType("boolean") - .HasColumnName("serverexcluded"); - - b.HasKey("Id") - .HasName("pk_xpsettings"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_xpsettings_guildconfigid"); - - b.ToTable("xpsettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpShopOwnedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("IsUsing") - .HasColumnType("boolean") - .HasColumnName("isusing"); - - b.Property("ItemKey") - .IsRequired() - .HasColumnType("text") - .HasColumnName("itemkey"); - - b.Property("ItemType") - .HasColumnType("integer") - .HasColumnName("itemtype"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_xpshopowneditem"); - - b.HasIndex("UserId", "ItemType", "ItemKey") - .IsUnique() - .HasDatabaseName("ix_xpshopowneditem_userid_itemtype_itemkey"); - - b.ToTable("xpshopowneditem", (string)null); - }); - - modelBuilder.Entity("EllieBot.Services.GreetSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoDeleteTimer") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("autodeletetimer"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("GreetType") - .HasColumnType("integer") - .HasColumnName("greettype"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("isenabled"); - - b.Property("MessageText") - .HasColumnType("text") - .HasColumnName("messagetext"); - - b.HasKey("Id") - .HasName("pk_greetsettings"); - - b.HasIndex("GuildId", "GreetType") - .IsUnique() - .HasDatabaseName("ix_greetsettings_guildid_greettype"); - - b.ToTable("greetsettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiAltSetting") - .HasForeignKey("EllieBot.Db.Models.AntiAltSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiRaidSetting") - .HasForeignKey("EllieBot.Db.Models.AntiRaidSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.HasOne("EllieBot.Db.Models.AntiSpamSetting", null) - .WithMany("IgnoredChannels") - .HasForeignKey("AntiSpamSettingId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiSpamSetting") - .HasForeignKey("EllieBot.Db.Models.AntiSpamSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.HasOne("EllieBot.Db.Models.AutoTranslateChannel", "Channel") - .WithMany("Users") - .HasForeignKey("ChannelId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); - - b.Navigation("Channel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Applicants") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubapplicants_clubs_clubid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubapplicants_discorduser_userid"); - - b.Navigation("Club"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Bans") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubbans_clubs_clubid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubbans_discorduser_userid"); - - b.Navigation("Club"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Owner") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.ClubInfo", "OwnerId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("fk_clubs_discorduser_ownerid"); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandAliases") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandCooldown", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandCooldowns") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("DelMsgOnCmdChannels") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Members") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.NoAction) - .HasConstraintName("fk_discorduser_clubs_clubid"); - - b.Navigation("Club"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("ExclusionList") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("FeedSubs") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_feedsub_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterInvitesChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterLinksChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterWordsChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilteredWords") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FollowedStreams") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GCChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("GenerateCurrencyChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.HasOne("EllieBot.Db.Models.GiveawayModel", null) - .WithMany("Participants") - .HasForeignKey("GiveawayId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_giveawayuser_giveawaymodel_giveawayid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("SelfAssignableRoleGroupNames") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_groupname_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.HasOne("EllieBot.Db.Models.LogSetting", "LogSetting") - .WithMany("LogIgnores") - .HasForeignKey("LogSettingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_ignoredlogchannels_logsettings_logsettingid"); - - b.Navigation("LogSetting"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("MutedUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("Permissions") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.HasOne("EllieBot.Db.Models.MusicPlaylist", null) - .WithMany("Songs") - .HasForeignKey("MusicPlaylistId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("ShopEntries") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.HasOne("EllieBot.Db.Models.ShopEntry", null) - .WithMany("Items") - .HasForeignKey("ShopEntryId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredRoles") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Blacklist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesett~"); - - b.Navigation("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("StreamRole") - .HasForeignKey("EllieBot.Db.Models.StreamRoleSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Whitelist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesett~"); - - b.Navigation("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.HasOne("EllieBot.Db.Models.ArchivedTodoListModel", null) - .WithMany("Items") - .HasForeignKey("ArchiveId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_todos_todosarchive_archiveid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnbanTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnmuteTimers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnroleTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.VcRoleInfo", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("VcRoleInfos") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Affinity") - .WithMany() - .HasForeignKey("AffinityId") - .HasConstraintName("fk_waifuinfo_discorduser_affinityid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Claimer") - .WithMany() - .HasForeignKey("ClaimerId") - .HasConstraintName("fk_waifuinfo_discorduser_claimerid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Waifu") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.WaifuInfo", "WaifuId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); - - b.Navigation("Affinity"); - - b.Navigation("Claimer"); - - b.Navigation("Waifu"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.HasOne("EllieBot.Db.Models.WaifuInfo", "WaifuInfo") - .WithMany("Items") - .HasForeignKey("WaifuInfoId") - .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); - - b.Navigation("WaifuInfo"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "New") - .WithMany() - .HasForeignKey("NewId") - .HasConstraintName("fk_waifuupdates_discorduser_newid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Old") - .WithMany() - .HasForeignKey("OldId") - .HasConstraintName("fk_waifuupdates_discorduser_oldid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_waifuupdates_discorduser_userid"); - - b.Navigation("New"); - - b.Navigation("Old"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("CurrencyRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_xpcurrencyreward_xpsettings_xpsettingsid"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("RoleRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_xprolereward_xpsettings_xpsettingsid"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("XpSettings") - .HasForeignKey("EllieBot.Db.Models.XpSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Navigation("IgnoredChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Navigation("Users"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Navigation("Applicants"); - - b.Navigation("Bans"); - - b.Navigation("Members"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Navigation("Participants"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GuildConfig", b => - { - b.Navigation("AntiAltSetting"); - - b.Navigation("AntiRaidSetting"); - - b.Navigation("AntiSpamSetting"); - - 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("GenerateCurrencyChannelIds"); - - b.Navigation("MutedUsers"); - - b.Navigation("Permissions"); - - b.Navigation("SelfAssignableRoleGroupNames"); - - b.Navigation("ShopEntries"); - - b.Navigation("SlowmodeIgnoredRoles"); - - b.Navigation("SlowmodeIgnoredUsers"); - - b.Navigation("StreamRole"); - - b.Navigation("UnbanTimer"); - - b.Navigation("UnmuteTimers"); - - b.Navigation("UnroleTimer"); - - b.Navigation("VcRoleInfos"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Navigation("LogIgnores"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Navigation("Songs"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Navigation("Blacklist"); - - b.Navigation("Whitelist"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Navigation("CurrencyRewards"); - - b.Navigation("ExclusionList"); - - b.Navigation("RoleRewards"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/EllieBot/Migrations/PostgreSql/20241028033704_ncanvas.cs b/src/EllieBot/Migrations/PostgreSql/20241028033704_ncanvas.cs deleted file mode 100644 index 0a1a175..0000000 --- a/src/EllieBot/Migrations/PostgreSql/20241028033704_ncanvas.cs +++ /dev/null @@ -1,54 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace EllieBot.Migrations.PostgreSql -{ - /// - public partial class ncanvas : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "ncpixel", - columns: table => new - { - id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - position = table.Column(type: "integer", nullable: false), - price = table.Column(type: "bigint", nullable: false), - ownerid = table.Column(type: "numeric(20,0)", nullable: false), - color = table.Column(type: "bigint", nullable: false), - text = table.Column(type: "character varying(256)", maxLength: 256, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_ncpixel", x => x.id); - table.UniqueConstraint("ak_ncpixel_position", x => x.position); - }); - - migrationBuilder.CreateIndex( - name: "ix_discorduser_username", - table: "discorduser", - column: "username"); - - migrationBuilder.CreateIndex( - name: "ix_ncpixel_ownerid", - table: "ncpixel", - column: "ownerid"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "ncpixel"); - - migrationBuilder.DropIndex( - name: "ix_discorduser_username", - table: "discorduser"); - } - } -} diff --git a/src/EllieBot/Migrations/PostgreSql/20241102022956_no-discrim-and-flag-translate.cs b/src/EllieBot/Migrations/PostgreSql/20241102022956_no-discrim-and-flag-translate.cs deleted file mode 100644 index ca32adb..0000000 --- a/src/EllieBot/Migrations/PostgreSql/20241102022956_no-discrim-and-flag-translate.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace EllieBot.Migrations.PostgreSql -{ - /// - public partial class nodiscrimandflagtranslate : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - MigrationQueries.UpdateUsernames(migrationBuilder); - - migrationBuilder.DropColumn( - name: "discriminator", - table: "discorduser"); - - migrationBuilder.CreateTable( - name: "flagtranslatechannel", - 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), - dateadded = table.Column(type: "timestamp without time zone", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("pk_flagtranslatechannel", x => x.id); - }); - - migrationBuilder.CreateIndex( - name: "ix_flagtranslatechannel_guildid_channelid", - table: "flagtranslatechannel", - columns: new[] { "guildid", "channelid" }, - unique: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "flagtranslatechannel"); - - migrationBuilder.AddColumn( - name: "discriminator", - table: "discorduser", - type: "text", - nullable: true); - } - } -} diff --git a/src/EllieBot/Migrations/PostgreSql/20241105024753_betstats.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20241105024753_betstats.Designer.cs deleted file mode 100644 index 685e80e..0000000 --- a/src/EllieBot/Migrations/PostgreSql/20241105024753_betstats.Designer.cs +++ /dev/null @@ -1,3902 +0,0 @@ -// -using System; -using EllieBot.Db; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace EllieBot.Migrations.PostgreSql -{ - [DbContext(typeof(PostgreSqlContext))] - [Migration("20241105024753_betstats")] - partial class betstats - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.8") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .HasColumnType("integer") - .HasColumnName("action"); - - b.Property("ActionDurationMinutes") - .HasColumnType("integer") - .HasColumnName("actiondurationminutes"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("MinAge") - .HasColumnType("interval") - .HasColumnName("minage"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_antialtsetting"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_antialtsetting_guildconfigid"); - - b.ToTable("antialtsetting", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .HasColumnType("integer") - .HasColumnName("action"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("PunishDuration") - .HasColumnType("integer") - .HasColumnName("punishduration"); - - b.Property("Seconds") - .HasColumnType("integer") - .HasColumnName("seconds"); - - b.Property("UserThreshold") - .HasColumnType("integer") - .HasColumnName("userthreshold"); - - b.HasKey("Id") - .HasName("pk_antiraidsetting"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_antiraidsetting_guildconfigid"); - - b.ToTable("antiraidsetting", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AntiSpamSettingId") - .HasColumnType("integer") - .HasColumnName("antispamsettingid"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.HasKey("Id") - .HasName("pk_antispamignore"); - - b.HasIndex("AntiSpamSettingId") - .HasDatabaseName("ix_antispamignore_antispamsettingid"); - - b.ToTable("antispamignore", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .HasColumnType("integer") - .HasColumnName("action"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("MessageThreshold") - .HasColumnType("integer") - .HasColumnName("messagethreshold"); - - b.Property("MuteTime") - .HasColumnType("integer") - .HasColumnName("mutetime"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_antispamsetting"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_antispamsetting_guildconfigid"); - - b.ToTable("antispamsetting", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_todosarchive"); - - b.ToTable("todosarchive", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoCommand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("ChannelName") - .HasColumnType("text") - .HasColumnName("channelname"); - - b.Property("CommandText") - .HasColumnType("text") - .HasColumnName("commandtext"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("GuildName") - .HasColumnType("text") - .HasColumnName("guildname"); - - b.Property("Interval") - .HasColumnType("integer") - .HasColumnName("interval"); - - b.Property("VoiceChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("voicechannelid"); - - b.Property("VoiceChannelName") - .HasColumnType("text") - .HasColumnName("voicechannelname"); - - b.HasKey("Id") - .HasName("pk_autocommands"); - - b.ToTable("autocommands", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoPublishChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.HasKey("Id") - .HasName("pk_autopublishchannel"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_autopublishchannel_guildid"); - - b.ToTable("autopublishchannel", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoDelete") - .HasColumnType("boolean") - .HasColumnName("autodelete"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.HasKey("Id") - .HasName("pk_autotranslatechannels"); - - b.HasIndex("ChannelId") - .IsUnique() - .HasDatabaseName("ix_autotranslatechannels_channelid"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_autotranslatechannels_guildid"); - - b.ToTable("autotranslatechannels", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("integer") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Source") - .HasColumnType("text") - .HasColumnName("source"); - - b.Property("Target") - .HasColumnType("text") - .HasColumnName("target"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_autotranslateusers"); - - b.HasAlternateKey("ChannelId", "UserId") - .HasName("ak_autotranslateusers_channelid_userid"); - - b.ToTable("autotranslateusers", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BanTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("PruneDays") - .HasColumnType("integer") - .HasColumnName("prunedays"); - - b.Property("Text") - .HasColumnType("text") - .HasColumnName("text"); - - b.HasKey("Id") - .HasName("pk_bantemplates"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_bantemplates_guildid"); - - b.ToTable("bantemplates", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Balance") - .HasColumnType("bigint") - .HasColumnName("balance"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_bankusers"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("ix_bankusers_userid"); - - b.ToTable("bankusers", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BlacklistEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ItemId") - .HasColumnType("numeric(20,0)") - .HasColumnName("itemid"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_blacklist"); - - b.ToTable("blacklist", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.Property("ClubId") - .HasColumnType("integer") - .HasColumnName("clubid"); - - b.Property("UserId") - .HasColumnType("integer") - .HasColumnName("userid"); - - b.HasKey("ClubId", "UserId") - .HasName("pk_clubapplicants"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_clubapplicants_userid"); - - b.ToTable("clubapplicants", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.Property("ClubId") - .HasColumnType("integer") - .HasColumnName("clubid"); - - b.Property("UserId") - .HasColumnType("integer") - .HasColumnName("userid"); - - b.HasKey("ClubId", "UserId") - .HasName("pk_clubbans"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_clubbans_userid"); - - b.ToTable("clubbans", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Description") - .HasColumnType("text") - .HasColumnName("description"); - - b.Property("ImageUrl") - .HasColumnType("text") - .HasColumnName("imageurl"); - - b.Property("Name") - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("name"); - - b.Property("OwnerId") - .HasColumnType("integer") - .HasColumnName("ownerid"); - - b.Property("Xp") - .HasColumnType("integer") - .HasColumnName("xp"); - - b.HasKey("Id") - .HasName("pk_clubs"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_clubs_name"); - - b.HasIndex("OwnerId") - .IsUnique() - .HasDatabaseName("ix_clubs_ownerid"); - - b.ToTable("clubs", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Mapping") - .HasColumnType("text") - .HasColumnName("mapping"); - - b.Property("Trigger") - .HasColumnType("text") - .HasColumnName("trigger"); - - b.HasKey("Id") - .HasName("pk_commandalias"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_commandalias_guildconfigid"); - - b.ToTable("commandalias", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandCooldown", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CommandName") - .HasColumnType("text") - .HasColumnName("commandname"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Seconds") - .HasColumnType("integer") - .HasColumnName("seconds"); - - b.HasKey("Id") - .HasName("pk_commandcooldown"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_commandcooldown_guildconfigid"); - - b.ToTable("commandcooldown", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CurrencyTransaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("bigint") - .HasColumnName("amount"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Extra") - .IsRequired() - .HasColumnType("text") - .HasColumnName("extra"); - - b.Property("Note") - .HasColumnType("text") - .HasColumnName("note"); - - b.Property("OtherId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") - .HasColumnName("otherid") - .HasDefaultValueSql("NULL"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text") - .HasColumnName("type"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_currencytransactions"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_currencytransactions_userid"); - - b.ToTable("currencytransactions", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("State") - .HasColumnType("boolean") - .HasColumnName("state"); - - b.HasKey("Id") - .HasName("pk_delmsgoncmdchannel"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); - - b.ToTable("delmsgoncmdchannel", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordPermOverride", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Command") - .HasColumnType("text") - .HasColumnName("command"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Perm") - .HasColumnType("numeric(20,0)") - .HasColumnName("perm"); - - b.HasKey("Id") - .HasName("pk_discordpermoverrides"); - - b.HasIndex("GuildId", "Command") - .IsUnique() - .HasDatabaseName("ix_discordpermoverrides_guildid_command"); - - b.ToTable("discordpermoverrides", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AvatarId") - .HasColumnType("text") - .HasColumnName("avatarid"); - - b.Property("ClubId") - .HasColumnType("integer") - .HasColumnName("clubid"); - - b.Property("CurrencyAmount") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasDefaultValue(0L) - .HasColumnName("currencyamount"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("IsClubAdmin") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("isclubadmin"); - - b.Property("NotifyOnLevelUp") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("notifyonlevelup"); - - b.Property("TotalXp") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasDefaultValue(0L) - .HasColumnName("totalxp"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); - - b.HasKey("Id") - .HasName("pk_discorduser"); - - b.HasAlternateKey("UserId") - .HasName("ak_discorduser_userid"); - - b.HasIndex("ClubId") - .HasDatabaseName("ix_discorduser_clubid"); - - b.HasIndex("CurrencyAmount") - .HasDatabaseName("ix_discorduser_currencyamount"); - - b.HasIndex("TotalXp") - .HasDatabaseName("ix_discorduser_totalxp"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_discorduser_userid"); - - b.HasIndex("Username") - .HasDatabaseName("ix_discorduser_username"); - - b.ToTable("discorduser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AllowTarget") - .HasColumnType("boolean") - .HasColumnName("allowtarget"); - - b.Property("AutoDeleteTrigger") - .HasColumnType("boolean") - .HasColumnName("autodeletetrigger"); - - b.Property("ContainsAnywhere") - .HasColumnType("boolean") - .HasColumnName("containsanywhere"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("DmResponse") - .HasColumnType("boolean") - .HasColumnName("dmresponse"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Reactions") - .HasColumnType("text") - .HasColumnName("reactions"); - - b.Property("Response") - .HasColumnType("text") - .HasColumnName("response"); - - b.Property("Trigger") - .HasColumnType("text") - .HasColumnName("trigger"); - - b.HasKey("Id") - .HasName("pk_expressions"); - - b.ToTable("expressions", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ItemId") - .HasColumnType("numeric(20,0)") - .HasColumnName("itemid"); - - b.Property("ItemType") - .HasColumnType("integer") - .HasColumnName("itemtype"); - - b.Property("XpSettingsId") - .HasColumnType("integer") - .HasColumnName("xpsettingsid"); - - b.HasKey("Id") - .HasName("pk_excludeditem"); - - b.HasIndex("XpSettingsId") - .HasDatabaseName("ix_excludeditem_xpsettingsid"); - - b.ToTable("excludeditem", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text") - .HasColumnName("url"); - - b.HasKey("Id") - .HasName("pk_feedsub"); - - b.HasAlternateKey("GuildConfigId", "Url") - .HasName("ak_feedsub_guildconfigid_url"); - - b.ToTable("feedsub", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.HasKey("Id") - .HasName("pk_filterchannelid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filterchannelid_guildconfigid"); - - b.ToTable("filterchannelid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.HasKey("Id") - .HasName("pk_filterlinkschannelid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); - - b.ToTable("filterlinkschannelid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.HasKey("Id") - .HasName("pk_filterwordschannelid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); - - b.ToTable("filterwordschannelid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Word") - .HasColumnType("text") - .HasColumnName("word"); - - b.HasKey("Id") - .HasName("pk_filteredword"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filteredword_guildconfigid"); - - b.ToTable("filteredword", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FlagTranslateChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.HasKey("Id") - .HasName("pk_flagtranslatechannel"); - - b.HasIndex("GuildId", "ChannelId") - .IsUnique() - .HasDatabaseName("ix_flagtranslatechannel_guildid_channelid"); - - b.ToTable("flagtranslatechannel", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); - - b.HasKey("Id") - .HasName("pk_followedstream"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_followedstream_guildconfigid"); - - b.ToTable("followedstream", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GCChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.HasKey("Id") - .HasName("pk_gcchannelid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_gcchannelid_guildconfigid"); - - b.ToTable("gcchannelid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GamblingStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Bet") - .HasColumnType("numeric") - .HasColumnName("bet"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Feature") - .HasColumnType("text") - .HasColumnName("feature"); - - b.Property("PaidOut") - .HasColumnType("numeric") - .HasColumnName("paidout"); - - b.HasKey("Id") - .HasName("pk_gamblingstats"); - - b.HasIndex("Feature") - .IsUnique() - .HasDatabaseName("ix_gamblingstats_feature"); - - b.ToTable("gamblingstats", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("EndsAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("endsat"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); - - b.HasKey("Id") - .HasName("pk_giveawaymodel"); - - b.ToTable("giveawaymodel", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("GiveawayId") - .HasColumnType("integer") - .HasColumnName("giveawayid"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_giveawayuser"); - - b.HasIndex("GiveawayId", "UserId") - .IsUnique() - .HasDatabaseName("ix_giveawayuser_giveawayid_userid"); - - b.ToTable("giveawayuser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("Number") - .HasColumnType("integer") - .HasColumnName("number"); - - b.HasKey("Id") - .HasName("pk_groupname"); - - b.HasIndex("GuildConfigId", "Number") - .IsUnique() - .HasDatabaseName("ix_groupname_guildconfigid_number"); - - b.ToTable("groupname", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GuildConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoAssignRoleIds") - .HasColumnType("text") - .HasColumnName("autoassignroleids"); - - b.Property("AutoDeleteSelfAssignedRoleMessages") - .HasColumnType("boolean") - .HasColumnName("autodeleteselfassignedrolemessages"); - - b.Property("CleverbotEnabled") - .HasColumnType("boolean") - .HasColumnName("cleverbotenabled"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("DeleteMessageOnCommand") - .HasColumnType("boolean") - .HasColumnName("deletemessageoncommand"); - - b.Property("DeleteStreamOnlineMessage") - .HasColumnType("boolean") - .HasColumnName("deletestreamonlinemessage"); - - b.Property("DisableGlobalExpressions") - .HasColumnType("boolean") - .HasColumnName("disableglobalexpressions"); - - b.Property("ExclusiveSelfAssignedRoles") - .HasColumnType("boolean") - .HasColumnName("exclusiveselfassignedroles"); - - b.Property("FilterInvites") - .HasColumnType("boolean") - .HasColumnName("filterinvites"); - - b.Property("FilterLinks") - .HasColumnType("boolean") - .HasColumnName("filterlinks"); - - b.Property("FilterWords") - .HasColumnType("boolean") - .HasColumnName("filterwords"); - - b.Property("GameVoiceChannel") - .HasColumnType("numeric(20,0)") - .HasColumnName("gamevoicechannel"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Locale") - .HasColumnType("text") - .HasColumnName("locale"); - - b.Property("MuteRoleName") - .HasColumnType("text") - .HasColumnName("muterolename"); - - b.Property("NotifyStreamOffline") - .HasColumnType("boolean") - .HasColumnName("notifystreamoffline"); - - b.Property("PermissionRole") - .HasColumnType("text") - .HasColumnName("permissionrole"); - - b.Property("Prefix") - .HasColumnType("text") - .HasColumnName("prefix"); - - b.Property("StickyRoles") - .HasColumnType("boolean") - .HasColumnName("stickyroles"); - - b.Property("TimeZoneId") - .HasColumnType("text") - .HasColumnName("timezoneid"); - - b.Property("VerboseErrors") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(true) - .HasColumnName("verboseerrors"); - - b.Property("VerbosePermissions") - .HasColumnType("boolean") - .HasColumnName("verbosepermissions"); - - b.Property("WarnExpireAction") - .HasColumnType("integer") - .HasColumnName("warnexpireaction"); - - b.Property("WarnExpireHours") - .HasColumnType("integer") - .HasColumnName("warnexpirehours"); - - b.Property("WarningsInitialized") - .HasColumnType("boolean") - .HasColumnName("warningsinitialized"); - - b.HasKey("Id") - .HasName("pk_guildconfigs"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_guildconfigs_guildid"); - - b.HasIndex("WarnExpireHours") - .HasDatabaseName("ix_guildconfigs_warnexpirehours"); - - b.ToTable("guildconfigs", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.HoneypotChannel", b => - { - b.Property("GuildId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.HasKey("GuildId") - .HasName("pk_honeypotchannels"); - - b.ToTable("honeypotchannels", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ItemType") - .HasColumnType("integer") - .HasColumnName("itemtype"); - - b.Property("LogItemId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logitemid"); - - b.Property("LogSettingId") - .HasColumnType("integer") - .HasColumnName("logsettingid"); - - b.HasKey("Id") - .HasName("pk_ignoredlogchannels"); - - b.HasIndex("LogSettingId", "LogItemId", "ItemType") - .IsUnique() - .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype"); - - b.ToTable("ignoredlogchannels", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ImageOnlyChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_imageonlychannels"); - - b.HasIndex("ChannelId") - .IsUnique() - .HasDatabaseName("ix_imageonlychannels_channelid"); - - b.ToTable("imageonlychannels", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelCreatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelcreatedid"); - - b.Property("ChannelDestroyedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channeldestroyedid"); - - b.Property("ChannelUpdatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelupdatedid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("LogOtherId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logotherid"); - - b.Property("LogUserPresenceId") - .HasColumnType("numeric(20,0)") - .HasColumnName("loguserpresenceid"); - - b.Property("LogVoicePresenceId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logvoicepresenceid"); - - b.Property("LogVoicePresenceTTSId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logvoicepresencettsid"); - - b.Property("LogWarnsId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logwarnsid"); - - b.Property("MessageDeletedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messagedeletedid"); - - b.Property("MessageUpdatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageupdatedid"); - - b.Property("ThreadCreatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("threadcreatedid"); - - b.Property("ThreadDeletedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("threaddeletedid"); - - b.Property("UserBannedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userbannedid"); - - b.Property("UserJoinedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userjoinedid"); - - b.Property("UserLeftId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userleftid"); - - b.Property("UserMutedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("usermutedid"); - - b.Property("UserUnbannedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userunbannedid"); - - b.Property("UserUpdatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userupdatedid"); - - b.HasKey("Id") - .HasName("pk_logsettings"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_logsettings_guildid"); - - b.ToTable("logsettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlayerSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoDisconnect") - .HasColumnType("boolean") - .HasColumnName("autodisconnect"); - - b.Property("AutoPlay") - .HasColumnType("boolean") - .HasColumnName("autoplay"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("MusicChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("musicchannelid"); - - b.Property("PlayerRepeat") - .HasColumnType("integer") - .HasColumnName("playerrepeat"); - - b.Property("QualityPreset") - .HasColumnType("integer") - .HasColumnName("qualitypreset"); - - b.Property("Volume") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(100) - .HasColumnName("volume"); - - b.HasKey("Id") - .HasName("pk_musicplayersettings"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_musicplayersettings_guildid"); - - b.ToTable("musicplayersettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Author") - .HasColumnType("text") - .HasColumnName("author"); - - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") - .HasColumnName("authorid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_musicplaylists"); - - b.ToTable("musicplaylists", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_muteduserid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_muteduserid_guildconfigid"); - - b.ToTable("muteduserid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.NCPixel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Color") - .HasColumnType("bigint") - .HasColumnName("color"); - - b.Property("OwnerId") - .HasColumnType("numeric(20,0)") - .HasColumnName("ownerid"); - - b.Property("Position") - .HasColumnType("integer") - .HasColumnName("position"); - - b.Property("Price") - .HasColumnType("bigint") - .HasColumnName("price"); - - b.Property("Text") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("text"); - - b.HasKey("Id") - .HasName("pk_ncpixel"); - - b.HasAlternateKey("Position") - .HasName("ak_ncpixel_position"); - - b.HasIndex("OwnerId") - .HasDatabaseName("ix_ncpixel_ownerid"); - - b.ToTable("ncpixel", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("AmountCents") - .HasColumnType("integer") - .HasColumnName("amountcents"); - - b.Property("LastCharge") - .HasColumnType("timestamp without time zone") - .HasColumnName("lastcharge"); - - b.Property("UniquePlatformUserId") - .HasColumnType("text") - .HasColumnName("uniqueplatformuserid"); - - b.Property("ValidThru") - .HasColumnType("timestamp without time zone") - .HasColumnName("validthru"); - - b.HasKey("UserId") - .HasName("pk_patrons"); - - b.HasIndex("UniquePlatformUserId") - .IsUnique() - .HasDatabaseName("ix_patrons_uniqueplatformuserid"); - - b.ToTable("patrons", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Index") - .HasColumnType("integer") - .HasColumnName("index"); - - b.Property("IsCustomCommand") - .HasColumnType("boolean") - .HasColumnName("iscustomcommand"); - - b.Property("PrimaryTarget") - .HasColumnType("integer") - .HasColumnName("primarytarget"); - - b.Property("PrimaryTargetId") - .HasColumnType("numeric(20,0)") - .HasColumnName("primarytargetid"); - - b.Property("SecondaryTarget") - .HasColumnType("integer") - .HasColumnName("secondarytarget"); - - b.Property("SecondaryTargetName") - .HasColumnType("text") - .HasColumnName("secondarytargetname"); - - b.Property("State") - .HasColumnType("boolean") - .HasColumnName("state"); - - b.HasKey("Id") - .HasName("pk_permissions"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_permissions_guildconfigid"); - - b.ToTable("permissions", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlantedCurrency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("bigint") - .HasColumnName("amount"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); - - b.Property("Password") - .HasColumnType("text") - .HasColumnName("password"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_plantedcurrency"); - - b.HasIndex("ChannelId") - .HasDatabaseName("ix_plantedcurrency_channelid"); - - b.HasIndex("MessageId") - .IsUnique() - .HasDatabaseName("ix_plantedcurrency_messageid"); - - b.ToTable("plantedcurrency", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("MusicPlaylistId") - .HasColumnType("integer") - .HasColumnName("musicplaylistid"); - - b.Property("Provider") - .HasColumnType("text") - .HasColumnName("provider"); - - b.Property("ProviderType") - .HasColumnType("integer") - .HasColumnName("providertype"); - - b.Property("Query") - .HasColumnType("text") - .HasColumnName("query"); - - b.Property("Title") - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("Uri") - .HasColumnType("text") - .HasColumnName("uri"); - - b.HasKey("Id") - .HasName("pk_playlistsong"); - - b.HasIndex("MusicPlaylistId") - .HasDatabaseName("ix_playlistsong_musicplaylistid"); - - b.ToTable("playlistsong", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Quote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") - .HasColumnName("authorid"); - - b.Property("AuthorName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("authorname"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("text") - .HasColumnName("keyword"); - - b.Property("Text") - .IsRequired() - .HasColumnType("text") - .HasColumnName("text"); - - b.HasKey("Id") - .HasName("pk_quotes"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_quotes_guildid"); - - b.HasIndex("Keyword") - .HasDatabaseName("ix_quotes_keyword"); - - b.ToTable("quotes", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ReactionRoleV2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Emote") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("emote"); - - b.Property("Group") - .HasColumnType("integer") - .HasColumnName("group"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("LevelReq") - .HasColumnType("integer") - .HasColumnName("levelreq"); - - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_reactionroles"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_reactionroles_guildid"); - - b.HasIndex("MessageId", "Emote") - .IsUnique() - .HasDatabaseName("ix_reactionroles_messageid_emote"); - - b.ToTable("reactionroles", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Reminder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("IsPrivate") - .HasColumnType("boolean") - .HasColumnName("isprivate"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("ServerId") - .HasColumnType("numeric(20,0)") - .HasColumnName("serverid"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("When") - .HasColumnType("timestamp without time zone") - .HasColumnName("when"); - - b.HasKey("Id") - .HasName("pk_reminders"); - - b.HasIndex("When") - .HasDatabaseName("ix_reminders_when"); - - b.ToTable("reminders", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Repeater", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Interval") - .HasColumnType("interval") - .HasColumnName("interval"); - - b.Property("LastMessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("lastmessageid"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("NoRedundant") - .HasColumnType("boolean") - .HasColumnName("noredundant"); - - b.Property("StartTimeOfDay") - .HasColumnType("interval") - .HasColumnName("starttimeofday"); - - b.HasKey("Id") - .HasName("pk_repeaters"); - - b.ToTable("repeaters", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.RewardedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AmountRewardedThisMonth") - .HasColumnType("bigint") - .HasColumnName("amountrewardedthismonth"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("LastReward") - .HasColumnType("timestamp without time zone") - .HasColumnName("lastreward"); - - b.Property("PlatformUserId") - .HasColumnType("text") - .HasColumnName("platformuserid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_rewardedusers"); - - b.HasIndex("PlatformUserId") - .IsUnique() - .HasDatabaseName("ix_rewardedusers_platformuserid"); - - b.ToTable("rewardedusers", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.RotatingPlayingStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Status") - .HasColumnType("text") - .HasColumnName("status"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_rotatingstatus"); - - b.ToTable("rotatingstatus", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SelfAssignedRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Group") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("group"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("LevelRequirement") - .HasColumnType("integer") - .HasColumnName("levelrequirement"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_selfassignableroles"); - - b.HasIndex("GuildId", "RoleId") - .IsUnique() - .HasDatabaseName("ix_selfassignableroles_guildid_roleid"); - - b.ToTable("selfassignableroles", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") - .HasColumnName("authorid"); - - b.Property("Command") - .HasColumnType("text") - .HasColumnName("command"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Index") - .HasColumnType("integer") - .HasColumnName("index"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("Price") - .HasColumnType("integer") - .HasColumnName("price"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("RoleName") - .HasColumnType("text") - .HasColumnName("rolename"); - - b.Property("RoleRequirement") - .HasColumnType("numeric(20,0)") - .HasColumnName("rolerequirement"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_shopentry"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_shopentry_guildconfigid"); - - b.ToTable("shopentry", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ShopEntryId") - .HasColumnType("integer") - .HasColumnName("shopentryid"); - - b.Property("Text") - .HasColumnType("text") - .HasColumnName("text"); - - b.HasKey("Id") - .HasName("pk_shopentryitem"); - - b.HasIndex("ShopEntryId") - .HasDatabaseName("ix_shopentryitem_shopentryid"); - - b.ToTable("shopentryitem", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_slowmodeignoredrole"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_slowmodeignoredrole_guildconfigid"); - - b.ToTable("slowmodeignoredrole", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_slowmodeignoreduser"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_slowmodeignoreduser_guildconfigid"); - - b.ToTable("slowmodeignoreduser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StickyRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("RoleIds") - .HasColumnType("text") - .HasColumnName("roleids"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_stickyroles"); - - b.HasIndex("GuildId", "UserId") - .IsUnique() - .HasDatabaseName("ix_stickyroles_guildid_userid"); - - b.ToTable("stickyroles", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamOnlineMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_streamonlinemessages"); - - b.ToTable("streamonlinemessages", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("StreamRoleSettingsId") - .HasColumnType("integer") - .HasColumnName("streamrolesettingsid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); - - b.HasKey("Id") - .HasName("pk_streamroleblacklisteduser"); - - b.HasIndex("StreamRoleSettingsId") - .HasDatabaseName("ix_streamroleblacklisteduser_streamrolesettingsid"); - - b.ToTable("streamroleblacklisteduser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddRoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("addroleid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Enabled") - .HasColumnType("boolean") - .HasColumnName("enabled"); - - b.Property("FromRoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("fromroleid"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Keyword") - .HasColumnType("text") - .HasColumnName("keyword"); - - b.HasKey("Id") - .HasName("pk_streamrolesettings"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_streamrolesettings_guildconfigid"); - - b.ToTable("streamrolesettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("StreamRoleSettingsId") - .HasColumnType("integer") - .HasColumnName("streamrolesettingsid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); - - b.HasKey("Id") - .HasName("pk_streamrolewhitelisteduser"); - - b.HasIndex("StreamRoleSettingsId") - .HasDatabaseName("ix_streamrolewhitelisteduser_streamrolesettingsid"); - - b.ToTable("streamrolewhitelisteduser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ArchiveId") - .HasColumnType("integer") - .HasColumnName("archiveid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("IsDone") - .HasColumnType("boolean") - .HasColumnName("isdone"); - - b.Property("Todo") - .HasColumnType("text") - .HasColumnName("todo"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_todos"); - - b.HasIndex("ArchiveId") - .HasDatabaseName("ix_todos_archiveid"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_todos_userid"); - - b.ToTable("todos", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("UnbanAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("unbanat"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_unbantimer"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_unbantimer_guildconfigid"); - - b.ToTable("unbantimer", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("UnmuteAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("unmuteat"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_unmutetimer"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_unmutetimer_guildconfigid"); - - b.ToTable("unmutetimer", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("UnbanAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("unbanat"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_unroletimer"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_unroletimer_guildconfigid"); - - b.ToTable("unroletimer", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UserXpStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AwardedXp") - .HasColumnType("bigint") - .HasColumnName("awardedxp"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("NotifyOnLevelUp") - .HasColumnType("integer") - .HasColumnName("notifyonlevelup"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Xp") - .HasColumnType("bigint") - .HasColumnName("xp"); - - b.HasKey("Id") - .HasName("pk_userxpstats"); - - b.HasIndex("AwardedXp") - .HasDatabaseName("ix_userxpstats_awardedxp"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_userxpstats_guildid"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_userxpstats_userid"); - - b.HasIndex("Xp") - .HasDatabaseName("ix_userxpstats_xp"); - - b.HasIndex("UserId", "GuildId") - .IsUnique() - .HasDatabaseName("ix_userxpstats_userid_guildid"); - - b.ToTable("userxpstats", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.VcRoleInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("VoiceChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("voicechannelid"); - - b.HasKey("Id") - .HasName("pk_vcroleinfo"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_vcroleinfo_guildconfigid"); - - b.ToTable("vcroleinfo", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AffinityId") - .HasColumnType("integer") - .HasColumnName("affinityid"); - - b.Property("ClaimerId") - .HasColumnType("integer") - .HasColumnName("claimerid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Price") - .HasColumnType("bigint") - .HasColumnName("price"); - - b.Property("WaifuId") - .HasColumnType("integer") - .HasColumnName("waifuid"); - - b.HasKey("Id") - .HasName("pk_waifuinfo"); - - b.HasIndex("AffinityId") - .HasDatabaseName("ix_waifuinfo_affinityid"); - - b.HasIndex("ClaimerId") - .HasDatabaseName("ix_waifuinfo_claimerid"); - - b.HasIndex("Price") - .HasDatabaseName("ix_waifuinfo_price"); - - b.HasIndex("WaifuId") - .IsUnique() - .HasDatabaseName("ix_waifuinfo_waifuid"); - - b.ToTable("waifuinfo", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ItemEmoji") - .HasColumnType("text") - .HasColumnName("itememoji"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("WaifuInfoId") - .HasColumnType("integer") - .HasColumnName("waifuinfoid"); - - b.HasKey("Id") - .HasName("pk_waifuitem"); - - b.HasIndex("WaifuInfoId") - .HasDatabaseName("ix_waifuitem_waifuinfoid"); - - b.ToTable("waifuitem", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("NewId") - .HasColumnType("integer") - .HasColumnName("newid"); - - b.Property("OldId") - .HasColumnType("integer") - .HasColumnName("oldid"); - - b.Property("UpdateType") - .HasColumnType("integer") - .HasColumnName("updatetype"); - - b.Property("UserId") - .HasColumnType("integer") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_waifuupdates"); - - b.HasIndex("NewId") - .HasDatabaseName("ix_waifuupdates_newid"); - - b.HasIndex("OldId") - .HasDatabaseName("ix_waifuupdates_oldid"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_waifuupdates_userid"); - - b.ToTable("waifuupdates", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Warning", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Forgiven") - .HasColumnType("boolean") - .HasColumnName("forgiven"); - - b.Property("ForgivenBy") - .HasColumnType("text") - .HasColumnName("forgivenby"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Moderator") - .HasColumnType("text") - .HasColumnName("moderator"); - - b.Property("Reason") - .HasColumnType("text") - .HasColumnName("reason"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Weight") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasDefaultValue(1L) - .HasColumnName("weight"); - - b.HasKey("Id") - .HasName("pk_warnings"); - - b.HasIndex("DateAdded") - .HasDatabaseName("ix_warnings_dateadded"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_warnings_guildid"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_warnings_userid"); - - b.ToTable("warnings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WarningPunishment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Count") - .HasColumnType("integer") - .HasColumnName("count"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Punishment") - .HasColumnType("integer") - .HasColumnName("punishment"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("Time") - .HasColumnType("integer") - .HasColumnName("time"); - - b.HasKey("Id") - .HasName("pk_warningpunishment"); - - b.HasAlternateKey("GuildId", "Count") - .HasName("ak_warningpunishment_guildid_count"); - - b.ToTable("warningpunishment", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("integer") - .HasColumnName("amount"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property("XpSettingsId") - .HasColumnType("integer") - .HasColumnName("xpsettingsid"); - - b.HasKey("Id") - .HasName("pk_xpcurrencyreward"); - - b.HasIndex("XpSettingsId") - .HasDatabaseName("ix_xpcurrencyreward_xpsettingsid"); - - b.ToTable("xpcurrencyreward", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property("Remove") - .HasColumnType("boolean") - .HasColumnName("remove"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("XpSettingsId") - .HasColumnType("integer") - .HasColumnName("xpsettingsid"); - - b.HasKey("Id") - .HasName("pk_xprolereward"); - - b.HasIndex("XpSettingsId", "Level") - .IsUnique() - .HasDatabaseName("ix_xprolereward_xpsettingsid_level"); - - b.ToTable("xprolereward", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("ServerExcluded") - .HasColumnType("boolean") - .HasColumnName("serverexcluded"); - - b.HasKey("Id") - .HasName("pk_xpsettings"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_xpsettings_guildconfigid"); - - b.ToTable("xpsettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpShopOwnedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("IsUsing") - .HasColumnType("boolean") - .HasColumnName("isusing"); - - b.Property("ItemKey") - .IsRequired() - .HasColumnType("text") - .HasColumnName("itemkey"); - - b.Property("ItemType") - .HasColumnType("integer") - .HasColumnName("itemtype"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_xpshopowneditem"); - - b.HasIndex("UserId", "ItemType", "ItemKey") - .IsUnique() - .HasDatabaseName("ix_xpshopowneditem_userid_itemtype_itemkey"); - - b.ToTable("xpshopowneditem", (string)null); - }); - - modelBuilder.Entity("EllieBot.Services.GreetSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoDeleteTimer") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("autodeletetimer"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("GreetType") - .HasColumnType("integer") - .HasColumnName("greettype"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("isenabled"); - - b.Property("MessageText") - .HasColumnType("text") - .HasColumnName("messagetext"); - - b.HasKey("Id") - .HasName("pk_greetsettings"); - - b.HasIndex("GuildId", "GreetType") - .IsUnique() - .HasDatabaseName("ix_greetsettings_guildid_greettype"); - - b.ToTable("greetsettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Services.UserBetStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Game") - .HasColumnType("integer") - .HasColumnName("game"); - - b.Property("LoseCount") - .HasColumnType("bigint") - .HasColumnName("losecount"); - - b.Property("MaxBet") - .HasColumnType("bigint") - .HasColumnName("maxbet"); - - b.Property("MaxWin") - .HasColumnType("bigint") - .HasColumnName("maxwin"); - - b.Property("PaidOut") - .HasColumnType("numeric") - .HasColumnName("paidout"); - - b.Property("TotalBet") - .HasColumnType("numeric") - .HasColumnName("totalbet"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("WinCount") - .HasColumnType("bigint") - .HasColumnName("wincount"); - - b.HasKey("Id") - .HasName("pk_userbetstats"); - - b.HasIndex("UserId", "Game") - .IsUnique() - .HasDatabaseName("ix_userbetstats_userid_game"); - - b.ToTable("userbetstats", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiAltSetting") - .HasForeignKey("EllieBot.Db.Models.AntiAltSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiRaidSetting") - .HasForeignKey("EllieBot.Db.Models.AntiRaidSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.HasOne("EllieBot.Db.Models.AntiSpamSetting", null) - .WithMany("IgnoredChannels") - .HasForeignKey("AntiSpamSettingId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiSpamSetting") - .HasForeignKey("EllieBot.Db.Models.AntiSpamSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.HasOne("EllieBot.Db.Models.AutoTranslateChannel", "Channel") - .WithMany("Users") - .HasForeignKey("ChannelId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); - - b.Navigation("Channel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Applicants") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubapplicants_clubs_clubid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubapplicants_discorduser_userid"); - - b.Navigation("Club"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Bans") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubbans_clubs_clubid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubbans_discorduser_userid"); - - b.Navigation("Club"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Owner") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.ClubInfo", "OwnerId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("fk_clubs_discorduser_ownerid"); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandAliases") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandCooldown", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandCooldowns") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("DelMsgOnCmdChannels") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Members") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.NoAction) - .HasConstraintName("fk_discorduser_clubs_clubid"); - - b.Navigation("Club"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("ExclusionList") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("FeedSubs") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_feedsub_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterInvitesChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterLinksChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterWordsChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilteredWords") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FollowedStreams") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GCChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("GenerateCurrencyChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.HasOne("EllieBot.Db.Models.GiveawayModel", null) - .WithMany("Participants") - .HasForeignKey("GiveawayId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_giveawayuser_giveawaymodel_giveawayid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("SelfAssignableRoleGroupNames") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_groupname_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.HasOne("EllieBot.Db.Models.LogSetting", "LogSetting") - .WithMany("LogIgnores") - .HasForeignKey("LogSettingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_ignoredlogchannels_logsettings_logsettingid"); - - b.Navigation("LogSetting"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("MutedUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("Permissions") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.HasOne("EllieBot.Db.Models.MusicPlaylist", null) - .WithMany("Songs") - .HasForeignKey("MusicPlaylistId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("ShopEntries") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.HasOne("EllieBot.Db.Models.ShopEntry", null) - .WithMany("Items") - .HasForeignKey("ShopEntryId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredRoles") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Blacklist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesett~"); - - b.Navigation("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("StreamRole") - .HasForeignKey("EllieBot.Db.Models.StreamRoleSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Whitelist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesett~"); - - b.Navigation("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.HasOne("EllieBot.Db.Models.ArchivedTodoListModel", null) - .WithMany("Items") - .HasForeignKey("ArchiveId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_todos_todosarchive_archiveid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnbanTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnmuteTimers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnroleTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.VcRoleInfo", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("VcRoleInfos") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Affinity") - .WithMany() - .HasForeignKey("AffinityId") - .HasConstraintName("fk_waifuinfo_discorduser_affinityid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Claimer") - .WithMany() - .HasForeignKey("ClaimerId") - .HasConstraintName("fk_waifuinfo_discorduser_claimerid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Waifu") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.WaifuInfo", "WaifuId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); - - b.Navigation("Affinity"); - - b.Navigation("Claimer"); - - b.Navigation("Waifu"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.HasOne("EllieBot.Db.Models.WaifuInfo", "WaifuInfo") - .WithMany("Items") - .HasForeignKey("WaifuInfoId") - .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); - - b.Navigation("WaifuInfo"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "New") - .WithMany() - .HasForeignKey("NewId") - .HasConstraintName("fk_waifuupdates_discorduser_newid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Old") - .WithMany() - .HasForeignKey("OldId") - .HasConstraintName("fk_waifuupdates_discorduser_oldid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_waifuupdates_discorduser_userid"); - - b.Navigation("New"); - - b.Navigation("Old"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("CurrencyRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_xpcurrencyreward_xpsettings_xpsettingsid"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("RoleRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_xprolereward_xpsettings_xpsettingsid"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("XpSettings") - .HasForeignKey("EllieBot.Db.Models.XpSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Navigation("IgnoredChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Navigation("Users"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Navigation("Applicants"); - - b.Navigation("Bans"); - - b.Navigation("Members"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Navigation("Participants"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GuildConfig", b => - { - b.Navigation("AntiAltSetting"); - - b.Navigation("AntiRaidSetting"); - - b.Navigation("AntiSpamSetting"); - - 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("GenerateCurrencyChannelIds"); - - b.Navigation("MutedUsers"); - - b.Navigation("Permissions"); - - b.Navigation("SelfAssignableRoleGroupNames"); - - b.Navigation("ShopEntries"); - - b.Navigation("SlowmodeIgnoredRoles"); - - b.Navigation("SlowmodeIgnoredUsers"); - - b.Navigation("StreamRole"); - - b.Navigation("UnbanTimer"); - - b.Navigation("UnmuteTimers"); - - b.Navigation("UnroleTimer"); - - b.Navigation("VcRoleInfos"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Navigation("LogIgnores"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Navigation("Songs"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Navigation("Blacklist"); - - b.Navigation("Whitelist"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Navigation("CurrencyRewards"); - - b.Navigation("ExclusionList"); - - b.Navigation("RoleRewards"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/EllieBot/Migrations/PostgreSql/20241105024753_betstats.cs b/src/EllieBot/Migrations/PostgreSql/20241105024753_betstats.cs deleted file mode 100644 index 91a9dde..0000000 --- a/src/EllieBot/Migrations/PostgreSql/20241105024753_betstats.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace EllieBot.Migrations.PostgreSql -{ - /// - public partial class betstats : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "userbetstats", - columns: table => new - { - id = table.Column(type: "integer", nullable: false) - .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), - userid = table.Column(type: "numeric(20,0)", nullable: false), - game = table.Column(type: "integer", nullable: false), - wincount = table.Column(type: "bigint", nullable: false), - losecount = table.Column(type: "bigint", nullable: false), - totalbet = table.Column(type: "numeric", nullable: false), - paidout = table.Column(type: "numeric", nullable: false), - maxwin = table.Column(type: "bigint", nullable: false), - maxbet = table.Column(type: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_userbetstats", x => x.id); - }); - - migrationBuilder.CreateIndex( - name: "ix_userbetstats_userid_game", - table: "userbetstats", - columns: new[] { "userid", "game" }, - unique: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "userbetstats"); - } - } -} diff --git a/src/EllieBot/Migrations/PostgreSql/20241107051622_rakeback.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20241107051622_rakeback.Designer.cs deleted file mode 100644 index 013b589..0000000 --- a/src/EllieBot/Migrations/PostgreSql/20241107051622_rakeback.Designer.cs +++ /dev/null @@ -1,3919 +0,0 @@ -// -using System; -using EllieBot.Db; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace EllieBot.Migrations.PostgreSql -{ - [DbContext(typeof(PostgreSqlContext))] - [Migration("20241107051622_rakeback")] - partial class rakeback - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.8") - .HasAnnotation("Relational:MaxIdentifierLength", 63); - - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .HasColumnType("integer") - .HasColumnName("action"); - - b.Property("ActionDurationMinutes") - .HasColumnType("integer") - .HasColumnName("actiondurationminutes"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("MinAge") - .HasColumnType("interval") - .HasColumnName("minage"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_antialtsetting"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_antialtsetting_guildconfigid"); - - b.ToTable("antialtsetting", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .HasColumnType("integer") - .HasColumnName("action"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("PunishDuration") - .HasColumnType("integer") - .HasColumnName("punishduration"); - - b.Property("Seconds") - .HasColumnType("integer") - .HasColumnName("seconds"); - - b.Property("UserThreshold") - .HasColumnType("integer") - .HasColumnName("userthreshold"); - - b.HasKey("Id") - .HasName("pk_antiraidsetting"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_antiraidsetting_guildconfigid"); - - b.ToTable("antiraidsetting", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AntiSpamSettingId") - .HasColumnType("integer") - .HasColumnName("antispamsettingid"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.HasKey("Id") - .HasName("pk_antispamignore"); - - b.HasIndex("AntiSpamSettingId") - .HasDatabaseName("ix_antispamignore_antispamsettingid"); - - b.ToTable("antispamignore", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Action") - .HasColumnType("integer") - .HasColumnName("action"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("MessageThreshold") - .HasColumnType("integer") - .HasColumnName("messagethreshold"); - - b.Property("MuteTime") - .HasColumnType("integer") - .HasColumnName("mutetime"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_antispamsetting"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_antispamsetting_guildconfigid"); - - b.ToTable("antispamsetting", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_todosarchive"); - - b.ToTable("todosarchive", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoCommand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("ChannelName") - .HasColumnType("text") - .HasColumnName("channelname"); - - b.Property("CommandText") - .HasColumnType("text") - .HasColumnName("commandtext"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("GuildName") - .HasColumnType("text") - .HasColumnName("guildname"); - - b.Property("Interval") - .HasColumnType("integer") - .HasColumnName("interval"); - - b.Property("VoiceChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("voicechannelid"); - - b.Property("VoiceChannelName") - .HasColumnType("text") - .HasColumnName("voicechannelname"); - - b.HasKey("Id") - .HasName("pk_autocommands"); - - b.ToTable("autocommands", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoPublishChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.HasKey("Id") - .HasName("pk_autopublishchannel"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_autopublishchannel_guildid"); - - b.ToTable("autopublishchannel", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoDelete") - .HasColumnType("boolean") - .HasColumnName("autodelete"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.HasKey("Id") - .HasName("pk_autotranslatechannels"); - - b.HasIndex("ChannelId") - .IsUnique() - .HasDatabaseName("ix_autotranslatechannels_channelid"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_autotranslatechannels_guildid"); - - b.ToTable("autotranslatechannels", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("integer") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Source") - .HasColumnType("text") - .HasColumnName("source"); - - b.Property("Target") - .HasColumnType("text") - .HasColumnName("target"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_autotranslateusers"); - - b.HasAlternateKey("ChannelId", "UserId") - .HasName("ak_autotranslateusers_channelid_userid"); - - b.ToTable("autotranslateusers", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BanTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("PruneDays") - .HasColumnType("integer") - .HasColumnName("prunedays"); - - b.Property("Text") - .HasColumnType("text") - .HasColumnName("text"); - - b.HasKey("Id") - .HasName("pk_bantemplates"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_bantemplates_guildid"); - - b.ToTable("bantemplates", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Balance") - .HasColumnType("bigint") - .HasColumnName("balance"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_bankusers"); - - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("ix_bankusers_userid"); - - b.ToTable("bankusers", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BlacklistEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ItemId") - .HasColumnType("numeric(20,0)") - .HasColumnName("itemid"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_blacklist"); - - b.ToTable("blacklist", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.Property("ClubId") - .HasColumnType("integer") - .HasColumnName("clubid"); - - b.Property("UserId") - .HasColumnType("integer") - .HasColumnName("userid"); - - b.HasKey("ClubId", "UserId") - .HasName("pk_clubapplicants"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_clubapplicants_userid"); - - b.ToTable("clubapplicants", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.Property("ClubId") - .HasColumnType("integer") - .HasColumnName("clubid"); - - b.Property("UserId") - .HasColumnType("integer") - .HasColumnName("userid"); - - b.HasKey("ClubId", "UserId") - .HasName("pk_clubbans"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_clubbans_userid"); - - b.ToTable("clubbans", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Description") - .HasColumnType("text") - .HasColumnName("description"); - - b.Property("ImageUrl") - .HasColumnType("text") - .HasColumnName("imageurl"); - - b.Property("Name") - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("name"); - - b.Property("OwnerId") - .HasColumnType("integer") - .HasColumnName("ownerid"); - - b.Property("Xp") - .HasColumnType("integer") - .HasColumnName("xp"); - - b.HasKey("Id") - .HasName("pk_clubs"); - - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_clubs_name"); - - b.HasIndex("OwnerId") - .IsUnique() - .HasDatabaseName("ix_clubs_ownerid"); - - b.ToTable("clubs", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Mapping") - .HasColumnType("text") - .HasColumnName("mapping"); - - b.Property("Trigger") - .HasColumnType("text") - .HasColumnName("trigger"); - - b.HasKey("Id") - .HasName("pk_commandalias"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_commandalias_guildconfigid"); - - b.ToTable("commandalias", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandCooldown", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("CommandName") - .HasColumnType("text") - .HasColumnName("commandname"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Seconds") - .HasColumnType("integer") - .HasColumnName("seconds"); - - b.HasKey("Id") - .HasName("pk_commandcooldown"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_commandcooldown_guildconfigid"); - - b.ToTable("commandcooldown", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CurrencyTransaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("bigint") - .HasColumnName("amount"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Extra") - .IsRequired() - .HasColumnType("text") - .HasColumnName("extra"); - - b.Property("Note") - .HasColumnType("text") - .HasColumnName("note"); - - b.Property("OtherId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") - .HasColumnName("otherid") - .HasDefaultValueSql("NULL"); - - b.Property("Type") - .IsRequired() - .HasColumnType("text") - .HasColumnName("type"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_currencytransactions"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_currencytransactions_userid"); - - b.ToTable("currencytransactions", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("State") - .HasColumnType("boolean") - .HasColumnName("state"); - - b.HasKey("Id") - .HasName("pk_delmsgoncmdchannel"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); - - b.ToTable("delmsgoncmdchannel", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordPermOverride", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Command") - .HasColumnType("text") - .HasColumnName("command"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Perm") - .HasColumnType("numeric(20,0)") - .HasColumnName("perm"); - - b.HasKey("Id") - .HasName("pk_discordpermoverrides"); - - b.HasIndex("GuildId", "Command") - .IsUnique() - .HasDatabaseName("ix_discordpermoverrides_guildid_command"); - - b.ToTable("discordpermoverrides", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AvatarId") - .HasColumnType("text") - .HasColumnName("avatarid"); - - b.Property("ClubId") - .HasColumnType("integer") - .HasColumnName("clubid"); - - b.Property("CurrencyAmount") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasDefaultValue(0L) - .HasColumnName("currencyamount"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("IsClubAdmin") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("isclubadmin"); - - b.Property("NotifyOnLevelUp") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("notifyonlevelup"); - - b.Property("TotalXp") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasDefaultValue(0L) - .HasColumnName("totalxp"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); - - b.HasKey("Id") - .HasName("pk_discorduser"); - - b.HasAlternateKey("UserId") - .HasName("ak_discorduser_userid"); - - b.HasIndex("ClubId") - .HasDatabaseName("ix_discorduser_clubid"); - - b.HasIndex("CurrencyAmount") - .HasDatabaseName("ix_discorduser_currencyamount"); - - b.HasIndex("TotalXp") - .HasDatabaseName("ix_discorduser_totalxp"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_discorduser_userid"); - - b.HasIndex("Username") - .HasDatabaseName("ix_discorduser_username"); - - b.ToTable("discorduser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AllowTarget") - .HasColumnType("boolean") - .HasColumnName("allowtarget"); - - b.Property("AutoDeleteTrigger") - .HasColumnType("boolean") - .HasColumnName("autodeletetrigger"); - - b.Property("ContainsAnywhere") - .HasColumnType("boolean") - .HasColumnName("containsanywhere"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("DmResponse") - .HasColumnType("boolean") - .HasColumnName("dmresponse"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Reactions") - .HasColumnType("text") - .HasColumnName("reactions"); - - b.Property("Response") - .HasColumnType("text") - .HasColumnName("response"); - - b.Property("Trigger") - .HasColumnType("text") - .HasColumnName("trigger"); - - b.HasKey("Id") - .HasName("pk_expressions"); - - b.ToTable("expressions", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ItemId") - .HasColumnType("numeric(20,0)") - .HasColumnName("itemid"); - - b.Property("ItemType") - .HasColumnType("integer") - .HasColumnName("itemtype"); - - b.Property("XpSettingsId") - .HasColumnType("integer") - .HasColumnName("xpsettingsid"); - - b.HasKey("Id") - .HasName("pk_excludeditem"); - - b.HasIndex("XpSettingsId") - .HasDatabaseName("ix_excludeditem_xpsettingsid"); - - b.ToTable("excludeditem", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("Url") - .IsRequired() - .HasColumnType("text") - .HasColumnName("url"); - - b.HasKey("Id") - .HasName("pk_feedsub"); - - b.HasAlternateKey("GuildConfigId", "Url") - .HasName("ak_feedsub_guildconfigid_url"); - - b.ToTable("feedsub", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.HasKey("Id") - .HasName("pk_filterchannelid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filterchannelid_guildconfigid"); - - b.ToTable("filterchannelid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.HasKey("Id") - .HasName("pk_filterlinkschannelid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); - - b.ToTable("filterlinkschannelid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.HasKey("Id") - .HasName("pk_filterwordschannelid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); - - b.ToTable("filterwordschannelid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Word") - .HasColumnType("text") - .HasColumnName("word"); - - b.HasKey("Id") - .HasName("pk_filteredword"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filteredword_guildconfigid"); - - b.ToTable("filteredword", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FlagTranslateChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.HasKey("Id") - .HasName("pk_flagtranslatechannel"); - - b.HasIndex("GuildId", "ChannelId") - .IsUnique() - .HasDatabaseName("ix_flagtranslatechannel_guildid_channelid"); - - b.ToTable("flagtranslatechannel", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); - - b.HasKey("Id") - .HasName("pk_followedstream"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_followedstream_guildconfigid"); - - b.ToTable("followedstream", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GCChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.HasKey("Id") - .HasName("pk_gcchannelid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_gcchannelid_guildconfigid"); - - b.ToTable("gcchannelid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GamblingStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Bet") - .HasColumnType("numeric") - .HasColumnName("bet"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Feature") - .HasColumnType("text") - .HasColumnName("feature"); - - b.Property("PaidOut") - .HasColumnType("numeric") - .HasColumnName("paidout"); - - b.HasKey("Id") - .HasName("pk_gamblingstats"); - - b.HasIndex("Feature") - .IsUnique() - .HasDatabaseName("ix_gamblingstats_feature"); - - b.ToTable("gamblingstats", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("EndsAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("endsat"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); - - b.HasKey("Id") - .HasName("pk_giveawaymodel"); - - b.ToTable("giveawaymodel", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("GiveawayId") - .HasColumnType("integer") - .HasColumnName("giveawayid"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_giveawayuser"); - - b.HasIndex("GiveawayId", "UserId") - .IsUnique() - .HasDatabaseName("ix_giveawayuser_giveawayid_userid"); - - b.ToTable("giveawayuser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("Number") - .HasColumnType("integer") - .HasColumnName("number"); - - b.HasKey("Id") - .HasName("pk_groupname"); - - b.HasIndex("GuildConfigId", "Number") - .IsUnique() - .HasDatabaseName("ix_groupname_guildconfigid_number"); - - b.ToTable("groupname", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GuildConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoAssignRoleIds") - .HasColumnType("text") - .HasColumnName("autoassignroleids"); - - b.Property("AutoDeleteSelfAssignedRoleMessages") - .HasColumnType("boolean") - .HasColumnName("autodeleteselfassignedrolemessages"); - - b.Property("CleverbotEnabled") - .HasColumnType("boolean") - .HasColumnName("cleverbotenabled"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("DeleteMessageOnCommand") - .HasColumnType("boolean") - .HasColumnName("deletemessageoncommand"); - - b.Property("DeleteStreamOnlineMessage") - .HasColumnType("boolean") - .HasColumnName("deletestreamonlinemessage"); - - b.Property("DisableGlobalExpressions") - .HasColumnType("boolean") - .HasColumnName("disableglobalexpressions"); - - b.Property("ExclusiveSelfAssignedRoles") - .HasColumnType("boolean") - .HasColumnName("exclusiveselfassignedroles"); - - b.Property("FilterInvites") - .HasColumnType("boolean") - .HasColumnName("filterinvites"); - - b.Property("FilterLinks") - .HasColumnType("boolean") - .HasColumnName("filterlinks"); - - b.Property("FilterWords") - .HasColumnType("boolean") - .HasColumnName("filterwords"); - - b.Property("GameVoiceChannel") - .HasColumnType("numeric(20,0)") - .HasColumnName("gamevoicechannel"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Locale") - .HasColumnType("text") - .HasColumnName("locale"); - - b.Property("MuteRoleName") - .HasColumnType("text") - .HasColumnName("muterolename"); - - b.Property("NotifyStreamOffline") - .HasColumnType("boolean") - .HasColumnName("notifystreamoffline"); - - b.Property("PermissionRole") - .HasColumnType("text") - .HasColumnName("permissionrole"); - - b.Property("Prefix") - .HasColumnType("text") - .HasColumnName("prefix"); - - b.Property("StickyRoles") - .HasColumnType("boolean") - .HasColumnName("stickyroles"); - - b.Property("TimeZoneId") - .HasColumnType("text") - .HasColumnName("timezoneid"); - - b.Property("VerboseErrors") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(true) - .HasColumnName("verboseerrors"); - - b.Property("VerbosePermissions") - .HasColumnType("boolean") - .HasColumnName("verbosepermissions"); - - b.Property("WarnExpireAction") - .HasColumnType("integer") - .HasColumnName("warnexpireaction"); - - b.Property("WarnExpireHours") - .HasColumnType("integer") - .HasColumnName("warnexpirehours"); - - b.Property("WarningsInitialized") - .HasColumnType("boolean") - .HasColumnName("warningsinitialized"); - - b.HasKey("Id") - .HasName("pk_guildconfigs"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_guildconfigs_guildid"); - - b.HasIndex("WarnExpireHours") - .HasDatabaseName("ix_guildconfigs_warnexpirehours"); - - b.ToTable("guildconfigs", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.HoneypotChannel", b => - { - b.Property("GuildId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.HasKey("GuildId") - .HasName("pk_honeypotchannels"); - - b.ToTable("honeypotchannels", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ItemType") - .HasColumnType("integer") - .HasColumnName("itemtype"); - - b.Property("LogItemId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logitemid"); - - b.Property("LogSettingId") - .HasColumnType("integer") - .HasColumnName("logsettingid"); - - b.HasKey("Id") - .HasName("pk_ignoredlogchannels"); - - b.HasIndex("LogSettingId", "LogItemId", "ItemType") - .IsUnique() - .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype"); - - b.ToTable("ignoredlogchannels", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ImageOnlyChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_imageonlychannels"); - - b.HasIndex("ChannelId") - .IsUnique() - .HasDatabaseName("ix_imageonlychannels_channelid"); - - b.ToTable("imageonlychannels", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelCreatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelcreatedid"); - - b.Property("ChannelDestroyedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channeldestroyedid"); - - b.Property("ChannelUpdatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelupdatedid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("LogOtherId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logotherid"); - - b.Property("LogUserPresenceId") - .HasColumnType("numeric(20,0)") - .HasColumnName("loguserpresenceid"); - - b.Property("LogVoicePresenceId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logvoicepresenceid"); - - b.Property("LogVoicePresenceTTSId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logvoicepresencettsid"); - - b.Property("LogWarnsId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logwarnsid"); - - b.Property("MessageDeletedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messagedeletedid"); - - b.Property("MessageUpdatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageupdatedid"); - - b.Property("ThreadCreatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("threadcreatedid"); - - b.Property("ThreadDeletedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("threaddeletedid"); - - b.Property("UserBannedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userbannedid"); - - b.Property("UserJoinedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userjoinedid"); - - b.Property("UserLeftId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userleftid"); - - b.Property("UserMutedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("usermutedid"); - - b.Property("UserUnbannedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userunbannedid"); - - b.Property("UserUpdatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userupdatedid"); - - b.HasKey("Id") - .HasName("pk_logsettings"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_logsettings_guildid"); - - b.ToTable("logsettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlayerSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoDisconnect") - .HasColumnType("boolean") - .HasColumnName("autodisconnect"); - - b.Property("AutoPlay") - .HasColumnType("boolean") - .HasColumnName("autoplay"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("MusicChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("musicchannelid"); - - b.Property("PlayerRepeat") - .HasColumnType("integer") - .HasColumnName("playerrepeat"); - - b.Property("QualityPreset") - .HasColumnType("integer") - .HasColumnName("qualitypreset"); - - b.Property("Volume") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(100) - .HasColumnName("volume"); - - b.HasKey("Id") - .HasName("pk_musicplayersettings"); - - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_musicplayersettings_guildid"); - - b.ToTable("musicplayersettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Author") - .HasColumnType("text") - .HasColumnName("author"); - - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") - .HasColumnName("authorid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.HasKey("Id") - .HasName("pk_musicplaylists"); - - b.ToTable("musicplaylists", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_muteduserid"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_muteduserid_guildconfigid"); - - b.ToTable("muteduserid", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.NCPixel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Color") - .HasColumnType("bigint") - .HasColumnName("color"); - - b.Property("OwnerId") - .HasColumnType("numeric(20,0)") - .HasColumnName("ownerid"); - - b.Property("Position") - .HasColumnType("integer") - .HasColumnName("position"); - - b.Property("Price") - .HasColumnType("bigint") - .HasColumnName("price"); - - b.Property("Text") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("text"); - - b.HasKey("Id") - .HasName("pk_ncpixel"); - - b.HasAlternateKey("Position") - .HasName("ak_ncpixel_position"); - - b.HasIndex("OwnerId") - .HasDatabaseName("ix_ncpixel_ownerid"); - - b.ToTable("ncpixel", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("AmountCents") - .HasColumnType("integer") - .HasColumnName("amountcents"); - - b.Property("LastCharge") - .HasColumnType("timestamp without time zone") - .HasColumnName("lastcharge"); - - b.Property("UniquePlatformUserId") - .HasColumnType("text") - .HasColumnName("uniqueplatformuserid"); - - b.Property("ValidThru") - .HasColumnType("timestamp without time zone") - .HasColumnName("validthru"); - - b.HasKey("UserId") - .HasName("pk_patrons"); - - b.HasIndex("UniquePlatformUserId") - .IsUnique() - .HasDatabaseName("ix_patrons_uniqueplatformuserid"); - - b.ToTable("patrons", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Index") - .HasColumnType("integer") - .HasColumnName("index"); - - b.Property("IsCustomCommand") - .HasColumnType("boolean") - .HasColumnName("iscustomcommand"); - - b.Property("PrimaryTarget") - .HasColumnType("integer") - .HasColumnName("primarytarget"); - - b.Property("PrimaryTargetId") - .HasColumnType("numeric(20,0)") - .HasColumnName("primarytargetid"); - - b.Property("SecondaryTarget") - .HasColumnType("integer") - .HasColumnName("secondarytarget"); - - b.Property("SecondaryTargetName") - .HasColumnType("text") - .HasColumnName("secondarytargetname"); - - b.Property("State") - .HasColumnType("boolean") - .HasColumnName("state"); - - b.HasKey("Id") - .HasName("pk_permissions"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_permissions_guildconfigid"); - - b.ToTable("permissions", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlantedCurrency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("bigint") - .HasColumnName("amount"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); - - b.Property("Password") - .HasColumnType("text") - .HasColumnName("password"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_plantedcurrency"); - - b.HasIndex("ChannelId") - .HasDatabaseName("ix_plantedcurrency_channelid"); - - b.HasIndex("MessageId") - .IsUnique() - .HasDatabaseName("ix_plantedcurrency_messageid"); - - b.ToTable("plantedcurrency", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("MusicPlaylistId") - .HasColumnType("integer") - .HasColumnName("musicplaylistid"); - - b.Property("Provider") - .HasColumnType("text") - .HasColumnName("provider"); - - b.Property("ProviderType") - .HasColumnType("integer") - .HasColumnName("providertype"); - - b.Property("Query") - .HasColumnType("text") - .HasColumnName("query"); - - b.Property("Title") - .HasColumnType("text") - .HasColumnName("title"); - - b.Property("Uri") - .HasColumnType("text") - .HasColumnName("uri"); - - b.HasKey("Id") - .HasName("pk_playlistsong"); - - b.HasIndex("MusicPlaylistId") - .HasDatabaseName("ix_playlistsong_musicplaylistid"); - - b.ToTable("playlistsong", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Quote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") - .HasColumnName("authorid"); - - b.Property("AuthorName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("authorname"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("text") - .HasColumnName("keyword"); - - b.Property("Text") - .IsRequired() - .HasColumnType("text") - .HasColumnName("text"); - - b.HasKey("Id") - .HasName("pk_quotes"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_quotes_guildid"); - - b.HasIndex("Keyword") - .HasDatabaseName("ix_quotes_keyword"); - - b.ToTable("quotes", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ReactionRoleV2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Emote") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("emote"); - - b.Property("Group") - .HasColumnType("integer") - .HasColumnName("group"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("LevelReq") - .HasColumnType("integer") - .HasColumnName("levelreq"); - - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_reactionroles"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_reactionroles_guildid"); - - b.HasIndex("MessageId", "Emote") - .IsUnique() - .HasDatabaseName("ix_reactionroles_messageid_emote"); - - b.ToTable("reactionroles", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Reminder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("IsPrivate") - .HasColumnType("boolean") - .HasColumnName("isprivate"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("ServerId") - .HasColumnType("numeric(20,0)") - .HasColumnName("serverid"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("When") - .HasColumnType("timestamp without time zone") - .HasColumnName("when"); - - b.HasKey("Id") - .HasName("pk_reminders"); - - b.HasIndex("When") - .HasDatabaseName("ix_reminders_when"); - - b.ToTable("reminders", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Repeater", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Interval") - .HasColumnType("interval") - .HasColumnName("interval"); - - b.Property("LastMessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("lastmessageid"); - - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); - - b.Property("NoRedundant") - .HasColumnType("boolean") - .HasColumnName("noredundant"); - - b.Property("StartTimeOfDay") - .HasColumnType("interval") - .HasColumnName("starttimeofday"); - - b.HasKey("Id") - .HasName("pk_repeaters"); - - b.ToTable("repeaters", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.RewardedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AmountRewardedThisMonth") - .HasColumnType("bigint") - .HasColumnName("amountrewardedthismonth"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("LastReward") - .HasColumnType("timestamp without time zone") - .HasColumnName("lastreward"); - - b.Property("PlatformUserId") - .HasColumnType("text") - .HasColumnName("platformuserid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_rewardedusers"); - - b.HasIndex("PlatformUserId") - .IsUnique() - .HasDatabaseName("ix_rewardedusers_platformuserid"); - - b.ToTable("rewardedusers", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.RotatingPlayingStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Status") - .HasColumnType("text") - .HasColumnName("status"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_rotatingstatus"); - - b.ToTable("rotatingstatus", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SelfAssignedRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Group") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("group"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("LevelRequirement") - .HasColumnType("integer") - .HasColumnName("levelrequirement"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_selfassignableroles"); - - b.HasIndex("GuildId", "RoleId") - .IsUnique() - .HasDatabaseName("ix_selfassignableroles_guildid_roleid"); - - b.ToTable("selfassignableroles", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") - .HasColumnName("authorid"); - - b.Property("Command") - .HasColumnType("text") - .HasColumnName("command"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Index") - .HasColumnType("integer") - .HasColumnName("index"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("Price") - .HasColumnType("integer") - .HasColumnName("price"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("RoleName") - .HasColumnType("text") - .HasColumnName("rolename"); - - b.Property("RoleRequirement") - .HasColumnType("numeric(20,0)") - .HasColumnName("rolerequirement"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_shopentry"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_shopentry_guildconfigid"); - - b.ToTable("shopentry", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ShopEntryId") - .HasColumnType("integer") - .HasColumnName("shopentryid"); - - b.Property("Text") - .HasColumnType("text") - .HasColumnName("text"); - - b.HasKey("Id") - .HasName("pk_shopentryitem"); - - b.HasIndex("ShopEntryId") - .HasDatabaseName("ix_shopentryitem_shopentryid"); - - b.ToTable("shopentryitem", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.HasKey("Id") - .HasName("pk_slowmodeignoredrole"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_slowmodeignoredrole_guildconfigid"); - - b.ToTable("slowmodeignoredrole", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_slowmodeignoreduser"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_slowmodeignoreduser_guildconfigid"); - - b.ToTable("slowmodeignoreduser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StickyRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("RoleIds") - .HasColumnType("text") - .HasColumnName("roleids"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_stickyroles"); - - b.HasIndex("GuildId", "UserId") - .IsUnique() - .HasDatabaseName("ix_stickyroles_guildid_userid"); - - b.ToTable("stickyroles", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamOnlineMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.HasKey("Id") - .HasName("pk_streamonlinemessages"); - - b.ToTable("streamonlinemessages", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("StreamRoleSettingsId") - .HasColumnType("integer") - .HasColumnName("streamrolesettingsid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); - - b.HasKey("Id") - .HasName("pk_streamroleblacklisteduser"); - - b.HasIndex("StreamRoleSettingsId") - .HasDatabaseName("ix_streamroleblacklisteduser_streamrolesettingsid"); - - b.ToTable("streamroleblacklisteduser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddRoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("addroleid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Enabled") - .HasColumnType("boolean") - .HasColumnName("enabled"); - - b.Property("FromRoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("fromroleid"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("Keyword") - .HasColumnType("text") - .HasColumnName("keyword"); - - b.HasKey("Id") - .HasName("pk_streamrolesettings"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_streamrolesettings_guildconfigid"); - - b.ToTable("streamrolesettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("StreamRoleSettingsId") - .HasColumnType("integer") - .HasColumnName("streamrolesettingsid"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); - - b.HasKey("Id") - .HasName("pk_streamrolewhitelisteduser"); - - b.HasIndex("StreamRoleSettingsId") - .HasDatabaseName("ix_streamrolewhitelisteduser_streamrolesettingsid"); - - b.ToTable("streamrolewhitelisteduser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ArchiveId") - .HasColumnType("integer") - .HasColumnName("archiveid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("IsDone") - .HasColumnType("boolean") - .HasColumnName("isdone"); - - b.Property("Todo") - .HasColumnType("text") - .HasColumnName("todo"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_todos"); - - b.HasIndex("ArchiveId") - .HasDatabaseName("ix_todos_archiveid"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_todos_userid"); - - b.ToTable("todos", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("UnbanAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("unbanat"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_unbantimer"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_unbantimer_guildconfigid"); - - b.ToTable("unbantimer", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("UnmuteAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("unmuteat"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_unmutetimer"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_unmutetimer_guildconfigid"); - - b.ToTable("unmutetimer", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("UnbanAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("unbanat"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_unroletimer"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_unroletimer_guildconfigid"); - - b.ToTable("unroletimer", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UserXpStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AwardedXp") - .HasColumnType("bigint") - .HasColumnName("awardedxp"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("NotifyOnLevelUp") - .HasColumnType("integer") - .HasColumnName("notifyonlevelup"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Xp") - .HasColumnType("bigint") - .HasColumnName("xp"); - - b.HasKey("Id") - .HasName("pk_userxpstats"); - - b.HasIndex("AwardedXp") - .HasDatabaseName("ix_userxpstats_awardedxp"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_userxpstats_guildid"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_userxpstats_userid"); - - b.HasIndex("Xp") - .HasDatabaseName("ix_userxpstats_xp"); - - b.HasIndex("UserId", "GuildId") - .IsUnique() - .HasDatabaseName("ix_userxpstats_userid_guildid"); - - b.ToTable("userxpstats", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.VcRoleInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("VoiceChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("voicechannelid"); - - b.HasKey("Id") - .HasName("pk_vcroleinfo"); - - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_vcroleinfo_guildconfigid"); - - b.ToTable("vcroleinfo", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AffinityId") - .HasColumnType("integer") - .HasColumnName("affinityid"); - - b.Property("ClaimerId") - .HasColumnType("integer") - .HasColumnName("claimerid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Price") - .HasColumnType("bigint") - .HasColumnName("price"); - - b.Property("WaifuId") - .HasColumnType("integer") - .HasColumnName("waifuid"); - - b.HasKey("Id") - .HasName("pk_waifuinfo"); - - b.HasIndex("AffinityId") - .HasDatabaseName("ix_waifuinfo_affinityid"); - - b.HasIndex("ClaimerId") - .HasDatabaseName("ix_waifuinfo_claimerid"); - - b.HasIndex("Price") - .HasDatabaseName("ix_waifuinfo_price"); - - b.HasIndex("WaifuId") - .IsUnique() - .HasDatabaseName("ix_waifuinfo_waifuid"); - - b.ToTable("waifuinfo", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("ItemEmoji") - .HasColumnType("text") - .HasColumnName("itememoji"); - - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); - - b.Property("WaifuInfoId") - .HasColumnType("integer") - .HasColumnName("waifuinfoid"); - - b.HasKey("Id") - .HasName("pk_waifuitem"); - - b.HasIndex("WaifuInfoId") - .HasDatabaseName("ix_waifuitem_waifuinfoid"); - - b.ToTable("waifuitem", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("NewId") - .HasColumnType("integer") - .HasColumnName("newid"); - - b.Property("OldId") - .HasColumnType("integer") - .HasColumnName("oldid"); - - b.Property("UpdateType") - .HasColumnType("integer") - .HasColumnName("updatetype"); - - b.Property("UserId") - .HasColumnType("integer") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_waifuupdates"); - - b.HasIndex("NewId") - .HasDatabaseName("ix_waifuupdates_newid"); - - b.HasIndex("OldId") - .HasDatabaseName("ix_waifuupdates_oldid"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_waifuupdates_userid"); - - b.ToTable("waifuupdates", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Warning", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Forgiven") - .HasColumnType("boolean") - .HasColumnName("forgiven"); - - b.Property("ForgivenBy") - .HasColumnType("text") - .HasColumnName("forgivenby"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Moderator") - .HasColumnType("text") - .HasColumnName("moderator"); - - b.Property("Reason") - .HasColumnType("text") - .HasColumnName("reason"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Weight") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasDefaultValue(1L) - .HasColumnName("weight"); - - b.HasKey("Id") - .HasName("pk_warnings"); - - b.HasIndex("DateAdded") - .HasDatabaseName("ix_warnings_dateadded"); - - b.HasIndex("GuildId") - .HasDatabaseName("ix_warnings_guildid"); - - b.HasIndex("UserId") - .HasDatabaseName("ix_warnings_userid"); - - b.ToTable("warnings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WarningPunishment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Count") - .HasColumnType("integer") - .HasColumnName("count"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Punishment") - .HasColumnType("integer") - .HasColumnName("punishment"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("Time") - .HasColumnType("integer") - .HasColumnName("time"); - - b.HasKey("Id") - .HasName("pk_warningpunishment"); - - b.HasAlternateKey("GuildId", "Count") - .HasName("ak_warningpunishment_guildid_count"); - - b.ToTable("warningpunishment", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Amount") - .HasColumnType("integer") - .HasColumnName("amount"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property("XpSettingsId") - .HasColumnType("integer") - .HasColumnName("xpsettingsid"); - - b.HasKey("Id") - .HasName("pk_xpcurrencyreward"); - - b.HasIndex("XpSettingsId") - .HasDatabaseName("ix_xpcurrencyreward_xpsettingsid"); - - b.ToTable("xpcurrencyreward", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); - - b.Property("Remove") - .HasColumnType("boolean") - .HasColumnName("remove"); - - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); - - b.Property("XpSettingsId") - .HasColumnType("integer") - .HasColumnName("xpsettingsid"); - - b.HasKey("Id") - .HasName("pk_xprolereward"); - - b.HasIndex("XpSettingsId", "Level") - .IsUnique() - .HasDatabaseName("ix_xprolereward_xpsettingsid_level"); - - b.ToTable("xprolereward", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); - - b.Property("ServerExcluded") - .HasColumnType("boolean") - .HasColumnName("serverexcluded"); - - b.HasKey("Id") - .HasName("pk_xpsettings"); - - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_xpsettings_guildconfigid"); - - b.ToTable("xpsettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpShopOwnedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("IsUsing") - .HasColumnType("boolean") - .HasColumnName("isusing"); - - b.Property("ItemKey") - .IsRequired() - .HasColumnType("text") - .HasColumnName("itemkey"); - - b.Property("ItemType") - .HasColumnType("integer") - .HasColumnName("itemtype"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.HasKey("Id") - .HasName("pk_xpshopowneditem"); - - b.HasIndex("UserId", "ItemType", "ItemKey") - .IsUnique() - .HasDatabaseName("ix_xpshopowneditem_userid_itemtype_itemkey"); - - b.ToTable("xpshopowneditem", (string)null); - }); - - modelBuilder.Entity("EllieBot.Services.GreetSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AutoDeleteTimer") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("autodeletetimer"); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("GreetType") - .HasColumnType("integer") - .HasColumnName("greettype"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("isenabled"); - - b.Property("MessageText") - .HasColumnType("text") - .HasColumnName("messagetext"); - - b.HasKey("Id") - .HasName("pk_greetsettings"); - - b.HasIndex("GuildId", "GreetType") - .IsUnique() - .HasDatabaseName("ix_greetsettings_guildid_greettype"); - - b.ToTable("greetsettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Services.Rakeback", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Amount") - .HasColumnType("numeric") - .HasColumnName("amount"); - - b.HasKey("UserId") - .HasName("pk_rakeback"); - - b.ToTable("rakeback", (string)null); - }); - - modelBuilder.Entity("EllieBot.Services.UserBetStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Game") - .HasColumnType("integer") - .HasColumnName("game"); - - b.Property("LoseCount") - .HasColumnType("bigint") - .HasColumnName("losecount"); - - b.Property("MaxBet") - .HasColumnType("bigint") - .HasColumnName("maxbet"); - - b.Property("MaxWin") - .HasColumnType("bigint") - .HasColumnName("maxwin"); - - b.Property("PaidOut") - .HasColumnType("numeric") - .HasColumnName("paidout"); - - b.Property("TotalBet") - .HasColumnType("numeric") - .HasColumnName("totalbet"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("WinCount") - .HasColumnType("bigint") - .HasColumnName("wincount"); - - b.HasKey("Id") - .HasName("pk_userbetstats"); - - b.HasIndex("UserId", "Game") - .IsUnique() - .HasDatabaseName("ix_userbetstats_userid_game"); - - b.ToTable("userbetstats", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiAltSetting") - .HasForeignKey("EllieBot.Db.Models.AntiAltSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiRaidSetting") - .HasForeignKey("EllieBot.Db.Models.AntiRaidSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.HasOne("EllieBot.Db.Models.AntiSpamSetting", null) - .WithMany("IgnoredChannels") - .HasForeignKey("AntiSpamSettingId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiSpamSetting") - .HasForeignKey("EllieBot.Db.Models.AntiSpamSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.HasOne("EllieBot.Db.Models.AutoTranslateChannel", "Channel") - .WithMany("Users") - .HasForeignKey("ChannelId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); - - b.Navigation("Channel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Applicants") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubapplicants_clubs_clubid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubapplicants_discorduser_userid"); - - b.Navigation("Club"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Bans") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubbans_clubs_clubid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubbans_discorduser_userid"); - - b.Navigation("Club"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Owner") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.ClubInfo", "OwnerId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("fk_clubs_discorduser_ownerid"); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandAliases") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandCooldown", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandCooldowns") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("DelMsgOnCmdChannels") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Members") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.NoAction) - .HasConstraintName("fk_discorduser_clubs_clubid"); - - b.Navigation("Club"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("ExclusionList") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("FeedSubs") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_feedsub_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterInvitesChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterLinksChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterWordsChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilteredWords") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FollowedStreams") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GCChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("GenerateCurrencyChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.HasOne("EllieBot.Db.Models.GiveawayModel", null) - .WithMany("Participants") - .HasForeignKey("GiveawayId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_giveawayuser_giveawaymodel_giveawayid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("SelfAssignableRoleGroupNames") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_groupname_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.HasOne("EllieBot.Db.Models.LogSetting", "LogSetting") - .WithMany("LogIgnores") - .HasForeignKey("LogSettingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_ignoredlogchannels_logsettings_logsettingid"); - - b.Navigation("LogSetting"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("MutedUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("Permissions") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.HasOne("EllieBot.Db.Models.MusicPlaylist", null) - .WithMany("Songs") - .HasForeignKey("MusicPlaylistId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("ShopEntries") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.HasOne("EllieBot.Db.Models.ShopEntry", null) - .WithMany("Items") - .HasForeignKey("ShopEntryId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredRoles") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Blacklist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesett~"); - - b.Navigation("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("StreamRole") - .HasForeignKey("EllieBot.Db.Models.StreamRoleSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Whitelist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesett~"); - - b.Navigation("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.HasOne("EllieBot.Db.Models.ArchivedTodoListModel", null) - .WithMany("Items") - .HasForeignKey("ArchiveId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_todos_todosarchive_archiveid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnbanTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnmuteTimers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnroleTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.VcRoleInfo", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("VcRoleInfos") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Affinity") - .WithMany() - .HasForeignKey("AffinityId") - .HasConstraintName("fk_waifuinfo_discorduser_affinityid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Claimer") - .WithMany() - .HasForeignKey("ClaimerId") - .HasConstraintName("fk_waifuinfo_discorduser_claimerid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Waifu") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.WaifuInfo", "WaifuId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); - - b.Navigation("Affinity"); - - b.Navigation("Claimer"); - - b.Navigation("Waifu"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.HasOne("EllieBot.Db.Models.WaifuInfo", "WaifuInfo") - .WithMany("Items") - .HasForeignKey("WaifuInfoId") - .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); - - b.Navigation("WaifuInfo"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "New") - .WithMany() - .HasForeignKey("NewId") - .HasConstraintName("fk_waifuupdates_discorduser_newid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Old") - .WithMany() - .HasForeignKey("OldId") - .HasConstraintName("fk_waifuupdates_discorduser_oldid"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_waifuupdates_discorduser_userid"); - - b.Navigation("New"); - - b.Navigation("Old"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("CurrencyRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_xpcurrencyreward_xpsettings_xpsettingsid"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("RoleRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_xprolereward_xpsettings_xpsettingsid"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("XpSettings") - .HasForeignKey("EllieBot.Db.Models.XpSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Navigation("IgnoredChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Navigation("Users"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Navigation("Applicants"); - - b.Navigation("Bans"); - - b.Navigation("Members"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Navigation("Participants"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GuildConfig", b => - { - b.Navigation("AntiAltSetting"); - - b.Navigation("AntiRaidSetting"); - - b.Navigation("AntiSpamSetting"); - - 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("GenerateCurrencyChannelIds"); - - b.Navigation("MutedUsers"); - - b.Navigation("Permissions"); - - b.Navigation("SelfAssignableRoleGroupNames"); - - b.Navigation("ShopEntries"); - - b.Navigation("SlowmodeIgnoredRoles"); - - b.Navigation("SlowmodeIgnoredUsers"); - - b.Navigation("StreamRole"); - - b.Navigation("UnbanTimer"); - - b.Navigation("UnmuteTimers"); - - b.Navigation("UnroleTimer"); - - b.Navigation("VcRoleInfos"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Navigation("LogIgnores"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Navigation("Songs"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Navigation("Blacklist"); - - b.Navigation("Whitelist"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Navigation("CurrencyRewards"); - - b.Navigation("ExclusionList"); - - b.Navigation("RoleRewards"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/EllieBot/Migrations/PostgreSql/20241107051622_rakeback.cs b/src/EllieBot/Migrations/PostgreSql/20241107051622_rakeback.cs deleted file mode 100644 index 0781acb..0000000 --- a/src/EllieBot/Migrations/PostgreSql/20241107051622_rakeback.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace EllieBot.Migrations.PostgreSql -{ - /// - public partial class rakeback : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "rakeback", - columns: table => new - { - userid = table.Column(type: "numeric(20,0)", nullable: false), - amount = table.Column(type: "numeric", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_rakeback", x => x.userid); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "rakeback"); - } - } -} diff --git a/src/EllieBot/Migrations/PostgreSql/PostgreSqlContextModelSnapshot.cs b/src/EllieBot/Migrations/PostgreSql/PostgreSqlContextModelSnapshot.cs index d7e5362..c72940f 100644 --- a/src/EllieBot/Migrations/PostgreSql/PostgreSqlContextModelSnapshot.cs +++ b/src/EllieBot/Migrations/PostgreSql/PostgreSqlContextModelSnapshot.cs @@ -1,9 +1,9 @@ // using System; -using EllieBot.Db; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using EllieBot.Db; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable @@ -23,3893 +23,3759 @@ namespace EllieBot.Migrations.PostgreSql NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Action") - .HasColumnType("integer") - .HasColumnName("action"); + b.Property("Action") + .HasColumnType("integer") + .HasColumnName("action"); - b.Property("ActionDurationMinutes") - .HasColumnType("integer") - .HasColumnName("actiondurationminutes"); + b.Property("ActionDurationMinutes") + .HasColumnType("integer") + .HasColumnName("actiondurationminutes"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.Property("MinAge") - .HasColumnType("interval") - .HasColumnName("minage"); + b.Property("MinAge") + .HasColumnType("interval") + .HasColumnName("minage"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); + b.Property("RoleId") + .HasColumnType("numeric(20,0)") + .HasColumnName("roleid"); - b.HasKey("Id") - .HasName("pk_antialtsetting"); + b.HasKey("Id") + .HasName("pk_antialtsetting"); - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_antialtsetting_guildconfigid"); + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antialtsetting_guildconfigid"); - b.ToTable("antialtsetting", (string)null); - }); + b.ToTable("antialtsetting", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Action") - .HasColumnType("integer") - .HasColumnName("action"); + b.Property("Action") + .HasColumnType("integer") + .HasColumnName("action"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.Property("PunishDuration") - .HasColumnType("integer") - .HasColumnName("punishduration"); + b.Property("PunishDuration") + .HasColumnType("integer") + .HasColumnName("punishduration"); - b.Property("Seconds") - .HasColumnType("integer") - .HasColumnName("seconds"); + b.Property("Seconds") + .HasColumnType("integer") + .HasColumnName("seconds"); - b.Property("UserThreshold") - .HasColumnType("integer") - .HasColumnName("userthreshold"); + b.Property("UserThreshold") + .HasColumnType("integer") + .HasColumnName("userthreshold"); - b.HasKey("Id") - .HasName("pk_antiraidsetting"); + b.HasKey("Id") + .HasName("pk_antiraidsetting"); - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_antiraidsetting_guildconfigid"); + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antiraidsetting_guildconfigid"); - b.ToTable("antiraidsetting", (string)null); - }); + b.ToTable("antiraidsetting", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("AntiSpamSettingId") - .HasColumnType("integer") - .HasColumnName("antispamsettingid"); + b.Property("AntiSpamSettingId") + .HasColumnType("integer") + .HasColumnName("antispamsettingid"); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); + b.Property("ChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("channelid"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.HasKey("Id") - .HasName("pk_antispamignore"); + b.HasKey("Id") + .HasName("pk_antispamignore"); - b.HasIndex("AntiSpamSettingId") - .HasDatabaseName("ix_antispamignore_antispamsettingid"); + b.HasIndex("AntiSpamSettingId") + .HasDatabaseName("ix_antispamignore_antispamsettingid"); - b.ToTable("antispamignore", (string)null); - }); + b.ToTable("antispamignore", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Action") - .HasColumnType("integer") - .HasColumnName("action"); + b.Property("Action") + .HasColumnType("integer") + .HasColumnName("action"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.Property("MessageThreshold") - .HasColumnType("integer") - .HasColumnName("messagethreshold"); + b.Property("MessageThreshold") + .HasColumnType("integer") + .HasColumnName("messagethreshold"); - b.Property("MuteTime") - .HasColumnType("integer") - .HasColumnName("mutetime"); + b.Property("MuteTime") + .HasColumnType("integer") + .HasColumnName("mutetime"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); + b.Property("RoleId") + .HasColumnType("numeric(20,0)") + .HasColumnName("roleid"); - b.HasKey("Id") - .HasName("pk_antispamsetting"); + b.HasKey("Id") + .HasName("pk_antispamsetting"); - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_antispamsetting_guildconfigid"); + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antispamsetting_guildconfigid"); - b.ToTable("antispamsetting", (string)null); - }); + b.ToTable("antispamsetting", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); + b.Property("Name") + .HasColumnType("text") + .HasColumnName("name"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); + b.Property("UserId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userid"); - b.HasKey("Id") - .HasName("pk_todosarchive"); + b.HasKey("Id") + .HasName("pk_todosarchive"); - b.ToTable("todosarchive", (string)null); - }); + b.ToTable("todosarchive", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.AutoCommand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); + b.Property("ChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("channelid"); - b.Property("ChannelName") - .HasColumnType("text") - .HasColumnName("channelname"); + b.Property("ChannelName") + .HasColumnType("text") + .HasColumnName("channelname"); - b.Property("CommandText") - .HasColumnType("text") - .HasColumnName("commandtext"); + b.Property("CommandText") + .HasColumnType("text") + .HasColumnName("commandtext"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + b.Property("GuildId") + .HasColumnType("numeric(20,0)") + .HasColumnName("guildid"); - b.Property("GuildName") - .HasColumnType("text") - .HasColumnName("guildname"); + b.Property("GuildName") + .HasColumnType("text") + .HasColumnName("guildname"); - b.Property("Interval") - .HasColumnType("integer") - .HasColumnName("interval"); + b.Property("Interval") + .HasColumnType("integer") + .HasColumnName("interval"); - b.Property("VoiceChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("voicechannelid"); + b.Property("VoiceChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("voicechannelid"); - b.Property("VoiceChannelName") - .HasColumnType("text") - .HasColumnName("voicechannelname"); + b.Property("VoiceChannelName") + .HasColumnType("text") + .HasColumnName("voicechannelname"); - b.HasKey("Id") - .HasName("pk_autocommands"); + b.HasKey("Id") + .HasName("pk_autocommands"); - b.ToTable("autocommands", (string)null); - }); + b.ToTable("autocommands", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.AutoPublishChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); + b.Property("ChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("channelid"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + b.Property("GuildId") + .HasColumnType("numeric(20,0)") + .HasColumnName("guildid"); - b.HasKey("Id") - .HasName("pk_autopublishchannel"); + b.HasKey("Id") + .HasName("pk_autopublishchannel"); - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_autopublishchannel_guildid"); + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_autopublishchannel_guildid"); - b.ToTable("autopublishchannel", (string)null); - }); + b.ToTable("autopublishchannel", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("AutoDelete") - .HasColumnType("boolean") - .HasColumnName("autodelete"); + b.Property("AutoDelete") + .HasColumnType("boolean") + .HasColumnName("autodelete"); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); + b.Property("ChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("channelid"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + b.Property("GuildId") + .HasColumnType("numeric(20,0)") + .HasColumnName("guildid"); - b.HasKey("Id") - .HasName("pk_autotranslatechannels"); + b.HasKey("Id") + .HasName("pk_autotranslatechannels"); - b.HasIndex("ChannelId") - .IsUnique() - .HasDatabaseName("ix_autotranslatechannels_channelid"); + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_autotranslatechannels_channelid"); - b.HasIndex("GuildId") - .HasDatabaseName("ix_autotranslatechannels_guildid"); + b.HasIndex("GuildId") + .HasDatabaseName("ix_autotranslatechannels_guildid"); - b.ToTable("autotranslatechannels", (string)null); - }); + b.ToTable("autotranslatechannels", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("integer") - .HasColumnName("channelid"); + b.Property("ChannelId") + .HasColumnType("integer") + .HasColumnName("channelid"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("Source") - .HasColumnType("text") - .HasColumnName("source"); + b.Property("Source") + .HasColumnType("text") + .HasColumnName("source"); - b.Property("Target") - .HasColumnType("text") - .HasColumnName("target"); + b.Property("Target") + .HasColumnType("text") + .HasColumnName("target"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); + b.Property("UserId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userid"); - b.HasKey("Id") - .HasName("pk_autotranslateusers"); + b.HasKey("Id") + .HasName("pk_autotranslateusers"); - b.HasAlternateKey("ChannelId", "UserId") - .HasName("ak_autotranslateusers_channelid_userid"); + b.HasAlternateKey("ChannelId", "UserId") + .HasName("ak_autotranslateusers_channelid_userid"); - b.ToTable("autotranslateusers", (string)null); - }); + b.ToTable("autotranslateusers", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.BanTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + b.Property("GuildId") + .HasColumnType("numeric(20,0)") + .HasColumnName("guildid"); - b.Property("PruneDays") - .HasColumnType("integer") - .HasColumnName("prunedays"); + b.Property("PruneDays") + .HasColumnType("integer") + .HasColumnName("prunedays"); - b.Property("Text") - .HasColumnType("text") - .HasColumnName("text"); + b.Property("Text") + .HasColumnType("text") + .HasColumnName("text"); - b.HasKey("Id") - .HasName("pk_bantemplates"); + b.HasKey("Id") + .HasName("pk_bantemplates"); - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_bantemplates_guildid"); + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_bantemplates_guildid"); - b.ToTable("bantemplates", (string)null); - }); + b.ToTable("bantemplates", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Balance") - .HasColumnType("bigint") - .HasColumnName("balance"); + b.Property("Balance") + .HasColumnType("bigint") + .HasColumnName("balance"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); + b.Property("UserId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userid"); - b.HasKey("Id") - .HasName("pk_bankusers"); + b.HasKey("Id") + .HasName("pk_bankusers"); - b.HasIndex("UserId") - .IsUnique() - .HasDatabaseName("ix_bankusers_userid"); + b.HasIndex("UserId") + .IsUnique() + .HasDatabaseName("ix_bankusers_userid"); - b.ToTable("bankusers", (string)null); - }); + b.ToTable("bankusers", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.BlacklistEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("ItemId") - .HasColumnType("numeric(20,0)") - .HasColumnName("itemid"); + b.Property("ItemId") + .HasColumnType("numeric(20,0)") + .HasColumnName("itemid"); - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); + b.Property("Type") + .HasColumnType("integer") + .HasColumnName("type"); - b.HasKey("Id") - .HasName("pk_blacklist"); + b.HasKey("Id") + .HasName("pk_blacklist"); - b.ToTable("blacklist", (string)null); - }); + b.ToTable("blacklist", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.Property("ClubId") - .HasColumnType("integer") - .HasColumnName("clubid"); + { + b.Property("ClubId") + .HasColumnType("integer") + .HasColumnName("clubid"); - b.Property("UserId") - .HasColumnType("integer") - .HasColumnName("userid"); + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("userid"); - b.HasKey("ClubId", "UserId") - .HasName("pk_clubapplicants"); + b.HasKey("ClubId", "UserId") + .HasName("pk_clubapplicants"); - b.HasIndex("UserId") - .HasDatabaseName("ix_clubapplicants_userid"); + b.HasIndex("UserId") + .HasDatabaseName("ix_clubapplicants_userid"); - b.ToTable("clubapplicants", (string)null); - }); + b.ToTable("clubapplicants", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.Property("ClubId") - .HasColumnType("integer") - .HasColumnName("clubid"); + { + b.Property("ClubId") + .HasColumnType("integer") + .HasColumnName("clubid"); - b.Property("UserId") - .HasColumnType("integer") - .HasColumnName("userid"); + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("userid"); - b.HasKey("ClubId", "UserId") - .HasName("pk_clubbans"); + b.HasKey("ClubId", "UserId") + .HasName("pk_clubbans"); - b.HasIndex("UserId") - .HasDatabaseName("ix_clubbans_userid"); + b.HasIndex("UserId") + .HasDatabaseName("ix_clubbans_userid"); - b.ToTable("clubbans", (string)null); - }); + b.ToTable("clubbans", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("Description") - .HasColumnType("text") - .HasColumnName("description"); + b.Property("Description") + .HasColumnType("text") + .HasColumnName("description"); - b.Property("ImageUrl") - .HasColumnType("text") - .HasColumnName("imageurl"); + b.Property("ImageUrl") + .HasColumnType("text") + .HasColumnName("imageurl"); - b.Property("Name") - .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("name"); + b.Property("Name") + .HasMaxLength(20) + .HasColumnType("character varying(20)") + .HasColumnName("name"); - b.Property("OwnerId") - .HasColumnType("integer") - .HasColumnName("ownerid"); + b.Property("OwnerId") + .HasColumnType("integer") + .HasColumnName("ownerid"); - b.Property("Xp") - .HasColumnType("integer") - .HasColumnName("xp"); + b.Property("Xp") + .HasColumnType("integer") + .HasColumnName("xp"); - b.HasKey("Id") - .HasName("pk_clubs"); + b.HasKey("Id") + .HasName("pk_clubs"); - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_clubs_name"); + b.HasIndex("Name") + .IsUnique() + .HasDatabaseName("ix_clubs_name"); - b.HasIndex("OwnerId") - .IsUnique() - .HasDatabaseName("ix_clubs_ownerid"); + b.HasIndex("OwnerId") + .IsUnique() + .HasDatabaseName("ix_clubs_ownerid"); - b.ToTable("clubs", (string)null); - }); + b.ToTable("clubs", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.Property("Mapping") - .HasColumnType("text") - .HasColumnName("mapping"); + b.Property("Mapping") + .HasColumnType("text") + .HasColumnName("mapping"); - b.Property("Trigger") - .HasColumnType("text") - .HasColumnName("trigger"); + b.Property("Trigger") + .HasColumnType("text") + .HasColumnName("trigger"); - b.HasKey("Id") - .HasName("pk_commandalias"); + b.HasKey("Id") + .HasName("pk_commandalias"); - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_commandalias_guildconfigid"); + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandalias_guildconfigid"); - b.ToTable("commandalias", (string)null); - }); + b.ToTable("commandalias", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.CommandCooldown", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("CommandName") - .HasColumnType("text") - .HasColumnName("commandname"); + b.Property("CommandName") + .HasColumnType("text") + .HasColumnName("commandname"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.Property("Seconds") - .HasColumnType("integer") - .HasColumnName("seconds"); + b.Property("Seconds") + .HasColumnType("integer") + .HasColumnName("seconds"); - b.HasKey("Id") - .HasName("pk_commandcooldown"); + b.HasKey("Id") + .HasName("pk_commandcooldown"); - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_commandcooldown_guildconfigid"); + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandcooldown_guildconfigid"); - b.ToTable("commandcooldown", (string)null); - }); + b.ToTable("commandcooldown", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.CurrencyTransaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Amount") - .HasColumnType("bigint") - .HasColumnName("amount"); + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("Extra") - .IsRequired() - .HasColumnType("text") - .HasColumnName("extra"); + b.Property("Extra") + .IsRequired() + .HasColumnType("text") + .HasColumnName("extra"); - b.Property("Note") - .HasColumnType("text") - .HasColumnName("note"); + b.Property("Note") + .HasColumnType("text") + .HasColumnName("note"); - b.Property("OtherId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") - .HasColumnName("otherid") - .HasDefaultValueSql("NULL"); + b.Property("OtherId") + .ValueGeneratedOnAdd() + .HasColumnType("numeric(20,0)") + .HasColumnName("otherid") + .HasDefaultValueSql("NULL"); - b.Property("Type") - .IsRequired() - .HasColumnType("text") - .HasColumnName("type"); + b.Property("Type") + .IsRequired() + .HasColumnType("text") + .HasColumnName("type"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); + b.Property("UserId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userid"); - b.HasKey("Id") - .HasName("pk_currencytransactions"); + b.HasKey("Id") + .HasName("pk_currencytransactions"); - b.HasIndex("UserId") - .HasDatabaseName("ix_currencytransactions_userid"); + b.HasIndex("UserId") + .HasDatabaseName("ix_currencytransactions_userid"); - b.ToTable("currencytransactions", (string)null); - }); + b.ToTable("currencytransactions", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); + b.Property("ChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("channelid"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.Property("State") - .HasColumnType("boolean") - .HasColumnName("state"); + b.Property("State") + .HasColumnType("boolean") + .HasColumnName("state"); - b.HasKey("Id") - .HasName("pk_delmsgoncmdchannel"); + b.HasKey("Id") + .HasName("pk_delmsgoncmdchannel"); - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); - b.ToTable("delmsgoncmdchannel", (string)null); - }); + b.ToTable("delmsgoncmdchannel", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.DiscordPermOverride", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Command") - .HasColumnType("text") - .HasColumnName("command"); + b.Property("Command") + .HasColumnType("text") + .HasColumnName("command"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + b.Property("GuildId") + .HasColumnType("numeric(20,0)") + .HasColumnName("guildid"); - b.Property("Perm") - .HasColumnType("numeric(20,0)") - .HasColumnName("perm"); + b.Property("Perm") + .HasColumnType("numeric(20,0)") + .HasColumnName("perm"); - b.HasKey("Id") - .HasName("pk_discordpermoverrides"); + b.HasKey("Id") + .HasName("pk_discordpermoverrides"); - b.HasIndex("GuildId", "Command") - .IsUnique() - .HasDatabaseName("ix_discordpermoverrides_guildid_command"); + b.HasIndex("GuildId", "Command") + .IsUnique() + .HasDatabaseName("ix_discordpermoverrides_guildid_command"); - b.ToTable("discordpermoverrides", (string)null); - }); + b.ToTable("discordpermoverrides", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("AvatarId") - .HasColumnType("text") - .HasColumnName("avatarid"); + b.Property("AvatarId") + .HasColumnType("text") + .HasColumnName("avatarid"); - b.Property("ClubId") - .HasColumnType("integer") - .HasColumnName("clubid"); + b.Property("ClubId") + .HasColumnType("integer") + .HasColumnName("clubid"); - b.Property("CurrencyAmount") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasDefaultValue(0L) - .HasColumnName("currencyamount"); + b.Property("CurrencyAmount") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("currencyamount"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("IsClubAdmin") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("isclubadmin"); + b.Property("Discriminator") + .HasColumnType("text") + .HasColumnName("discriminator"); - b.Property("NotifyOnLevelUp") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("notifyonlevelup"); + b.Property("IsClubAdmin") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(false) + .HasColumnName("isclubadmin"); - b.Property("TotalXp") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasDefaultValue(0L) - .HasColumnName("totalxp"); + b.Property("NotifyOnLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("notifyonlevelup"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); + b.Property("TotalXp") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("totalxp"); - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); + b.Property("UserId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userid"); - b.HasKey("Id") - .HasName("pk_discorduser"); + b.Property("Username") + .HasColumnType("text") + .HasColumnName("username"); - b.HasAlternateKey("UserId") - .HasName("ak_discorduser_userid"); + b.HasKey("Id") + .HasName("pk_discorduser"); - b.HasIndex("ClubId") - .HasDatabaseName("ix_discorduser_clubid"); + b.HasAlternateKey("UserId") + .HasName("ak_discorduser_userid"); - b.HasIndex("CurrencyAmount") - .HasDatabaseName("ix_discorduser_currencyamount"); + b.HasIndex("ClubId") + .HasDatabaseName("ix_discorduser_clubid"); - b.HasIndex("TotalXp") - .HasDatabaseName("ix_discorduser_totalxp"); + b.HasIndex("CurrencyAmount") + .HasDatabaseName("ix_discorduser_currencyamount"); - b.HasIndex("UserId") - .HasDatabaseName("ix_discorduser_userid"); + b.HasIndex("TotalXp") + .HasDatabaseName("ix_discorduser_totalxp"); - b.HasIndex("Username") - .HasDatabaseName("ix_discorduser_username"); + b.HasIndex("UserId") + .HasDatabaseName("ix_discorduser_userid"); - b.ToTable("discorduser", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AllowTarget") - .HasColumnType("boolean") - .HasColumnName("allowtarget"); - - b.Property("AutoDeleteTrigger") - .HasColumnType("boolean") - .HasColumnName("autodeletetrigger"); - - b.Property("ContainsAnywhere") - .HasColumnType("boolean") - .HasColumnName("containsanywhere"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("DmResponse") - .HasColumnType("boolean") - .HasColumnName("dmresponse"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.Property("Reactions") - .HasColumnType("text") - .HasColumnName("reactions"); - - b.Property("Response") - .HasColumnType("text") - .HasColumnName("response"); - - b.Property("Trigger") - .HasColumnType("text") - .HasColumnName("trigger"); - - b.HasKey("Id") - .HasName("pk_expressions"); - - b.ToTable("expressions", (string)null); - }); + b.ToTable("discorduser", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("ItemId") - .HasColumnType("numeric(20,0)") - .HasColumnName("itemid"); + b.Property("ItemId") + .HasColumnType("numeric(20,0)") + .HasColumnName("itemid"); - b.Property("ItemType") - .HasColumnType("integer") - .HasColumnName("itemtype"); + b.Property("ItemType") + .HasColumnType("integer") + .HasColumnName("itemtype"); - b.Property("XpSettingsId") - .HasColumnType("integer") - .HasColumnName("xpsettingsid"); + b.Property("XpSettingsId") + .HasColumnType("integer") + .HasColumnName("xpsettingsid"); - b.HasKey("Id") - .HasName("pk_excludeditem"); + b.HasKey("Id") + .HasName("pk_excludeditem"); - b.HasIndex("XpSettingsId") - .HasDatabaseName("ix_excludeditem_xpsettingsid"); + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_excludeditem_xpsettingsid"); - b.ToTable("excludeditem", (string)null); - }); + b.ToTable("excludeditem", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); + b.Property("ChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("channelid"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); + b.Property("Message") + .HasColumnType("text") + .HasColumnName("message"); - b.Property("Url") - .IsRequired() - .HasColumnType("text") - .HasColumnName("url"); + b.Property("Url") + .IsRequired() + .HasColumnType("text") + .HasColumnName("url"); - b.HasKey("Id") - .HasName("pk_feedsub"); + b.HasKey("Id") + .HasName("pk_feedsub"); - b.HasAlternateKey("GuildConfigId", "Url") - .HasName("ak_feedsub_guildconfigid_url"); + b.HasAlternateKey("GuildConfigId", "Url") + .HasName("ak_feedsub_guildconfigid_url"); - b.ToTable("feedsub", (string)null); - }); + b.ToTable("feedsub", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.FilterChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); + b.Property("ChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("channelid"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.HasKey("Id") - .HasName("pk_filterchannelid"); + b.HasKey("Id") + .HasName("pk_filterchannelid"); - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filterchannelid_guildconfigid"); + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterchannelid_guildconfigid"); - b.ToTable("filterchannelid", (string)null); - }); + b.ToTable("filterchannelid", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); + b.Property("ChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("channelid"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.HasKey("Id") - .HasName("pk_filterlinkschannelid"); + b.HasKey("Id") + .HasName("pk_filterlinkschannelid"); - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); - b.ToTable("filterlinkschannelid", (string)null); - }); + b.ToTable("filterlinkschannelid", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); + b.Property("ChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("channelid"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.HasKey("Id") - .HasName("pk_filterwordschannelid"); + b.HasKey("Id") + .HasName("pk_filterwordschannelid"); - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); - b.ToTable("filterwordschannelid", (string)null); - }); + b.ToTable("filterwordschannelid", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.Property("Word") - .HasColumnType("text") - .HasColumnName("word"); + b.Property("Word") + .HasColumnType("text") + .HasColumnName("word"); - b.HasKey("Id") - .HasName("pk_filteredword"); + b.HasKey("Id") + .HasName("pk_filteredword"); - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_filteredword_guildconfigid"); + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filteredword_guildconfigid"); - b.ToTable("filteredword", (string)null); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FlagTranslateChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); - - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); - - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); - - b.HasKey("Id") - .HasName("pk_flagtranslatechannel"); - - b.HasIndex("GuildId", "ChannelId") - .IsUnique() - .HasDatabaseName("ix_flagtranslatechannel_guildid_channelid"); - - b.ToTable("flagtranslatechannel", (string)null); - }); + b.ToTable("filteredword", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); + b.Property("ChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("channelid"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + b.Property("GuildId") + .HasColumnType("numeric(20,0)") + .HasColumnName("guildid"); - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); + b.Property("Message") + .HasColumnType("text") + .HasColumnName("message"); - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); + b.Property("Type") + .HasColumnType("integer") + .HasColumnName("type"); - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); + b.Property("Username") + .HasColumnType("text") + .HasColumnName("username"); - b.HasKey("Id") - .HasName("pk_followedstream"); + b.HasKey("Id") + .HasName("pk_followedstream"); - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_followedstream_guildconfigid"); + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_followedstream_guildconfigid"); - b.ToTable("followedstream", (string)null); - }); + b.ToTable("followedstream", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.GCChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); + b.Property("ChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("channelid"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.HasKey("Id") - .HasName("pk_gcchannelid"); + b.HasKey("Id") + .HasName("pk_gcchannelid"); - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_gcchannelid_guildconfigid"); + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_gcchannelid_guildconfigid"); - b.ToTable("gcchannelid", (string)null); - }); + b.ToTable("gcchannelid", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.GamblingStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Bet") - .HasColumnType("numeric") - .HasColumnName("bet"); + b.Property("Bet") + .HasColumnType("numeric") + .HasColumnName("bet"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("Feature") - .HasColumnType("text") - .HasColumnName("feature"); + b.Property("Feature") + .HasColumnType("text") + .HasColumnName("feature"); - b.Property("PaidOut") - .HasColumnType("numeric") - .HasColumnName("paidout"); + b.Property("PaidOut") + .HasColumnType("numeric") + .HasColumnName("paidout"); - b.HasKey("Id") - .HasName("pk_gamblingstats"); + b.HasKey("Id") + .HasName("pk_gamblingstats"); - b.HasIndex("Feature") - .IsUnique() - .HasDatabaseName("ix_gamblingstats_feature"); + b.HasIndex("Feature") + .IsUnique() + .HasDatabaseName("ix_gamblingstats_feature"); - b.ToTable("gamblingstats", (string)null); - }); + b.ToTable("gamblingstats", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); + b.Property("ChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("channelid"); - b.Property("EndsAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("endsat"); + b.Property("EndsAt") + .HasColumnType("timestamp without time zone") + .HasColumnName("endsat"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + b.Property("GuildId") + .HasColumnType("numeric(20,0)") + .HasColumnName("guildid"); - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); + b.Property("Message") + .HasColumnType("text") + .HasColumnName("message"); - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); + b.Property("MessageId") + .HasColumnType("numeric(20,0)") + .HasColumnName("messageid"); - b.HasKey("Id") - .HasName("pk_giveawaymodel"); + b.HasKey("Id") + .HasName("pk_giveawaymodel"); - b.ToTable("giveawaymodel", (string)null); - }); + b.ToTable("giveawaymodel", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("GiveawayId") - .HasColumnType("integer") - .HasColumnName("giveawayid"); + b.Property("GiveawayId") + .HasColumnType("integer") + .HasColumnName("giveawayid"); - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); + b.Property("Name") + .HasColumnType("text") + .HasColumnName("name"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); + b.Property("UserId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userid"); - b.HasKey("Id") - .HasName("pk_giveawayuser"); + b.HasKey("Id") + .HasName("pk_giveawayuser"); - b.HasIndex("GiveawayId", "UserId") - .IsUnique() - .HasDatabaseName("ix_giveawayuser_giveawayid_userid"); + b.HasIndex("GiveawayId", "UserId") + .IsUnique() + .HasDatabaseName("ix_giveawayuser_giveawayid_userid"); - b.ToTable("giveawayuser", (string)null); - }); + b.ToTable("giveawayuser", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); + b.Property("Name") + .HasColumnType("text") + .HasColumnName("name"); - b.Property("Number") - .HasColumnType("integer") - .HasColumnName("number"); + b.Property("Number") + .HasColumnType("integer") + .HasColumnName("number"); - b.HasKey("Id") - .HasName("pk_groupname"); + b.HasKey("Id") + .HasName("pk_groupname"); - b.HasIndex("GuildConfigId", "Number") - .IsUnique() - .HasDatabaseName("ix_groupname_guildconfigid_number"); + b.HasIndex("GuildConfigId", "Number") + .IsUnique() + .HasDatabaseName("ix_groupname_guildconfigid_number"); - b.ToTable("groupname", (string)null); - }); + b.ToTable("groupname", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.GuildConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("AutoAssignRoleIds") - .HasColumnType("text") - .HasColumnName("autoassignroleids"); + b.Property("AutoAssignRoleIds") + .HasColumnType("text") + .HasColumnName("autoassignroleids"); - b.Property("AutoDeleteSelfAssignedRoleMessages") - .HasColumnType("boolean") - .HasColumnName("autodeleteselfassignedrolemessages"); + b.Property("AutoDeleteSelfAssignedRoleMessages") + .HasColumnType("boolean") + .HasColumnName("autodeleteselfassignedrolemessages"); - b.Property("CleverbotEnabled") - .HasColumnType("boolean") - .HasColumnName("cleverbotenabled"); + b.Property("CleverbotEnabled") + .HasColumnType("boolean") + .HasColumnName("cleverbotenabled"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("DeleteMessageOnCommand") - .HasColumnType("boolean") - .HasColumnName("deletemessageoncommand"); + b.Property("DeleteMessageOnCommand") + .HasColumnType("boolean") + .HasColumnName("deletemessageoncommand"); - b.Property("DeleteStreamOnlineMessage") - .HasColumnType("boolean") - .HasColumnName("deletestreamonlinemessage"); + b.Property("DeleteStreamOnlineMessage") + .HasColumnType("boolean") + .HasColumnName("deletestreamonlinemessage"); - b.Property("DisableGlobalExpressions") - .HasColumnType("boolean") - .HasColumnName("disableglobalexpressions"); + b.Property("DisableGlobalExpressions") + .HasColumnType("boolean") + .HasColumnName("disableglobalexpressions"); - b.Property("ExclusiveSelfAssignedRoles") - .HasColumnType("boolean") - .HasColumnName("exclusiveselfassignedroles"); + b.Property("ExclusiveSelfAssignedRoles") + .HasColumnType("boolean") + .HasColumnName("exclusiveselfassignedroles"); - b.Property("FilterInvites") - .HasColumnType("boolean") - .HasColumnName("filterinvites"); + b.Property("FilterInvites") + .HasColumnType("boolean") + .HasColumnName("filterinvites"); - b.Property("FilterLinks") - .HasColumnType("boolean") - .HasColumnName("filterlinks"); + b.Property("FilterLinks") + .HasColumnType("boolean") + .HasColumnName("filterlinks"); - b.Property("FilterWords") - .HasColumnType("boolean") - .HasColumnName("filterwords"); + b.Property("FilterWords") + .HasColumnType("boolean") + .HasColumnName("filterwords"); - b.Property("GameVoiceChannel") - .HasColumnType("numeric(20,0)") - .HasColumnName("gamevoicechannel"); + b.Property("GameVoiceChannel") + .HasColumnType("numeric(20,0)") + .HasColumnName("gamevoicechannel"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + b.Property("GuildId") + .HasColumnType("numeric(20,0)") + .HasColumnName("guildid"); - b.Property("Locale") - .HasColumnType("text") - .HasColumnName("locale"); + b.Property("Locale") + .HasColumnType("text") + .HasColumnName("locale"); - b.Property("MuteRoleName") - .HasColumnType("text") - .HasColumnName("muterolename"); + b.Property("MuteRoleName") + .HasColumnType("text") + .HasColumnName("muterolename"); - b.Property("NotifyStreamOffline") - .HasColumnType("boolean") - .HasColumnName("notifystreamoffline"); + b.Property("NotifyStreamOffline") + .HasColumnType("boolean") + .HasColumnName("notifystreamoffline"); - b.Property("PermissionRole") - .HasColumnType("text") - .HasColumnName("permissionrole"); + b.Property("PermissionRole") + .HasColumnType("text") + .HasColumnName("permissionrole"); - b.Property("Prefix") - .HasColumnType("text") - .HasColumnName("prefix"); + b.Property("Prefix") + .HasColumnType("text") + .HasColumnName("prefix"); - b.Property("StickyRoles") - .HasColumnType("boolean") - .HasColumnName("stickyroles"); + b.Property("StickyRoles") + .HasColumnType("boolean") + .HasColumnName("stickyroles"); - b.Property("TimeZoneId") - .HasColumnType("text") - .HasColumnName("timezoneid"); + b.Property("TimeZoneId") + .HasColumnType("text") + .HasColumnName("timezoneid"); - b.Property("VerboseErrors") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(true) - .HasColumnName("verboseerrors"); + b.Property("VerboseErrors") + .ValueGeneratedOnAdd() + .HasColumnType("boolean") + .HasDefaultValue(true) + .HasColumnName("verboseerrors"); - b.Property("VerbosePermissions") - .HasColumnType("boolean") - .HasColumnName("verbosepermissions"); + b.Property("VerbosePermissions") + .HasColumnType("boolean") + .HasColumnName("verbosepermissions"); - b.Property("WarnExpireAction") - .HasColumnType("integer") - .HasColumnName("warnexpireaction"); + b.Property("WarnExpireAction") + .HasColumnType("integer") + .HasColumnName("warnexpireaction"); - b.Property("WarnExpireHours") - .HasColumnType("integer") - .HasColumnName("warnexpirehours"); + b.Property("WarnExpireHours") + .HasColumnType("integer") + .HasColumnName("warnexpirehours"); - b.Property("WarningsInitialized") - .HasColumnType("boolean") - .HasColumnName("warningsinitialized"); + b.Property("WarningsInitialized") + .HasColumnType("boolean") + .HasColumnName("warningsinitialized"); - b.HasKey("Id") - .HasName("pk_guildconfigs"); + b.HasKey("Id") + .HasName("pk_guildconfigs"); - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_guildconfigs_guildid"); + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_guildconfigs_guildid"); - b.HasIndex("WarnExpireHours") - .HasDatabaseName("ix_guildconfigs_warnexpirehours"); + b.HasIndex("WarnExpireHours") + .HasDatabaseName("ix_guildconfigs_warnexpirehours"); - b.ToTable("guildconfigs", (string)null); - }); + b.ToTable("guildconfigs", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.HoneypotChannel", b => - { - b.Property("GuildId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + { + b.Property("GuildId") + .ValueGeneratedOnAdd() + .HasColumnType("numeric(20,0)") + .HasColumnName("guildid"); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); + b.Property("ChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("channelid"); - b.HasKey("GuildId") - .HasName("pk_honeypotchannels"); + b.HasKey("GuildId") + .HasName("pk_honeypotchannels"); - b.ToTable("honeypotchannels", (string)null); - }); + b.ToTable("honeypotchannels", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("ItemType") - .HasColumnType("integer") - .HasColumnName("itemtype"); + b.Property("ItemType") + .HasColumnType("integer") + .HasColumnName("itemtype"); - b.Property("LogItemId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logitemid"); + b.Property("LogItemId") + .HasColumnType("numeric(20,0)") + .HasColumnName("logitemid"); - b.Property("LogSettingId") - .HasColumnType("integer") - .HasColumnName("logsettingid"); + b.Property("LogSettingId") + .HasColumnType("integer") + .HasColumnName("logsettingid"); - b.HasKey("Id") - .HasName("pk_ignoredlogchannels"); + b.HasKey("Id") + .HasName("pk_ignoredlogchannels"); - b.HasIndex("LogSettingId", "LogItemId", "ItemType") - .IsUnique() - .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype"); + b.HasIndex("LogSettingId", "LogItemId", "ItemType") + .IsUnique() + .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype"); - b.ToTable("ignoredlogchannels", (string)null); - }); + b.ToTable("ignoredlogchannels", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.ImageOnlyChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); + b.Property("ChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("channelid"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + b.Property("GuildId") + .HasColumnType("numeric(20,0)") + .HasColumnName("guildid"); - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); + b.Property("Type") + .HasColumnType("integer") + .HasColumnName("type"); - b.HasKey("Id") - .HasName("pk_imageonlychannels"); + b.HasKey("Id") + .HasName("pk_imageonlychannels"); - b.HasIndex("ChannelId") - .IsUnique() - .HasDatabaseName("ix_imageonlychannels_channelid"); + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_imageonlychannels_channelid"); - b.ToTable("imageonlychannels", (string)null); - }); + b.ToTable("imageonlychannels", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("ChannelCreatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelcreatedid"); + b.Property("ChannelCreatedId") + .HasColumnType("numeric(20,0)") + .HasColumnName("channelcreatedid"); - b.Property("ChannelDestroyedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channeldestroyedid"); + b.Property("ChannelDestroyedId") + .HasColumnType("numeric(20,0)") + .HasColumnName("channeldestroyedid"); - b.Property("ChannelUpdatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelupdatedid"); + b.Property("ChannelUpdatedId") + .HasColumnType("numeric(20,0)") + .HasColumnName("channelupdatedid"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + b.Property("GuildId") + .HasColumnType("numeric(20,0)") + .HasColumnName("guildid"); - b.Property("LogOtherId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logotherid"); + b.Property("LogOtherId") + .HasColumnType("numeric(20,0)") + .HasColumnName("logotherid"); - b.Property("LogUserPresenceId") - .HasColumnType("numeric(20,0)") - .HasColumnName("loguserpresenceid"); + b.Property("LogUserPresenceId") + .HasColumnType("numeric(20,0)") + .HasColumnName("loguserpresenceid"); - b.Property("LogVoicePresenceId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logvoicepresenceid"); + b.Property("LogVoicePresenceId") + .HasColumnType("numeric(20,0)") + .HasColumnName("logvoicepresenceid"); - b.Property("LogVoicePresenceTTSId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logvoicepresencettsid"); + b.Property("LogVoicePresenceTTSId") + .HasColumnType("numeric(20,0)") + .HasColumnName("logvoicepresencettsid"); - b.Property("LogWarnsId") - .HasColumnType("numeric(20,0)") - .HasColumnName("logwarnsid"); + b.Property("LogWarnsId") + .HasColumnType("numeric(20,0)") + .HasColumnName("logwarnsid"); - b.Property("MessageDeletedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messagedeletedid"); + b.Property("MessageDeletedId") + .HasColumnType("numeric(20,0)") + .HasColumnName("messagedeletedid"); - b.Property("MessageUpdatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageupdatedid"); + b.Property("MessageUpdatedId") + .HasColumnType("numeric(20,0)") + .HasColumnName("messageupdatedid"); - b.Property("ThreadCreatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("threadcreatedid"); + b.Property("ThreadCreatedId") + .HasColumnType("numeric(20,0)") + .HasColumnName("threadcreatedid"); - b.Property("ThreadDeletedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("threaddeletedid"); + b.Property("ThreadDeletedId") + .HasColumnType("numeric(20,0)") + .HasColumnName("threaddeletedid"); - b.Property("UserBannedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userbannedid"); + b.Property("UserBannedId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userbannedid"); - b.Property("UserJoinedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userjoinedid"); + b.Property("UserJoinedId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userjoinedid"); - b.Property("UserLeftId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userleftid"); + b.Property("UserLeftId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userleftid"); - b.Property("UserMutedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("usermutedid"); + b.Property("UserMutedId") + .HasColumnType("numeric(20,0)") + .HasColumnName("usermutedid"); - b.Property("UserUnbannedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userunbannedid"); + b.Property("UserUnbannedId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userunbannedid"); - b.Property("UserUpdatedId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userupdatedid"); + b.Property("UserUpdatedId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userupdatedid"); - b.HasKey("Id") - .HasName("pk_logsettings"); + b.HasKey("Id") + .HasName("pk_logsettings"); - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_logsettings_guildid"); + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_logsettings_guildid"); - b.ToTable("logsettings", (string)null); - }); + b.ToTable("logsettings", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.MusicPlayerSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("AutoDisconnect") - .HasColumnType("boolean") - .HasColumnName("autodisconnect"); + b.Property("AutoDisconnect") + .HasColumnType("boolean") + .HasColumnName("autodisconnect"); - b.Property("AutoPlay") - .HasColumnType("boolean") - .HasColumnName("autoplay"); + b.Property("AutoPlay") + .HasColumnType("boolean") + .HasColumnName("autoplay"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + b.Property("GuildId") + .HasColumnType("numeric(20,0)") + .HasColumnName("guildid"); - b.Property("MusicChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("musicchannelid"); + b.Property("MusicChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("musicchannelid"); - b.Property("PlayerRepeat") - .HasColumnType("integer") - .HasColumnName("playerrepeat"); + b.Property("PlayerRepeat") + .HasColumnType("integer") + .HasColumnName("playerrepeat"); - b.Property("QualityPreset") - .HasColumnType("integer") - .HasColumnName("qualitypreset"); + b.Property("QualityPreset") + .HasColumnType("integer") + .HasColumnName("qualitypreset"); - b.Property("Volume") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(100) - .HasColumnName("volume"); + b.Property("Volume") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(100) + .HasColumnName("volume"); - b.HasKey("Id") - .HasName("pk_musicplayersettings"); + b.HasKey("Id") + .HasName("pk_musicplayersettings"); - b.HasIndex("GuildId") - .IsUnique() - .HasDatabaseName("ix_musicplayersettings_guildid"); + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_musicplayersettings_guildid"); - b.ToTable("musicplayersettings", (string)null); - }); + b.ToTable("musicplayersettings", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Author") - .HasColumnType("text") - .HasColumnName("author"); + b.Property("Author") + .HasColumnType("text") + .HasColumnName("author"); - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") - .HasColumnName("authorid"); + b.Property("AuthorId") + .HasColumnType("numeric(20,0)") + .HasColumnName("authorid"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); + b.Property("Name") + .HasColumnType("text") + .HasColumnName("name"); - b.HasKey("Id") - .HasName("pk_musicplaylists"); + b.HasKey("Id") + .HasName("pk_musicplaylists"); - b.ToTable("musicplaylists", (string)null); - }); + b.ToTable("musicplaylists", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); + b.Property("UserId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userid"); - b.HasKey("Id") - .HasName("pk_muteduserid"); + b.HasKey("Id") + .HasName("pk_muteduserid"); - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_muteduserid_guildconfigid"); + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_muteduserid_guildconfigid"); - b.ToTable("muteduserid", (string)null); - }); + b.ToTable("muteduserid", (string)null); + }); - modelBuilder.Entity("EllieBot.Db.Models.NCPixel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Color") - .HasColumnType("bigint") - .HasColumnName("color"); + b.Property("AllowTarget") + .HasColumnType("boolean") + .HasColumnName("allowtarget"); - b.Property("OwnerId") - .HasColumnType("numeric(20,0)") - .HasColumnName("ownerid"); + b.Property("AutoDeleteTrigger") + .HasColumnType("boolean") + .HasColumnName("autodeletetrigger"); - b.Property("Position") - .HasColumnType("integer") - .HasColumnName("position"); + b.Property("ContainsAnywhere") + .HasColumnType("boolean") + .HasColumnName("containsanywhere"); - b.Property("Price") - .HasColumnType("bigint") - .HasColumnName("price"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("Text") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("text"); + b.Property("DmResponse") + .HasColumnType("boolean") + .HasColumnName("dmresponse"); - b.HasKey("Id") - .HasName("pk_ncpixel"); + b.Property("GuildId") + .HasColumnType("numeric(20,0)") + .HasColumnName("guildid"); - b.HasAlternateKey("Position") - .HasName("ak_ncpixel_position"); + b.Property("Reactions") + .HasColumnType("text") + .HasColumnName("reactions"); - b.HasIndex("OwnerId") - .HasDatabaseName("ix_ncpixel_ownerid"); + b.Property("Response") + .HasColumnType("text") + .HasColumnName("response"); - b.ToTable("ncpixel", (string)null); - }); + b.Property("Trigger") + .HasColumnType("text") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_expressions"); + + b.ToTable("expressions", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); + { + b.Property("UserId") + .ValueGeneratedOnAdd() + .HasColumnType("numeric(20,0)") + .HasColumnName("userid"); - b.Property("AmountCents") - .HasColumnType("integer") - .HasColumnName("amountcents"); + b.Property("AmountCents") + .HasColumnType("integer") + .HasColumnName("amountcents"); - b.Property("LastCharge") - .HasColumnType("timestamp without time zone") - .HasColumnName("lastcharge"); + b.Property("LastCharge") + .HasColumnType("timestamp without time zone") + .HasColumnName("lastcharge"); - b.Property("UniquePlatformUserId") - .HasColumnType("text") - .HasColumnName("uniqueplatformuserid"); + b.Property("UniquePlatformUserId") + .HasColumnType("text") + .HasColumnName("uniqueplatformuserid"); - b.Property("ValidThru") - .HasColumnType("timestamp without time zone") - .HasColumnName("validthru"); + b.Property("ValidThru") + .HasColumnType("timestamp without time zone") + .HasColumnName("validthru"); - b.HasKey("UserId") - .HasName("pk_patrons"); + b.HasKey("UserId") + .HasName("pk_patrons"); - b.HasIndex("UniquePlatformUserId") - .IsUnique() - .HasDatabaseName("ix_patrons_uniqueplatformuserid"); + b.HasIndex("UniquePlatformUserId") + .IsUnique() + .HasDatabaseName("ix_patrons_uniqueplatformuserid"); - b.ToTable("patrons", (string)null); - }); + b.ToTable("patrons", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.Property("Index") - .HasColumnType("integer") - .HasColumnName("index"); + b.Property("Index") + .HasColumnType("integer") + .HasColumnName("index"); - b.Property("IsCustomCommand") - .HasColumnType("boolean") - .HasColumnName("iscustomcommand"); + b.Property("IsCustomCommand") + .HasColumnType("boolean") + .HasColumnName("iscustomcommand"); - b.Property("PrimaryTarget") - .HasColumnType("integer") - .HasColumnName("primarytarget"); + b.Property("PrimaryTarget") + .HasColumnType("integer") + .HasColumnName("primarytarget"); - b.Property("PrimaryTargetId") - .HasColumnType("numeric(20,0)") - .HasColumnName("primarytargetid"); + b.Property("PrimaryTargetId") + .HasColumnType("numeric(20,0)") + .HasColumnName("primarytargetid"); - b.Property("SecondaryTarget") - .HasColumnType("integer") - .HasColumnName("secondarytarget"); + b.Property("SecondaryTarget") + .HasColumnType("integer") + .HasColumnName("secondarytarget"); - b.Property("SecondaryTargetName") - .HasColumnType("text") - .HasColumnName("secondarytargetname"); + b.Property("SecondaryTargetName") + .HasColumnType("text") + .HasColumnName("secondarytargetname"); - b.Property("State") - .HasColumnType("boolean") - .HasColumnName("state"); + b.Property("State") + .HasColumnType("boolean") + .HasColumnName("state"); - b.HasKey("Id") - .HasName("pk_permissions"); + b.HasKey("Id") + .HasName("pk_permissions"); - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_permissions_guildconfigid"); + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_permissions_guildconfigid"); - b.ToTable("permissions", (string)null); - }); + b.ToTable("permissions", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.PlantedCurrency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Amount") - .HasColumnType("bigint") - .HasColumnName("amount"); + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); + b.Property("ChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("channelid"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + b.Property("GuildId") + .HasColumnType("numeric(20,0)") + .HasColumnName("guildid"); - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); + b.Property("MessageId") + .HasColumnType("numeric(20,0)") + .HasColumnName("messageid"); - b.Property("Password") - .HasColumnType("text") - .HasColumnName("password"); + b.Property("Password") + .HasColumnType("text") + .HasColumnName("password"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); + b.Property("UserId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userid"); - b.HasKey("Id") - .HasName("pk_plantedcurrency"); + b.HasKey("Id") + .HasName("pk_plantedcurrency"); - b.HasIndex("ChannelId") - .HasDatabaseName("ix_plantedcurrency_channelid"); + b.HasIndex("ChannelId") + .HasDatabaseName("ix_plantedcurrency_channelid"); - b.HasIndex("MessageId") - .IsUnique() - .HasDatabaseName("ix_plantedcurrency_messageid"); + b.HasIndex("MessageId") + .IsUnique() + .HasDatabaseName("ix_plantedcurrency_messageid"); - b.ToTable("plantedcurrency", (string)null); - }); + b.ToTable("plantedcurrency", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("MusicPlaylistId") - .HasColumnType("integer") - .HasColumnName("musicplaylistid"); + b.Property("MusicPlaylistId") + .HasColumnType("integer") + .HasColumnName("musicplaylistid"); - b.Property("Provider") - .HasColumnType("text") - .HasColumnName("provider"); + b.Property("Provider") + .HasColumnType("text") + .HasColumnName("provider"); - b.Property("ProviderType") - .HasColumnType("integer") - .HasColumnName("providertype"); + b.Property("ProviderType") + .HasColumnType("integer") + .HasColumnName("providertype"); - b.Property("Query") - .HasColumnType("text") - .HasColumnName("query"); + b.Property("Query") + .HasColumnType("text") + .HasColumnName("query"); - b.Property("Title") - .HasColumnType("text") - .HasColumnName("title"); + b.Property("Title") + .HasColumnType("text") + .HasColumnName("title"); - b.Property("Uri") - .HasColumnType("text") - .HasColumnName("uri"); + b.Property("Uri") + .HasColumnType("text") + .HasColumnName("uri"); - b.HasKey("Id") - .HasName("pk_playlistsong"); + b.HasKey("Id") + .HasName("pk_playlistsong"); - b.HasIndex("MusicPlaylistId") - .HasDatabaseName("ix_playlistsong_musicplaylistid"); + b.HasIndex("MusicPlaylistId") + .HasDatabaseName("ix_playlistsong_musicplaylistid"); - b.ToTable("playlistsong", (string)null); - }); + b.ToTable("playlistsong", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.Quote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") - .HasColumnName("authorid"); + b.Property("AuthorId") + .HasColumnType("numeric(20,0)") + .HasColumnName("authorid"); - b.Property("AuthorName") - .IsRequired() - .HasColumnType("text") - .HasColumnName("authorname"); + b.Property("AuthorName") + .IsRequired() + .HasColumnType("text") + .HasColumnName("authorname"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + b.Property("GuildId") + .HasColumnType("numeric(20,0)") + .HasColumnName("guildid"); - b.Property("Keyword") - .IsRequired() - .HasColumnType("text") - .HasColumnName("keyword"); + b.Property("Keyword") + .IsRequired() + .HasColumnType("text") + .HasColumnName("keyword"); - b.Property("Text") - .IsRequired() - .HasColumnType("text") - .HasColumnName("text"); + b.Property("Text") + .IsRequired() + .HasColumnType("text") + .HasColumnName("text"); - b.HasKey("Id") - .HasName("pk_quotes"); + b.HasKey("Id") + .HasName("pk_quotes"); - b.HasIndex("GuildId") - .HasDatabaseName("ix_quotes_guildid"); + b.HasIndex("GuildId") + .HasDatabaseName("ix_quotes_guildid"); - b.HasIndex("Keyword") - .HasDatabaseName("ix_quotes_keyword"); + b.HasIndex("Keyword") + .HasDatabaseName("ix_quotes_keyword"); - b.ToTable("quotes", (string)null); - }); + b.ToTable("quotes", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.ReactionRoleV2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); + b.Property("ChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("channelid"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("Emote") - .HasMaxLength(100) - .HasColumnType("character varying(100)") - .HasColumnName("emote"); + b.Property("Emote") + .HasMaxLength(100) + .HasColumnType("character varying(100)") + .HasColumnName("emote"); - b.Property("Group") - .HasColumnType("integer") - .HasColumnName("group"); + b.Property("Group") + .HasColumnType("integer") + .HasColumnName("group"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + b.Property("GuildId") + .HasColumnType("numeric(20,0)") + .HasColumnName("guildid"); - b.Property("LevelReq") - .HasColumnType("integer") - .HasColumnName("levelreq"); + b.Property("LevelReq") + .HasColumnType("integer") + .HasColumnName("levelreq"); - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); + b.Property("MessageId") + .HasColumnType("numeric(20,0)") + .HasColumnName("messageid"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); + b.Property("RoleId") + .HasColumnType("numeric(20,0)") + .HasColumnName("roleid"); - b.HasKey("Id") - .HasName("pk_reactionroles"); + b.HasKey("Id") + .HasName("pk_reactionroles"); - b.HasIndex("GuildId") - .HasDatabaseName("ix_reactionroles_guildid"); + b.HasIndex("GuildId") + .HasDatabaseName("ix_reactionroles_guildid"); - b.HasIndex("MessageId", "Emote") - .IsUnique() - .HasDatabaseName("ix_reactionroles_messageid_emote"); + b.HasIndex("MessageId", "Emote") + .IsUnique() + .HasDatabaseName("ix_reactionroles_messageid_emote"); - b.ToTable("reactionroles", (string)null); - }); + b.ToTable("reactionroles", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.Reminder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); + b.Property("ChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("channelid"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("IsPrivate") - .HasColumnType("boolean") - .HasColumnName("isprivate"); + b.Property("IsPrivate") + .HasColumnType("boolean") + .HasColumnName("isprivate"); - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); + b.Property("Message") + .HasColumnType("text") + .HasColumnName("message"); - b.Property("ServerId") - .HasColumnType("numeric(20,0)") - .HasColumnName("serverid"); + b.Property("ServerId") + .HasColumnType("numeric(20,0)") + .HasColumnName("serverid"); - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); + b.Property("Type") + .HasColumnType("integer") + .HasColumnName("type"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); + b.Property("UserId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userid"); - b.Property("When") - .HasColumnType("timestamp without time zone") - .HasColumnName("when"); + b.Property("When") + .HasColumnType("timestamp without time zone") + .HasColumnName("when"); - b.HasKey("Id") - .HasName("pk_reminders"); + b.HasKey("Id") + .HasName("pk_reminders"); - b.HasIndex("When") - .HasDatabaseName("ix_reminders_when"); + b.HasIndex("When") + .HasDatabaseName("ix_reminders_when"); - b.ToTable("reminders", (string)null); - }); + b.ToTable("reminders", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.Repeater", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); + b.Property("ChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("channelid"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + b.Property("GuildId") + .HasColumnType("numeric(20,0)") + .HasColumnName("guildid"); - b.Property("Interval") - .HasColumnType("interval") - .HasColumnName("interval"); + b.Property("Interval") + .HasColumnType("interval") + .HasColumnName("interval"); - b.Property("LastMessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("lastmessageid"); + b.Property("LastMessageId") + .HasColumnType("numeric(20,0)") + .HasColumnName("lastmessageid"); - b.Property("Message") - .HasColumnType("text") - .HasColumnName("message"); + b.Property("Message") + .HasColumnType("text") + .HasColumnName("message"); - b.Property("NoRedundant") - .HasColumnType("boolean") - .HasColumnName("noredundant"); + b.Property("NoRedundant") + .HasColumnType("boolean") + .HasColumnName("noredundant"); - b.Property("StartTimeOfDay") - .HasColumnType("interval") - .HasColumnName("starttimeofday"); + b.Property("StartTimeOfDay") + .HasColumnType("interval") + .HasColumnName("starttimeofday"); - b.HasKey("Id") - .HasName("pk_repeaters"); + b.HasKey("Id") + .HasName("pk_repeaters"); - b.ToTable("repeaters", (string)null); - }); + b.ToTable("repeaters", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.RewardedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("AmountRewardedThisMonth") - .HasColumnType("bigint") - .HasColumnName("amountrewardedthismonth"); + b.Property("AmountRewardedThisMonth") + .HasColumnType("bigint") + .HasColumnName("amountrewardedthismonth"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("LastReward") - .HasColumnType("timestamp without time zone") - .HasColumnName("lastreward"); + b.Property("LastReward") + .HasColumnType("timestamp without time zone") + .HasColumnName("lastreward"); - b.Property("PlatformUserId") - .HasColumnType("text") - .HasColumnName("platformuserid"); + b.Property("PlatformUserId") + .HasColumnType("text") + .HasColumnName("platformuserid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); + b.Property("UserId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userid"); - b.HasKey("Id") - .HasName("pk_rewardedusers"); + b.HasKey("Id") + .HasName("pk_rewardedusers"); - b.HasIndex("PlatformUserId") - .IsUnique() - .HasDatabaseName("ix_rewardedusers_platformuserid"); + b.HasIndex("PlatformUserId") + .IsUnique() + .HasDatabaseName("ix_rewardedusers_platformuserid"); - b.ToTable("rewardedusers", (string)null); - }); + b.ToTable("rewardedusers", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.RotatingPlayingStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("Status") - .HasColumnType("text") - .HasColumnName("status"); + b.Property("Status") + .HasColumnType("text") + .HasColumnName("status"); - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); + b.Property("Type") + .HasColumnType("integer") + .HasColumnName("type"); - b.HasKey("Id") - .HasName("pk_rotatingstatus"); + b.HasKey("Id") + .HasName("pk_rotatingstatus"); - b.ToTable("rotatingstatus", (string)null); - }); + b.ToTable("rotatingstatus", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.SelfAssignedRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("Group") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("group"); + b.Property("Group") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasDefaultValue(0) + .HasColumnName("group"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + b.Property("GuildId") + .HasColumnType("numeric(20,0)") + .HasColumnName("guildid"); - b.Property("LevelRequirement") - .HasColumnType("integer") - .HasColumnName("levelrequirement"); + b.Property("LevelRequirement") + .HasColumnType("integer") + .HasColumnName("levelrequirement"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); + b.Property("RoleId") + .HasColumnType("numeric(20,0)") + .HasColumnName("roleid"); - b.HasKey("Id") - .HasName("pk_selfassignableroles"); + b.HasKey("Id") + .HasName("pk_selfassignableroles"); - b.HasIndex("GuildId", "RoleId") - .IsUnique() - .HasDatabaseName("ix_selfassignableroles_guildid_roleid"); + b.HasIndex("GuildId", "RoleId") + .IsUnique() + .HasDatabaseName("ix_selfassignableroles_guildid_roleid"); - b.ToTable("selfassignableroles", (string)null); - }); + b.ToTable("selfassignableroles", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") - .HasColumnName("authorid"); + b.Property("AuthorId") + .HasColumnType("numeric(20,0)") + .HasColumnName("authorid"); - b.Property("Command") - .HasColumnType("text") - .HasColumnName("command"); + b.Property("Command") + .HasColumnType("text") + .HasColumnName("command"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.Property("Index") - .HasColumnType("integer") - .HasColumnName("index"); + b.Property("Index") + .HasColumnType("integer") + .HasColumnName("index"); - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); + b.Property("Name") + .HasColumnType("text") + .HasColumnName("name"); - b.Property("Price") - .HasColumnType("integer") - .HasColumnName("price"); + b.Property("Price") + .HasColumnType("integer") + .HasColumnName("price"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); + b.Property("RoleId") + .HasColumnType("numeric(20,0)") + .HasColumnName("roleid"); - b.Property("RoleName") - .HasColumnType("text") - .HasColumnName("rolename"); + b.Property("RoleName") + .HasColumnType("text") + .HasColumnName("rolename"); - b.Property("RoleRequirement") - .HasColumnType("numeric(20,0)") - .HasColumnName("rolerequirement"); + b.Property("RoleRequirement") + .HasColumnType("numeric(20,0)") + .HasColumnName("rolerequirement"); - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); + b.Property("Type") + .HasColumnType("integer") + .HasColumnName("type"); - b.HasKey("Id") - .HasName("pk_shopentry"); + b.HasKey("Id") + .HasName("pk_shopentry"); - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_shopentry_guildconfigid"); + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_shopentry_guildconfigid"); - b.ToTable("shopentry", (string)null); - }); + b.ToTable("shopentry", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("ShopEntryId") - .HasColumnType("integer") - .HasColumnName("shopentryid"); + b.Property("ShopEntryId") + .HasColumnType("integer") + .HasColumnName("shopentryid"); - b.Property("Text") - .HasColumnType("text") - .HasColumnName("text"); + b.Property("Text") + .HasColumnType("text") + .HasColumnName("text"); - b.HasKey("Id") - .HasName("pk_shopentryitem"); + b.HasKey("Id") + .HasName("pk_shopentryitem"); - b.HasIndex("ShopEntryId") - .HasDatabaseName("ix_shopentryitem_shopentryid"); + b.HasIndex("ShopEntryId") + .HasDatabaseName("ix_shopentryitem_shopentryid"); - b.ToTable("shopentryitem", (string)null); - }); + b.ToTable("shopentryitem", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); + b.Property("RoleId") + .HasColumnType("numeric(20,0)") + .HasColumnName("roleid"); - b.HasKey("Id") - .HasName("pk_slowmodeignoredrole"); + b.HasKey("Id") + .HasName("pk_slowmodeignoredrole"); - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_slowmodeignoredrole_guildconfigid"); + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoredrole_guildconfigid"); - b.ToTable("slowmodeignoredrole", (string)null); - }); + b.ToTable("slowmodeignoredrole", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); + b.Property("UserId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userid"); - b.HasKey("Id") - .HasName("pk_slowmodeignoreduser"); + b.HasKey("Id") + .HasName("pk_slowmodeignoreduser"); - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_slowmodeignoreduser_guildconfigid"); + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoreduser_guildconfigid"); - b.ToTable("slowmodeignoreduser", (string)null); - }); + b.ToTable("slowmodeignoreduser", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.StickyRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + b.Property("GuildId") + .HasColumnType("numeric(20,0)") + .HasColumnName("guildid"); - b.Property("RoleIds") - .HasColumnType("text") - .HasColumnName("roleids"); + b.Property("RoleIds") + .HasColumnType("text") + .HasColumnName("roleids"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); + b.Property("UserId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userid"); - b.HasKey("Id") - .HasName("pk_stickyroles"); + b.HasKey("Id") + .HasName("pk_stickyroles"); - b.HasIndex("GuildId", "UserId") - .IsUnique() - .HasDatabaseName("ix_stickyroles_guildid_userid"); + b.HasIndex("GuildId", "UserId") + .IsUnique() + .HasDatabaseName("ix_stickyroles_guildid_userid"); - b.ToTable("stickyroles", (string)null); - }); + b.ToTable("stickyroles", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.StreamOnlineMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); + b.Property("ChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("channelid"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("MessageId") - .HasColumnType("numeric(20,0)") - .HasColumnName("messageid"); + b.Property("MessageId") + .HasColumnType("numeric(20,0)") + .HasColumnName("messageid"); - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); + b.Property("Name") + .HasColumnType("text") + .HasColumnName("name"); - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); + b.Property("Type") + .HasColumnType("integer") + .HasColumnName("type"); - b.HasKey("Id") - .HasName("pk_streamonlinemessages"); + b.HasKey("Id") + .HasName("pk_streamonlinemessages"); - b.ToTable("streamonlinemessages", (string)null); - }); + b.ToTable("streamonlinemessages", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("StreamRoleSettingsId") - .HasColumnType("integer") - .HasColumnName("streamrolesettingsid"); + b.Property("StreamRoleSettingsId") + .HasColumnType("integer") + .HasColumnName("streamrolesettingsid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); + b.Property("UserId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userid"); - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); + b.Property("Username") + .HasColumnType("text") + .HasColumnName("username"); - b.HasKey("Id") - .HasName("pk_streamroleblacklisteduser"); + b.HasKey("Id") + .HasName("pk_streamroleblacklisteduser"); - b.HasIndex("StreamRoleSettingsId") - .HasDatabaseName("ix_streamroleblacklisteduser_streamrolesettingsid"); + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamroleblacklisteduser_streamrolesettingsid"); - b.ToTable("streamroleblacklisteduser", (string)null); - }); + b.ToTable("streamroleblacklisteduser", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("AddRoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("addroleid"); + b.Property("AddRoleId") + .HasColumnType("numeric(20,0)") + .HasColumnName("addroleid"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("Enabled") - .HasColumnType("boolean") - .HasColumnName("enabled"); + b.Property("Enabled") + .HasColumnType("boolean") + .HasColumnName("enabled"); - b.Property("FromRoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("fromroleid"); + b.Property("FromRoleId") + .HasColumnType("numeric(20,0)") + .HasColumnName("fromroleid"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.Property("Keyword") - .HasColumnType("text") - .HasColumnName("keyword"); + b.Property("Keyword") + .HasColumnType("text") + .HasColumnName("keyword"); - b.HasKey("Id") - .HasName("pk_streamrolesettings"); + b.HasKey("Id") + .HasName("pk_streamrolesettings"); - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_streamrolesettings_guildconfigid"); + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_streamrolesettings_guildconfigid"); - b.ToTable("streamrolesettings", (string)null); - }); + b.ToTable("streamrolesettings", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("StreamRoleSettingsId") - .HasColumnType("integer") - .HasColumnName("streamrolesettingsid"); + b.Property("StreamRoleSettingsId") + .HasColumnType("integer") + .HasColumnName("streamrolesettingsid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); + b.Property("UserId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userid"); - b.Property("Username") - .HasColumnType("text") - .HasColumnName("username"); + b.Property("Username") + .HasColumnType("text") + .HasColumnName("username"); - b.HasKey("Id") - .HasName("pk_streamrolewhitelisteduser"); + b.HasKey("Id") + .HasName("pk_streamrolewhitelisteduser"); - b.HasIndex("StreamRoleSettingsId") - .HasDatabaseName("ix_streamrolewhitelisteduser_streamrolesettingsid"); + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamrolewhitelisteduser_streamrolesettingsid"); - b.ToTable("streamrolewhitelisteduser", (string)null); - }); + b.ToTable("streamrolewhitelisteduser", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("ArchiveId") - .HasColumnType("integer") - .HasColumnName("archiveid"); + b.Property("ArchiveId") + .HasColumnType("integer") + .HasColumnName("archiveid"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("IsDone") - .HasColumnType("boolean") - .HasColumnName("isdone"); + b.Property("IsDone") + .HasColumnType("boolean") + .HasColumnName("isdone"); - b.Property("Todo") - .HasColumnType("text") - .HasColumnName("todo"); + b.Property("Todo") + .HasColumnType("text") + .HasColumnName("todo"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); + b.Property("UserId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userid"); - b.HasKey("Id") - .HasName("pk_todos"); + b.HasKey("Id") + .HasName("pk_todos"); - b.HasIndex("ArchiveId") - .HasDatabaseName("ix_todos_archiveid"); + b.HasIndex("ArchiveId") + .HasDatabaseName("ix_todos_archiveid"); - b.HasIndex("UserId") - .HasDatabaseName("ix_todos_userid"); + b.HasIndex("UserId") + .HasDatabaseName("ix_todos_userid"); - b.ToTable("todos", (string)null); - }); + b.ToTable("todos", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.Property("UnbanAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("unbanat"); + b.Property("UnbanAt") + .HasColumnType("timestamp without time zone") + .HasColumnName("unbanat"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); + b.Property("UserId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userid"); - b.HasKey("Id") - .HasName("pk_unbantimer"); + b.HasKey("Id") + .HasName("pk_unbantimer"); - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_unbantimer_guildconfigid"); + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unbantimer_guildconfigid"); - b.ToTable("unbantimer", (string)null); - }); + b.ToTable("unbantimer", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.Property("UnmuteAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("unmuteat"); + b.Property("UnmuteAt") + .HasColumnType("timestamp without time zone") + .HasColumnName("unmuteat"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); + b.Property("UserId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userid"); - b.HasKey("Id") - .HasName("pk_unmutetimer"); + b.HasKey("Id") + .HasName("pk_unmutetimer"); - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_unmutetimer_guildconfigid"); + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unmutetimer_guildconfigid"); - b.ToTable("unmutetimer", (string)null); - }); + b.ToTable("unmutetimer", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); + b.Property("RoleId") + .HasColumnType("numeric(20,0)") + .HasColumnName("roleid"); - b.Property("UnbanAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("unbanat"); + b.Property("UnbanAt") + .HasColumnType("timestamp without time zone") + .HasColumnName("unbanat"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); + b.Property("UserId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userid"); - b.HasKey("Id") - .HasName("pk_unroletimer"); + b.HasKey("Id") + .HasName("pk_unroletimer"); - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_unroletimer_guildconfigid"); + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unroletimer_guildconfigid"); - b.ToTable("unroletimer", (string)null); - }); + b.ToTable("unroletimer", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.UserXpStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("AwardedXp") - .HasColumnType("bigint") - .HasColumnName("awardedxp"); + b.Property("AwardedXp") + .HasColumnType("bigint") + .HasColumnName("awardedxp"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + b.Property("GuildId") + .HasColumnType("numeric(20,0)") + .HasColumnName("guildid"); - b.Property("NotifyOnLevelUp") - .HasColumnType("integer") - .HasColumnName("notifyonlevelup"); + b.Property("NotifyOnLevelUp") + .HasColumnType("integer") + .HasColumnName("notifyonlevelup"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); + b.Property("UserId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userid"); - b.Property("Xp") - .HasColumnType("bigint") - .HasColumnName("xp"); + b.Property("Xp") + .HasColumnType("bigint") + .HasColumnName("xp"); - b.HasKey("Id") - .HasName("pk_userxpstats"); + b.HasKey("Id") + .HasName("pk_userxpstats"); - b.HasIndex("AwardedXp") - .HasDatabaseName("ix_userxpstats_awardedxp"); + b.HasIndex("AwardedXp") + .HasDatabaseName("ix_userxpstats_awardedxp"); - b.HasIndex("GuildId") - .HasDatabaseName("ix_userxpstats_guildid"); + b.HasIndex("GuildId") + .HasDatabaseName("ix_userxpstats_guildid"); - b.HasIndex("UserId") - .HasDatabaseName("ix_userxpstats_userid"); + b.HasIndex("UserId") + .HasDatabaseName("ix_userxpstats_userid"); - b.HasIndex("Xp") - .HasDatabaseName("ix_userxpstats_xp"); + b.HasIndex("Xp") + .HasDatabaseName("ix_userxpstats_xp"); - b.HasIndex("UserId", "GuildId") - .IsUnique() - .HasDatabaseName("ix_userxpstats_userid_guildid"); + b.HasIndex("UserId", "GuildId") + .IsUnique() + .HasDatabaseName("ix_userxpstats_userid_guildid"); - b.ToTable("userxpstats", (string)null); - }); + b.ToTable("userxpstats", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.VcRoleInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); + b.Property("RoleId") + .HasColumnType("numeric(20,0)") + .HasColumnName("roleid"); - b.Property("VoiceChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("voicechannelid"); + b.Property("VoiceChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("voicechannelid"); - b.HasKey("Id") - .HasName("pk_vcroleinfo"); + b.HasKey("Id") + .HasName("pk_vcroleinfo"); - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_vcroleinfo_guildconfigid"); + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_vcroleinfo_guildconfigid"); - b.ToTable("vcroleinfo", (string)null); - }); + b.ToTable("vcroleinfo", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("AffinityId") - .HasColumnType("integer") - .HasColumnName("affinityid"); + b.Property("AffinityId") + .HasColumnType("integer") + .HasColumnName("affinityid"); - b.Property("ClaimerId") - .HasColumnType("integer") - .HasColumnName("claimerid"); + b.Property("ClaimerId") + .HasColumnType("integer") + .HasColumnName("claimerid"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("Price") - .HasColumnType("bigint") - .HasColumnName("price"); + b.Property("Price") + .HasColumnType("bigint") + .HasColumnName("price"); - b.Property("WaifuId") - .HasColumnType("integer") - .HasColumnName("waifuid"); + b.Property("WaifuId") + .HasColumnType("integer") + .HasColumnName("waifuid"); - b.HasKey("Id") - .HasName("pk_waifuinfo"); + b.HasKey("Id") + .HasName("pk_waifuinfo"); - b.HasIndex("AffinityId") - .HasDatabaseName("ix_waifuinfo_affinityid"); + b.HasIndex("AffinityId") + .HasDatabaseName("ix_waifuinfo_affinityid"); - b.HasIndex("ClaimerId") - .HasDatabaseName("ix_waifuinfo_claimerid"); + b.HasIndex("ClaimerId") + .HasDatabaseName("ix_waifuinfo_claimerid"); - b.HasIndex("Price") - .HasDatabaseName("ix_waifuinfo_price"); + b.HasIndex("Price") + .HasDatabaseName("ix_waifuinfo_price"); - b.HasIndex("WaifuId") - .IsUnique() - .HasDatabaseName("ix_waifuinfo_waifuid"); + b.HasIndex("WaifuId") + .IsUnique() + .HasDatabaseName("ix_waifuinfo_waifuid"); - b.ToTable("waifuinfo", (string)null); - }); + b.ToTable("waifuinfo", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("ItemEmoji") - .HasColumnType("text") - .HasColumnName("itememoji"); + b.Property("ItemEmoji") + .HasColumnType("text") + .HasColumnName("itememoji"); - b.Property("Name") - .HasColumnType("text") - .HasColumnName("name"); + b.Property("Name") + .HasColumnType("text") + .HasColumnName("name"); - b.Property("WaifuInfoId") - .HasColumnType("integer") - .HasColumnName("waifuinfoid"); + b.Property("WaifuInfoId") + .HasColumnType("integer") + .HasColumnName("waifuinfoid"); - b.HasKey("Id") - .HasName("pk_waifuitem"); + b.HasKey("Id") + .HasName("pk_waifuitem"); - b.HasIndex("WaifuInfoId") - .HasDatabaseName("ix_waifuitem_waifuinfoid"); + b.HasIndex("WaifuInfoId") + .HasDatabaseName("ix_waifuitem_waifuinfoid"); - b.ToTable("waifuitem", (string)null); - }); + b.ToTable("waifuitem", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("NewId") - .HasColumnType("integer") - .HasColumnName("newid"); + b.Property("NewId") + .HasColumnType("integer") + .HasColumnName("newid"); - b.Property("OldId") - .HasColumnType("integer") - .HasColumnName("oldid"); + b.Property("OldId") + .HasColumnType("integer") + .HasColumnName("oldid"); - b.Property("UpdateType") - .HasColumnType("integer") - .HasColumnName("updatetype"); + b.Property("UpdateType") + .HasColumnType("integer") + .HasColumnName("updatetype"); - b.Property("UserId") - .HasColumnType("integer") - .HasColumnName("userid"); + b.Property("UserId") + .HasColumnType("integer") + .HasColumnName("userid"); - b.HasKey("Id") - .HasName("pk_waifuupdates"); + b.HasKey("Id") + .HasName("pk_waifuupdates"); - b.HasIndex("NewId") - .HasDatabaseName("ix_waifuupdates_newid"); + b.HasIndex("NewId") + .HasDatabaseName("ix_waifuupdates_newid"); - b.HasIndex("OldId") - .HasDatabaseName("ix_waifuupdates_oldid"); + b.HasIndex("OldId") + .HasDatabaseName("ix_waifuupdates_oldid"); - b.HasIndex("UserId") - .HasDatabaseName("ix_waifuupdates_userid"); + b.HasIndex("UserId") + .HasDatabaseName("ix_waifuupdates_userid"); - b.ToTable("waifuupdates", (string)null); - }); + b.ToTable("waifuupdates", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.Warning", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("Forgiven") - .HasColumnType("boolean") - .HasColumnName("forgiven"); + b.Property("Forgiven") + .HasColumnType("boolean") + .HasColumnName("forgiven"); - b.Property("ForgivenBy") - .HasColumnType("text") - .HasColumnName("forgivenby"); + b.Property("ForgivenBy") + .HasColumnType("text") + .HasColumnName("forgivenby"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + b.Property("GuildId") + .HasColumnType("numeric(20,0)") + .HasColumnName("guildid"); - b.Property("Moderator") - .HasColumnType("text") - .HasColumnName("moderator"); + b.Property("Moderator") + .HasColumnType("text") + .HasColumnName("moderator"); - b.Property("Reason") - .HasColumnType("text") - .HasColumnName("reason"); + b.Property("Reason") + .HasColumnType("text") + .HasColumnName("reason"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); + b.Property("UserId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userid"); - b.Property("Weight") - .ValueGeneratedOnAdd() - .HasColumnType("bigint") - .HasDefaultValue(1L) - .HasColumnName("weight"); + b.Property("Weight") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(1L) + .HasColumnName("weight"); - b.HasKey("Id") - .HasName("pk_warnings"); + b.HasKey("Id") + .HasName("pk_warnings"); - b.HasIndex("DateAdded") - .HasDatabaseName("ix_warnings_dateadded"); + b.HasIndex("DateAdded") + .HasDatabaseName("ix_warnings_dateadded"); - b.HasIndex("GuildId") - .HasDatabaseName("ix_warnings_guildid"); + b.HasIndex("GuildId") + .HasDatabaseName("ix_warnings_guildid"); - b.HasIndex("UserId") - .HasDatabaseName("ix_warnings_userid"); + b.HasIndex("UserId") + .HasDatabaseName("ix_warnings_userid"); - b.ToTable("warnings", (string)null); - }); + b.ToTable("warnings", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.WarningPunishment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Count") - .HasColumnType("integer") - .HasColumnName("count"); + b.Property("Count") + .HasColumnType("integer") + .HasColumnName("count"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.Property("Punishment") - .HasColumnType("integer") - .HasColumnName("punishment"); + b.Property("Punishment") + .HasColumnType("integer") + .HasColumnName("punishment"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); + b.Property("RoleId") + .HasColumnType("numeric(20,0)") + .HasColumnName("roleid"); - b.Property("Time") - .HasColumnType("integer") - .HasColumnName("time"); + b.Property("Time") + .HasColumnType("integer") + .HasColumnName("time"); - b.HasKey("Id") - .HasName("pk_warningpunishment"); + b.HasKey("Id") + .HasName("pk_warningpunishment"); - b.HasAlternateKey("GuildId", "Count") - .HasName("ak_warningpunishment_guildid_count"); + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_warningpunishment_guildconfigid"); - b.ToTable("warningpunishment", (string)null); - }); + b.ToTable("warningpunishment", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Amount") - .HasColumnType("integer") - .HasColumnName("amount"); + b.Property("Amount") + .HasColumnType("integer") + .HasColumnName("amount"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); + b.Property("Level") + .HasColumnType("integer") + .HasColumnName("level"); - b.Property("XpSettingsId") - .HasColumnType("integer") - .HasColumnName("xpsettingsid"); + b.Property("XpSettingsId") + .HasColumnType("integer") + .HasColumnName("xpsettingsid"); - b.HasKey("Id") - .HasName("pk_xpcurrencyreward"); + b.HasKey("Id") + .HasName("pk_xpcurrencyreward"); - b.HasIndex("XpSettingsId") - .HasDatabaseName("ix_xpcurrencyreward_xpsettingsid"); + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_xpcurrencyreward_xpsettingsid"); - b.ToTable("xpcurrencyreward", (string)null); - }); + b.ToTable("xpcurrencyreward", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("Level") - .HasColumnType("integer") - .HasColumnName("level"); + b.Property("Level") + .HasColumnType("integer") + .HasColumnName("level"); - b.Property("Remove") - .HasColumnType("boolean") - .HasColumnName("remove"); + b.Property("Remove") + .HasColumnType("boolean") + .HasColumnName("remove"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") - .HasColumnName("roleid"); + b.Property("RoleId") + .HasColumnType("numeric(20,0)") + .HasColumnName("roleid"); - b.Property("XpSettingsId") - .HasColumnType("integer") - .HasColumnName("xpsettingsid"); + b.Property("XpSettingsId") + .HasColumnType("integer") + .HasColumnName("xpsettingsid"); - b.HasKey("Id") - .HasName("pk_xprolereward"); + b.HasKey("Id") + .HasName("pk_xprolereward"); - b.HasIndex("XpSettingsId", "Level") - .IsUnique() - .HasDatabaseName("ix_xprolereward_xpsettingsid_level"); + b.HasIndex("XpSettingsId", "Level") + .IsUnique() + .HasDatabaseName("ix_xprolereward_xpsettingsid_level"); - b.ToTable("xprolereward", (string)null); - }); + b.ToTable("xprolereward", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("GuildConfigId") + .HasColumnType("integer") + .HasColumnName("guildconfigid"); - b.Property("ServerExcluded") - .HasColumnType("boolean") - .HasColumnName("serverexcluded"); + b.Property("ServerExcluded") + .HasColumnType("boolean") + .HasColumnName("serverexcluded"); - b.HasKey("Id") - .HasName("pk_xpsettings"); + b.HasKey("Id") + .HasName("pk_xpsettings"); - b.HasIndex("GuildConfigId") - .IsUnique() - .HasDatabaseName("ix_xpsettings_guildconfigid"); + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_xpsettings_guildconfigid"); - b.ToTable("xpsettings", (string)null); - }); + b.ToTable("xpsettings", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.XpShopOwnedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") - .HasColumnName("dateadded"); + b.Property("DateAdded") + .HasColumnType("timestamp without time zone") + .HasColumnName("dateadded"); - b.Property("IsUsing") - .HasColumnType("boolean") - .HasColumnName("isusing"); + b.Property("IsUsing") + .HasColumnType("boolean") + .HasColumnName("isusing"); - b.Property("ItemKey") - .IsRequired() - .HasColumnType("text") - .HasColumnName("itemkey"); + b.Property("ItemKey") + .IsRequired() + .HasColumnType("text") + .HasColumnName("itemkey"); - b.Property("ItemType") - .HasColumnType("integer") - .HasColumnName("itemtype"); + b.Property("ItemType") + .HasColumnType("integer") + .HasColumnName("itemtype"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); + b.Property("UserId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userid"); - b.HasKey("Id") - .HasName("pk_xpshopowneditem"); + b.HasKey("Id") + .HasName("pk_xpshopowneditem"); - b.HasIndex("UserId", "ItemType", "ItemKey") - .IsUnique() - .HasDatabaseName("ix_xpshopowneditem_userid_itemtype_itemkey"); + b.HasIndex("UserId", "ItemType", "ItemKey") + .IsUnique() + .HasDatabaseName("ix_xpshopowneditem_userid_itemtype_itemkey"); - b.ToTable("xpshopowneditem", (string)null); - }); + b.ToTable("xpshopowneditem", (string)null); + }); modelBuilder.Entity("EllieBot.Services.GreetSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("AutoDeleteTimer") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasDefaultValue(0) - .HasColumnName("autodeletetimer"); + b.Property("AutoDeleteTimer") + .HasColumnType("integer") + .HasColumnName("autodeletetimer"); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") - .HasColumnName("channelid"); + b.Property("ChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("channelid"); - b.Property("GreetType") - .HasColumnType("integer") - .HasColumnName("greettype"); + b.Property("GreetType") + .HasColumnType("integer") + .HasColumnName("greettype"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + b.Property("GuildId") + .HasColumnType("numeric(20,0)") + .HasColumnName("guildid"); - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("isenabled"); + b.Property("IsEnabled") + .HasColumnType("boolean") + .HasColumnName("isenabled"); - b.Property("MessageText") - .HasColumnType("text") - .HasColumnName("messagetext"); + b.Property("MessageText") + .HasColumnType("text") + .HasColumnName("messagetext"); - b.HasKey("Id") - .HasName("pk_greetsettings"); + b.HasKey("Id") + .HasName("pk_greetsettings"); - b.HasIndex("GuildId", "GreetType") - .IsUnique() - .HasDatabaseName("ix_greetsettings_guildid_greettype"); + b.HasIndex("GuildId", "GreetType") + .IsUnique() + .HasDatabaseName("ix_greetsettings_guildid_greettype"); - b.ToTable("greetsettings", (string)null); - }); - - modelBuilder.Entity("EllieBot.Services.Rakeback", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("Amount") - .HasColumnType("numeric") - .HasColumnName("amount"); - - b.HasKey("UserId") - .HasName("pk_rakeback"); - - b.ToTable("rakeback", (string)null); - }); - - modelBuilder.Entity("EllieBot.Services.UserBetStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("integer") - .HasColumnName("id"); - - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("Game") - .HasColumnType("integer") - .HasColumnName("game"); - - b.Property("LoseCount") - .HasColumnType("bigint") - .HasColumnName("losecount"); - - b.Property("MaxBet") - .HasColumnType("bigint") - .HasColumnName("maxbet"); - - b.Property("MaxWin") - .HasColumnType("bigint") - .HasColumnName("maxwin"); - - b.Property("PaidOut") - .HasColumnType("numeric") - .HasColumnName("paidout"); - - b.Property("TotalBet") - .HasColumnType("numeric") - .HasColumnName("totalbet"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") - .HasColumnName("userid"); - - b.Property("WinCount") - .HasColumnType("bigint") - .HasColumnName("wincount"); - - b.HasKey("Id") - .HasName("pk_userbetstats"); - - b.HasIndex("UserId", "Game") - .IsUnique() - .HasDatabaseName("ix_userbetstats_userid_game"); - - b.ToTable("userbetstats", (string)null); - }); + b.ToTable("greetsettings", (string)null); + }); modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiAltSetting") - .HasForeignKey("EllieBot.Db.Models.AntiAltSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithOne("AntiAltSetting") + .HasForeignKey("EllieBot.Db.Models.AntiAltSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); + }); modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiRaidSetting") - .HasForeignKey("EllieBot.Db.Models.AntiRaidSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithOne("AntiRaidSetting") + .HasForeignKey("EllieBot.Db.Models.AntiRaidSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); + }); modelBuilder.Entity("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.HasOne("EllieBot.Db.Models.AntiSpamSetting", null) - .WithMany("IgnoredChannels") - .HasForeignKey("AntiSpamSettingId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); - }); + { + b.HasOne("EllieBot.Db.Models.AntiSpamSetting", null) + .WithMany("IgnoredChannels") + .HasForeignKey("AntiSpamSettingId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); + }); modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiSpamSetting") - .HasForeignKey("EllieBot.Db.Models.AntiSpamSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithOne("AntiSpamSetting") + .HasForeignKey("EllieBot.Db.Models.AntiSpamSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); + }); modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.HasOne("EllieBot.Db.Models.AutoTranslateChannel", "Channel") - .WithMany("Users") - .HasForeignKey("ChannelId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); + { + b.HasOne("EllieBot.Db.Models.AutoTranslateChannel", "Channel") + .WithMany("Users") + .HasForeignKey("ChannelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); - b.Navigation("Channel"); - }); + b.Navigation("Channel"); + }); modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Applicants") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubapplicants_clubs_clubid"); + { + b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") + .WithMany("Applicants") + .HasForeignKey("ClubId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_clubapplicants_clubs_clubid"); - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubapplicants_discorduser_userid"); + b.HasOne("EllieBot.Db.Models.DiscordUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_clubapplicants_discorduser_userid"); - b.Navigation("Club"); + b.Navigation("Club"); - b.Navigation("User"); - }); + b.Navigation("User"); + }); modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Bans") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubbans_clubs_clubid"); + { + b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") + .WithMany("Bans") + .HasForeignKey("ClubId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_clubbans_clubs_clubid"); - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_clubbans_discorduser_userid"); + b.HasOne("EllieBot.Db.Models.DiscordUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_clubbans_discorduser_userid"); - b.Navigation("Club"); + b.Navigation("Club"); - b.Navigation("User"); - }); + b.Navigation("User"); + }); modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Owner") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.ClubInfo", "OwnerId") - .OnDelete(DeleteBehavior.SetNull) - .HasConstraintName("fk_clubs_discorduser_ownerid"); + { + b.HasOne("EllieBot.Db.Models.DiscordUser", "Owner") + .WithOne() + .HasForeignKey("EllieBot.Db.Models.ClubInfo", "OwnerId") + .OnDelete(DeleteBehavior.SetNull) + .HasConstraintName("fk_clubs_discorduser_ownerid"); - b.Navigation("Owner"); - }); + b.Navigation("Owner"); + }); modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandAliases") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("CommandAliases") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); + }); modelBuilder.Entity("EllieBot.Db.Models.CommandCooldown", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandCooldowns") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("CommandCooldowns") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); + }); modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("DelMsgOnCmdChannels") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("DelMsgOnCmdChannels") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); + }); modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Members") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.NoAction) - .HasConstraintName("fk_discorduser_clubs_clubid"); + { + b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") + .WithMany("Members") + .HasForeignKey("ClubId") + .OnDelete(DeleteBehavior.NoAction) + .HasConstraintName("fk_discorduser_clubs_clubid"); - b.Navigation("Club"); - }); + b.Navigation("Club"); + }); modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("ExclusionList") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); + { + b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") + .WithMany("ExclusionList") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); - b.Navigation("XpSettings"); - }); + b.Navigation("XpSettings"); + }); modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("FeedSubs") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_feedsub_guildconfigs_guildconfigid"); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") + .WithMany("FeedSubs") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_feedsub_guildconfigs_guildconfigid"); - b.Navigation("GuildConfig"); - }); + b.Navigation("GuildConfig"); + }); modelBuilder.Entity("EllieBot.Db.Models.FilterChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterInvitesChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("FilterInvitesChannelIds") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); + }); modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterLinksChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("FilterLinksChannelIds") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); + }); modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterWordsChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("FilterWordsChannelIds") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); + }); modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilteredWords") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("FilteredWords") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); + }); modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FollowedStreams") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("FollowedStreams") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); + }); modelBuilder.Entity("EllieBot.Db.Models.GCChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("GenerateCurrencyChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") + .WithMany("GenerateCurrencyChannelIds") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); - b.Navigation("GuildConfig"); - }); + b.Navigation("GuildConfig"); + }); modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.HasOne("EllieBot.Db.Models.GiveawayModel", null) - .WithMany("Participants") - .HasForeignKey("GiveawayId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_giveawayuser_giveawaymodel_giveawayid"); - }); + { + b.HasOne("EllieBot.Db.Models.GiveawayModel", null) + .WithMany("Participants") + .HasForeignKey("GiveawayId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_giveawayuser_giveawaymodel_giveawayid"); + }); modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("SelfAssignableRoleGroupNames") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_groupname_guildconfigs_guildconfigid"); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") + .WithMany("SelfAssignableRoleGroupNames") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_groupname_guildconfigs_guildconfigid"); - b.Navigation("GuildConfig"); - }); + b.Navigation("GuildConfig"); + }); modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.HasOne("EllieBot.Db.Models.LogSetting", "LogSetting") - .WithMany("LogIgnores") - .HasForeignKey("LogSettingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_ignoredlogchannels_logsettings_logsettingid"); + { + b.HasOne("EllieBot.Db.Models.LogSetting", "LogSetting") + .WithMany("LogIgnores") + .HasForeignKey("LogSettingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ignoredlogchannels_logsettings_logsettingid"); - b.Navigation("LogSetting"); - }); + b.Navigation("LogSetting"); + }); modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("MutedUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("MutedUsers") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); + }); modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("Permissions") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("Permissions") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); + }); modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.HasOne("EllieBot.Db.Models.MusicPlaylist", null) - .WithMany("Songs") - .HasForeignKey("MusicPlaylistId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); - }); + { + b.HasOne("EllieBot.Db.Models.MusicPlaylist", null) + .WithMany("Songs") + .HasForeignKey("MusicPlaylistId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); + }); modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("ShopEntries") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("ShopEntries") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); + }); modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.HasOne("EllieBot.Db.Models.ShopEntry", null) - .WithMany("Items") - .HasForeignKey("ShopEntryId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); - }); + { + b.HasOne("EllieBot.Db.Models.ShopEntry", null) + .WithMany("Items") + .HasForeignKey("ShopEntryId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); + }); modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredRoles") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredRoles") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); + }); modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredUsers") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); + }); modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Blacklist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesett~"); + { + b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") + .WithMany("Blacklist") + .HasForeignKey("StreamRoleSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesett~"); - b.Navigation("StreamRoleSettings"); - }); + b.Navigation("StreamRoleSettings"); + }); modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("StreamRole") - .HasForeignKey("EllieBot.Db.Models.StreamRoleSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") + .WithOne("StreamRole") + .HasForeignKey("EllieBot.Db.Models.StreamRoleSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); - b.Navigation("GuildConfig"); - }); + b.Navigation("GuildConfig"); + }); modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Whitelist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesett~"); + { + b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") + .WithMany("Whitelist") + .HasForeignKey("StreamRoleSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesett~"); - b.Navigation("StreamRoleSettings"); - }); + b.Navigation("StreamRoleSettings"); + }); modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.HasOne("EllieBot.Db.Models.ArchivedTodoListModel", null) - .WithMany("Items") - .HasForeignKey("ArchiveId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_todos_todosarchive_archiveid"); - }); + { + b.HasOne("EllieBot.Db.Models.ArchivedTodoListModel", null) + .WithMany("Items") + .HasForeignKey("ArchiveId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_todos_todosarchive_archiveid"); + }); modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnbanTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("UnbanTimer") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); + }); modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnmuteTimers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("UnmuteTimers") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); + }); modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnroleTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("UnroleTimer") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); + }); modelBuilder.Entity("EllieBot.Db.Models.VcRoleInfo", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("VcRoleInfos") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("VcRoleInfos") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); + }); modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Affinity") - .WithMany() - .HasForeignKey("AffinityId") - .HasConstraintName("fk_waifuinfo_discorduser_affinityid"); + { + b.HasOne("EllieBot.Db.Models.DiscordUser", "Affinity") + .WithMany() + .HasForeignKey("AffinityId") + .HasConstraintName("fk_waifuinfo_discorduser_affinityid"); - b.HasOne("EllieBot.Db.Models.DiscordUser", "Claimer") - .WithMany() - .HasForeignKey("ClaimerId") - .HasConstraintName("fk_waifuinfo_discorduser_claimerid"); + b.HasOne("EllieBot.Db.Models.DiscordUser", "Claimer") + .WithMany() + .HasForeignKey("ClaimerId") + .HasConstraintName("fk_waifuinfo_discorduser_claimerid"); - b.HasOne("EllieBot.Db.Models.DiscordUser", "Waifu") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.WaifuInfo", "WaifuId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); + b.HasOne("EllieBot.Db.Models.DiscordUser", "Waifu") + .WithOne() + .HasForeignKey("EllieBot.Db.Models.WaifuInfo", "WaifuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); - b.Navigation("Affinity"); + b.Navigation("Affinity"); - b.Navigation("Claimer"); + b.Navigation("Claimer"); - b.Navigation("Waifu"); - }); + b.Navigation("Waifu"); + }); modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.HasOne("EllieBot.Db.Models.WaifuInfo", "WaifuInfo") - .WithMany("Items") - .HasForeignKey("WaifuInfoId") - .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); + { + b.HasOne("EllieBot.Db.Models.WaifuInfo", "WaifuInfo") + .WithMany("Items") + .HasForeignKey("WaifuInfoId") + .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); - b.Navigation("WaifuInfo"); - }); + b.Navigation("WaifuInfo"); + }); modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "New") - .WithMany() - .HasForeignKey("NewId") - .HasConstraintName("fk_waifuupdates_discorduser_newid"); + { + b.HasOne("EllieBot.Db.Models.DiscordUser", "New") + .WithMany() + .HasForeignKey("NewId") + .HasConstraintName("fk_waifuupdates_discorduser_newid"); - b.HasOne("EllieBot.Db.Models.DiscordUser", "Old") - .WithMany() - .HasForeignKey("OldId") - .HasConstraintName("fk_waifuupdates_discorduser_oldid"); + b.HasOne("EllieBot.Db.Models.DiscordUser", "Old") + .WithMany() + .HasForeignKey("OldId") + .HasConstraintName("fk_waifuupdates_discorduser_oldid"); - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_waifuupdates_discorduser_userid"); + b.HasOne("EllieBot.Db.Models.DiscordUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_waifuupdates_discorduser_userid"); - b.Navigation("New"); + b.Navigation("New"); - b.Navigation("Old"); + b.Navigation("Old"); - b.Navigation("User"); - }); + b.Navigation("User"); + }); + + modelBuilder.Entity("EllieBot.Db.Models.WarningPunishment", b => + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("WarnPunishments") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_warningpunishment_guildconfigs_guildconfigid"); + }); modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("CurrencyRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_xpcurrencyreward_xpsettings_xpsettingsid"); + { + b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") + .WithMany("CurrencyRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpcurrencyreward_xpsettings_xpsettingsid"); - b.Navigation("XpSettings"); - }); + b.Navigation("XpSettings"); + }); modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("RoleRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_xprolereward_xpsettings_xpsettingsid"); + { + b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") + .WithMany("RoleRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xprolereward_xpsettings_xpsettingsid"); - b.Navigation("XpSettings"); - }); + b.Navigation("XpSettings"); + }); modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("XpSettings") - .HasForeignKey("EllieBot.Db.Models.XpSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") + .WithOne("XpSettings") + .HasForeignKey("EllieBot.Db.Models.XpSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); - b.Navigation("GuildConfig"); - }); + b.Navigation("GuildConfig"); + }); modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Navigation("IgnoredChannels"); - }); + { + b.Navigation("IgnoredChannels"); + }); modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Navigation("Items"); - }); + { + b.Navigation("Items"); + }); modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Navigation("Users"); - }); + { + b.Navigation("Users"); + }); modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Navigation("Applicants"); + { + b.Navigation("Applicants"); - b.Navigation("Bans"); + b.Navigation("Bans"); - b.Navigation("Members"); - }); + b.Navigation("Members"); + }); modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Navigation("Participants"); - }); + { + b.Navigation("Participants"); + }); modelBuilder.Entity("EllieBot.Db.Models.GuildConfig", b => - { - b.Navigation("AntiAltSetting"); + { + b.Navigation("AntiAltSetting"); - b.Navigation("AntiRaidSetting"); + b.Navigation("AntiRaidSetting"); - b.Navigation("AntiSpamSetting"); + b.Navigation("AntiSpamSetting"); - b.Navigation("CommandAliases"); + b.Navigation("CommandAliases"); - b.Navigation("CommandCooldowns"); + b.Navigation("CommandCooldowns"); - b.Navigation("DelMsgOnCmdChannels"); + b.Navigation("DelMsgOnCmdChannels"); - b.Navigation("FeedSubs"); + b.Navigation("FeedSubs"); - b.Navigation("FilterInvitesChannelIds"); + b.Navigation("FilterInvitesChannelIds"); - b.Navigation("FilterLinksChannelIds"); + b.Navigation("FilterLinksChannelIds"); - b.Navigation("FilterWordsChannelIds"); + b.Navigation("FilterWordsChannelIds"); - b.Navigation("FilteredWords"); + b.Navigation("FilteredWords"); - b.Navigation("FollowedStreams"); + b.Navigation("FollowedStreams"); - b.Navigation("GenerateCurrencyChannelIds"); + b.Navigation("GenerateCurrencyChannelIds"); - b.Navigation("MutedUsers"); + b.Navigation("MutedUsers"); - b.Navigation("Permissions"); + b.Navigation("Permissions"); - b.Navigation("SelfAssignableRoleGroupNames"); + b.Navigation("SelfAssignableRoleGroupNames"); - b.Navigation("ShopEntries"); + b.Navigation("ShopEntries"); - b.Navigation("SlowmodeIgnoredRoles"); + b.Navigation("SlowmodeIgnoredRoles"); - b.Navigation("SlowmodeIgnoredUsers"); + b.Navigation("SlowmodeIgnoredUsers"); - b.Navigation("StreamRole"); + b.Navigation("StreamRole"); - b.Navigation("UnbanTimer"); + b.Navigation("UnbanTimer"); - b.Navigation("UnmuteTimers"); + b.Navigation("UnmuteTimers"); - b.Navigation("UnroleTimer"); + b.Navigation("UnroleTimer"); - b.Navigation("VcRoleInfos"); + b.Navigation("VcRoleInfos"); - b.Navigation("XpSettings"); - }); + b.Navigation("WarnPunishments"); + + b.Navigation("XpSettings"); + }); modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Navigation("LogIgnores"); - }); + { + b.Navigation("LogIgnores"); + }); modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Navigation("Songs"); - }); + { + b.Navigation("Songs"); + }); modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Navigation("Items"); - }); + { + b.Navigation("Items"); + }); modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Navigation("Blacklist"); + { + b.Navigation("Blacklist"); - b.Navigation("Whitelist"); - }); + b.Navigation("Whitelist"); + }); modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Navigation("Items"); - }); + { + b.Navigation("Items"); + }); modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Navigation("CurrencyRewards"); + { + b.Navigation("CurrencyRewards"); - b.Navigation("ExclusionList"); + b.Navigation("ExclusionList"); - b.Navigation("RoleRewards"); - }); + b.Navigation("RoleRewards"); + }); #pragma warning restore 612, 618 } } diff --git a/src/EllieBot/Migrations/Sqlite/20241028033656_ncanvas.Designer.cs b/src/EllieBot/Migrations/Sqlite/20240911104847_greet-settings.Designer.cs similarity index 98% rename from src/EllieBot/Migrations/Sqlite/20241028033656_ncanvas.Designer.cs rename to src/EllieBot/Migrations/Sqlite/20240911104847_greet-settings.Designer.cs index d85e305..54ccb84 100644 --- a/src/EllieBot/Migrations/Sqlite/20241028033656_ncanvas.Designer.cs +++ b/src/EllieBot/Migrations/Sqlite/20240911104847_greet-settings.Designer.cs @@ -11,8 +11,8 @@ using EllieBot.Db; namespace EllieBot.Migrations { [DbContext(typeof(SqliteContext))] - [Migration("20241028033656_ncanvas")] - partial class ncanvas + [Migration("20240911104847_greet-settings")] + partial class greetsettings { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -599,8 +599,6 @@ namespace EllieBot.Migrations b.HasIndex("UserId"); - b.HasIndex("Username"); - b.ToTable("DiscordUser"); }); @@ -1218,38 +1216,6 @@ namespace EllieBot.Migrations b.ToTable("MutedUserId"); }); - modelBuilder.Entity("EllieBot.Db.Models.NCPixel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Color") - .HasColumnType("INTEGER"); - - b.Property("OwnerId") - .HasColumnType("INTEGER"); - - b.Property("Position") - .HasColumnType("INTEGER"); - - b.Property("Price") - .HasColumnType("INTEGER"); - - b.Property("Text") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasAlternateKey("Position"); - - b.HasIndex("OwnerId"); - - b.ToTable("NCPixel"); - }); - modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => { b.Property("Id") @@ -2220,7 +2186,7 @@ namespace EllieBot.Migrations b.Property("DateAdded") .HasColumnType("TEXT"); - b.Property("GuildId") + b.Property("GuildConfigId") .HasColumnType("INTEGER"); b.Property("Punishment") @@ -2234,7 +2200,7 @@ namespace EllieBot.Migrations b.HasKey("Id"); - b.HasAlternateKey("GuildId", "Count"); + b.HasIndex("GuildConfigId"); b.ToTable("WarningPunishment"); }); @@ -2353,9 +2319,7 @@ namespace EllieBot.Migrations .HasColumnType("INTEGER"); b.Property("AutoDeleteTimer") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0); + .HasColumnType("INTEGER"); b.Property("ChannelId") .HasColumnType("INTEGER"); @@ -2367,9 +2331,7 @@ namespace EllieBot.Migrations .HasColumnType("INTEGER"); b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(false); + .HasColumnType("INTEGER"); b.Property("MessageText") .HasColumnType("TEXT"); @@ -2797,6 +2759,14 @@ namespace EllieBot.Migrations b.Navigation("User"); }); + modelBuilder.Entity("EllieBot.Db.Models.WarningPunishment", b => + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("WarnPunishments") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade); + }); + modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => { b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") @@ -2909,6 +2879,8 @@ namespace EllieBot.Migrations b.Navigation("VcRoleInfos"); + b.Navigation("WarnPunishments"); + b.Navigation("XpSettings"); }); diff --git a/src/EllieBot/Migrations/Sqlite/20240912124710_greet-settings.cs b/src/EllieBot/Migrations/Sqlite/20240911104847_greet-settings.cs similarity index 78% rename from src/EllieBot/Migrations/Sqlite/20240912124710_greet-settings.cs rename to src/EllieBot/Migrations/Sqlite/20240911104847_greet-settings.cs index 978c129..12448ba 100644 --- a/src/EllieBot/Migrations/Sqlite/20240912124710_greet-settings.cs +++ b/src/EllieBot/Migrations/Sqlite/20240911104847_greet-settings.cs @@ -19,9 +19,9 @@ namespace EllieBot.Migrations GuildId = table.Column(type: "INTEGER", nullable: false), GreetType = table.Column(type: "INTEGER", nullable: false), MessageText = table.Column(type: "TEXT", nullable: true), - IsEnabled = table.Column(type: "INTEGER", nullable: false, defaultValue: false), + IsEnabled = table.Column(type: "INTEGER", nullable: false), ChannelId = table.Column(type: "INTEGER", nullable: true), - AutoDeleteTimer = table.Column(type: "INTEGER", nullable: false, defaultValue: 0) + AutoDeleteTimer = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { @@ -33,8 +33,30 @@ namespace EllieBot.Migrations table: "GreetSettings", columns: new[] { "GuildId", "GreetType" }, unique: true); - - MigrationQueries.GreetSettingsCopy(migrationBuilder); + + + migrationBuilder.Sql(""" + INSERT INTO GreetSettings (GuildId, GreetType, MessageText, IsEnabled, ChannelId, AutoDeleteTimer) + SELECT GuildId, 0, ChannelGreetMessageText, SendChannelGreetMessage, GreetMessageChannelId, AutoDeleteGreetMessagesTimer + FROM GuildConfigs + WHERE SendChannelGreetMessage = 1; + + INSERT INTO GreetSettings (GuildId, GreetType, MessageText, IsEnabled, ChannelId, AutoDeleteTimer) + SELECT GuildId, 1, DmGreetMessageText, SendDmGreetMessage, GreetMessageChannelId, 0 + FROM GuildConfigs + WHERE SendDmGreetMessage = 1; + + INSERT INTO GreetSettings (GuildId, GreetType, MessageText, IsEnabled, ChannelId, AutoDeleteTimer) + SELECT GuildId, 2, ChannelByeMessageText, SendChannelByeMessage, ByeMessageChannelId, AutoDeleteByeMessagesTimer + FROM GuildConfigs + WHERE SendChannelByeMessage = 1; + + INSERT INTO GreetSettings (GuildId, GreetType, MessageText, IsEnabled, ChannelId, AutoDeleteTimer) + SELECT GuildId, 3, BoostMessage, SendBoostMessage, BoostMessageChannelId, BoostMessageDeleteAfter + FROM GuildConfigs + WHERE SendBoostMessage = 1; + """); + migrationBuilder.DropColumn( name: "AutoDeleteByeMessagesTimer", diff --git a/src/EllieBot/Migrations/Sqlite/20240912124710_greet-settings.Designer.cs b/src/EllieBot/Migrations/Sqlite/20240912124710_greet-settings.Designer.cs deleted file mode 100644 index a7edabe..0000000 --- a/src/EllieBot/Migrations/Sqlite/20240912124710_greet-settings.Designer.cs +++ /dev/null @@ -1,2929 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using EllieBot.Db; - -#nullable disable - -namespace EllieBot.Migrations -{ - [DbContext(typeof(SqliteContext))] - [Migration("20240912124710_greet-settings")] - partial class greetsettings - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.8"); - - modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Action") - .HasColumnType("INTEGER"); - - b.Property("ActionDurationMinutes") - .HasColumnType("INTEGER"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("MinAge") - .HasColumnType("TEXT"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId") - .IsUnique(); - - b.ToTable("AntiAltSetting"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Action") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AntiSpamSettingId") - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("AntiSpamSettingId"); - - b.ToTable("AntiSpamIgnore"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Action") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("MessageThreshold") - .HasColumnType("INTEGER"); - - b.Property("MuteTime") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId") - .IsUnique(); - - b.ToTable("AntiSpamSetting"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("TodosArchive"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoCommand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("ChannelName") - .HasColumnType("TEXT"); - - b.Property("CommandText") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("GuildName") - .HasColumnType("TEXT"); - - b.Property("Interval") - .HasColumnType("INTEGER"); - - b.Property("VoiceChannelId") - .HasColumnType("INTEGER"); - - b.Property("VoiceChannelName") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("AutoCommands"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoPublishChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.ToTable("AutoPublishChannel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AutoDelete") - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ChannelId") - .IsUnique(); - - b.HasIndex("GuildId"); - - b.ToTable("AutoTranslateChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Source") - .HasColumnType("TEXT"); - - b.Property("Target") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasAlternateKey("ChannelId", "UserId"); - - b.ToTable("AutoTranslateUsers"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BanTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("PruneDays") - .HasColumnType("INTEGER"); - - b.Property("Text") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.ToTable("BanTemplates"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Balance") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("BankUsers"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BlacklistEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ItemId") - .HasColumnType("INTEGER"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("Blacklist"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.Property("ClubId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("ClubId", "UserId"); - - b.HasIndex("UserId"); - - b.ToTable("ClubApplicants"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.Property("ClubId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("ClubId", "UserId"); - - b.HasIndex("UserId"); - - b.ToTable("ClubBans"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Description") - .HasColumnType("TEXT"); - - b.Property("ImageUrl") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasMaxLength(20) - .HasColumnType("TEXT"); - - b.Property("OwnerId") - .HasColumnType("INTEGER"); - - b.Property("Xp") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("OwnerId") - .IsUnique(); - - b.ToTable("Clubs"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.CommandCooldown", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CommandName") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Seconds") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("CommandCooldown"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CurrencyTransaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Amount") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Extra") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Note") - .HasColumnType("TEXT"); - - b.Property("OtherId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValueSql("NULL"); - - b.Property("Type") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("CurrencyTransactions"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("State") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("DelMsgOnCmdChannel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordPermOverride", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Command") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Perm") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "Command") - .IsUnique(); - - b.ToTable("DiscordPermOverrides"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AvatarId") - .HasColumnType("TEXT"); - - b.Property("ClubId") - .HasColumnType("INTEGER"); - - b.Property("CurrencyAmount") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0L); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Discriminator") - .HasColumnType("TEXT"); - - b.Property("IsClubAdmin") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(false); - - b.Property("NotifyOnLevelUp") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0); - - b.Property("TotalXp") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0L); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("Username") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasAlternateKey("UserId"); - - b.HasIndex("ClubId"); - - b.HasIndex("CurrencyAmount"); - - b.HasIndex("TotalXp"); - - b.HasIndex("UserId"); - - b.ToTable("DiscordUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ItemId") - .HasColumnType("INTEGER"); - - b.Property("ItemType") - .HasColumnType("INTEGER"); - - b.Property("XpSettingsId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("XpSettingsId"); - - b.ToTable("ExcludedItem"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.FilterChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("FilterChannelId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("FilterLinksChannelId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("FilterWordsChannelId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Word") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("FilteredWord"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - 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("EllieBot.Db.Models.GCChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("GCChannelId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GamblingStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Bet") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Feature") - .HasColumnType("TEXT"); - - b.Property("PaidOut") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Feature") - .IsUnique(); - - b.ToTable("GamblingStats"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("EndsAt") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Message") - .HasColumnType("TEXT"); - - b.Property("MessageId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("GiveawayModel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("GiveawayId") - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GiveawayId", "UserId") - .IsUnique(); - - b.ToTable("GiveawayUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.GuildConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AutoAssignRoleIds") - .HasColumnType("TEXT"); - - b.Property("AutoDeleteSelfAssignedRoleMessages") - .HasColumnType("INTEGER"); - - b.Property("CleverbotEnabled") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("DeleteMessageOnCommand") - .HasColumnType("INTEGER"); - - b.Property("DeleteStreamOnlineMessage") - .HasColumnType("INTEGER"); - - b.Property("DisableGlobalExpressions") - .HasColumnType("INTEGER"); - - b.Property("ExclusiveSelfAssignedRoles") - .HasColumnType("INTEGER"); - - b.Property("FilterInvites") - .HasColumnType("INTEGER"); - - b.Property("FilterLinks") - .HasColumnType("INTEGER"); - - b.Property("FilterWords") - .HasColumnType("INTEGER"); - - b.Property("GameVoiceChannel") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Locale") - .HasColumnType("TEXT"); - - b.Property("MuteRoleName") - .HasColumnType("TEXT"); - - b.Property("NotifyStreamOffline") - .HasColumnType("INTEGER"); - - b.Property("PermissionRole") - .HasColumnType("TEXT"); - - b.Property("Prefix") - .HasColumnType("TEXT"); - - b.Property("StickyRoles") - .HasColumnType("INTEGER"); - - b.Property("TimeZoneId") - .HasColumnType("TEXT"); - - b.Property("VerboseErrors") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(true); - - b.Property("VerbosePermissions") - .HasColumnType("INTEGER"); - - b.Property("WarnExpireAction") - .HasColumnType("INTEGER"); - - b.Property("WarnExpireHours") - .HasColumnType("INTEGER"); - - b.Property("WarningsInitialized") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.HasIndex("WarnExpireHours"); - - b.ToTable("GuildConfigs"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.HoneypotChannel", b => - { - b.Property("GuildId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.HasKey("GuildId"); - - b.ToTable("HoneyPotChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ItemType") - .HasColumnType("INTEGER"); - - b.Property("LogItemId") - .HasColumnType("INTEGER"); - - b.Property("LogSettingId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("LogSettingId", "LogItemId", "ItemType") - .IsUnique(); - - b.ToTable("IgnoredLogChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ImageOnlyChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ChannelId") - .IsUnique(); - - b.ToTable("ImageOnlyChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelCreatedId") - .HasColumnType("INTEGER"); - - b.Property("ChannelDestroyedId") - .HasColumnType("INTEGER"); - - b.Property("ChannelUpdatedId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("LogOtherId") - .HasColumnType("INTEGER"); - - b.Property("LogUserPresenceId") - .HasColumnType("INTEGER"); - - b.Property("LogVoicePresenceId") - .HasColumnType("INTEGER"); - - b.Property("LogVoicePresenceTTSId") - .HasColumnType("INTEGER"); - - b.Property("LogWarnsId") - .HasColumnType("INTEGER"); - - b.Property("MessageDeletedId") - .HasColumnType("INTEGER"); - - b.Property("MessageUpdatedId") - .HasColumnType("INTEGER"); - - b.Property("ThreadCreatedId") - .HasColumnType("INTEGER"); - - b.Property("ThreadDeletedId") - .HasColumnType("INTEGER"); - - b.Property("UserBannedId") - .HasColumnType("INTEGER"); - - b.Property("UserJoinedId") - .HasColumnType("INTEGER"); - - b.Property("UserLeftId") - .HasColumnType("INTEGER"); - - b.Property("UserMutedId") - .HasColumnType("INTEGER"); - - b.Property("UserUnbannedId") - .HasColumnType("INTEGER"); - - b.Property("UserUpdatedId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.ToTable("LogSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlayerSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AutoDisconnect") - .HasColumnType("INTEGER"); - - b.Property("AutoPlay") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("MusicChannelId") - .HasColumnType("INTEGER"); - - b.Property("PlayerRepeat") - .HasColumnType("INTEGER"); - - b.Property("QualityPreset") - .HasColumnType("INTEGER"); - - b.Property("Volume") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(100); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.ToTable("MusicPlayerSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Author") - .HasColumnType("TEXT"); - - b.Property("AuthorId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("MusicPlaylists"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("MutedUserId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AllowTarget") - .HasColumnType("INTEGER"); - - b.Property("AutoDeleteTrigger") - .HasColumnType("INTEGER"); - - b.Property("ContainsAnywhere") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("DmResponse") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Reactions") - .HasColumnType("TEXT"); - - b.Property("Response") - .HasColumnType("TEXT"); - - b.Property("Trigger") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Expressions"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AmountCents") - .HasColumnType("INTEGER"); - - b.Property("LastCharge") - .HasColumnType("TEXT"); - - b.Property("UniquePlatformUserId") - .HasColumnType("TEXT"); - - b.Property("ValidThru") - .HasColumnType("TEXT"); - - b.HasKey("UserId"); - - b.HasIndex("UniquePlatformUserId") - .IsUnique(); - - b.ToTable("Patrons"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Index") - .HasColumnType("INTEGER"); - - b.Property("IsCustomCommand") - .HasColumnType("INTEGER"); - - b.Property("PrimaryTarget") - .HasColumnType("INTEGER"); - - b.Property("PrimaryTargetId") - .HasColumnType("INTEGER"); - - b.Property("SecondaryTarget") - .HasColumnType("INTEGER"); - - b.Property("SecondaryTargetName") - .HasColumnType("TEXT"); - - b.Property("State") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlantedCurrency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Amount") - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("MessageId") - .HasColumnType("INTEGER"); - - b.Property("Password") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ChannelId"); - - b.HasIndex("MessageId") - .IsUnique(); - - b.ToTable("PlantedCurrency"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.Quote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AuthorId") - .HasColumnType("INTEGER"); - - b.Property("AuthorName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Text") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildId"); - - b.HasIndex("Keyword"); - - b.ToTable("Quotes"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ReactionRoleV2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Emote") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("Group") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("LevelReq") - .HasColumnType("INTEGER"); - - b.Property("MessageId") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId"); - - b.HasIndex("MessageId", "Emote") - .IsUnique(); - - b.ToTable("ReactionRoles"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Reminder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("IsPrivate") - .HasColumnType("INTEGER"); - - b.Property("Message") - .HasColumnType("TEXT"); - - b.Property("ServerId") - .HasColumnType("INTEGER"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("When") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("When"); - - b.ToTable("Reminders"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Repeater", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Interval") - .HasColumnType("TEXT"); - - b.Property("LastMessageId") - .HasColumnType("INTEGER"); - - b.Property("Message") - .HasColumnType("TEXT"); - - b.Property("NoRedundant") - .HasColumnType("INTEGER"); - - b.Property("StartTimeOfDay") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Repeaters"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.RewardedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AmountRewardedThisMonth") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("LastReward") - .HasColumnType("TEXT"); - - b.Property("PlatformUserId") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("PlatformUserId") - .IsUnique(); - - b.ToTable("RewardedUsers"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.RotatingPlayingStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Status") - .HasColumnType("TEXT"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("RotatingStatus"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SelfAssignedRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Group") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("LevelRequirement") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "RoleId") - .IsUnique(); - - b.ToTable("SelfAssignableRoles"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AuthorId") - .HasColumnType("INTEGER"); - - b.Property("Command") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Index") - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("Price") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("RoleName") - .HasColumnType("TEXT"); - - b.Property("RoleRequirement") - .HasColumnType("INTEGER"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("ShopEntry"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ShopEntryId") - .HasColumnType("INTEGER"); - - b.Property("Text") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("ShopEntryId"); - - b.ToTable("ShopEntryItem"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("SlowmodeIgnoredRole"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("SlowmodeIgnoredUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StickyRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("RoleIds") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "UserId") - .IsUnique(); - - b.ToTable("StickyRoles"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamOnlineMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("MessageId") - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("StreamOnlineMessages"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("StreamRoleSettingsId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("Username") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("StreamRoleSettingsId"); - - b.ToTable("StreamRoleBlacklistedUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AddRoleId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Enabled") - .HasColumnType("INTEGER"); - - b.Property("FromRoleId") - .HasColumnType("INTEGER"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Keyword") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId") - .IsUnique(); - - b.ToTable("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("StreamRoleSettingsId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("Username") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("StreamRoleSettingsId"); - - b.ToTable("StreamRoleWhitelistedUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ArchiveId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("IsDone") - .HasColumnType("INTEGER"); - - b.Property("Todo") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ArchiveId"); - - b.HasIndex("UserId"); - - b.ToTable("Todos"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("UnbanAt") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("UnbanTimer"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("UnmuteAt") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("UnmuteTimer"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("UnbanAt") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("UnroleTimer"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UserXpStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AwardedXp") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("NotifyOnLevelUp") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - 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("EllieBot.Db.Models.VcRoleInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("VoiceChannelId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("VcRoleInfo"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AffinityId") - .HasColumnType("INTEGER"); - - b.Property("ClaimerId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Price") - .HasColumnType("INTEGER"); - - b.Property("WaifuId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("AffinityId"); - - b.HasIndex("ClaimerId"); - - b.HasIndex("Price"); - - b.HasIndex("WaifuId") - .IsUnique(); - - b.ToTable("WaifuInfo"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ItemEmoji") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("WaifuInfoId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("WaifuInfoId"); - - b.ToTable("WaifuItem"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("NewId") - .HasColumnType("INTEGER"); - - b.Property("OldId") - .HasColumnType("INTEGER"); - - b.Property("UpdateType") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("NewId"); - - b.HasIndex("OldId"); - - b.HasIndex("UserId"); - - b.ToTable("WaifuUpdates"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Warning", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Forgiven") - .HasColumnType("INTEGER"); - - b.Property("ForgivenBy") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Moderator") - .HasColumnType("TEXT"); - - b.Property("Reason") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("Weight") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(1L); - - b.HasKey("Id"); - - b.HasIndex("DateAdded"); - - b.HasIndex("GuildId"); - - b.HasIndex("UserId"); - - b.ToTable("Warnings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WarningPunishment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Count") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Punishment") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("Time") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("WarningPunishment"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Amount") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Level") - .HasColumnType("INTEGER"); - - b.Property("XpSettingsId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("XpSettingsId"); - - b.ToTable("XpCurrencyReward"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Level") - .HasColumnType("INTEGER"); - - b.Property("Remove") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("XpSettingsId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("XpSettingsId", "Level") - .IsUnique(); - - b.ToTable("XpRoleReward"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("ServerExcluded") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId") - .IsUnique(); - - b.ToTable("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpShopOwnedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("IsUsing") - .HasColumnType("INTEGER"); - - b.Property("ItemKey") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ItemType") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemType", "ItemKey") - .IsUnique(); - - b.ToTable("XpShopOwnedItem"); - }); - - modelBuilder.Entity("EllieBot.Services.GreetSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AutoDeleteTimer") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("GreetType") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(false); - - b.Property("MessageText") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "GreetType") - .IsUnique(); - - b.ToTable("GreetSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiAltSetting") - .HasForeignKey("EllieBot.Db.Models.AntiAltSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiRaidSetting") - .HasForeignKey("EllieBot.Db.Models.AntiRaidSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.HasOne("EllieBot.Db.Models.AntiSpamSetting", null) - .WithMany("IgnoredChannels") - .HasForeignKey("AntiSpamSettingId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiSpamSetting") - .HasForeignKey("EllieBot.Db.Models.AntiSpamSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.HasOne("EllieBot.Db.Models.AutoTranslateChannel", "Channel") - .WithMany("Users") - .HasForeignKey("ChannelId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Channel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Applicants") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Club"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Bans") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Club"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Owner") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.ClubInfo", "OwnerId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandAliases") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandCooldown", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandCooldowns") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("DelMsgOnCmdChannels") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Members") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.NoAction); - - b.Navigation("Club"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("ExclusionList") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("FeedSubs") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterInvitesChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterLinksChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterWordsChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilteredWords") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FollowedStreams") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GCChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("GenerateCurrencyChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.HasOne("EllieBot.Db.Models.GiveawayModel", null) - .WithMany("Participants") - .HasForeignKey("GiveawayId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("SelfAssignableRoleGroupNames") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.HasOne("EllieBot.Db.Models.LogSetting", "LogSetting") - .WithMany("LogIgnores") - .HasForeignKey("LogSettingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("LogSetting"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("MutedUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("Permissions") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.HasOne("EllieBot.Db.Models.MusicPlaylist", null) - .WithMany("Songs") - .HasForeignKey("MusicPlaylistId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("ShopEntries") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.HasOne("EllieBot.Db.Models.ShopEntry", null) - .WithMany("Items") - .HasForeignKey("ShopEntryId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredRoles") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Blacklist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("StreamRole") - .HasForeignKey("EllieBot.Db.Models.StreamRoleSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Whitelist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.HasOne("EllieBot.Db.Models.ArchivedTodoListModel", null) - .WithMany("Items") - .HasForeignKey("ArchiveId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnbanTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnmuteTimers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnroleTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.VcRoleInfo", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("VcRoleInfos") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Affinity") - .WithMany() - .HasForeignKey("AffinityId"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Claimer") - .WithMany() - .HasForeignKey("ClaimerId"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Waifu") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.WaifuInfo", "WaifuId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Affinity"); - - b.Navigation("Claimer"); - - b.Navigation("Waifu"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.HasOne("EllieBot.Db.Models.WaifuInfo", "WaifuInfo") - .WithMany("Items") - .HasForeignKey("WaifuInfoId"); - - b.Navigation("WaifuInfo"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "New") - .WithMany() - .HasForeignKey("NewId"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Old") - .WithMany() - .HasForeignKey("OldId"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("New"); - - b.Navigation("Old"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WarningPunishment", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("WarnPunishments") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("CurrencyRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("RoleRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("XpSettings") - .HasForeignKey("EllieBot.Db.Models.XpSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Navigation("IgnoredChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Navigation("Users"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Navigation("Applicants"); - - b.Navigation("Bans"); - - b.Navigation("Members"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Navigation("Participants"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GuildConfig", b => - { - b.Navigation("AntiAltSetting"); - - b.Navigation("AntiRaidSetting"); - - b.Navigation("AntiSpamSetting"); - - 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("GenerateCurrencyChannelIds"); - - b.Navigation("MutedUsers"); - - b.Navigation("Permissions"); - - b.Navigation("SelfAssignableRoleGroupNames"); - - b.Navigation("ShopEntries"); - - b.Navigation("SlowmodeIgnoredRoles"); - - b.Navigation("SlowmodeIgnoredUsers"); - - b.Navigation("StreamRole"); - - b.Navigation("UnbanTimer"); - - b.Navigation("UnmuteTimers"); - - b.Navigation("UnroleTimer"); - - b.Navigation("VcRoleInfos"); - - b.Navigation("WarnPunishments"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Navigation("LogIgnores"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Navigation("Songs"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Navigation("Blacklist"); - - b.Navigation("Whitelist"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Navigation("CurrencyRewards"); - - b.Navigation("ExclusionList"); - - b.Navigation("RoleRewards"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/EllieBot/Migrations/Sqlite/20241018004612_warn-split.Designer.cs b/src/EllieBot/Migrations/Sqlite/20241018004612_warn-split.Designer.cs deleted file mode 100644 index 3fbae50..0000000 --- a/src/EllieBot/Migrations/Sqlite/20241018004612_warn-split.Designer.cs +++ /dev/null @@ -1,2919 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using EllieBot.Db; - -#nullable disable - -namespace EllieBot.Migrations -{ - [DbContext(typeof(SqliteContext))] - [Migration("20241018004612_warn-split")] - partial class warnsplit - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.8"); - - modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Action") - .HasColumnType("INTEGER"); - - b.Property("ActionDurationMinutes") - .HasColumnType("INTEGER"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("MinAge") - .HasColumnType("TEXT"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId") - .IsUnique(); - - b.ToTable("AntiAltSetting"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Action") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AntiSpamSettingId") - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("AntiSpamSettingId"); - - b.ToTable("AntiSpamIgnore"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Action") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("MessageThreshold") - .HasColumnType("INTEGER"); - - b.Property("MuteTime") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId") - .IsUnique(); - - b.ToTable("AntiSpamSetting"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("TodosArchive"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoCommand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("ChannelName") - .HasColumnType("TEXT"); - - b.Property("CommandText") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("GuildName") - .HasColumnType("TEXT"); - - b.Property("Interval") - .HasColumnType("INTEGER"); - - b.Property("VoiceChannelId") - .HasColumnType("INTEGER"); - - b.Property("VoiceChannelName") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("AutoCommands"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoPublishChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.ToTable("AutoPublishChannel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AutoDelete") - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ChannelId") - .IsUnique(); - - b.HasIndex("GuildId"); - - b.ToTable("AutoTranslateChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Source") - .HasColumnType("TEXT"); - - b.Property("Target") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasAlternateKey("ChannelId", "UserId"); - - b.ToTable("AutoTranslateUsers"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BanTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("PruneDays") - .HasColumnType("INTEGER"); - - b.Property("Text") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.ToTable("BanTemplates"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Balance") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("BankUsers"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BlacklistEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ItemId") - .HasColumnType("INTEGER"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("Blacklist"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.Property("ClubId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("ClubId", "UserId"); - - b.HasIndex("UserId"); - - b.ToTable("ClubApplicants"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.Property("ClubId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("ClubId", "UserId"); - - b.HasIndex("UserId"); - - b.ToTable("ClubBans"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Description") - .HasColumnType("TEXT"); - - b.Property("ImageUrl") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasMaxLength(20) - .HasColumnType("TEXT"); - - b.Property("OwnerId") - .HasColumnType("INTEGER"); - - b.Property("Xp") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("OwnerId") - .IsUnique(); - - b.ToTable("Clubs"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.CommandCooldown", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CommandName") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Seconds") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("CommandCooldown"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CurrencyTransaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Amount") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Extra") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Note") - .HasColumnType("TEXT"); - - b.Property("OtherId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValueSql("NULL"); - - b.Property("Type") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("CurrencyTransactions"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("State") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("DelMsgOnCmdChannel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordPermOverride", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Command") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Perm") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "Command") - .IsUnique(); - - b.ToTable("DiscordPermOverrides"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AvatarId") - .HasColumnType("TEXT"); - - b.Property("ClubId") - .HasColumnType("INTEGER"); - - b.Property("CurrencyAmount") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0L); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Discriminator") - .HasColumnType("TEXT"); - - b.Property("IsClubAdmin") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(false); - - b.Property("NotifyOnLevelUp") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0); - - b.Property("TotalXp") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0L); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("Username") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasAlternateKey("UserId"); - - b.HasIndex("ClubId"); - - b.HasIndex("CurrencyAmount"); - - b.HasIndex("TotalXp"); - - b.HasIndex("UserId"); - - b.ToTable("DiscordUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ItemId") - .HasColumnType("INTEGER"); - - b.Property("ItemType") - .HasColumnType("INTEGER"); - - b.Property("XpSettingsId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("XpSettingsId"); - - b.ToTable("ExcludedItem"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.FilterChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("FilterChannelId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("FilterLinksChannelId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("FilterWordsChannelId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Word") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("FilteredWord"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - 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("EllieBot.Db.Models.GCChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("GCChannelId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GamblingStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Bet") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Feature") - .HasColumnType("TEXT"); - - b.Property("PaidOut") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Feature") - .IsUnique(); - - b.ToTable("GamblingStats"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("EndsAt") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Message") - .HasColumnType("TEXT"); - - b.Property("MessageId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("GiveawayModel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("GiveawayId") - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GiveawayId", "UserId") - .IsUnique(); - - b.ToTable("GiveawayUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.GuildConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AutoAssignRoleIds") - .HasColumnType("TEXT"); - - b.Property("AutoDeleteSelfAssignedRoleMessages") - .HasColumnType("INTEGER"); - - b.Property("CleverbotEnabled") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("DeleteMessageOnCommand") - .HasColumnType("INTEGER"); - - b.Property("DeleteStreamOnlineMessage") - .HasColumnType("INTEGER"); - - b.Property("DisableGlobalExpressions") - .HasColumnType("INTEGER"); - - b.Property("ExclusiveSelfAssignedRoles") - .HasColumnType("INTEGER"); - - b.Property("FilterInvites") - .HasColumnType("INTEGER"); - - b.Property("FilterLinks") - .HasColumnType("INTEGER"); - - b.Property("FilterWords") - .HasColumnType("INTEGER"); - - b.Property("GameVoiceChannel") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Locale") - .HasColumnType("TEXT"); - - b.Property("MuteRoleName") - .HasColumnType("TEXT"); - - b.Property("NotifyStreamOffline") - .HasColumnType("INTEGER"); - - b.Property("PermissionRole") - .HasColumnType("TEXT"); - - b.Property("Prefix") - .HasColumnType("TEXT"); - - b.Property("StickyRoles") - .HasColumnType("INTEGER"); - - b.Property("TimeZoneId") - .HasColumnType("TEXT"); - - b.Property("VerboseErrors") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(true); - - b.Property("VerbosePermissions") - .HasColumnType("INTEGER"); - - b.Property("WarnExpireAction") - .HasColumnType("INTEGER"); - - b.Property("WarnExpireHours") - .HasColumnType("INTEGER"); - - b.Property("WarningsInitialized") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.HasIndex("WarnExpireHours"); - - b.ToTable("GuildConfigs"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.HoneypotChannel", b => - { - b.Property("GuildId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.HasKey("GuildId"); - - b.ToTable("HoneyPotChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ItemType") - .HasColumnType("INTEGER"); - - b.Property("LogItemId") - .HasColumnType("INTEGER"); - - b.Property("LogSettingId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("LogSettingId", "LogItemId", "ItemType") - .IsUnique(); - - b.ToTable("IgnoredLogChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ImageOnlyChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ChannelId") - .IsUnique(); - - b.ToTable("ImageOnlyChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelCreatedId") - .HasColumnType("INTEGER"); - - b.Property("ChannelDestroyedId") - .HasColumnType("INTEGER"); - - b.Property("ChannelUpdatedId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("LogOtherId") - .HasColumnType("INTEGER"); - - b.Property("LogUserPresenceId") - .HasColumnType("INTEGER"); - - b.Property("LogVoicePresenceId") - .HasColumnType("INTEGER"); - - b.Property("LogVoicePresenceTTSId") - .HasColumnType("INTEGER"); - - b.Property("LogWarnsId") - .HasColumnType("INTEGER"); - - b.Property("MessageDeletedId") - .HasColumnType("INTEGER"); - - b.Property("MessageUpdatedId") - .HasColumnType("INTEGER"); - - b.Property("ThreadCreatedId") - .HasColumnType("INTEGER"); - - b.Property("ThreadDeletedId") - .HasColumnType("INTEGER"); - - b.Property("UserBannedId") - .HasColumnType("INTEGER"); - - b.Property("UserJoinedId") - .HasColumnType("INTEGER"); - - b.Property("UserLeftId") - .HasColumnType("INTEGER"); - - b.Property("UserMutedId") - .HasColumnType("INTEGER"); - - b.Property("UserUnbannedId") - .HasColumnType("INTEGER"); - - b.Property("UserUpdatedId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.ToTable("LogSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlayerSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AutoDisconnect") - .HasColumnType("INTEGER"); - - b.Property("AutoPlay") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("MusicChannelId") - .HasColumnType("INTEGER"); - - b.Property("PlayerRepeat") - .HasColumnType("INTEGER"); - - b.Property("QualityPreset") - .HasColumnType("INTEGER"); - - b.Property("Volume") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(100); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.ToTable("MusicPlayerSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Author") - .HasColumnType("TEXT"); - - b.Property("AuthorId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("MusicPlaylists"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("MutedUserId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AllowTarget") - .HasColumnType("INTEGER"); - - b.Property("AutoDeleteTrigger") - .HasColumnType("INTEGER"); - - b.Property("ContainsAnywhere") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("DmResponse") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Reactions") - .HasColumnType("TEXT"); - - b.Property("Response") - .HasColumnType("TEXT"); - - b.Property("Trigger") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Expressions"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AmountCents") - .HasColumnType("INTEGER"); - - b.Property("LastCharge") - .HasColumnType("TEXT"); - - b.Property("UniquePlatformUserId") - .HasColumnType("TEXT"); - - b.Property("ValidThru") - .HasColumnType("TEXT"); - - b.HasKey("UserId"); - - b.HasIndex("UniquePlatformUserId") - .IsUnique(); - - b.ToTable("Patrons"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Index") - .HasColumnType("INTEGER"); - - b.Property("IsCustomCommand") - .HasColumnType("INTEGER"); - - b.Property("PrimaryTarget") - .HasColumnType("INTEGER"); - - b.Property("PrimaryTargetId") - .HasColumnType("INTEGER"); - - b.Property("SecondaryTarget") - .HasColumnType("INTEGER"); - - b.Property("SecondaryTargetName") - .HasColumnType("TEXT"); - - b.Property("State") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlantedCurrency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Amount") - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("MessageId") - .HasColumnType("INTEGER"); - - b.Property("Password") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ChannelId"); - - b.HasIndex("MessageId") - .IsUnique(); - - b.ToTable("PlantedCurrency"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.Quote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AuthorId") - .HasColumnType("INTEGER"); - - b.Property("AuthorName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Text") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildId"); - - b.HasIndex("Keyword"); - - b.ToTable("Quotes"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ReactionRoleV2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Emote") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("Group") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("LevelReq") - .HasColumnType("INTEGER"); - - b.Property("MessageId") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId"); - - b.HasIndex("MessageId", "Emote") - .IsUnique(); - - b.ToTable("ReactionRoles"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Reminder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("IsPrivate") - .HasColumnType("INTEGER"); - - b.Property("Message") - .HasColumnType("TEXT"); - - b.Property("ServerId") - .HasColumnType("INTEGER"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("When") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("When"); - - b.ToTable("Reminders"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Repeater", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Interval") - .HasColumnType("TEXT"); - - b.Property("LastMessageId") - .HasColumnType("INTEGER"); - - b.Property("Message") - .HasColumnType("TEXT"); - - b.Property("NoRedundant") - .HasColumnType("INTEGER"); - - b.Property("StartTimeOfDay") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Repeaters"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.RewardedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AmountRewardedThisMonth") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("LastReward") - .HasColumnType("TEXT"); - - b.Property("PlatformUserId") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("PlatformUserId") - .IsUnique(); - - b.ToTable("RewardedUsers"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.RotatingPlayingStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Status") - .HasColumnType("TEXT"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("RotatingStatus"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SelfAssignedRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Group") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("LevelRequirement") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "RoleId") - .IsUnique(); - - b.ToTable("SelfAssignableRoles"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AuthorId") - .HasColumnType("INTEGER"); - - b.Property("Command") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Index") - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("Price") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("RoleName") - .HasColumnType("TEXT"); - - b.Property("RoleRequirement") - .HasColumnType("INTEGER"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("ShopEntry"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ShopEntryId") - .HasColumnType("INTEGER"); - - b.Property("Text") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("ShopEntryId"); - - b.ToTable("ShopEntryItem"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("SlowmodeIgnoredRole"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("SlowmodeIgnoredUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StickyRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("RoleIds") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "UserId") - .IsUnique(); - - b.ToTable("StickyRoles"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamOnlineMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("MessageId") - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("StreamOnlineMessages"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("StreamRoleSettingsId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("Username") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("StreamRoleSettingsId"); - - b.ToTable("StreamRoleBlacklistedUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AddRoleId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Enabled") - .HasColumnType("INTEGER"); - - b.Property("FromRoleId") - .HasColumnType("INTEGER"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Keyword") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId") - .IsUnique(); - - b.ToTable("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("StreamRoleSettingsId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("Username") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("StreamRoleSettingsId"); - - b.ToTable("StreamRoleWhitelistedUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ArchiveId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("IsDone") - .HasColumnType("INTEGER"); - - b.Property("Todo") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ArchiveId"); - - b.HasIndex("UserId"); - - b.ToTable("Todos"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("UnbanAt") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("UnbanTimer"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("UnmuteAt") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("UnmuteTimer"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("UnbanAt") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("UnroleTimer"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UserXpStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AwardedXp") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("NotifyOnLevelUp") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - 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("EllieBot.Db.Models.VcRoleInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("VoiceChannelId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("VcRoleInfo"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AffinityId") - .HasColumnType("INTEGER"); - - b.Property("ClaimerId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Price") - .HasColumnType("INTEGER"); - - b.Property("WaifuId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("AffinityId"); - - b.HasIndex("ClaimerId"); - - b.HasIndex("Price"); - - b.HasIndex("WaifuId") - .IsUnique(); - - b.ToTable("WaifuInfo"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ItemEmoji") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("WaifuInfoId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("WaifuInfoId"); - - b.ToTable("WaifuItem"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("NewId") - .HasColumnType("INTEGER"); - - b.Property("OldId") - .HasColumnType("INTEGER"); - - b.Property("UpdateType") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("NewId"); - - b.HasIndex("OldId"); - - b.HasIndex("UserId"); - - b.ToTable("WaifuUpdates"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Warning", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Forgiven") - .HasColumnType("INTEGER"); - - b.Property("ForgivenBy") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Moderator") - .HasColumnType("TEXT"); - - b.Property("Reason") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("Weight") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(1L); - - b.HasKey("Id"); - - b.HasIndex("DateAdded"); - - b.HasIndex("GuildId"); - - b.HasIndex("UserId"); - - b.ToTable("Warnings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WarningPunishment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Count") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Punishment") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("Time") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasAlternateKey("GuildId", "Count"); - - b.ToTable("WarningPunishment"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Amount") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Level") - .HasColumnType("INTEGER"); - - b.Property("XpSettingsId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("XpSettingsId"); - - b.ToTable("XpCurrencyReward"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Level") - .HasColumnType("INTEGER"); - - b.Property("Remove") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("XpSettingsId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("XpSettingsId", "Level") - .IsUnique(); - - b.ToTable("XpRoleReward"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("ServerExcluded") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId") - .IsUnique(); - - b.ToTable("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpShopOwnedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("IsUsing") - .HasColumnType("INTEGER"); - - b.Property("ItemKey") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ItemType") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemType", "ItemKey") - .IsUnique(); - - b.ToTable("XpShopOwnedItem"); - }); - - modelBuilder.Entity("EllieBot.Services.GreetSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AutoDeleteTimer") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("GreetType") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(false); - - b.Property("MessageText") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "GreetType") - .IsUnique(); - - b.ToTable("GreetSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiAltSetting") - .HasForeignKey("EllieBot.Db.Models.AntiAltSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiRaidSetting") - .HasForeignKey("EllieBot.Db.Models.AntiRaidSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.HasOne("EllieBot.Db.Models.AntiSpamSetting", null) - .WithMany("IgnoredChannels") - .HasForeignKey("AntiSpamSettingId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiSpamSetting") - .HasForeignKey("EllieBot.Db.Models.AntiSpamSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.HasOne("EllieBot.Db.Models.AutoTranslateChannel", "Channel") - .WithMany("Users") - .HasForeignKey("ChannelId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Channel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Applicants") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Club"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Bans") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Club"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Owner") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.ClubInfo", "OwnerId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandAliases") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandCooldown", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandCooldowns") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("DelMsgOnCmdChannels") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Members") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.NoAction); - - b.Navigation("Club"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("ExclusionList") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("FeedSubs") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterInvitesChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterLinksChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterWordsChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilteredWords") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FollowedStreams") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GCChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("GenerateCurrencyChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.HasOne("EllieBot.Db.Models.GiveawayModel", null) - .WithMany("Participants") - .HasForeignKey("GiveawayId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("SelfAssignableRoleGroupNames") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.HasOne("EllieBot.Db.Models.LogSetting", "LogSetting") - .WithMany("LogIgnores") - .HasForeignKey("LogSettingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("LogSetting"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("MutedUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("Permissions") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.HasOne("EllieBot.Db.Models.MusicPlaylist", null) - .WithMany("Songs") - .HasForeignKey("MusicPlaylistId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("ShopEntries") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.HasOne("EllieBot.Db.Models.ShopEntry", null) - .WithMany("Items") - .HasForeignKey("ShopEntryId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredRoles") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Blacklist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("StreamRole") - .HasForeignKey("EllieBot.Db.Models.StreamRoleSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Whitelist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.HasOne("EllieBot.Db.Models.ArchivedTodoListModel", null) - .WithMany("Items") - .HasForeignKey("ArchiveId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnbanTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnmuteTimers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnroleTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.VcRoleInfo", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("VcRoleInfos") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Affinity") - .WithMany() - .HasForeignKey("AffinityId"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Claimer") - .WithMany() - .HasForeignKey("ClaimerId"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Waifu") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.WaifuInfo", "WaifuId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Affinity"); - - b.Navigation("Claimer"); - - b.Navigation("Waifu"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.HasOne("EllieBot.Db.Models.WaifuInfo", "WaifuInfo") - .WithMany("Items") - .HasForeignKey("WaifuInfoId"); - - b.Navigation("WaifuInfo"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "New") - .WithMany() - .HasForeignKey("NewId"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Old") - .WithMany() - .HasForeignKey("OldId"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("New"); - - b.Navigation("Old"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("CurrencyRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("RoleRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("XpSettings") - .HasForeignKey("EllieBot.Db.Models.XpSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Navigation("IgnoredChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Navigation("Users"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Navigation("Applicants"); - - b.Navigation("Bans"); - - b.Navigation("Members"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Navigation("Participants"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GuildConfig", b => - { - b.Navigation("AntiAltSetting"); - - b.Navigation("AntiRaidSetting"); - - b.Navigation("AntiSpamSetting"); - - 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("GenerateCurrencyChannelIds"); - - b.Navigation("MutedUsers"); - - b.Navigation("Permissions"); - - b.Navigation("SelfAssignableRoleGroupNames"); - - b.Navigation("ShopEntries"); - - b.Navigation("SlowmodeIgnoredRoles"); - - b.Navigation("SlowmodeIgnoredUsers"); - - b.Navigation("StreamRole"); - - b.Navigation("UnbanTimer"); - - b.Navigation("UnmuteTimers"); - - b.Navigation("UnroleTimer"); - - b.Navigation("VcRoleInfos"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Navigation("LogIgnores"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Navigation("Songs"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Navigation("Blacklist"); - - b.Navigation("Whitelist"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Navigation("CurrencyRewards"); - - b.Navigation("ExclusionList"); - - b.Navigation("RoleRewards"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/EllieBot/Migrations/Sqlite/20241018004612_warn-split.cs b/src/EllieBot/Migrations/Sqlite/20241018004612_warn-split.cs deleted file mode 100644 index f2ae5a3..0000000 --- a/src/EllieBot/Migrations/Sqlite/20241018004612_warn-split.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Microsoft.EntityFrameworkCore.Metadata.Internal; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace EllieBot.Migrations -{ - /// - public partial class warnsplit : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "GuildId", - table: "WarningPunishment", - type: "INTEGER", - nullable: false, - defaultValue: 0ul); - - MigrationQueries.AddGuildIdsToWarningPunishment(migrationBuilder); - - migrationBuilder.DropForeignKey( - name: "FK_WarningPunishment_GuildConfigs_GuildConfigId", - table: "WarningPunishment"); - - migrationBuilder.DropIndex( - name: "IX_WarningPunishment_GuildConfigId", - table: "WarningPunishment"); - - migrationBuilder.DropColumn( - name: "GuildConfigId", - table: "WarningPunishment"); - - migrationBuilder.AddUniqueConstraint( - name: "AK_WarningPunishment_GuildId_Count", - table: "WarningPunishment", - columns: new[] { "GuildId", "Count" }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropUniqueConstraint( - name: "AK_WarningPunishment_GuildId_Count", - table: "WarningPunishment"); - - migrationBuilder.DropColumn( - name: "GuildId", - table: "WarningPunishment"); - - migrationBuilder.AddColumn( - name: "GuildConfigId", - table: "WarningPunishment", - type: "INTEGER", - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_WarningPunishment_GuildConfigId", - table: "WarningPunishment", - column: "GuildConfigId"); - - migrationBuilder.AddForeignKey( - name: "FK_WarningPunishment_GuildConfigs_GuildConfigId", - table: "WarningPunishment", - column: "GuildConfigId", - principalTable: "GuildConfigs", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - } -} \ No newline at end of file diff --git a/src/EllieBot/Migrations/Sqlite/20241028033656_ncanvas.cs b/src/EllieBot/Migrations/Sqlite/20241028033656_ncanvas.cs deleted file mode 100644 index e99fb10..0000000 --- a/src/EllieBot/Migrations/Sqlite/20241028033656_ncanvas.cs +++ /dev/null @@ -1,53 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace EllieBot.Migrations -{ - /// - public partial class ncanvas : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "NCPixel", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Position = table.Column(type: "INTEGER", nullable: false), - Price = table.Column(type: "INTEGER", nullable: false), - OwnerId = table.Column(type: "INTEGER", nullable: false), - Color = table.Column(type: "INTEGER", nullable: false), - Text = table.Column(type: "TEXT", maxLength: 256, nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_NCPixel", x => x.Id); - table.UniqueConstraint("AK_NCPixel_Position", x => x.Position); - }); - - migrationBuilder.CreateIndex( - name: "IX_DiscordUser_Username", - table: "DiscordUser", - column: "Username"); - - migrationBuilder.CreateIndex( - name: "IX_NCPixel_OwnerId", - table: "NCPixel", - column: "OwnerId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "NCPixel"); - - migrationBuilder.DropIndex( - name: "IX_DiscordUser_Username", - table: "DiscordUser"); - } - } -} \ No newline at end of file diff --git a/src/EllieBot/Migrations/Sqlite/20241102022949_no-discrim-and-flag-translate.Designer.cs b/src/EllieBot/Migrations/Sqlite/20241102022949_no-discrim-and-flag-translate.Designer.cs deleted file mode 100644 index 0547dac..0000000 --- a/src/EllieBot/Migrations/Sqlite/20241102022949_no-discrim-and-flag-translate.Designer.cs +++ /dev/null @@ -1,2973 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using EllieBot.Db; - -#nullable disable - -namespace EllieBot.Migrations -{ - [DbContext(typeof(SqliteContext))] - [Migration("20241102022949_no-discrim-and-flag-translate")] - partial class nodiscrimandflagtranslate - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.8"); - - modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Action") - .HasColumnType("INTEGER"); - - b.Property("ActionDurationMinutes") - .HasColumnType("INTEGER"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("MinAge") - .HasColumnType("TEXT"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId") - .IsUnique(); - - b.ToTable("AntiAltSetting"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Action") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AntiSpamSettingId") - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("AntiSpamSettingId"); - - b.ToTable("AntiSpamIgnore"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Action") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("MessageThreshold") - .HasColumnType("INTEGER"); - - b.Property("MuteTime") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId") - .IsUnique(); - - b.ToTable("AntiSpamSetting"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("TodosArchive"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoCommand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("ChannelName") - .HasColumnType("TEXT"); - - b.Property("CommandText") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("GuildName") - .HasColumnType("TEXT"); - - b.Property("Interval") - .HasColumnType("INTEGER"); - - b.Property("VoiceChannelId") - .HasColumnType("INTEGER"); - - b.Property("VoiceChannelName") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("AutoCommands"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoPublishChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.ToTable("AutoPublishChannel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AutoDelete") - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ChannelId") - .IsUnique(); - - b.HasIndex("GuildId"); - - b.ToTable("AutoTranslateChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Source") - .HasColumnType("TEXT"); - - b.Property("Target") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasAlternateKey("ChannelId", "UserId"); - - b.ToTable("AutoTranslateUsers"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BanTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("PruneDays") - .HasColumnType("INTEGER"); - - b.Property("Text") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.ToTable("BanTemplates"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Balance") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("BankUsers"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BlacklistEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ItemId") - .HasColumnType("INTEGER"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("Blacklist"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.Property("ClubId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("ClubId", "UserId"); - - b.HasIndex("UserId"); - - b.ToTable("ClubApplicants"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.Property("ClubId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("ClubId", "UserId"); - - b.HasIndex("UserId"); - - b.ToTable("ClubBans"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Description") - .HasColumnType("TEXT"); - - b.Property("ImageUrl") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasMaxLength(20) - .HasColumnType("TEXT"); - - b.Property("OwnerId") - .HasColumnType("INTEGER"); - - b.Property("Xp") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("OwnerId") - .IsUnique(); - - b.ToTable("Clubs"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.CommandCooldown", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CommandName") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Seconds") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("CommandCooldown"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CurrencyTransaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Amount") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Extra") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Note") - .HasColumnType("TEXT"); - - b.Property("OtherId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValueSql("NULL"); - - b.Property("Type") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("CurrencyTransactions"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("State") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("DelMsgOnCmdChannel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordPermOverride", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Command") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Perm") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "Command") - .IsUnique(); - - b.ToTable("DiscordPermOverrides"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AvatarId") - .HasColumnType("TEXT"); - - b.Property("ClubId") - .HasColumnType("INTEGER"); - - b.Property("CurrencyAmount") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0L); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("IsClubAdmin") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(false); - - b.Property("NotifyOnLevelUp") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0); - - b.Property("TotalXp") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0L); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("Username") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasAlternateKey("UserId"); - - b.HasIndex("ClubId"); - - b.HasIndex("CurrencyAmount"); - - b.HasIndex("TotalXp"); - - b.HasIndex("UserId"); - - b.HasIndex("Username"); - - b.ToTable("DiscordUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ItemId") - .HasColumnType("INTEGER"); - - b.Property("ItemType") - .HasColumnType("INTEGER"); - - b.Property("XpSettingsId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("XpSettingsId"); - - b.ToTable("ExcludedItem"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.FilterChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("FilterChannelId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("FilterLinksChannelId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("FilterWordsChannelId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Word") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("FilteredWord"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FlagTranslateChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "ChannelId") - .IsUnique(); - - b.ToTable("FlagTranslateChannel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - 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("EllieBot.Db.Models.GCChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("GCChannelId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GamblingStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Bet") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Feature") - .HasColumnType("TEXT"); - - b.Property("PaidOut") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Feature") - .IsUnique(); - - b.ToTable("GamblingStats"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("EndsAt") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Message") - .HasColumnType("TEXT"); - - b.Property("MessageId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("GiveawayModel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("GiveawayId") - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GiveawayId", "UserId") - .IsUnique(); - - b.ToTable("GiveawayUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.GuildConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AutoAssignRoleIds") - .HasColumnType("TEXT"); - - b.Property("AutoDeleteSelfAssignedRoleMessages") - .HasColumnType("INTEGER"); - - b.Property("CleverbotEnabled") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("DeleteMessageOnCommand") - .HasColumnType("INTEGER"); - - b.Property("DeleteStreamOnlineMessage") - .HasColumnType("INTEGER"); - - b.Property("DisableGlobalExpressions") - .HasColumnType("INTEGER"); - - b.Property("ExclusiveSelfAssignedRoles") - .HasColumnType("INTEGER"); - - b.Property("FilterInvites") - .HasColumnType("INTEGER"); - - b.Property("FilterLinks") - .HasColumnType("INTEGER"); - - b.Property("FilterWords") - .HasColumnType("INTEGER"); - - b.Property("GameVoiceChannel") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Locale") - .HasColumnType("TEXT"); - - b.Property("MuteRoleName") - .HasColumnType("TEXT"); - - b.Property("NotifyStreamOffline") - .HasColumnType("INTEGER"); - - b.Property("PermissionRole") - .HasColumnType("TEXT"); - - b.Property("Prefix") - .HasColumnType("TEXT"); - - b.Property("StickyRoles") - .HasColumnType("INTEGER"); - - b.Property("TimeZoneId") - .HasColumnType("TEXT"); - - b.Property("VerboseErrors") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(true); - - b.Property("VerbosePermissions") - .HasColumnType("INTEGER"); - - b.Property("WarnExpireAction") - .HasColumnType("INTEGER"); - - b.Property("WarnExpireHours") - .HasColumnType("INTEGER"); - - b.Property("WarningsInitialized") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.HasIndex("WarnExpireHours"); - - b.ToTable("GuildConfigs"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.HoneypotChannel", b => - { - b.Property("GuildId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.HasKey("GuildId"); - - b.ToTable("HoneyPotChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ItemType") - .HasColumnType("INTEGER"); - - b.Property("LogItemId") - .HasColumnType("INTEGER"); - - b.Property("LogSettingId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("LogSettingId", "LogItemId", "ItemType") - .IsUnique(); - - b.ToTable("IgnoredLogChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ImageOnlyChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ChannelId") - .IsUnique(); - - b.ToTable("ImageOnlyChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelCreatedId") - .HasColumnType("INTEGER"); - - b.Property("ChannelDestroyedId") - .HasColumnType("INTEGER"); - - b.Property("ChannelUpdatedId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("LogOtherId") - .HasColumnType("INTEGER"); - - b.Property("LogUserPresenceId") - .HasColumnType("INTEGER"); - - b.Property("LogVoicePresenceId") - .HasColumnType("INTEGER"); - - b.Property("LogVoicePresenceTTSId") - .HasColumnType("INTEGER"); - - b.Property("LogWarnsId") - .HasColumnType("INTEGER"); - - b.Property("MessageDeletedId") - .HasColumnType("INTEGER"); - - b.Property("MessageUpdatedId") - .HasColumnType("INTEGER"); - - b.Property("ThreadCreatedId") - .HasColumnType("INTEGER"); - - b.Property("ThreadDeletedId") - .HasColumnType("INTEGER"); - - b.Property("UserBannedId") - .HasColumnType("INTEGER"); - - b.Property("UserJoinedId") - .HasColumnType("INTEGER"); - - b.Property("UserLeftId") - .HasColumnType("INTEGER"); - - b.Property("UserMutedId") - .HasColumnType("INTEGER"); - - b.Property("UserUnbannedId") - .HasColumnType("INTEGER"); - - b.Property("UserUpdatedId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.ToTable("LogSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlayerSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AutoDisconnect") - .HasColumnType("INTEGER"); - - b.Property("AutoPlay") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("MusicChannelId") - .HasColumnType("INTEGER"); - - b.Property("PlayerRepeat") - .HasColumnType("INTEGER"); - - b.Property("QualityPreset") - .HasColumnType("INTEGER"); - - b.Property("Volume") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(100); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.ToTable("MusicPlayerSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Author") - .HasColumnType("TEXT"); - - b.Property("AuthorId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("MusicPlaylists"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("MutedUserId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.NCPixel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Color") - .HasColumnType("INTEGER"); - - b.Property("OwnerId") - .HasColumnType("INTEGER"); - - b.Property("Position") - .HasColumnType("INTEGER"); - - b.Property("Price") - .HasColumnType("INTEGER"); - - b.Property("Text") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasAlternateKey("Position"); - - b.HasIndex("OwnerId"); - - b.ToTable("NCPixel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AllowTarget") - .HasColumnType("INTEGER"); - - b.Property("AutoDeleteTrigger") - .HasColumnType("INTEGER"); - - b.Property("ContainsAnywhere") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("DmResponse") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Reactions") - .HasColumnType("TEXT"); - - b.Property("Response") - .HasColumnType("TEXT"); - - b.Property("Trigger") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Expressions"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AmountCents") - .HasColumnType("INTEGER"); - - b.Property("LastCharge") - .HasColumnType("TEXT"); - - b.Property("UniquePlatformUserId") - .HasColumnType("TEXT"); - - b.Property("ValidThru") - .HasColumnType("TEXT"); - - b.HasKey("UserId"); - - b.HasIndex("UniquePlatformUserId") - .IsUnique(); - - b.ToTable("Patrons"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Index") - .HasColumnType("INTEGER"); - - b.Property("IsCustomCommand") - .HasColumnType("INTEGER"); - - b.Property("PrimaryTarget") - .HasColumnType("INTEGER"); - - b.Property("PrimaryTargetId") - .HasColumnType("INTEGER"); - - b.Property("SecondaryTarget") - .HasColumnType("INTEGER"); - - b.Property("SecondaryTargetName") - .HasColumnType("TEXT"); - - b.Property("State") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlantedCurrency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Amount") - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("MessageId") - .HasColumnType("INTEGER"); - - b.Property("Password") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ChannelId"); - - b.HasIndex("MessageId") - .IsUnique(); - - b.ToTable("PlantedCurrency"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.Quote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AuthorId") - .HasColumnType("INTEGER"); - - b.Property("AuthorName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Text") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildId"); - - b.HasIndex("Keyword"); - - b.ToTable("Quotes"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ReactionRoleV2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Emote") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("Group") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("LevelReq") - .HasColumnType("INTEGER"); - - b.Property("MessageId") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId"); - - b.HasIndex("MessageId", "Emote") - .IsUnique(); - - b.ToTable("ReactionRoles"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Reminder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("IsPrivate") - .HasColumnType("INTEGER"); - - b.Property("Message") - .HasColumnType("TEXT"); - - b.Property("ServerId") - .HasColumnType("INTEGER"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("When") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("When"); - - b.ToTable("Reminders"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Repeater", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Interval") - .HasColumnType("TEXT"); - - b.Property("LastMessageId") - .HasColumnType("INTEGER"); - - b.Property("Message") - .HasColumnType("TEXT"); - - b.Property("NoRedundant") - .HasColumnType("INTEGER"); - - b.Property("StartTimeOfDay") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Repeaters"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.RewardedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AmountRewardedThisMonth") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("LastReward") - .HasColumnType("TEXT"); - - b.Property("PlatformUserId") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("PlatformUserId") - .IsUnique(); - - b.ToTable("RewardedUsers"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.RotatingPlayingStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Status") - .HasColumnType("TEXT"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("RotatingStatus"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SelfAssignedRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Group") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("LevelRequirement") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "RoleId") - .IsUnique(); - - b.ToTable("SelfAssignableRoles"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AuthorId") - .HasColumnType("INTEGER"); - - b.Property("Command") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Index") - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("Price") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("RoleName") - .HasColumnType("TEXT"); - - b.Property("RoleRequirement") - .HasColumnType("INTEGER"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("ShopEntry"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ShopEntryId") - .HasColumnType("INTEGER"); - - b.Property("Text") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("ShopEntryId"); - - b.ToTable("ShopEntryItem"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("SlowmodeIgnoredRole"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("SlowmodeIgnoredUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StickyRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("RoleIds") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "UserId") - .IsUnique(); - - b.ToTable("StickyRoles"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamOnlineMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("MessageId") - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("StreamOnlineMessages"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("StreamRoleSettingsId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("Username") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("StreamRoleSettingsId"); - - b.ToTable("StreamRoleBlacklistedUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AddRoleId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Enabled") - .HasColumnType("INTEGER"); - - b.Property("FromRoleId") - .HasColumnType("INTEGER"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Keyword") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId") - .IsUnique(); - - b.ToTable("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("StreamRoleSettingsId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("Username") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("StreamRoleSettingsId"); - - b.ToTable("StreamRoleWhitelistedUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ArchiveId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("IsDone") - .HasColumnType("INTEGER"); - - b.Property("Todo") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ArchiveId"); - - b.HasIndex("UserId"); - - b.ToTable("Todos"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("UnbanAt") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("UnbanTimer"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("UnmuteAt") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("UnmuteTimer"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("UnbanAt") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("UnroleTimer"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UserXpStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AwardedXp") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("NotifyOnLevelUp") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - 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("EllieBot.Db.Models.VcRoleInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("VoiceChannelId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("VcRoleInfo"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AffinityId") - .HasColumnType("INTEGER"); - - b.Property("ClaimerId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Price") - .HasColumnType("INTEGER"); - - b.Property("WaifuId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("AffinityId"); - - b.HasIndex("ClaimerId"); - - b.HasIndex("Price"); - - b.HasIndex("WaifuId") - .IsUnique(); - - b.ToTable("WaifuInfo"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ItemEmoji") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("WaifuInfoId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("WaifuInfoId"); - - b.ToTable("WaifuItem"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("NewId") - .HasColumnType("INTEGER"); - - b.Property("OldId") - .HasColumnType("INTEGER"); - - b.Property("UpdateType") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("NewId"); - - b.HasIndex("OldId"); - - b.HasIndex("UserId"); - - b.ToTable("WaifuUpdates"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Warning", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Forgiven") - .HasColumnType("INTEGER"); - - b.Property("ForgivenBy") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Moderator") - .HasColumnType("TEXT"); - - b.Property("Reason") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("Weight") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(1L); - - b.HasKey("Id"); - - b.HasIndex("DateAdded"); - - b.HasIndex("GuildId"); - - b.HasIndex("UserId"); - - b.ToTable("Warnings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WarningPunishment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Count") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Punishment") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("Time") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasAlternateKey("GuildId", "Count"); - - b.ToTable("WarningPunishment"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Amount") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Level") - .HasColumnType("INTEGER"); - - b.Property("XpSettingsId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("XpSettingsId"); - - b.ToTable("XpCurrencyReward"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Level") - .HasColumnType("INTEGER"); - - b.Property("Remove") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("XpSettingsId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("XpSettingsId", "Level") - .IsUnique(); - - b.ToTable("XpRoleReward"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("ServerExcluded") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId") - .IsUnique(); - - b.ToTable("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpShopOwnedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("IsUsing") - .HasColumnType("INTEGER"); - - b.Property("ItemKey") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ItemType") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemType", "ItemKey") - .IsUnique(); - - b.ToTable("XpShopOwnedItem"); - }); - - modelBuilder.Entity("EllieBot.Services.GreetSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AutoDeleteTimer") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("GreetType") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(false); - - b.Property("MessageText") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "GreetType") - .IsUnique(); - - b.ToTable("GreetSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiAltSetting") - .HasForeignKey("EllieBot.Db.Models.AntiAltSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiRaidSetting") - .HasForeignKey("EllieBot.Db.Models.AntiRaidSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.HasOne("EllieBot.Db.Models.AntiSpamSetting", null) - .WithMany("IgnoredChannels") - .HasForeignKey("AntiSpamSettingId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiSpamSetting") - .HasForeignKey("EllieBot.Db.Models.AntiSpamSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.HasOne("EllieBot.Db.Models.AutoTranslateChannel", "Channel") - .WithMany("Users") - .HasForeignKey("ChannelId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Channel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Applicants") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Club"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Bans") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Club"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Owner") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.ClubInfo", "OwnerId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandAliases") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandCooldown", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandCooldowns") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("DelMsgOnCmdChannels") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Members") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.NoAction); - - b.Navigation("Club"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("ExclusionList") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("FeedSubs") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterInvitesChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterLinksChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterWordsChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilteredWords") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FollowedStreams") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GCChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("GenerateCurrencyChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.HasOne("EllieBot.Db.Models.GiveawayModel", null) - .WithMany("Participants") - .HasForeignKey("GiveawayId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("SelfAssignableRoleGroupNames") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.HasOne("EllieBot.Db.Models.LogSetting", "LogSetting") - .WithMany("LogIgnores") - .HasForeignKey("LogSettingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("LogSetting"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("MutedUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("Permissions") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.HasOne("EllieBot.Db.Models.MusicPlaylist", null) - .WithMany("Songs") - .HasForeignKey("MusicPlaylistId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("ShopEntries") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.HasOne("EllieBot.Db.Models.ShopEntry", null) - .WithMany("Items") - .HasForeignKey("ShopEntryId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredRoles") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Blacklist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("StreamRole") - .HasForeignKey("EllieBot.Db.Models.StreamRoleSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Whitelist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.HasOne("EllieBot.Db.Models.ArchivedTodoListModel", null) - .WithMany("Items") - .HasForeignKey("ArchiveId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnbanTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnmuteTimers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnroleTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.VcRoleInfo", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("VcRoleInfos") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Affinity") - .WithMany() - .HasForeignKey("AffinityId"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Claimer") - .WithMany() - .HasForeignKey("ClaimerId"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Waifu") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.WaifuInfo", "WaifuId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Affinity"); - - b.Navigation("Claimer"); - - b.Navigation("Waifu"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.HasOne("EllieBot.Db.Models.WaifuInfo", "WaifuInfo") - .WithMany("Items") - .HasForeignKey("WaifuInfoId"); - - b.Navigation("WaifuInfo"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "New") - .WithMany() - .HasForeignKey("NewId"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Old") - .WithMany() - .HasForeignKey("OldId"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("New"); - - b.Navigation("Old"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("CurrencyRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("RoleRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("XpSettings") - .HasForeignKey("EllieBot.Db.Models.XpSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Navigation("IgnoredChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Navigation("Users"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Navigation("Applicants"); - - b.Navigation("Bans"); - - b.Navigation("Members"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Navigation("Participants"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GuildConfig", b => - { - b.Navigation("AntiAltSetting"); - - b.Navigation("AntiRaidSetting"); - - b.Navigation("AntiSpamSetting"); - - 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("GenerateCurrencyChannelIds"); - - b.Navigation("MutedUsers"); - - b.Navigation("Permissions"); - - b.Navigation("SelfAssignableRoleGroupNames"); - - b.Navigation("ShopEntries"); - - b.Navigation("SlowmodeIgnoredRoles"); - - b.Navigation("SlowmodeIgnoredUsers"); - - b.Navigation("StreamRole"); - - b.Navigation("UnbanTimer"); - - b.Navigation("UnmuteTimers"); - - b.Navigation("UnroleTimer"); - - b.Navigation("VcRoleInfos"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Navigation("LogIgnores"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Navigation("Songs"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Navigation("Blacklist"); - - b.Navigation("Whitelist"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Navigation("CurrencyRewards"); - - b.Navigation("ExclusionList"); - - b.Navigation("RoleRewards"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/EllieBot/Migrations/Sqlite/20241102022949_no-discrim-and-flag-translate.cs b/src/EllieBot/Migrations/Sqlite/20241102022949_no-discrim-and-flag-translate.cs deleted file mode 100644 index f9ddda7..0000000 --- a/src/EllieBot/Migrations/Sqlite/20241102022949_no-discrim-and-flag-translate.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace EllieBot.Migrations -{ - /// - public partial class nodiscrimandflagtranslate : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - MigrationQueries.UpdateUsernames(migrationBuilder); - - migrationBuilder.DropColumn( - name: "Discriminator", - table: "DiscordUser"); - - migrationBuilder.CreateTable( - name: "FlagTranslateChannel", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - GuildId = table.Column(type: "INTEGER", nullable: false), - ChannelId = table.Column(type: "INTEGER", nullable: false), - DateAdded = table.Column(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_FlagTranslateChannel", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_FlagTranslateChannel_GuildId_ChannelId", - table: "FlagTranslateChannel", - columns: new[] { "GuildId", "ChannelId" }, - unique: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "FlagTranslateChannel"); - - migrationBuilder.AddColumn( - name: "Discriminator", - table: "DiscordUser", - type: "TEXT", - nullable: true); - } - } -} diff --git a/src/EllieBot/Migrations/Sqlite/20241105024653_betstats.Designer.cs b/src/EllieBot/Migrations/Sqlite/20241105024653_betstats.Designer.cs deleted file mode 100644 index 3151283..0000000 --- a/src/EllieBot/Migrations/Sqlite/20241105024653_betstats.Designer.cs +++ /dev/null @@ -1,3011 +0,0 @@ -// -using System; -using EllieBot.Db; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace EllieBot.Migrations -{ - [DbContext(typeof(SqliteContext))] - [Migration("20241105024653_betstats")] - partial class betstats - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.8"); - - modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Action") - .HasColumnType("INTEGER"); - - b.Property("ActionDurationMinutes") - .HasColumnType("INTEGER"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("MinAge") - .HasColumnType("TEXT"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId") - .IsUnique(); - - b.ToTable("AntiAltSetting"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Action") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AntiSpamSettingId") - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("AntiSpamSettingId"); - - b.ToTable("AntiSpamIgnore"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Action") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("MessageThreshold") - .HasColumnType("INTEGER"); - - b.Property("MuteTime") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId") - .IsUnique(); - - b.ToTable("AntiSpamSetting"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("TodosArchive"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoCommand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("ChannelName") - .HasColumnType("TEXT"); - - b.Property("CommandText") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("GuildName") - .HasColumnType("TEXT"); - - b.Property("Interval") - .HasColumnType("INTEGER"); - - b.Property("VoiceChannelId") - .HasColumnType("INTEGER"); - - b.Property("VoiceChannelName") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("AutoCommands"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoPublishChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.ToTable("AutoPublishChannel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AutoDelete") - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ChannelId") - .IsUnique(); - - b.HasIndex("GuildId"); - - b.ToTable("AutoTranslateChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Source") - .HasColumnType("TEXT"); - - b.Property("Target") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasAlternateKey("ChannelId", "UserId"); - - b.ToTable("AutoTranslateUsers"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BanTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("PruneDays") - .HasColumnType("INTEGER"); - - b.Property("Text") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.ToTable("BanTemplates"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Balance") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("BankUsers"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BlacklistEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ItemId") - .HasColumnType("INTEGER"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("Blacklist"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.Property("ClubId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("ClubId", "UserId"); - - b.HasIndex("UserId"); - - b.ToTable("ClubApplicants"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.Property("ClubId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("ClubId", "UserId"); - - b.HasIndex("UserId"); - - b.ToTable("ClubBans"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Description") - .HasColumnType("TEXT"); - - b.Property("ImageUrl") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasMaxLength(20) - .HasColumnType("TEXT"); - - b.Property("OwnerId") - .HasColumnType("INTEGER"); - - b.Property("Xp") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("OwnerId") - .IsUnique(); - - b.ToTable("Clubs"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.CommandCooldown", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CommandName") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Seconds") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("CommandCooldown"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CurrencyTransaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Amount") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Extra") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Note") - .HasColumnType("TEXT"); - - b.Property("OtherId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValueSql("NULL"); - - b.Property("Type") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("CurrencyTransactions"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("State") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("DelMsgOnCmdChannel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordPermOverride", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Command") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Perm") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "Command") - .IsUnique(); - - b.ToTable("DiscordPermOverrides"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AvatarId") - .HasColumnType("TEXT"); - - b.Property("ClubId") - .HasColumnType("INTEGER"); - - b.Property("CurrencyAmount") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0L); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("IsClubAdmin") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(false); - - b.Property("NotifyOnLevelUp") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0); - - b.Property("TotalXp") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0L); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("Username") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasAlternateKey("UserId"); - - b.HasIndex("ClubId"); - - b.HasIndex("CurrencyAmount"); - - b.HasIndex("TotalXp"); - - b.HasIndex("UserId"); - - b.HasIndex("Username"); - - b.ToTable("DiscordUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AllowTarget") - .HasColumnType("INTEGER"); - - b.Property("AutoDeleteTrigger") - .HasColumnType("INTEGER"); - - b.Property("ContainsAnywhere") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("DmResponse") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Reactions") - .HasColumnType("TEXT"); - - b.Property("Response") - .HasColumnType("TEXT"); - - b.Property("Trigger") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Expressions"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ItemId") - .HasColumnType("INTEGER"); - - b.Property("ItemType") - .HasColumnType("INTEGER"); - - b.Property("XpSettingsId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("XpSettingsId"); - - b.ToTable("ExcludedItem"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.FilterChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("FilterChannelId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("FilterLinksChannelId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("FilterWordsChannelId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Word") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("FilteredWord"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FlagTranslateChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "ChannelId") - .IsUnique(); - - b.ToTable("FlagTranslateChannel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - 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("EllieBot.Db.Models.GCChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("GCChannelId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GamblingStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Bet") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Feature") - .HasColumnType("TEXT"); - - b.Property("PaidOut") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Feature") - .IsUnique(); - - b.ToTable("GamblingStats"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("EndsAt") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Message") - .HasColumnType("TEXT"); - - b.Property("MessageId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("GiveawayModel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("GiveawayId") - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GiveawayId", "UserId") - .IsUnique(); - - b.ToTable("GiveawayUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.GuildConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AutoAssignRoleIds") - .HasColumnType("TEXT"); - - b.Property("AutoDeleteSelfAssignedRoleMessages") - .HasColumnType("INTEGER"); - - b.Property("CleverbotEnabled") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("DeleteMessageOnCommand") - .HasColumnType("INTEGER"); - - b.Property("DeleteStreamOnlineMessage") - .HasColumnType("INTEGER"); - - b.Property("DisableGlobalExpressions") - .HasColumnType("INTEGER"); - - b.Property("ExclusiveSelfAssignedRoles") - .HasColumnType("INTEGER"); - - b.Property("FilterInvites") - .HasColumnType("INTEGER"); - - b.Property("FilterLinks") - .HasColumnType("INTEGER"); - - b.Property("FilterWords") - .HasColumnType("INTEGER"); - - b.Property("GameVoiceChannel") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Locale") - .HasColumnType("TEXT"); - - b.Property("MuteRoleName") - .HasColumnType("TEXT"); - - b.Property("NotifyStreamOffline") - .HasColumnType("INTEGER"); - - b.Property("PermissionRole") - .HasColumnType("TEXT"); - - b.Property("Prefix") - .HasColumnType("TEXT"); - - b.Property("StickyRoles") - .HasColumnType("INTEGER"); - - b.Property("TimeZoneId") - .HasColumnType("TEXT"); - - b.Property("VerboseErrors") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(true); - - b.Property("VerbosePermissions") - .HasColumnType("INTEGER"); - - b.Property("WarnExpireAction") - .HasColumnType("INTEGER"); - - b.Property("WarnExpireHours") - .HasColumnType("INTEGER"); - - b.Property("WarningsInitialized") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.HasIndex("WarnExpireHours"); - - b.ToTable("GuildConfigs"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.HoneypotChannel", b => - { - b.Property("GuildId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.HasKey("GuildId"); - - b.ToTable("HoneyPotChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ItemType") - .HasColumnType("INTEGER"); - - b.Property("LogItemId") - .HasColumnType("INTEGER"); - - b.Property("LogSettingId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("LogSettingId", "LogItemId", "ItemType") - .IsUnique(); - - b.ToTable("IgnoredLogChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ImageOnlyChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ChannelId") - .IsUnique(); - - b.ToTable("ImageOnlyChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelCreatedId") - .HasColumnType("INTEGER"); - - b.Property("ChannelDestroyedId") - .HasColumnType("INTEGER"); - - b.Property("ChannelUpdatedId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("LogOtherId") - .HasColumnType("INTEGER"); - - b.Property("LogUserPresenceId") - .HasColumnType("INTEGER"); - - b.Property("LogVoicePresenceId") - .HasColumnType("INTEGER"); - - b.Property("LogVoicePresenceTTSId") - .HasColumnType("INTEGER"); - - b.Property("LogWarnsId") - .HasColumnType("INTEGER"); - - b.Property("MessageDeletedId") - .HasColumnType("INTEGER"); - - b.Property("MessageUpdatedId") - .HasColumnType("INTEGER"); - - b.Property("ThreadCreatedId") - .HasColumnType("INTEGER"); - - b.Property("ThreadDeletedId") - .HasColumnType("INTEGER"); - - b.Property("UserBannedId") - .HasColumnType("INTEGER"); - - b.Property("UserJoinedId") - .HasColumnType("INTEGER"); - - b.Property("UserLeftId") - .HasColumnType("INTEGER"); - - b.Property("UserMutedId") - .HasColumnType("INTEGER"); - - b.Property("UserUnbannedId") - .HasColumnType("INTEGER"); - - b.Property("UserUpdatedId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.ToTable("LogSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlayerSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AutoDisconnect") - .HasColumnType("INTEGER"); - - b.Property("AutoPlay") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("MusicChannelId") - .HasColumnType("INTEGER"); - - b.Property("PlayerRepeat") - .HasColumnType("INTEGER"); - - b.Property("QualityPreset") - .HasColumnType("INTEGER"); - - b.Property("Volume") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(100); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.ToTable("MusicPlayerSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Author") - .HasColumnType("TEXT"); - - b.Property("AuthorId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("MusicPlaylists"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("MutedUserId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.NCPixel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Color") - .HasColumnType("INTEGER"); - - b.Property("OwnerId") - .HasColumnType("INTEGER"); - - b.Property("Position") - .HasColumnType("INTEGER"); - - b.Property("Price") - .HasColumnType("INTEGER"); - - b.Property("Text") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasAlternateKey("Position"); - - b.HasIndex("OwnerId"); - - b.ToTable("NCPixel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AmountCents") - .HasColumnType("INTEGER"); - - b.Property("LastCharge") - .HasColumnType("TEXT"); - - b.Property("UniquePlatformUserId") - .HasColumnType("TEXT"); - - b.Property("ValidThru") - .HasColumnType("TEXT"); - - b.HasKey("UserId"); - - b.HasIndex("UniquePlatformUserId") - .IsUnique(); - - b.ToTable("Patrons"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Index") - .HasColumnType("INTEGER"); - - b.Property("IsCustomCommand") - .HasColumnType("INTEGER"); - - b.Property("PrimaryTarget") - .HasColumnType("INTEGER"); - - b.Property("PrimaryTargetId") - .HasColumnType("INTEGER"); - - b.Property("SecondaryTarget") - .HasColumnType("INTEGER"); - - b.Property("SecondaryTargetName") - .HasColumnType("TEXT"); - - b.Property("State") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlantedCurrency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Amount") - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("MessageId") - .HasColumnType("INTEGER"); - - b.Property("Password") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ChannelId"); - - b.HasIndex("MessageId") - .IsUnique(); - - b.ToTable("PlantedCurrency"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.Quote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AuthorId") - .HasColumnType("INTEGER"); - - b.Property("AuthorName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Text") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildId"); - - b.HasIndex("Keyword"); - - b.ToTable("Quotes"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ReactionRoleV2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Emote") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("Group") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("LevelReq") - .HasColumnType("INTEGER"); - - b.Property("MessageId") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId"); - - b.HasIndex("MessageId", "Emote") - .IsUnique(); - - b.ToTable("ReactionRoles"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Reminder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("IsPrivate") - .HasColumnType("INTEGER"); - - b.Property("Message") - .HasColumnType("TEXT"); - - b.Property("ServerId") - .HasColumnType("INTEGER"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("When") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("When"); - - b.ToTable("Reminders"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Repeater", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Interval") - .HasColumnType("TEXT"); - - b.Property("LastMessageId") - .HasColumnType("INTEGER"); - - b.Property("Message") - .HasColumnType("TEXT"); - - b.Property("NoRedundant") - .HasColumnType("INTEGER"); - - b.Property("StartTimeOfDay") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Repeaters"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.RewardedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AmountRewardedThisMonth") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("LastReward") - .HasColumnType("TEXT"); - - b.Property("PlatformUserId") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("PlatformUserId") - .IsUnique(); - - b.ToTable("RewardedUsers"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.RotatingPlayingStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Status") - .HasColumnType("TEXT"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("RotatingStatus"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SelfAssignedRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Group") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("LevelRequirement") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "RoleId") - .IsUnique(); - - b.ToTable("SelfAssignableRoles"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AuthorId") - .HasColumnType("INTEGER"); - - b.Property("Command") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Index") - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("Price") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("RoleName") - .HasColumnType("TEXT"); - - b.Property("RoleRequirement") - .HasColumnType("INTEGER"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("ShopEntry"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ShopEntryId") - .HasColumnType("INTEGER"); - - b.Property("Text") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("ShopEntryId"); - - b.ToTable("ShopEntryItem"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("SlowmodeIgnoredRole"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("SlowmodeIgnoredUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StickyRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("RoleIds") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "UserId") - .IsUnique(); - - b.ToTable("StickyRoles"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamOnlineMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("MessageId") - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("StreamOnlineMessages"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("StreamRoleSettingsId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("Username") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("StreamRoleSettingsId"); - - b.ToTable("StreamRoleBlacklistedUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AddRoleId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Enabled") - .HasColumnType("INTEGER"); - - b.Property("FromRoleId") - .HasColumnType("INTEGER"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Keyword") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId") - .IsUnique(); - - b.ToTable("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("StreamRoleSettingsId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("Username") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("StreamRoleSettingsId"); - - b.ToTable("StreamRoleWhitelistedUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ArchiveId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("IsDone") - .HasColumnType("INTEGER"); - - b.Property("Todo") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ArchiveId"); - - b.HasIndex("UserId"); - - b.ToTable("Todos"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("UnbanAt") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("UnbanTimer"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("UnmuteAt") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("UnmuteTimer"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("UnbanAt") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("UnroleTimer"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UserXpStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AwardedXp") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("NotifyOnLevelUp") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - 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("EllieBot.Db.Models.VcRoleInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("VoiceChannelId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("VcRoleInfo"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AffinityId") - .HasColumnType("INTEGER"); - - b.Property("ClaimerId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Price") - .HasColumnType("INTEGER"); - - b.Property("WaifuId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("AffinityId"); - - b.HasIndex("ClaimerId"); - - b.HasIndex("Price"); - - b.HasIndex("WaifuId") - .IsUnique(); - - b.ToTable("WaifuInfo"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ItemEmoji") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("WaifuInfoId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("WaifuInfoId"); - - b.ToTable("WaifuItem"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("NewId") - .HasColumnType("INTEGER"); - - b.Property("OldId") - .HasColumnType("INTEGER"); - - b.Property("UpdateType") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("NewId"); - - b.HasIndex("OldId"); - - b.HasIndex("UserId"); - - b.ToTable("WaifuUpdates"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Warning", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Forgiven") - .HasColumnType("INTEGER"); - - b.Property("ForgivenBy") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Moderator") - .HasColumnType("TEXT"); - - b.Property("Reason") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("Weight") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(1L); - - b.HasKey("Id"); - - b.HasIndex("DateAdded"); - - b.HasIndex("GuildId"); - - b.HasIndex("UserId"); - - b.ToTable("Warnings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WarningPunishment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Count") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Punishment") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("Time") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasAlternateKey("GuildId", "Count"); - - b.ToTable("WarningPunishment"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Amount") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Level") - .HasColumnType("INTEGER"); - - b.Property("XpSettingsId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("XpSettingsId"); - - b.ToTable("XpCurrencyReward"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Level") - .HasColumnType("INTEGER"); - - b.Property("Remove") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("XpSettingsId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("XpSettingsId", "Level") - .IsUnique(); - - b.ToTable("XpRoleReward"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("ServerExcluded") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId") - .IsUnique(); - - b.ToTable("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpShopOwnedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("IsUsing") - .HasColumnType("INTEGER"); - - b.Property("ItemKey") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ItemType") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemType", "ItemKey") - .IsUnique(); - - b.ToTable("XpShopOwnedItem"); - }); - - modelBuilder.Entity("EllieBot.Services.GreetSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AutoDeleteTimer") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("GreetType") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(false); - - b.Property("MessageText") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "GreetType") - .IsUnique(); - - b.ToTable("GreetSettings"); - }); - - modelBuilder.Entity("EllieBot.Services.UserBetStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Game") - .HasColumnType("INTEGER"); - - b.Property("LoseCount") - .HasColumnType("INTEGER"); - - b.Property("MaxBet") - .HasColumnType("INTEGER"); - - b.Property("MaxWin") - .HasColumnType("INTEGER"); - - b.Property("PaidOut") - .HasColumnType("TEXT"); - - b.Property("TotalBet") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("WinCount") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Game") - .IsUnique(); - - b.ToTable("UserBetStats"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiAltSetting") - .HasForeignKey("EllieBot.Db.Models.AntiAltSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiRaidSetting") - .HasForeignKey("EllieBot.Db.Models.AntiRaidSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.HasOne("EllieBot.Db.Models.AntiSpamSetting", null) - .WithMany("IgnoredChannels") - .HasForeignKey("AntiSpamSettingId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiSpamSetting") - .HasForeignKey("EllieBot.Db.Models.AntiSpamSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.HasOne("EllieBot.Db.Models.AutoTranslateChannel", "Channel") - .WithMany("Users") - .HasForeignKey("ChannelId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Channel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Applicants") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Club"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Bans") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Club"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Owner") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.ClubInfo", "OwnerId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandAliases") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandCooldown", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandCooldowns") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("DelMsgOnCmdChannels") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Members") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.NoAction); - - b.Navigation("Club"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("ExclusionList") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("FeedSubs") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterInvitesChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterLinksChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterWordsChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilteredWords") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FollowedStreams") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GCChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("GenerateCurrencyChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.HasOne("EllieBot.Db.Models.GiveawayModel", null) - .WithMany("Participants") - .HasForeignKey("GiveawayId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("SelfAssignableRoleGroupNames") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.HasOne("EllieBot.Db.Models.LogSetting", "LogSetting") - .WithMany("LogIgnores") - .HasForeignKey("LogSettingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("LogSetting"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("MutedUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("Permissions") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.HasOne("EllieBot.Db.Models.MusicPlaylist", null) - .WithMany("Songs") - .HasForeignKey("MusicPlaylistId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("ShopEntries") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.HasOne("EllieBot.Db.Models.ShopEntry", null) - .WithMany("Items") - .HasForeignKey("ShopEntryId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredRoles") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Blacklist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("StreamRole") - .HasForeignKey("EllieBot.Db.Models.StreamRoleSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Whitelist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.HasOne("EllieBot.Db.Models.ArchivedTodoListModel", null) - .WithMany("Items") - .HasForeignKey("ArchiveId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnbanTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnmuteTimers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnroleTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.VcRoleInfo", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("VcRoleInfos") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Affinity") - .WithMany() - .HasForeignKey("AffinityId"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Claimer") - .WithMany() - .HasForeignKey("ClaimerId"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Waifu") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.WaifuInfo", "WaifuId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Affinity"); - - b.Navigation("Claimer"); - - b.Navigation("Waifu"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.HasOne("EllieBot.Db.Models.WaifuInfo", "WaifuInfo") - .WithMany("Items") - .HasForeignKey("WaifuInfoId"); - - b.Navigation("WaifuInfo"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "New") - .WithMany() - .HasForeignKey("NewId"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Old") - .WithMany() - .HasForeignKey("OldId"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("New"); - - b.Navigation("Old"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("CurrencyRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("RoleRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("XpSettings") - .HasForeignKey("EllieBot.Db.Models.XpSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Navigation("IgnoredChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Navigation("Users"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Navigation("Applicants"); - - b.Navigation("Bans"); - - b.Navigation("Members"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Navigation("Participants"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GuildConfig", b => - { - b.Navigation("AntiAltSetting"); - - b.Navigation("AntiRaidSetting"); - - b.Navigation("AntiSpamSetting"); - - 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("GenerateCurrencyChannelIds"); - - b.Navigation("MutedUsers"); - - b.Navigation("Permissions"); - - b.Navigation("SelfAssignableRoleGroupNames"); - - b.Navigation("ShopEntries"); - - b.Navigation("SlowmodeIgnoredRoles"); - - b.Navigation("SlowmodeIgnoredUsers"); - - b.Navigation("StreamRole"); - - b.Navigation("UnbanTimer"); - - b.Navigation("UnmuteTimers"); - - b.Navigation("UnroleTimer"); - - b.Navigation("VcRoleInfos"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Navigation("LogIgnores"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Navigation("Songs"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Navigation("Blacklist"); - - b.Navigation("Whitelist"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Navigation("CurrencyRewards"); - - b.Navigation("ExclusionList"); - - b.Navigation("RoleRewards"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/EllieBot/Migrations/Sqlite/20241105024653_betstats.cs b/src/EllieBot/Migrations/Sqlite/20241105024653_betstats.cs deleted file mode 100644 index 609c3f3..0000000 --- a/src/EllieBot/Migrations/Sqlite/20241105024653_betstats.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace EllieBot.Migrations -{ - /// - public partial class betstats : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "UserBetStats", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - UserId = table.Column(type: "INTEGER", nullable: false), - Game = table.Column(type: "INTEGER", nullable: false), - WinCount = table.Column(type: "INTEGER", nullable: false), - LoseCount = table.Column(type: "INTEGER", nullable: false), - TotalBet = table.Column(type: "TEXT", nullable: false), - PaidOut = table.Column(type: "TEXT", nullable: false), - MaxWin = table.Column(type: "INTEGER", nullable: false), - MaxBet = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_UserBetStats", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_UserBetStats_UserId_Game", - table: "UserBetStats", - columns: new[] { "UserId", "Game" }, - unique: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "UserBetStats"); - } - } -} diff --git a/src/EllieBot/Migrations/Sqlite/20241107051525_rakeback.Designer.cs b/src/EllieBot/Migrations/Sqlite/20241107051525_rakeback.Designer.cs deleted file mode 100644 index 08669ff..0000000 --- a/src/EllieBot/Migrations/Sqlite/20241107051525_rakeback.Designer.cs +++ /dev/null @@ -1,3025 +0,0 @@ -// -using System; -using EllieBot.Db; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace EllieBot.Migrations -{ - [DbContext(typeof(SqliteContext))] - [Migration("20241107051525_rakeback")] - partial class rakeback - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.8"); - - modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Action") - .HasColumnType("INTEGER"); - - b.Property("ActionDurationMinutes") - .HasColumnType("INTEGER"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("MinAge") - .HasColumnType("TEXT"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId") - .IsUnique(); - - b.ToTable("AntiAltSetting"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Action") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AntiSpamSettingId") - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("AntiSpamSettingId"); - - b.ToTable("AntiSpamIgnore"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Action") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("MessageThreshold") - .HasColumnType("INTEGER"); - - b.Property("MuteTime") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId") - .IsUnique(); - - b.ToTable("AntiSpamSetting"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("TodosArchive"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoCommand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("ChannelName") - .HasColumnType("TEXT"); - - b.Property("CommandText") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("GuildName") - .HasColumnType("TEXT"); - - b.Property("Interval") - .HasColumnType("INTEGER"); - - b.Property("VoiceChannelId") - .HasColumnType("INTEGER"); - - b.Property("VoiceChannelName") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("AutoCommands"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoPublishChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.ToTable("AutoPublishChannel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AutoDelete") - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ChannelId") - .IsUnique(); - - b.HasIndex("GuildId"); - - b.ToTable("AutoTranslateChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Source") - .HasColumnType("TEXT"); - - b.Property("Target") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasAlternateKey("ChannelId", "UserId"); - - b.ToTable("AutoTranslateUsers"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BanTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("PruneDays") - .HasColumnType("INTEGER"); - - b.Property("Text") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.ToTable("BanTemplates"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Balance") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("BankUsers"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.BlacklistEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ItemId") - .HasColumnType("INTEGER"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("Blacklist"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.Property("ClubId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("ClubId", "UserId"); - - b.HasIndex("UserId"); - - b.ToTable("ClubApplicants"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.Property("ClubId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("ClubId", "UserId"); - - b.HasIndex("UserId"); - - b.ToTable("ClubBans"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Description") - .HasColumnType("TEXT"); - - b.Property("ImageUrl") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasMaxLength(20) - .HasColumnType("TEXT"); - - b.Property("OwnerId") - .HasColumnType("INTEGER"); - - b.Property("Xp") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique(); - - b.HasIndex("OwnerId") - .IsUnique(); - - b.ToTable("Clubs"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.CommandCooldown", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("CommandName") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Seconds") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("CommandCooldown"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CurrencyTransaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Amount") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Extra") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Note") - .HasColumnType("TEXT"); - - b.Property("OtherId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValueSql("NULL"); - - b.Property("Type") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("CurrencyTransactions"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("State") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("DelMsgOnCmdChannel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordPermOverride", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Command") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Perm") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "Command") - .IsUnique(); - - b.ToTable("DiscordPermOverrides"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AvatarId") - .HasColumnType("TEXT"); - - b.Property("ClubId") - .HasColumnType("INTEGER"); - - b.Property("CurrencyAmount") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0L); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("IsClubAdmin") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(false); - - b.Property("NotifyOnLevelUp") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0); - - b.Property("TotalXp") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0L); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("Username") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasAlternateKey("UserId"); - - b.HasIndex("ClubId"); - - b.HasIndex("CurrencyAmount"); - - b.HasIndex("TotalXp"); - - b.HasIndex("UserId"); - - b.HasIndex("Username"); - - b.ToTable("DiscordUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AllowTarget") - .HasColumnType("INTEGER"); - - b.Property("AutoDeleteTrigger") - .HasColumnType("INTEGER"); - - b.Property("ContainsAnywhere") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("DmResponse") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Reactions") - .HasColumnType("TEXT"); - - b.Property("Response") - .HasColumnType("TEXT"); - - b.Property("Trigger") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Expressions"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ItemId") - .HasColumnType("INTEGER"); - - b.Property("ItemType") - .HasColumnType("INTEGER"); - - b.Property("XpSettingsId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("XpSettingsId"); - - b.ToTable("ExcludedItem"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.FilterChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("FilterChannelId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("FilterLinksChannelId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("FilterWordsChannelId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Word") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("FilteredWord"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FlagTranslateChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "ChannelId") - .IsUnique(); - - b.ToTable("FlagTranslateChannel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - 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("EllieBot.Db.Models.GCChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("GCChannelId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GamblingStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Bet") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Feature") - .HasColumnType("TEXT"); - - b.Property("PaidOut") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Feature") - .IsUnique(); - - b.ToTable("GamblingStats"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("EndsAt") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Message") - .HasColumnType("TEXT"); - - b.Property("MessageId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("GiveawayModel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("GiveawayId") - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GiveawayId", "UserId") - .IsUnique(); - - b.ToTable("GiveawayUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.GuildConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AutoAssignRoleIds") - .HasColumnType("TEXT"); - - b.Property("AutoDeleteSelfAssignedRoleMessages") - .HasColumnType("INTEGER"); - - b.Property("CleverbotEnabled") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("DeleteMessageOnCommand") - .HasColumnType("INTEGER"); - - b.Property("DeleteStreamOnlineMessage") - .HasColumnType("INTEGER"); - - b.Property("DisableGlobalExpressions") - .HasColumnType("INTEGER"); - - b.Property("ExclusiveSelfAssignedRoles") - .HasColumnType("INTEGER"); - - b.Property("FilterInvites") - .HasColumnType("INTEGER"); - - b.Property("FilterLinks") - .HasColumnType("INTEGER"); - - b.Property("FilterWords") - .HasColumnType("INTEGER"); - - b.Property("GameVoiceChannel") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Locale") - .HasColumnType("TEXT"); - - b.Property("MuteRoleName") - .HasColumnType("TEXT"); - - b.Property("NotifyStreamOffline") - .HasColumnType("INTEGER"); - - b.Property("PermissionRole") - .HasColumnType("TEXT"); - - b.Property("Prefix") - .HasColumnType("TEXT"); - - b.Property("StickyRoles") - .HasColumnType("INTEGER"); - - b.Property("TimeZoneId") - .HasColumnType("TEXT"); - - b.Property("VerboseErrors") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(true); - - b.Property("VerbosePermissions") - .HasColumnType("INTEGER"); - - b.Property("WarnExpireAction") - .HasColumnType("INTEGER"); - - b.Property("WarnExpireHours") - .HasColumnType("INTEGER"); - - b.Property("WarningsInitialized") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.HasIndex("WarnExpireHours"); - - b.ToTable("GuildConfigs"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.HoneypotChannel", b => - { - b.Property("GuildId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.HasKey("GuildId"); - - b.ToTable("HoneyPotChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ItemType") - .HasColumnType("INTEGER"); - - b.Property("LogItemId") - .HasColumnType("INTEGER"); - - b.Property("LogSettingId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("LogSettingId", "LogItemId", "ItemType") - .IsUnique(); - - b.ToTable("IgnoredLogChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ImageOnlyChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ChannelId") - .IsUnique(); - - b.ToTable("ImageOnlyChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelCreatedId") - .HasColumnType("INTEGER"); - - b.Property("ChannelDestroyedId") - .HasColumnType("INTEGER"); - - b.Property("ChannelUpdatedId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("LogOtherId") - .HasColumnType("INTEGER"); - - b.Property("LogUserPresenceId") - .HasColumnType("INTEGER"); - - b.Property("LogVoicePresenceId") - .HasColumnType("INTEGER"); - - b.Property("LogVoicePresenceTTSId") - .HasColumnType("INTEGER"); - - b.Property("LogWarnsId") - .HasColumnType("INTEGER"); - - b.Property("MessageDeletedId") - .HasColumnType("INTEGER"); - - b.Property("MessageUpdatedId") - .HasColumnType("INTEGER"); - - b.Property("ThreadCreatedId") - .HasColumnType("INTEGER"); - - b.Property("ThreadDeletedId") - .HasColumnType("INTEGER"); - - b.Property("UserBannedId") - .HasColumnType("INTEGER"); - - b.Property("UserJoinedId") - .HasColumnType("INTEGER"); - - b.Property("UserLeftId") - .HasColumnType("INTEGER"); - - b.Property("UserMutedId") - .HasColumnType("INTEGER"); - - b.Property("UserUnbannedId") - .HasColumnType("INTEGER"); - - b.Property("UserUpdatedId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.ToTable("LogSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlayerSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AutoDisconnect") - .HasColumnType("INTEGER"); - - b.Property("AutoPlay") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("MusicChannelId") - .HasColumnType("INTEGER"); - - b.Property("PlayerRepeat") - .HasColumnType("INTEGER"); - - b.Property("QualityPreset") - .HasColumnType("INTEGER"); - - b.Property("Volume") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(100); - - b.HasKey("Id"); - - b.HasIndex("GuildId") - .IsUnique(); - - b.ToTable("MusicPlayerSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Author") - .HasColumnType("TEXT"); - - b.Property("AuthorId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("MusicPlaylists"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("MutedUserId"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.NCPixel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Color") - .HasColumnType("INTEGER"); - - b.Property("OwnerId") - .HasColumnType("INTEGER"); - - b.Property("Position") - .HasColumnType("INTEGER"); - - b.Property("Price") - .HasColumnType("INTEGER"); - - b.Property("Text") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasAlternateKey("Position"); - - b.HasIndex("OwnerId"); - - b.ToTable("NCPixel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AmountCents") - .HasColumnType("INTEGER"); - - b.Property("LastCharge") - .HasColumnType("TEXT"); - - b.Property("UniquePlatformUserId") - .HasColumnType("TEXT"); - - b.Property("ValidThru") - .HasColumnType("TEXT"); - - b.HasKey("UserId"); - - b.HasIndex("UniquePlatformUserId") - .IsUnique(); - - b.ToTable("Patrons"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Index") - .HasColumnType("INTEGER"); - - b.Property("IsCustomCommand") - .HasColumnType("INTEGER"); - - b.Property("PrimaryTarget") - .HasColumnType("INTEGER"); - - b.Property("PrimaryTargetId") - .HasColumnType("INTEGER"); - - b.Property("SecondaryTarget") - .HasColumnType("INTEGER"); - - b.Property("SecondaryTargetName") - .HasColumnType("TEXT"); - - b.Property("State") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlantedCurrency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Amount") - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("MessageId") - .HasColumnType("INTEGER"); - - b.Property("Password") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ChannelId"); - - b.HasIndex("MessageId") - .IsUnique(); - - b.ToTable("PlantedCurrency"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - 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("EllieBot.Db.Models.Quote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AuthorId") - .HasColumnType("INTEGER"); - - b.Property("AuthorName") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Keyword") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("Text") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildId"); - - b.HasIndex("Keyword"); - - b.ToTable("Quotes"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ReactionRoleV2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Emote") - .HasMaxLength(100) - .HasColumnType("TEXT"); - - b.Property("Group") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("LevelReq") - .HasColumnType("INTEGER"); - - b.Property("MessageId") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId"); - - b.HasIndex("MessageId", "Emote") - .IsUnique(); - - b.ToTable("ReactionRoles"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Reminder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("IsPrivate") - .HasColumnType("INTEGER"); - - b.Property("Message") - .HasColumnType("TEXT"); - - b.Property("ServerId") - .HasColumnType("INTEGER"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("When") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("When"); - - b.ToTable("Reminders"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Repeater", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Interval") - .HasColumnType("TEXT"); - - b.Property("LastMessageId") - .HasColumnType("INTEGER"); - - b.Property("Message") - .HasColumnType("TEXT"); - - b.Property("NoRedundant") - .HasColumnType("INTEGER"); - - b.Property("StartTimeOfDay") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Repeaters"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.RewardedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AmountRewardedThisMonth") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("LastReward") - .HasColumnType("TEXT"); - - b.Property("PlatformUserId") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("PlatformUserId") - .IsUnique(); - - b.ToTable("RewardedUsers"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.RotatingPlayingStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Status") - .HasColumnType("TEXT"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("RotatingStatus"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SelfAssignedRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Group") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("LevelRequirement") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "RoleId") - .IsUnique(); - - b.ToTable("SelfAssignableRoles"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AuthorId") - .HasColumnType("INTEGER"); - - b.Property("Command") - .HasColumnType("TEXT"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Index") - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("Price") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("RoleName") - .HasColumnType("TEXT"); - - b.Property("RoleRequirement") - .HasColumnType("INTEGER"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("ShopEntry"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ShopEntryId") - .HasColumnType("INTEGER"); - - b.Property("Text") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("ShopEntryId"); - - b.ToTable("ShopEntryItem"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("SlowmodeIgnoredRole"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("SlowmodeIgnoredUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StickyRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("RoleIds") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "UserId") - .IsUnique(); - - b.ToTable("StickyRoles"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamOnlineMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("MessageId") - .HasColumnType("INTEGER"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("StreamOnlineMessages"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("StreamRoleSettingsId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("Username") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("StreamRoleSettingsId"); - - b.ToTable("StreamRoleBlacklistedUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AddRoleId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Enabled") - .HasColumnType("INTEGER"); - - b.Property("FromRoleId") - .HasColumnType("INTEGER"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("Keyword") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId") - .IsUnique(); - - b.ToTable("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("StreamRoleSettingsId") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("Username") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("StreamRoleSettingsId"); - - b.ToTable("StreamRoleWhitelistedUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ArchiveId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("IsDone") - .HasColumnType("INTEGER"); - - b.Property("Todo") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ArchiveId"); - - b.HasIndex("UserId"); - - b.ToTable("Todos"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("UnbanAt") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("UnbanTimer"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("UnmuteAt") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("UnmuteTimer"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("UnbanAt") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("UnroleTimer"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UserXpStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AwardedXp") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("NotifyOnLevelUp") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - 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("EllieBot.Db.Models.VcRoleInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("VoiceChannelId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId"); - - b.ToTable("VcRoleInfo"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AffinityId") - .HasColumnType("INTEGER"); - - b.Property("ClaimerId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Price") - .HasColumnType("INTEGER"); - - b.Property("WaifuId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("AffinityId"); - - b.HasIndex("ClaimerId"); - - b.HasIndex("Price"); - - b.HasIndex("WaifuId") - .IsUnique(); - - b.ToTable("WaifuInfo"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("ItemEmoji") - .HasColumnType("TEXT"); - - b.Property("Name") - .HasColumnType("TEXT"); - - b.Property("WaifuInfoId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("WaifuInfoId"); - - b.ToTable("WaifuItem"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("NewId") - .HasColumnType("INTEGER"); - - b.Property("OldId") - .HasColumnType("INTEGER"); - - b.Property("UpdateType") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("NewId"); - - b.HasIndex("OldId"); - - b.HasIndex("UserId"); - - b.ToTable("WaifuUpdates"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Warning", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Forgiven") - .HasColumnType("INTEGER"); - - b.Property("ForgivenBy") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Moderator") - .HasColumnType("TEXT"); - - b.Property("Reason") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("Weight") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(1L); - - b.HasKey("Id"); - - b.HasIndex("DateAdded"); - - b.HasIndex("GuildId"); - - b.HasIndex("UserId"); - - b.ToTable("Warnings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WarningPunishment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Count") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Punishment") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("Time") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasAlternateKey("GuildId", "Count"); - - b.ToTable("WarningPunishment"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Amount") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Level") - .HasColumnType("INTEGER"); - - b.Property("XpSettingsId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("XpSettingsId"); - - b.ToTable("XpCurrencyReward"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("Level") - .HasColumnType("INTEGER"); - - b.Property("Remove") - .HasColumnType("INTEGER"); - - b.Property("RoleId") - .HasColumnType("INTEGER"); - - b.Property("XpSettingsId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("XpSettingsId", "Level") - .IsUnique(); - - b.ToTable("XpRoleReward"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); - - b.Property("ServerExcluded") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildConfigId") - .IsUnique(); - - b.ToTable("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpShopOwnedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("IsUsing") - .HasColumnType("INTEGER"); - - b.Property("ItemKey") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property("ItemType") - .HasColumnType("INTEGER"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemType", "ItemKey") - .IsUnique(); - - b.ToTable("XpShopOwnedItem"); - }); - - modelBuilder.Entity("EllieBot.Services.GreetSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AutoDeleteTimer") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("GreetType") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(false); - - b.Property("MessageText") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "GreetType") - .IsUnique(); - - b.ToTable("GreetSettings"); - }); - - modelBuilder.Entity("EllieBot.Services.Rakeback", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Amount") - .HasColumnType("TEXT"); - - b.HasKey("UserId"); - - b.ToTable("Rakeback"); - }); - - modelBuilder.Entity("EllieBot.Services.UserBetStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Game") - .HasColumnType("INTEGER"); - - b.Property("LoseCount") - .HasColumnType("INTEGER"); - - b.Property("MaxBet") - .HasColumnType("INTEGER"); - - b.Property("MaxWin") - .HasColumnType("INTEGER"); - - b.Property("PaidOut") - .HasColumnType("TEXT"); - - b.Property("TotalBet") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("WinCount") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Game") - .IsUnique(); - - b.ToTable("UserBetStats"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiAltSetting") - .HasForeignKey("EllieBot.Db.Models.AntiAltSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiRaidSetting") - .HasForeignKey("EllieBot.Db.Models.AntiRaidSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.HasOne("EllieBot.Db.Models.AntiSpamSetting", null) - .WithMany("IgnoredChannels") - .HasForeignKey("AntiSpamSettingId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiSpamSetting") - .HasForeignKey("EllieBot.Db.Models.AntiSpamSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.HasOne("EllieBot.Db.Models.AutoTranslateChannel", "Channel") - .WithMany("Users") - .HasForeignKey("ChannelId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Channel"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Applicants") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Club"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Bans") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Club"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Owner") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.ClubInfo", "OwnerId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandAliases") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.CommandCooldown", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandCooldowns") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("DelMsgOnCmdChannels") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Members") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.NoAction); - - b.Navigation("Club"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("ExclusionList") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("FeedSubs") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterInvitesChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterLinksChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterWordsChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilteredWords") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FollowedStreams") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GCChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("GenerateCurrencyChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.HasOne("EllieBot.Db.Models.GiveawayModel", null) - .WithMany("Participants") - .HasForeignKey("GiveawayId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("SelfAssignableRoleGroupNames") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.HasOne("EllieBot.Db.Models.LogSetting", "LogSetting") - .WithMany("LogIgnores") - .HasForeignKey("LogSettingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("LogSetting"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("MutedUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("Permissions") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.HasOne("EllieBot.Db.Models.MusicPlaylist", null) - .WithMany("Songs") - .HasForeignKey("MusicPlaylistId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("ShopEntries") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.HasOne("EllieBot.Db.Models.ShopEntry", null) - .WithMany("Items") - .HasForeignKey("ShopEntryId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredRoles") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Blacklist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("StreamRole") - .HasForeignKey("EllieBot.Db.Models.StreamRoleSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Whitelist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("StreamRoleSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.HasOne("EllieBot.Db.Models.ArchivedTodoListModel", null) - .WithMany("Items") - .HasForeignKey("ArchiveId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnbanTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnmuteTimers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnroleTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.VcRoleInfo", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("VcRoleInfos") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Affinity") - .WithMany() - .HasForeignKey("AffinityId"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Claimer") - .WithMany() - .HasForeignKey("ClaimerId"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Waifu") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.WaifuInfo", "WaifuId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Affinity"); - - b.Navigation("Claimer"); - - b.Navigation("Waifu"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.HasOne("EllieBot.Db.Models.WaifuInfo", "WaifuInfo") - .WithMany("Items") - .HasForeignKey("WaifuInfoId"); - - b.Navigation("WaifuInfo"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "New") - .WithMany() - .HasForeignKey("NewId"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "Old") - .WithMany() - .HasForeignKey("OldId"); - - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("New"); - - b.Navigation("Old"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("CurrencyRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("RoleRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("XpSettings") - .HasForeignKey("EllieBot.Db.Models.XpSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("GuildConfig"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Navigation("IgnoredChannels"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Navigation("Users"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Navigation("Applicants"); - - b.Navigation("Bans"); - - b.Navigation("Members"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Navigation("Participants"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.GuildConfig", b => - { - b.Navigation("AntiAltSetting"); - - b.Navigation("AntiRaidSetting"); - - b.Navigation("AntiSpamSetting"); - - 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("GenerateCurrencyChannelIds"); - - b.Navigation("MutedUsers"); - - b.Navigation("Permissions"); - - b.Navigation("SelfAssignableRoleGroupNames"); - - b.Navigation("ShopEntries"); - - b.Navigation("SlowmodeIgnoredRoles"); - - b.Navigation("SlowmodeIgnoredUsers"); - - b.Navigation("StreamRole"); - - b.Navigation("UnbanTimer"); - - b.Navigation("UnmuteTimers"); - - b.Navigation("UnroleTimer"); - - b.Navigation("VcRoleInfos"); - - b.Navigation("XpSettings"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Navigation("LogIgnores"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Navigation("Songs"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Navigation("Blacklist"); - - b.Navigation("Whitelist"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Navigation("Items"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Navigation("CurrencyRewards"); - - b.Navigation("ExclusionList"); - - b.Navigation("RoleRewards"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/EllieBot/Migrations/Sqlite/20241107051525_rakeback.cs b/src/EllieBot/Migrations/Sqlite/20241107051525_rakeback.cs deleted file mode 100644 index 2d6979f..0000000 --- a/src/EllieBot/Migrations/Sqlite/20241107051525_rakeback.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace EllieBot.Migrations -{ - /// - public partial class rakeback : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Rakeback", - columns: table => new - { - UserId = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Amount = table.Column(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Rakeback", x => x.UserId); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Rakeback"); - } - } -} diff --git a/src/EllieBot/Migrations/Sqlite/EllieSqliteContextModelSnapshot.cs b/src/EllieBot/Migrations/Sqlite/EllieSqliteContextModelSnapshot.cs index 66f5132..0891194 100644 --- a/src/EllieBot/Migrations/Sqlite/EllieSqliteContextModelSnapshot.cs +++ b/src/EllieBot/Migrations/Sqlite/EllieSqliteContextModelSnapshot.cs @@ -1,9 +1,9 @@ // using System; -using EllieBot.Db; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using EllieBot.Db; #nullable disable @@ -18,3004 +18,2904 @@ namespace EllieBot.Migrations modelBuilder.HasAnnotation("ProductVersion", "8.0.8"); modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("Action") - .HasColumnType("INTEGER"); + b.Property("Action") + .HasColumnType("INTEGER"); - b.Property("ActionDurationMinutes") - .HasColumnType("INTEGER"); + b.Property("ActionDurationMinutes") + .HasColumnType("INTEGER"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.Property("MinAge") - .HasColumnType("TEXT"); + b.Property("MinAge") + .HasColumnType("TEXT"); - b.Property("RoleId") - .HasColumnType("INTEGER"); + b.Property("RoleId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId") - .IsUnique(); + b.HasIndex("GuildConfigId") + .IsUnique(); - b.ToTable("AntiAltSetting"); - }); + b.ToTable("AntiAltSetting"); + }); modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("Action") - .HasColumnType("INTEGER"); + b.Property("Action") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.Property("PunishDuration") - .HasColumnType("INTEGER"); + b.Property("PunishDuration") + .HasColumnType("INTEGER"); - b.Property("Seconds") - .HasColumnType("INTEGER"); + b.Property("Seconds") + .HasColumnType("INTEGER"); - b.Property("UserThreshold") - .HasColumnType("INTEGER"); + b.Property("UserThreshold") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId") - .IsUnique(); + b.HasIndex("GuildConfigId") + .IsUnique(); - b.ToTable("AntiRaidSetting"); - }); + b.ToTable("AntiRaidSetting"); + }); modelBuilder.Entity("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("AntiSpamSettingId") - .HasColumnType("INTEGER"); + b.Property("AntiSpamSettingId") + .HasColumnType("INTEGER"); - b.Property("ChannelId") - .HasColumnType("INTEGER"); + b.Property("ChannelId") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("AntiSpamSettingId"); + b.HasIndex("AntiSpamSettingId"); - b.ToTable("AntiSpamIgnore"); - }); + b.ToTable("AntiSpamIgnore"); + }); modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("Action") - .HasColumnType("INTEGER"); + b.Property("Action") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.Property("MessageThreshold") - .HasColumnType("INTEGER"); + b.Property("MessageThreshold") + .HasColumnType("INTEGER"); - b.Property("MuteTime") - .HasColumnType("INTEGER"); + b.Property("MuteTime") + .HasColumnType("INTEGER"); - b.Property("RoleId") - .HasColumnType("INTEGER"); + b.Property("RoleId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId") - .IsUnique(); + b.HasIndex("GuildConfigId") + .IsUnique(); - b.ToTable("AntiSpamSetting"); - }); + b.ToTable("AntiSpamSetting"); + }); modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("Name") - .HasColumnType("TEXT"); + b.Property("Name") + .HasColumnType("TEXT"); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("TodosArchive"); - }); + b.ToTable("TodosArchive"); + }); modelBuilder.Entity("EllieBot.Db.Models.AutoCommand", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("ChannelId") - .HasColumnType("INTEGER"); + b.Property("ChannelId") + .HasColumnType("INTEGER"); - b.Property("ChannelName") - .HasColumnType("TEXT"); + b.Property("ChannelName") + .HasColumnType("TEXT"); - b.Property("CommandText") - .HasColumnType("TEXT"); + b.Property("CommandText") + .HasColumnType("TEXT"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildId") - .HasColumnType("INTEGER"); + b.Property("GuildId") + .HasColumnType("INTEGER"); - b.Property("GuildName") - .HasColumnType("TEXT"); + b.Property("GuildName") + .HasColumnType("TEXT"); - b.Property("Interval") - .HasColumnType("INTEGER"); + b.Property("Interval") + .HasColumnType("INTEGER"); - b.Property("VoiceChannelId") - .HasColumnType("INTEGER"); + b.Property("VoiceChannelId") + .HasColumnType("INTEGER"); - b.Property("VoiceChannelName") - .HasColumnType("TEXT"); + b.Property("VoiceChannelName") + .HasColumnType("TEXT"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("AutoCommands"); - }); + b.ToTable("AutoCommands"); + }); modelBuilder.Entity("EllieBot.Db.Models.AutoPublishChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("ChannelId") - .HasColumnType("INTEGER"); + b.Property("ChannelId") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildId") - .HasColumnType("INTEGER"); + b.Property("GuildId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildId") - .IsUnique(); + b.HasIndex("GuildId") + .IsUnique(); - b.ToTable("AutoPublishChannel"); - }); + b.ToTable("AutoPublishChannel"); + }); modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("AutoDelete") - .HasColumnType("INTEGER"); + b.Property("AutoDelete") + .HasColumnType("INTEGER"); - b.Property("ChannelId") - .HasColumnType("INTEGER"); + b.Property("ChannelId") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildId") - .HasColumnType("INTEGER"); + b.Property("GuildId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("ChannelId") - .IsUnique(); + b.HasIndex("ChannelId") + .IsUnique(); - b.HasIndex("GuildId"); + b.HasIndex("GuildId"); - b.ToTable("AutoTranslateChannels"); - }); + b.ToTable("AutoTranslateChannels"); + }); modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("ChannelId") - .HasColumnType("INTEGER"); + b.Property("ChannelId") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("Source") - .HasColumnType("TEXT"); + b.Property("Source") + .HasColumnType("TEXT"); - b.Property("Target") - .HasColumnType("TEXT"); + b.Property("Target") + .HasColumnType("TEXT"); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasAlternateKey("ChannelId", "UserId"); + b.HasAlternateKey("ChannelId", "UserId"); - b.ToTable("AutoTranslateUsers"); - }); + b.ToTable("AutoTranslateUsers"); + }); modelBuilder.Entity("EllieBot.Db.Models.BanTemplate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildId") - .HasColumnType("INTEGER"); + b.Property("GuildId") + .HasColumnType("INTEGER"); - b.Property("PruneDays") - .HasColumnType("INTEGER"); + b.Property("PruneDays") + .HasColumnType("INTEGER"); - b.Property("Text") - .HasColumnType("TEXT"); + b.Property("Text") + .HasColumnType("TEXT"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildId") - .IsUnique(); + b.HasIndex("GuildId") + .IsUnique(); - b.ToTable("BanTemplates"); - }); + b.ToTable("BanTemplates"); + }); modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("Balance") - .HasColumnType("INTEGER"); + b.Property("Balance") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("UserId") - .IsUnique(); + b.HasIndex("UserId") + .IsUnique(); - b.ToTable("BankUsers"); - }); + b.ToTable("BankUsers"); + }); modelBuilder.Entity("EllieBot.Db.Models.BlacklistEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("ItemId") - .HasColumnType("INTEGER"); + b.Property("ItemId") + .HasColumnType("INTEGER"); - b.Property("Type") - .HasColumnType("INTEGER"); + b.Property("Type") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("Blacklist"); - }); + b.ToTable("Blacklist"); + }); modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.Property("ClubId") - .HasColumnType("INTEGER"); + { + b.Property("ClubId") + .HasColumnType("INTEGER"); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.HasKey("ClubId", "UserId"); + b.HasKey("ClubId", "UserId"); - b.HasIndex("UserId"); + b.HasIndex("UserId"); - b.ToTable("ClubApplicants"); - }); + b.ToTable("ClubApplicants"); + }); modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.Property("ClubId") - .HasColumnType("INTEGER"); + { + b.Property("ClubId") + .HasColumnType("INTEGER"); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.HasKey("ClubId", "UserId"); + b.HasKey("ClubId", "UserId"); - b.HasIndex("UserId"); + b.HasIndex("UserId"); - b.ToTable("ClubBans"); - }); + b.ToTable("ClubBans"); + }); modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("Description") - .HasColumnType("TEXT"); + b.Property("Description") + .HasColumnType("TEXT"); - b.Property("ImageUrl") - .HasColumnType("TEXT"); + b.Property("ImageUrl") + .HasColumnType("TEXT"); - b.Property("Name") - .HasMaxLength(20) - .HasColumnType("TEXT"); + b.Property("Name") + .HasMaxLength(20) + .HasColumnType("TEXT"); - b.Property("OwnerId") - .HasColumnType("INTEGER"); + b.Property("OwnerId") + .HasColumnType("INTEGER"); - b.Property("Xp") - .HasColumnType("INTEGER"); + b.Property("Xp") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("Name") - .IsUnique(); + b.HasIndex("Name") + .IsUnique(); - b.HasIndex("OwnerId") - .IsUnique(); + b.HasIndex("OwnerId") + .IsUnique(); - b.ToTable("Clubs"); - }); + b.ToTable("Clubs"); + }); modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.Property("Mapping") - .HasColumnType("TEXT"); + b.Property("Mapping") + .HasColumnType("TEXT"); - b.Property("Trigger") - .HasColumnType("TEXT"); + b.Property("Trigger") + .HasColumnType("TEXT"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId"); + b.HasIndex("GuildConfigId"); - b.ToTable("CommandAlias"); - }); + b.ToTable("CommandAlias"); + }); modelBuilder.Entity("EllieBot.Db.Models.CommandCooldown", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("CommandName") - .HasColumnType("TEXT"); + b.Property("CommandName") + .HasColumnType("TEXT"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.Property("Seconds") - .HasColumnType("INTEGER"); + b.Property("Seconds") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId"); + b.HasIndex("GuildConfigId"); - b.ToTable("CommandCooldown"); - }); + b.ToTable("CommandCooldown"); + }); modelBuilder.Entity("EllieBot.Db.Models.CurrencyTransaction", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("Amount") - .HasColumnType("INTEGER"); + b.Property("Amount") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("Extra") - .IsRequired() - .HasColumnType("TEXT"); + b.Property("Extra") + .IsRequired() + .HasColumnType("TEXT"); - b.Property("Note") - .HasColumnType("TEXT"); + b.Property("Note") + .HasColumnType("TEXT"); - b.Property("OtherId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValueSql("NULL"); + b.Property("OtherId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValueSql("NULL"); - b.Property("Type") - .IsRequired() - .HasColumnType("TEXT"); + b.Property("Type") + .IsRequired() + .HasColumnType("TEXT"); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("UserId"); + b.HasIndex("UserId"); - b.ToTable("CurrencyTransactions"); - }); + b.ToTable("CurrencyTransactions"); + }); modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("ChannelId") - .HasColumnType("INTEGER"); + b.Property("ChannelId") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.Property("State") - .HasColumnType("INTEGER"); + b.Property("State") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId"); + b.HasIndex("GuildConfigId"); - b.ToTable("DelMsgOnCmdChannel"); - }); + b.ToTable("DelMsgOnCmdChannel"); + }); modelBuilder.Entity("EllieBot.Db.Models.DiscordPermOverride", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("Command") - .HasColumnType("TEXT"); + b.Property("Command") + .HasColumnType("TEXT"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildId") - .HasColumnType("INTEGER"); + b.Property("GuildId") + .HasColumnType("INTEGER"); - b.Property("Perm") - .HasColumnType("INTEGER"); + b.Property("Perm") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildId", "Command") - .IsUnique(); + b.HasIndex("GuildId", "Command") + .IsUnique(); - b.ToTable("DiscordPermOverrides"); - }); + b.ToTable("DiscordPermOverrides"); + }); modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("AvatarId") - .HasColumnType("TEXT"); + b.Property("AvatarId") + .HasColumnType("TEXT"); - b.Property("ClubId") - .HasColumnType("INTEGER"); + b.Property("ClubId") + .HasColumnType("INTEGER"); - b.Property("CurrencyAmount") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0L); + b.Property("CurrencyAmount") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(0L); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("IsClubAdmin") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(false); + b.Property("Discriminator") + .HasColumnType("TEXT"); - b.Property("NotifyOnLevelUp") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0); + b.Property("IsClubAdmin") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(false); - b.Property("TotalXp") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0L); + b.Property("NotifyOnLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(0); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("TotalXp") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(0L); - b.Property("Username") - .HasColumnType("TEXT"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.Property("Username") + .HasColumnType("TEXT"); - b.HasAlternateKey("UserId"); + b.HasKey("Id"); - b.HasIndex("ClubId"); + b.HasAlternateKey("UserId"); - b.HasIndex("CurrencyAmount"); + b.HasIndex("ClubId"); - b.HasIndex("TotalXp"); + b.HasIndex("CurrencyAmount"); - b.HasIndex("UserId"); + b.HasIndex("TotalXp"); - b.HasIndex("Username"); + b.HasIndex("UserId"); - b.ToTable("DiscordUser"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("AllowTarget") - .HasColumnType("INTEGER"); - - b.Property("AutoDeleteTrigger") - .HasColumnType("INTEGER"); - - b.Property("ContainsAnywhere") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("DmResponse") - .HasColumnType("INTEGER"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.Property("Reactions") - .HasColumnType("TEXT"); - - b.Property("Response") - .HasColumnType("TEXT"); - - b.Property("Trigger") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Expressions"); - }); + b.ToTable("DiscordUser"); + }); modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("ItemId") - .HasColumnType("INTEGER"); + b.Property("ItemId") + .HasColumnType("INTEGER"); - b.Property("ItemType") - .HasColumnType("INTEGER"); + b.Property("ItemType") + .HasColumnType("INTEGER"); - b.Property("XpSettingsId") - .HasColumnType("INTEGER"); + b.Property("XpSettingsId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("XpSettingsId"); + b.HasIndex("XpSettingsId"); - b.ToTable("ExcludedItem"); - }); + b.ToTable("ExcludedItem"); + }); modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("ChannelId") - .HasColumnType("INTEGER"); + b.Property("ChannelId") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.Property("Message") - .HasColumnType("TEXT"); + b.Property("Message") + .HasColumnType("TEXT"); - b.Property("Url") - .IsRequired() - .HasColumnType("TEXT"); + b.Property("Url") + .IsRequired() + .HasColumnType("TEXT"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasAlternateKey("GuildConfigId", "Url"); + b.HasAlternateKey("GuildConfigId", "Url"); - b.ToTable("FeedSub"); - }); + b.ToTable("FeedSub"); + }); modelBuilder.Entity("EllieBot.Db.Models.FilterChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("ChannelId") - .HasColumnType("INTEGER"); + b.Property("ChannelId") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId"); + b.HasIndex("GuildConfigId"); - b.ToTable("FilterChannelId"); - }); + b.ToTable("FilterChannelId"); + }); modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("ChannelId") - .HasColumnType("INTEGER"); + b.Property("ChannelId") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId"); + b.HasIndex("GuildConfigId"); - b.ToTable("FilterLinksChannelId"); - }); + b.ToTable("FilterLinksChannelId"); + }); modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("ChannelId") - .HasColumnType("INTEGER"); + b.Property("ChannelId") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId"); + b.HasIndex("GuildConfigId"); - b.ToTable("FilterWordsChannelId"); - }); + b.ToTable("FilterWordsChannelId"); + }); modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.Property("Word") - .HasColumnType("TEXT"); + b.Property("Word") + .HasColumnType("TEXT"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId"); + b.HasIndex("GuildConfigId"); - b.ToTable("FilteredWord"); - }); - - modelBuilder.Entity("EllieBot.Db.Models.FlagTranslateChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("ChannelId") - .HasColumnType("INTEGER"); - - b.Property("DateAdded") - .HasColumnType("TEXT"); - - b.Property("GuildId") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("GuildId", "ChannelId") - .IsUnique(); - - b.ToTable("FlagTranslateChannel"); - }); + b.ToTable("FilteredWord"); + }); modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("ChannelId") - .HasColumnType("INTEGER"); + b.Property("ChannelId") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.Property("GuildId") - .HasColumnType("INTEGER"); + b.Property("GuildId") + .HasColumnType("INTEGER"); - b.Property("Message") - .HasColumnType("TEXT"); + b.Property("Message") + .HasColumnType("TEXT"); - b.Property("Type") - .HasColumnType("INTEGER"); + b.Property("Type") + .HasColumnType("INTEGER"); - b.Property("Username") - .HasColumnType("TEXT"); + b.Property("Username") + .HasColumnType("TEXT"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId"); + b.HasIndex("GuildConfigId"); - b.ToTable("FollowedStream"); - }); + b.ToTable("FollowedStream"); + }); modelBuilder.Entity("EllieBot.Db.Models.GCChannelId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("ChannelId") - .HasColumnType("INTEGER"); + b.Property("ChannelId") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId"); + b.HasIndex("GuildConfigId"); - b.ToTable("GCChannelId"); - }); + b.ToTable("GCChannelId"); + }); modelBuilder.Entity("EllieBot.Db.Models.GamblingStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("Bet") - .HasColumnType("TEXT"); + b.Property("Bet") + .HasColumnType("TEXT"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("Feature") - .HasColumnType("TEXT"); + b.Property("Feature") + .HasColumnType("TEXT"); - b.Property("PaidOut") - .HasColumnType("TEXT"); + b.Property("PaidOut") + .HasColumnType("TEXT"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("Feature") - .IsUnique(); + b.HasIndex("Feature") + .IsUnique(); - b.ToTable("GamblingStats"); - }); + b.ToTable("GamblingStats"); + }); modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("ChannelId") - .HasColumnType("INTEGER"); + b.Property("ChannelId") + .HasColumnType("INTEGER"); - b.Property("EndsAt") - .HasColumnType("TEXT"); + b.Property("EndsAt") + .HasColumnType("TEXT"); - b.Property("GuildId") - .HasColumnType("INTEGER"); + b.Property("GuildId") + .HasColumnType("INTEGER"); - b.Property("Message") - .HasColumnType("TEXT"); + b.Property("Message") + .HasColumnType("TEXT"); - b.Property("MessageId") - .HasColumnType("INTEGER"); + b.Property("MessageId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("GiveawayModel"); - }); + b.ToTable("GiveawayModel"); + }); modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("GiveawayId") - .HasColumnType("INTEGER"); + b.Property("GiveawayId") + .HasColumnType("INTEGER"); - b.Property("Name") - .HasColumnType("TEXT"); + b.Property("Name") + .HasColumnType("TEXT"); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GiveawayId", "UserId") - .IsUnique(); + b.HasIndex("GiveawayId", "UserId") + .IsUnique(); - b.ToTable("GiveawayUser"); - }); + b.ToTable("GiveawayUser"); + }); modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.Property("Name") - .HasColumnType("TEXT"); + b.Property("Name") + .HasColumnType("TEXT"); - b.Property("Number") - .HasColumnType("INTEGER"); + b.Property("Number") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId", "Number") - .IsUnique(); + b.HasIndex("GuildConfigId", "Number") + .IsUnique(); - b.ToTable("GroupName"); - }); + b.ToTable("GroupName"); + }); modelBuilder.Entity("EllieBot.Db.Models.GuildConfig", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("AutoAssignRoleIds") - .HasColumnType("TEXT"); + b.Property("AutoAssignRoleIds") + .HasColumnType("TEXT"); - b.Property("AutoDeleteSelfAssignedRoleMessages") - .HasColumnType("INTEGER"); + b.Property("AutoDeleteSelfAssignedRoleMessages") + .HasColumnType("INTEGER"); - b.Property("CleverbotEnabled") - .HasColumnType("INTEGER"); + b.Property("CleverbotEnabled") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("DeleteMessageOnCommand") - .HasColumnType("INTEGER"); + b.Property("DeleteMessageOnCommand") + .HasColumnType("INTEGER"); - b.Property("DeleteStreamOnlineMessage") - .HasColumnType("INTEGER"); + b.Property("DeleteStreamOnlineMessage") + .HasColumnType("INTEGER"); - b.Property("DisableGlobalExpressions") - .HasColumnType("INTEGER"); + b.Property("DisableGlobalExpressions") + .HasColumnType("INTEGER"); - b.Property("ExclusiveSelfAssignedRoles") - .HasColumnType("INTEGER"); + b.Property("ExclusiveSelfAssignedRoles") + .HasColumnType("INTEGER"); - b.Property("FilterInvites") - .HasColumnType("INTEGER"); + b.Property("FilterInvites") + .HasColumnType("INTEGER"); - b.Property("FilterLinks") - .HasColumnType("INTEGER"); + b.Property("FilterLinks") + .HasColumnType("INTEGER"); - b.Property("FilterWords") - .HasColumnType("INTEGER"); + b.Property("FilterWords") + .HasColumnType("INTEGER"); - b.Property("GameVoiceChannel") - .HasColumnType("INTEGER"); + b.Property("GameVoiceChannel") + .HasColumnType("INTEGER"); - b.Property("GuildId") - .HasColumnType("INTEGER"); + b.Property("GuildId") + .HasColumnType("INTEGER"); - b.Property("Locale") - .HasColumnType("TEXT"); + b.Property("Locale") + .HasColumnType("TEXT"); - b.Property("MuteRoleName") - .HasColumnType("TEXT"); + b.Property("MuteRoleName") + .HasColumnType("TEXT"); - b.Property("NotifyStreamOffline") - .HasColumnType("INTEGER"); + b.Property("NotifyStreamOffline") + .HasColumnType("INTEGER"); - b.Property("PermissionRole") - .HasColumnType("TEXT"); + b.Property("PermissionRole") + .HasColumnType("TEXT"); - b.Property("Prefix") - .HasColumnType("TEXT"); + b.Property("Prefix") + .HasColumnType("TEXT"); - b.Property("StickyRoles") - .HasColumnType("INTEGER"); + b.Property("StickyRoles") + .HasColumnType("INTEGER"); - b.Property("TimeZoneId") - .HasColumnType("TEXT"); + b.Property("TimeZoneId") + .HasColumnType("TEXT"); - b.Property("VerboseErrors") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(true); + b.Property("VerboseErrors") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(true); - b.Property("VerbosePermissions") - .HasColumnType("INTEGER"); + b.Property("VerbosePermissions") + .HasColumnType("INTEGER"); - b.Property("WarnExpireAction") - .HasColumnType("INTEGER"); + b.Property("WarnExpireAction") + .HasColumnType("INTEGER"); - b.Property("WarnExpireHours") - .HasColumnType("INTEGER"); + b.Property("WarnExpireHours") + .HasColumnType("INTEGER"); - b.Property("WarningsInitialized") - .HasColumnType("INTEGER"); + b.Property("WarningsInitialized") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildId") - .IsUnique(); + b.HasIndex("GuildId") + .IsUnique(); - b.HasIndex("WarnExpireHours"); + b.HasIndex("WarnExpireHours"); - b.ToTable("GuildConfigs"); - }); + b.ToTable("GuildConfigs"); + }); modelBuilder.Entity("EllieBot.Db.Models.HoneypotChannel", b => - { - b.Property("GuildId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("GuildId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("ChannelId") - .HasColumnType("INTEGER"); + b.Property("ChannelId") + .HasColumnType("INTEGER"); - b.HasKey("GuildId"); + b.HasKey("GuildId"); - b.ToTable("HoneyPotChannels"); - }); + b.ToTable("HoneyPotChannels"); + }); modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("ItemType") - .HasColumnType("INTEGER"); + b.Property("ItemType") + .HasColumnType("INTEGER"); - b.Property("LogItemId") - .HasColumnType("INTEGER"); + b.Property("LogItemId") + .HasColumnType("INTEGER"); - b.Property("LogSettingId") - .HasColumnType("INTEGER"); + b.Property("LogSettingId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("LogSettingId", "LogItemId", "ItemType") - .IsUnique(); + b.HasIndex("LogSettingId", "LogItemId", "ItemType") + .IsUnique(); - b.ToTable("IgnoredLogChannels"); - }); + b.ToTable("IgnoredLogChannels"); + }); modelBuilder.Entity("EllieBot.Db.Models.ImageOnlyChannel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("ChannelId") - .HasColumnType("INTEGER"); + b.Property("ChannelId") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildId") - .HasColumnType("INTEGER"); + b.Property("GuildId") + .HasColumnType("INTEGER"); - b.Property("Type") - .HasColumnType("INTEGER"); + b.Property("Type") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("ChannelId") - .IsUnique(); + b.HasIndex("ChannelId") + .IsUnique(); - b.ToTable("ImageOnlyChannels"); - }); + b.ToTable("ImageOnlyChannels"); + }); modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("ChannelCreatedId") - .HasColumnType("INTEGER"); + b.Property("ChannelCreatedId") + .HasColumnType("INTEGER"); - b.Property("ChannelDestroyedId") - .HasColumnType("INTEGER"); + b.Property("ChannelDestroyedId") + .HasColumnType("INTEGER"); - b.Property("ChannelUpdatedId") - .HasColumnType("INTEGER"); + b.Property("ChannelUpdatedId") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildId") - .HasColumnType("INTEGER"); + b.Property("GuildId") + .HasColumnType("INTEGER"); - b.Property("LogOtherId") - .HasColumnType("INTEGER"); + b.Property("LogOtherId") + .HasColumnType("INTEGER"); - b.Property("LogUserPresenceId") - .HasColumnType("INTEGER"); + b.Property("LogUserPresenceId") + .HasColumnType("INTEGER"); - b.Property("LogVoicePresenceId") - .HasColumnType("INTEGER"); + b.Property("LogVoicePresenceId") + .HasColumnType("INTEGER"); - b.Property("LogVoicePresenceTTSId") - .HasColumnType("INTEGER"); + b.Property("LogVoicePresenceTTSId") + .HasColumnType("INTEGER"); - b.Property("LogWarnsId") - .HasColumnType("INTEGER"); + b.Property("LogWarnsId") + .HasColumnType("INTEGER"); - b.Property("MessageDeletedId") - .HasColumnType("INTEGER"); + b.Property("MessageDeletedId") + .HasColumnType("INTEGER"); - b.Property("MessageUpdatedId") - .HasColumnType("INTEGER"); + b.Property("MessageUpdatedId") + .HasColumnType("INTEGER"); - b.Property("ThreadCreatedId") - .HasColumnType("INTEGER"); + b.Property("ThreadCreatedId") + .HasColumnType("INTEGER"); - b.Property("ThreadDeletedId") - .HasColumnType("INTEGER"); + b.Property("ThreadDeletedId") + .HasColumnType("INTEGER"); - b.Property("UserBannedId") - .HasColumnType("INTEGER"); + b.Property("UserBannedId") + .HasColumnType("INTEGER"); - b.Property("UserJoinedId") - .HasColumnType("INTEGER"); + b.Property("UserJoinedId") + .HasColumnType("INTEGER"); - b.Property("UserLeftId") - .HasColumnType("INTEGER"); + b.Property("UserLeftId") + .HasColumnType("INTEGER"); - b.Property("UserMutedId") - .HasColumnType("INTEGER"); + b.Property("UserMutedId") + .HasColumnType("INTEGER"); - b.Property("UserUnbannedId") - .HasColumnType("INTEGER"); + b.Property("UserUnbannedId") + .HasColumnType("INTEGER"); - b.Property("UserUpdatedId") - .HasColumnType("INTEGER"); + b.Property("UserUpdatedId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildId") - .IsUnique(); + b.HasIndex("GuildId") + .IsUnique(); - b.ToTable("LogSettings"); - }); + b.ToTable("LogSettings"); + }); modelBuilder.Entity("EllieBot.Db.Models.MusicPlayerSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("AutoDisconnect") - .HasColumnType("INTEGER"); + b.Property("AutoDisconnect") + .HasColumnType("INTEGER"); - b.Property("AutoPlay") - .HasColumnType("INTEGER"); + b.Property("AutoPlay") + .HasColumnType("INTEGER"); - b.Property("GuildId") - .HasColumnType("INTEGER"); + b.Property("GuildId") + .HasColumnType("INTEGER"); - b.Property("MusicChannelId") - .HasColumnType("INTEGER"); + b.Property("MusicChannelId") + .HasColumnType("INTEGER"); - b.Property("PlayerRepeat") - .HasColumnType("INTEGER"); + b.Property("PlayerRepeat") + .HasColumnType("INTEGER"); - b.Property("QualityPreset") - .HasColumnType("INTEGER"); + b.Property("QualityPreset") + .HasColumnType("INTEGER"); - b.Property("Volume") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(100); + b.Property("Volume") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(100); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildId") - .IsUnique(); + b.HasIndex("GuildId") + .IsUnique(); - b.ToTable("MusicPlayerSettings"); - }); + b.ToTable("MusicPlayerSettings"); + }); modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("Author") - .HasColumnType("TEXT"); + b.Property("Author") + .HasColumnType("TEXT"); - b.Property("AuthorId") - .HasColumnType("INTEGER"); + b.Property("AuthorId") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("Name") - .HasColumnType("TEXT"); + b.Property("Name") + .HasColumnType("TEXT"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("MusicPlaylists"); - }); + b.ToTable("MusicPlaylists"); + }); modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId"); + b.HasIndex("GuildConfigId"); - b.ToTable("MutedUserId"); - }); + b.ToTable("MutedUserId"); + }); - modelBuilder.Entity("EllieBot.Db.Models.NCPixel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("Color") - .HasColumnType("INTEGER"); + b.Property("AllowTarget") + .HasColumnType("INTEGER"); - b.Property("OwnerId") - .HasColumnType("INTEGER"); + b.Property("AutoDeleteTrigger") + .HasColumnType("INTEGER"); - b.Property("Position") - .HasColumnType("INTEGER"); + b.Property("ContainsAnywhere") + .HasColumnType("INTEGER"); - b.Property("Price") - .HasColumnType("INTEGER"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("Text") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); + b.Property("DmResponse") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.Property("GuildId") + .HasColumnType("INTEGER"); - b.HasAlternateKey("Position"); + b.Property("Reactions") + .HasColumnType("TEXT"); - b.HasIndex("OwnerId"); + b.Property("Response") + .HasColumnType("TEXT"); - b.ToTable("NCPixel"); - }); + b.Property("Trigger") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Expressions"); + }); modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("UserId") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("AmountCents") - .HasColumnType("INTEGER"); + b.Property("AmountCents") + .HasColumnType("INTEGER"); - b.Property("LastCharge") - .HasColumnType("TEXT"); + b.Property("LastCharge") + .HasColumnType("TEXT"); - b.Property("UniquePlatformUserId") - .HasColumnType("TEXT"); + b.Property("UniquePlatformUserId") + .HasColumnType("TEXT"); - b.Property("ValidThru") - .HasColumnType("TEXT"); + b.Property("ValidThru") + .HasColumnType("TEXT"); - b.HasKey("UserId"); + b.HasKey("UserId"); - b.HasIndex("UniquePlatformUserId") - .IsUnique(); + b.HasIndex("UniquePlatformUserId") + .IsUnique(); - b.ToTable("Patrons"); - }); + b.ToTable("Patrons"); + }); modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.Property("Index") - .HasColumnType("INTEGER"); + b.Property("Index") + .HasColumnType("INTEGER"); - b.Property("IsCustomCommand") - .HasColumnType("INTEGER"); + b.Property("IsCustomCommand") + .HasColumnType("INTEGER"); - b.Property("PrimaryTarget") - .HasColumnType("INTEGER"); + b.Property("PrimaryTarget") + .HasColumnType("INTEGER"); - b.Property("PrimaryTargetId") - .HasColumnType("INTEGER"); + b.Property("PrimaryTargetId") + .HasColumnType("INTEGER"); - b.Property("SecondaryTarget") - .HasColumnType("INTEGER"); + b.Property("SecondaryTarget") + .HasColumnType("INTEGER"); - b.Property("SecondaryTargetName") - .HasColumnType("TEXT"); + b.Property("SecondaryTargetName") + .HasColumnType("TEXT"); - b.Property("State") - .HasColumnType("INTEGER"); + b.Property("State") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId"); + b.HasIndex("GuildConfigId"); - b.ToTable("Permissions"); - }); + b.ToTable("Permissions"); + }); modelBuilder.Entity("EllieBot.Db.Models.PlantedCurrency", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("Amount") - .HasColumnType("INTEGER"); + b.Property("Amount") + .HasColumnType("INTEGER"); - b.Property("ChannelId") - .HasColumnType("INTEGER"); + b.Property("ChannelId") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildId") - .HasColumnType("INTEGER"); + b.Property("GuildId") + .HasColumnType("INTEGER"); - b.Property("MessageId") - .HasColumnType("INTEGER"); + b.Property("MessageId") + .HasColumnType("INTEGER"); - b.Property("Password") - .HasColumnType("TEXT"); + b.Property("Password") + .HasColumnType("TEXT"); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("ChannelId"); + b.HasIndex("ChannelId"); - b.HasIndex("MessageId") - .IsUnique(); + b.HasIndex("MessageId") + .IsUnique(); - b.ToTable("PlantedCurrency"); - }); + b.ToTable("PlantedCurrency"); + }); modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("MusicPlaylistId") - .HasColumnType("INTEGER"); + b.Property("MusicPlaylistId") + .HasColumnType("INTEGER"); - b.Property("Provider") - .HasColumnType("TEXT"); + b.Property("Provider") + .HasColumnType("TEXT"); - b.Property("ProviderType") - .HasColumnType("INTEGER"); + b.Property("ProviderType") + .HasColumnType("INTEGER"); - b.Property("Query") - .HasColumnType("TEXT"); + b.Property("Query") + .HasColumnType("TEXT"); - b.Property("Title") - .HasColumnType("TEXT"); + b.Property("Title") + .HasColumnType("TEXT"); - b.Property("Uri") - .HasColumnType("TEXT"); + b.Property("Uri") + .HasColumnType("TEXT"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("MusicPlaylistId"); + b.HasIndex("MusicPlaylistId"); - b.ToTable("PlaylistSong"); - }); + b.ToTable("PlaylistSong"); + }); modelBuilder.Entity("EllieBot.Db.Models.Quote", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("AuthorId") - .HasColumnType("INTEGER"); + b.Property("AuthorId") + .HasColumnType("INTEGER"); - b.Property("AuthorName") - .IsRequired() - .HasColumnType("TEXT"); + b.Property("AuthorName") + .IsRequired() + .HasColumnType("TEXT"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildId") - .HasColumnType("INTEGER"); + b.Property("GuildId") + .HasColumnType("INTEGER"); - b.Property("Keyword") - .IsRequired() - .HasColumnType("TEXT"); + b.Property("Keyword") + .IsRequired() + .HasColumnType("TEXT"); - b.Property("Text") - .IsRequired() - .HasColumnType("TEXT"); + b.Property("Text") + .IsRequired() + .HasColumnType("TEXT"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildId"); + b.HasIndex("GuildId"); - b.HasIndex("Keyword"); + b.HasIndex("Keyword"); - b.ToTable("Quotes"); - }); + b.ToTable("Quotes"); + }); modelBuilder.Entity("EllieBot.Db.Models.ReactionRoleV2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("ChannelId") - .HasColumnType("INTEGER"); + b.Property("ChannelId") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("Emote") - .HasMaxLength(100) - .HasColumnType("TEXT"); + b.Property("Emote") + .HasMaxLength(100) + .HasColumnType("TEXT"); - b.Property("Group") - .HasColumnType("INTEGER"); + b.Property("Group") + .HasColumnType("INTEGER"); - b.Property("GuildId") - .HasColumnType("INTEGER"); + b.Property("GuildId") + .HasColumnType("INTEGER"); - b.Property("LevelReq") - .HasColumnType("INTEGER"); + b.Property("LevelReq") + .HasColumnType("INTEGER"); - b.Property("MessageId") - .HasColumnType("INTEGER"); + b.Property("MessageId") + .HasColumnType("INTEGER"); - b.Property("RoleId") - .HasColumnType("INTEGER"); + b.Property("RoleId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildId"); + b.HasIndex("GuildId"); - b.HasIndex("MessageId", "Emote") - .IsUnique(); + b.HasIndex("MessageId", "Emote") + .IsUnique(); - b.ToTable("ReactionRoles"); - }); + b.ToTable("ReactionRoles"); + }); modelBuilder.Entity("EllieBot.Db.Models.Reminder", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("ChannelId") - .HasColumnType("INTEGER"); + b.Property("ChannelId") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("IsPrivate") - .HasColumnType("INTEGER"); + b.Property("IsPrivate") + .HasColumnType("INTEGER"); - b.Property("Message") - .HasColumnType("TEXT"); + b.Property("Message") + .HasColumnType("TEXT"); - b.Property("ServerId") - .HasColumnType("INTEGER"); + b.Property("ServerId") + .HasColumnType("INTEGER"); - b.Property("Type") - .HasColumnType("INTEGER"); + b.Property("Type") + .HasColumnType("INTEGER"); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.Property("When") - .HasColumnType("TEXT"); + b.Property("When") + .HasColumnType("TEXT"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("When"); + b.HasIndex("When"); - b.ToTable("Reminders"); - }); + b.ToTable("Reminders"); + }); modelBuilder.Entity("EllieBot.Db.Models.Repeater", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("ChannelId") - .HasColumnType("INTEGER"); + b.Property("ChannelId") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildId") - .HasColumnType("INTEGER"); + b.Property("GuildId") + .HasColumnType("INTEGER"); - b.Property("Interval") - .HasColumnType("TEXT"); + b.Property("Interval") + .HasColumnType("TEXT"); - b.Property("LastMessageId") - .HasColumnType("INTEGER"); + b.Property("LastMessageId") + .HasColumnType("INTEGER"); - b.Property("Message") - .HasColumnType("TEXT"); + b.Property("Message") + .HasColumnType("TEXT"); - b.Property("NoRedundant") - .HasColumnType("INTEGER"); + b.Property("NoRedundant") + .HasColumnType("INTEGER"); - b.Property("StartTimeOfDay") - .HasColumnType("TEXT"); + b.Property("StartTimeOfDay") + .HasColumnType("TEXT"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("Repeaters"); - }); + b.ToTable("Repeaters"); + }); modelBuilder.Entity("EllieBot.Db.Models.RewardedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("AmountRewardedThisMonth") - .HasColumnType("INTEGER"); + b.Property("AmountRewardedThisMonth") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("LastReward") - .HasColumnType("TEXT"); + b.Property("LastReward") + .HasColumnType("TEXT"); - b.Property("PlatformUserId") - .HasColumnType("TEXT"); + b.Property("PlatformUserId") + .HasColumnType("TEXT"); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("PlatformUserId") - .IsUnique(); + b.HasIndex("PlatformUserId") + .IsUnique(); - b.ToTable("RewardedUsers"); - }); + b.ToTable("RewardedUsers"); + }); modelBuilder.Entity("EllieBot.Db.Models.RotatingPlayingStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("Status") - .HasColumnType("TEXT"); + b.Property("Status") + .HasColumnType("TEXT"); - b.Property("Type") - .HasColumnType("INTEGER"); + b.Property("Type") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("RotatingStatus"); - }); + b.ToTable("RotatingStatus"); + }); modelBuilder.Entity("EllieBot.Db.Models.SelfAssignedRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("Group") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0); + b.Property("Group") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(0); - b.Property("GuildId") - .HasColumnType("INTEGER"); + b.Property("GuildId") + .HasColumnType("INTEGER"); - b.Property("LevelRequirement") - .HasColumnType("INTEGER"); + b.Property("LevelRequirement") + .HasColumnType("INTEGER"); - b.Property("RoleId") - .HasColumnType("INTEGER"); + b.Property("RoleId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildId", "RoleId") - .IsUnique(); + b.HasIndex("GuildId", "RoleId") + .IsUnique(); - b.ToTable("SelfAssignableRoles"); - }); + b.ToTable("SelfAssignableRoles"); + }); modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("AuthorId") - .HasColumnType("INTEGER"); + b.Property("AuthorId") + .HasColumnType("INTEGER"); - b.Property("Command") - .HasColumnType("TEXT"); + b.Property("Command") + .HasColumnType("TEXT"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.Property("Index") - .HasColumnType("INTEGER"); + b.Property("Index") + .HasColumnType("INTEGER"); - b.Property("Name") - .HasColumnType("TEXT"); + b.Property("Name") + .HasColumnType("TEXT"); - b.Property("Price") - .HasColumnType("INTEGER"); + b.Property("Price") + .HasColumnType("INTEGER"); - b.Property("RoleId") - .HasColumnType("INTEGER"); + b.Property("RoleId") + .HasColumnType("INTEGER"); - b.Property("RoleName") - .HasColumnType("TEXT"); + b.Property("RoleName") + .HasColumnType("TEXT"); - b.Property("RoleRequirement") - .HasColumnType("INTEGER"); + b.Property("RoleRequirement") + .HasColumnType("INTEGER"); - b.Property("Type") - .HasColumnType("INTEGER"); + b.Property("Type") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId"); + b.HasIndex("GuildConfigId"); - b.ToTable("ShopEntry"); - }); + b.ToTable("ShopEntry"); + }); modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("ShopEntryId") - .HasColumnType("INTEGER"); + b.Property("ShopEntryId") + .HasColumnType("INTEGER"); - b.Property("Text") - .HasColumnType("TEXT"); + b.Property("Text") + .HasColumnType("TEXT"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("ShopEntryId"); + b.HasIndex("ShopEntryId"); - b.ToTable("ShopEntryItem"); - }); + b.ToTable("ShopEntryItem"); + }); modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.Property("RoleId") - .HasColumnType("INTEGER"); + b.Property("RoleId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId"); + b.HasIndex("GuildConfigId"); - b.ToTable("SlowmodeIgnoredRole"); - }); + b.ToTable("SlowmodeIgnoredRole"); + }); modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId"); + b.HasIndex("GuildConfigId"); - b.ToTable("SlowmodeIgnoredUser"); - }); + b.ToTable("SlowmodeIgnoredUser"); + }); modelBuilder.Entity("EllieBot.Db.Models.StickyRole", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildId") - .HasColumnType("INTEGER"); + b.Property("GuildId") + .HasColumnType("INTEGER"); - b.Property("RoleIds") - .HasColumnType("TEXT"); + b.Property("RoleIds") + .HasColumnType("TEXT"); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildId", "UserId") - .IsUnique(); + b.HasIndex("GuildId", "UserId") + .IsUnique(); - b.ToTable("StickyRoles"); - }); + b.ToTable("StickyRoles"); + }); modelBuilder.Entity("EllieBot.Db.Models.StreamOnlineMessage", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("ChannelId") - .HasColumnType("INTEGER"); + b.Property("ChannelId") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("MessageId") - .HasColumnType("INTEGER"); + b.Property("MessageId") + .HasColumnType("INTEGER"); - b.Property("Name") - .HasColumnType("TEXT"); + b.Property("Name") + .HasColumnType("TEXT"); - b.Property("Type") - .HasColumnType("INTEGER"); + b.Property("Type") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("StreamOnlineMessages"); - }); + b.ToTable("StreamOnlineMessages"); + }); modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("StreamRoleSettingsId") - .HasColumnType("INTEGER"); + b.Property("StreamRoleSettingsId") + .HasColumnType("INTEGER"); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.Property("Username") - .HasColumnType("TEXT"); + b.Property("Username") + .HasColumnType("TEXT"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("StreamRoleSettingsId"); + b.HasIndex("StreamRoleSettingsId"); - b.ToTable("StreamRoleBlacklistedUser"); - }); + b.ToTable("StreamRoleBlacklistedUser"); + }); modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("AddRoleId") - .HasColumnType("INTEGER"); + b.Property("AddRoleId") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("Enabled") - .HasColumnType("INTEGER"); + b.Property("Enabled") + .HasColumnType("INTEGER"); - b.Property("FromRoleId") - .HasColumnType("INTEGER"); + b.Property("FromRoleId") + .HasColumnType("INTEGER"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.Property("Keyword") - .HasColumnType("TEXT"); + b.Property("Keyword") + .HasColumnType("TEXT"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId") - .IsUnique(); + b.HasIndex("GuildConfigId") + .IsUnique(); - b.ToTable("StreamRoleSettings"); - }); + b.ToTable("StreamRoleSettings"); + }); modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("StreamRoleSettingsId") - .HasColumnType("INTEGER"); + b.Property("StreamRoleSettingsId") + .HasColumnType("INTEGER"); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.Property("Username") - .HasColumnType("TEXT"); + b.Property("Username") + .HasColumnType("TEXT"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("StreamRoleSettingsId"); + b.HasIndex("StreamRoleSettingsId"); - b.ToTable("StreamRoleWhitelistedUser"); - }); + b.ToTable("StreamRoleWhitelistedUser"); + }); modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("ArchiveId") - .HasColumnType("INTEGER"); + b.Property("ArchiveId") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("IsDone") - .HasColumnType("INTEGER"); + b.Property("IsDone") + .HasColumnType("INTEGER"); - b.Property("Todo") - .HasColumnType("TEXT"); + b.Property("Todo") + .HasColumnType("TEXT"); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("ArchiveId"); + b.HasIndex("ArchiveId"); - b.HasIndex("UserId"); + b.HasIndex("UserId"); - b.ToTable("Todos"); - }); + b.ToTable("Todos"); + }); modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.Property("UnbanAt") - .HasColumnType("TEXT"); + b.Property("UnbanAt") + .HasColumnType("TEXT"); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId"); + b.HasIndex("GuildConfigId"); - b.ToTable("UnbanTimer"); - }); + b.ToTable("UnbanTimer"); + }); modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.Property("UnmuteAt") - .HasColumnType("TEXT"); + b.Property("UnmuteAt") + .HasColumnType("TEXT"); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId"); + b.HasIndex("GuildConfigId"); - b.ToTable("UnmuteTimer"); - }); + b.ToTable("UnmuteTimer"); + }); modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.Property("RoleId") - .HasColumnType("INTEGER"); + b.Property("RoleId") + .HasColumnType("INTEGER"); - b.Property("UnbanAt") - .HasColumnType("TEXT"); + b.Property("UnbanAt") + .HasColumnType("TEXT"); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId"); + b.HasIndex("GuildConfigId"); - b.ToTable("UnroleTimer"); - }); + b.ToTable("UnroleTimer"); + }); modelBuilder.Entity("EllieBot.Db.Models.UserXpStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("AwardedXp") - .HasColumnType("INTEGER"); + b.Property("AwardedXp") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildId") - .HasColumnType("INTEGER"); + b.Property("GuildId") + .HasColumnType("INTEGER"); - b.Property("NotifyOnLevelUp") - .HasColumnType("INTEGER"); + b.Property("NotifyOnLevelUp") + .HasColumnType("INTEGER"); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.Property("Xp") - .HasColumnType("INTEGER"); + b.Property("Xp") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("AwardedXp"); + b.HasIndex("AwardedXp"); - b.HasIndex("GuildId"); + b.HasIndex("GuildId"); - b.HasIndex("UserId"); + b.HasIndex("UserId"); - b.HasIndex("Xp"); + b.HasIndex("Xp"); - b.HasIndex("UserId", "GuildId") - .IsUnique(); + b.HasIndex("UserId", "GuildId") + .IsUnique(); - b.ToTable("UserXpStats"); - }); + b.ToTable("UserXpStats"); + }); modelBuilder.Entity("EllieBot.Db.Models.VcRoleInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.Property("RoleId") - .HasColumnType("INTEGER"); + b.Property("RoleId") + .HasColumnType("INTEGER"); - b.Property("VoiceChannelId") - .HasColumnType("INTEGER"); + b.Property("VoiceChannelId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId"); + b.HasIndex("GuildConfigId"); - b.ToTable("VcRoleInfo"); - }); + b.ToTable("VcRoleInfo"); + }); modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("AffinityId") - .HasColumnType("INTEGER"); + b.Property("AffinityId") + .HasColumnType("INTEGER"); - b.Property("ClaimerId") - .HasColumnType("INTEGER"); + b.Property("ClaimerId") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("Price") - .HasColumnType("INTEGER"); + b.Property("Price") + .HasColumnType("INTEGER"); - b.Property("WaifuId") - .HasColumnType("INTEGER"); + b.Property("WaifuId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("AffinityId"); + b.HasIndex("AffinityId"); - b.HasIndex("ClaimerId"); + b.HasIndex("ClaimerId"); - b.HasIndex("Price"); + b.HasIndex("Price"); - b.HasIndex("WaifuId") - .IsUnique(); + b.HasIndex("WaifuId") + .IsUnique(); - b.ToTable("WaifuInfo"); - }); + b.ToTable("WaifuInfo"); + }); modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("ItemEmoji") - .HasColumnType("TEXT"); + b.Property("ItemEmoji") + .HasColumnType("TEXT"); - b.Property("Name") - .HasColumnType("TEXT"); + b.Property("Name") + .HasColumnType("TEXT"); - b.Property("WaifuInfoId") - .HasColumnType("INTEGER"); + b.Property("WaifuInfoId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("WaifuInfoId"); + b.HasIndex("WaifuInfoId"); - b.ToTable("WaifuItem"); - }); + b.ToTable("WaifuItem"); + }); modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("NewId") - .HasColumnType("INTEGER"); + b.Property("NewId") + .HasColumnType("INTEGER"); - b.Property("OldId") - .HasColumnType("INTEGER"); + b.Property("OldId") + .HasColumnType("INTEGER"); - b.Property("UpdateType") - .HasColumnType("INTEGER"); + b.Property("UpdateType") + .HasColumnType("INTEGER"); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("NewId"); + b.HasIndex("NewId"); - b.HasIndex("OldId"); + b.HasIndex("OldId"); - b.HasIndex("UserId"); + b.HasIndex("UserId"); - b.ToTable("WaifuUpdates"); - }); + b.ToTable("WaifuUpdates"); + }); modelBuilder.Entity("EllieBot.Db.Models.Warning", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("Forgiven") - .HasColumnType("INTEGER"); + b.Property("Forgiven") + .HasColumnType("INTEGER"); - b.Property("ForgivenBy") - .HasColumnType("TEXT"); + b.Property("ForgivenBy") + .HasColumnType("TEXT"); - b.Property("GuildId") - .HasColumnType("INTEGER"); + b.Property("GuildId") + .HasColumnType("INTEGER"); - b.Property("Moderator") - .HasColumnType("TEXT"); + b.Property("Moderator") + .HasColumnType("TEXT"); - b.Property("Reason") - .HasColumnType("TEXT"); + b.Property("Reason") + .HasColumnType("TEXT"); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.Property("Weight") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(1L); + b.Property("Weight") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasDefaultValue(1L); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("DateAdded"); + b.HasIndex("DateAdded"); - b.HasIndex("GuildId"); + b.HasIndex("GuildId"); - b.HasIndex("UserId"); + b.HasIndex("UserId"); - b.ToTable("Warnings"); - }); + b.ToTable("Warnings"); + }); modelBuilder.Entity("EllieBot.Db.Models.WarningPunishment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("Count") - .HasColumnType("INTEGER"); + b.Property("Count") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.Property("Punishment") - .HasColumnType("INTEGER"); + b.Property("Punishment") + .HasColumnType("INTEGER"); - b.Property("RoleId") - .HasColumnType("INTEGER"); + b.Property("RoleId") + .HasColumnType("INTEGER"); - b.Property("Time") - .HasColumnType("INTEGER"); + b.Property("Time") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasAlternateKey("GuildId", "Count"); + b.HasIndex("GuildConfigId"); - b.ToTable("WarningPunishment"); - }); + b.ToTable("WarningPunishment"); + }); modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("Amount") - .HasColumnType("INTEGER"); + b.Property("Amount") + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("Level") - .HasColumnType("INTEGER"); + b.Property("Level") + .HasColumnType("INTEGER"); - b.Property("XpSettingsId") - .HasColumnType("INTEGER"); + b.Property("XpSettingsId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("XpSettingsId"); + b.HasIndex("XpSettingsId"); - b.ToTable("XpCurrencyReward"); - }); + b.ToTable("XpCurrencyReward"); + }); modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("Level") - .HasColumnType("INTEGER"); + b.Property("Level") + .HasColumnType("INTEGER"); - b.Property("Remove") - .HasColumnType("INTEGER"); + b.Property("Remove") + .HasColumnType("INTEGER"); - b.Property("RoleId") - .HasColumnType("INTEGER"); + b.Property("RoleId") + .HasColumnType("INTEGER"); - b.Property("XpSettingsId") - .HasColumnType("INTEGER"); + b.Property("XpSettingsId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("XpSettingsId", "Level") - .IsUnique(); + b.HasIndex("XpSettingsId", "Level") + .IsUnique(); - b.ToTable("XpRoleReward"); - }); + b.ToTable("XpRoleReward"); + }); modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("GuildConfigId") - .HasColumnType("INTEGER"); + b.Property("GuildConfigId") + .HasColumnType("INTEGER"); - b.Property("ServerExcluded") - .HasColumnType("INTEGER"); + b.Property("ServerExcluded") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildConfigId") - .IsUnique(); + b.HasIndex("GuildConfigId") + .IsUnique(); - b.ToTable("XpSettings"); - }); + b.ToTable("XpSettings"); + }); modelBuilder.Entity("EllieBot.Db.Models.XpShopOwnedItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("DateAdded") - .HasColumnType("TEXT"); + b.Property("DateAdded") + .HasColumnType("TEXT"); - b.Property("IsUsing") - .HasColumnType("INTEGER"); + b.Property("IsUsing") + .HasColumnType("INTEGER"); - b.Property("ItemKey") - .IsRequired() - .HasColumnType("TEXT"); + b.Property("ItemKey") + .IsRequired() + .HasColumnType("TEXT"); - b.Property("ItemType") - .HasColumnType("INTEGER"); + b.Property("ItemType") + .HasColumnType("INTEGER"); - b.Property("UserId") - .HasColumnType("INTEGER"); + b.Property("UserId") + .HasColumnType("INTEGER"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("UserId", "ItemType", "ItemKey") - .IsUnique(); + b.HasIndex("UserId", "ItemType", "ItemKey") + .IsUnique(); - b.ToTable("XpShopOwnedItem"); - }); + b.ToTable("XpShopOwnedItem"); + }); modelBuilder.Entity("EllieBot.Services.GreetSettings", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); - b.Property("AutoDeleteTimer") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(0); + b.Property("AutoDeleteTimer") + .HasColumnType("INTEGER"); - b.Property("ChannelId") - .HasColumnType("INTEGER"); + b.Property("ChannelId") + .HasColumnType("INTEGER"); - b.Property("GreetType") - .HasColumnType("INTEGER"); + b.Property("GreetType") + .HasColumnType("INTEGER"); - b.Property("GuildId") - .HasColumnType("INTEGER"); + b.Property("GuildId") + .HasColumnType("INTEGER"); - b.Property("IsEnabled") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER") - .HasDefaultValue(false); + b.Property("IsEnabled") + .HasColumnType("INTEGER"); - b.Property("MessageText") - .HasColumnType("TEXT"); + b.Property("MessageText") + .HasColumnType("TEXT"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("GuildId", "GreetType") - .IsUnique(); + b.HasIndex("GuildId", "GreetType") + .IsUnique(); - b.ToTable("GreetSettings"); - }); - - modelBuilder.Entity("EllieBot.Services.Rakeback", b => - { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Amount") - .HasColumnType("TEXT"); - - b.HasKey("UserId"); - - b.ToTable("Rakeback"); - }); - - modelBuilder.Entity("EllieBot.Services.UserBetStats", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property("Game") - .HasColumnType("INTEGER"); - - b.Property("LoseCount") - .HasColumnType("INTEGER"); - - b.Property("MaxBet") - .HasColumnType("INTEGER"); - - b.Property("MaxWin") - .HasColumnType("INTEGER"); - - b.Property("PaidOut") - .HasColumnType("TEXT"); - - b.Property("TotalBet") - .HasColumnType("TEXT"); - - b.Property("UserId") - .HasColumnType("INTEGER"); - - b.Property("WinCount") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Game") - .IsUnique(); - - b.ToTable("UserBetStats"); - }); + b.ToTable("GreetSettings"); + }); modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiAltSetting") - .HasForeignKey("EllieBot.Db.Models.AntiAltSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithOne("AntiAltSetting") + .HasForeignKey("EllieBot.Db.Models.AntiAltSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiRaidSetting") - .HasForeignKey("EllieBot.Db.Models.AntiRaidSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithOne("AntiRaidSetting") + .HasForeignKey("EllieBot.Db.Models.AntiRaidSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); modelBuilder.Entity("EllieBot.Db.Models.AntiSpamIgnore", b => - { - b.HasOne("EllieBot.Db.Models.AntiSpamSetting", null) - .WithMany("IgnoredChannels") - .HasForeignKey("AntiSpamSettingId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("EllieBot.Db.Models.AntiSpamSetting", null) + .WithMany("IgnoredChannels") + .HasForeignKey("AntiSpamSettingId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithOne("AntiSpamSetting") - .HasForeignKey("EllieBot.Db.Models.AntiSpamSetting", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithOne("AntiSpamSetting") + .HasForeignKey("EllieBot.Db.Models.AntiSpamSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => - { - b.HasOne("EllieBot.Db.Models.AutoTranslateChannel", "Channel") - .WithMany("Users") - .HasForeignKey("ChannelId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("EllieBot.Db.Models.AutoTranslateChannel", "Channel") + .WithMany("Users") + .HasForeignKey("ChannelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Channel"); - }); + b.Navigation("Channel"); + }); modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Applicants") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") + .WithMany("Applicants") + .HasForeignKey("ClubId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("EllieBot.Db.Models.DiscordUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Club"); + b.Navigation("Club"); - b.Navigation("User"); - }); + b.Navigation("User"); + }); modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Bans") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") + .WithMany("Bans") + .HasForeignKey("ClubId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("EllieBot.Db.Models.DiscordUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Club"); + b.Navigation("Club"); - b.Navigation("User"); - }); + b.Navigation("User"); + }); modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Owner") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.ClubInfo", "OwnerId") - .OnDelete(DeleteBehavior.SetNull); + { + b.HasOne("EllieBot.Db.Models.DiscordUser", "Owner") + .WithOne() + .HasForeignKey("EllieBot.Db.Models.ClubInfo", "OwnerId") + .OnDelete(DeleteBehavior.SetNull); - b.Navigation("Owner"); - }); + b.Navigation("Owner"); + }); modelBuilder.Entity("EllieBot.Db.Models.CommandAlias", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandAliases") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("CommandAliases") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("EllieBot.Db.Models.CommandCooldown", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("CommandCooldowns") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("CommandCooldowns") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("EllieBot.Db.Models.DelMsgOnCmdChannel", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("DelMsgOnCmdChannels") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("DelMsgOnCmdChannels") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => - { - b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") - .WithMany("Members") - .HasForeignKey("ClubId") - .OnDelete(DeleteBehavior.NoAction); + { + b.HasOne("EllieBot.Db.Models.ClubInfo", "Club") + .WithMany("Members") + .HasForeignKey("ClubId") + .OnDelete(DeleteBehavior.NoAction); - b.Navigation("Club"); - }); + b.Navigation("Club"); + }); modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("ExclusionList") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade); + { + b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") + .WithMany("ExclusionList") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade); - b.Navigation("XpSettings"); - }); + b.Navigation("XpSettings"); + }); modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("FeedSubs") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") + .WithMany("FeedSubs") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("GuildConfig"); - }); + b.Navigation("GuildConfig"); + }); modelBuilder.Entity("EllieBot.Db.Models.FilterChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterInvitesChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("FilterInvitesChannelIds") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterLinksChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("FilterLinksChannelIds") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("EllieBot.Db.Models.FilterWordsChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilterWordsChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("FilterWordsChannelIds") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("EllieBot.Db.Models.FilteredWord", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FilteredWords") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("FilteredWords") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FollowedStreams") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("FollowedStreams") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("EllieBot.Db.Models.GCChannelId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("GenerateCurrencyChannelIds") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") + .WithMany("GenerateCurrencyChannelIds") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade); - b.Navigation("GuildConfig"); - }); + b.Navigation("GuildConfig"); + }); modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => - { - b.HasOne("EllieBot.Db.Models.GiveawayModel", null) - .WithMany("Participants") - .HasForeignKey("GiveawayId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); + { + b.HasOne("EllieBot.Db.Models.GiveawayModel", null) + .WithMany("Participants") + .HasForeignKey("GiveawayId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); modelBuilder.Entity("EllieBot.Db.Models.GroupName", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithMany("SelfAssignableRoleGroupNames") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") + .WithMany("SelfAssignableRoleGroupNames") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("GuildConfig"); - }); + b.Navigation("GuildConfig"); + }); modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => - { - b.HasOne("EllieBot.Db.Models.LogSetting", "LogSetting") - .WithMany("LogIgnores") - .HasForeignKey("LogSettingId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("EllieBot.Db.Models.LogSetting", "LogSetting") + .WithMany("LogIgnores") + .HasForeignKey("LogSettingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("LogSetting"); - }); + b.Navigation("LogSetting"); + }); modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("MutedUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("MutedUsers") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("Permissions") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("Permissions") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => - { - b.HasOne("EllieBot.Db.Models.MusicPlaylist", null) - .WithMany("Songs") - .HasForeignKey("MusicPlaylistId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("EllieBot.Db.Models.MusicPlaylist", null) + .WithMany("Songs") + .HasForeignKey("MusicPlaylistId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("ShopEntries") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("ShopEntries") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => - { - b.HasOne("EllieBot.Db.Models.ShopEntry", null) - .WithMany("Items") - .HasForeignKey("ShopEntryId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("EllieBot.Db.Models.ShopEntry", null) + .WithMany("Items") + .HasForeignKey("ShopEntryId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredRoles") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredRoles") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("SlowmodeIgnoredUsers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredUsers") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Blacklist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") + .WithMany("Blacklist") + .HasForeignKey("StreamRoleSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("StreamRoleSettings"); - }); + b.Navigation("StreamRoleSettings"); + }); modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("StreamRole") - .HasForeignKey("EllieBot.Db.Models.StreamRoleSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") + .WithOne("StreamRole") + .HasForeignKey("EllieBot.Db.Models.StreamRoleSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("GuildConfig"); - }); + b.Navigation("GuildConfig"); + }); modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => - { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") - .WithMany("Whitelist") - .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") + .WithMany("Whitelist") + .HasForeignKey("StreamRoleSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("StreamRoleSettings"); - }); + b.Navigation("StreamRoleSettings"); + }); modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => - { - b.HasOne("EllieBot.Db.Models.ArchivedTodoListModel", null) - .WithMany("Items") - .HasForeignKey("ArchiveId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("EllieBot.Db.Models.ArchivedTodoListModel", null) + .WithMany("Items") + .HasForeignKey("ArchiveId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("EllieBot.Db.Models.UnbanTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnbanTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("UnbanTimer") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnmuteTimers") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("UnmuteTimers") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("UnroleTimer") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("UnroleTimer") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("EllieBot.Db.Models.VcRoleInfo", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("VcRoleInfos") - .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("VcRoleInfos") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "Affinity") - .WithMany() - .HasForeignKey("AffinityId"); + { + b.HasOne("EllieBot.Db.Models.DiscordUser", "Affinity") + .WithMany() + .HasForeignKey("AffinityId"); - b.HasOne("EllieBot.Db.Models.DiscordUser", "Claimer") - .WithMany() - .HasForeignKey("ClaimerId"); + b.HasOne("EllieBot.Db.Models.DiscordUser", "Claimer") + .WithMany() + .HasForeignKey("ClaimerId"); - b.HasOne("EllieBot.Db.Models.DiscordUser", "Waifu") - .WithOne() - .HasForeignKey("EllieBot.Db.Models.WaifuInfo", "WaifuId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("EllieBot.Db.Models.DiscordUser", "Waifu") + .WithOne() + .HasForeignKey("EllieBot.Db.Models.WaifuInfo", "WaifuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("Affinity"); + b.Navigation("Affinity"); - b.Navigation("Claimer"); + b.Navigation("Claimer"); - b.Navigation("Waifu"); - }); + b.Navigation("Waifu"); + }); modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => - { - b.HasOne("EllieBot.Db.Models.WaifuInfo", "WaifuInfo") - .WithMany("Items") - .HasForeignKey("WaifuInfoId"); + { + b.HasOne("EllieBot.Db.Models.WaifuInfo", "WaifuInfo") + .WithMany("Items") + .HasForeignKey("WaifuInfoId"); - b.Navigation("WaifuInfo"); - }); + b.Navigation("WaifuInfo"); + }); modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => - { - b.HasOne("EllieBot.Db.Models.DiscordUser", "New") - .WithMany() - .HasForeignKey("NewId"); + { + b.HasOne("EllieBot.Db.Models.DiscordUser", "New") + .WithMany() + .HasForeignKey("NewId"); - b.HasOne("EllieBot.Db.Models.DiscordUser", "Old") - .WithMany() - .HasForeignKey("OldId"); + b.HasOne("EllieBot.Db.Models.DiscordUser", "Old") + .WithMany() + .HasForeignKey("OldId"); - b.HasOne("EllieBot.Db.Models.DiscordUser", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + b.HasOne("EllieBot.Db.Models.DiscordUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("New"); + b.Navigation("New"); - b.Navigation("Old"); + b.Navigation("Old"); - b.Navigation("User"); - }); + b.Navigation("User"); + }); + + modelBuilder.Entity("EllieBot.Db.Models.WarningPunishment", b => + { + b.HasOne("EllieBot.Db.Models.GuildConfig", null) + .WithMany("WarnPunishments") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("CurrencyRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") + .WithMany("CurrencyRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("XpSettings"); - }); + b.Navigation("XpSettings"); + }); modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => - { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("RoleRewards") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") + .WithMany("RoleRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("XpSettings"); - }); + b.Navigation("XpSettings"); + }); modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") - .WithOne("XpSettings") - .HasForeignKey("EllieBot.Db.Models.XpSettings", "GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); + { + b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") + .WithOne("XpSettings") + .HasForeignKey("EllieBot.Db.Models.XpSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); - b.Navigation("GuildConfig"); - }); + b.Navigation("GuildConfig"); + }); modelBuilder.Entity("EllieBot.Db.Models.AntiSpamSetting", b => - { - b.Navigation("IgnoredChannels"); - }); + { + b.Navigation("IgnoredChannels"); + }); modelBuilder.Entity("EllieBot.Db.Models.ArchivedTodoListModel", b => - { - b.Navigation("Items"); - }); + { + b.Navigation("Items"); + }); modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateChannel", b => - { - b.Navigation("Users"); - }); + { + b.Navigation("Users"); + }); modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => - { - b.Navigation("Applicants"); + { + b.Navigation("Applicants"); - b.Navigation("Bans"); + b.Navigation("Bans"); - b.Navigation("Members"); - }); + b.Navigation("Members"); + }); modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => - { - b.Navigation("Participants"); - }); + { + b.Navigation("Participants"); + }); modelBuilder.Entity("EllieBot.Db.Models.GuildConfig", b => - { - b.Navigation("AntiAltSetting"); + { + b.Navigation("AntiAltSetting"); - b.Navigation("AntiRaidSetting"); + b.Navigation("AntiRaidSetting"); - b.Navigation("AntiSpamSetting"); + b.Navigation("AntiSpamSetting"); - b.Navigation("CommandAliases"); + b.Navigation("CommandAliases"); - b.Navigation("CommandCooldowns"); + b.Navigation("CommandCooldowns"); - b.Navigation("DelMsgOnCmdChannels"); + b.Navigation("DelMsgOnCmdChannels"); - b.Navigation("FeedSubs"); + b.Navigation("FeedSubs"); - b.Navigation("FilterInvitesChannelIds"); + b.Navigation("FilterInvitesChannelIds"); - b.Navigation("FilterLinksChannelIds"); + b.Navigation("FilterLinksChannelIds"); - b.Navigation("FilterWordsChannelIds"); + b.Navigation("FilterWordsChannelIds"); - b.Navigation("FilteredWords"); + b.Navigation("FilteredWords"); - b.Navigation("FollowedStreams"); + b.Navigation("FollowedStreams"); - b.Navigation("GenerateCurrencyChannelIds"); + b.Navigation("GenerateCurrencyChannelIds"); - b.Navigation("MutedUsers"); + b.Navigation("MutedUsers"); - b.Navigation("Permissions"); + b.Navigation("Permissions"); - b.Navigation("SelfAssignableRoleGroupNames"); + b.Navigation("SelfAssignableRoleGroupNames"); - b.Navigation("ShopEntries"); + b.Navigation("ShopEntries"); - b.Navigation("SlowmodeIgnoredRoles"); + b.Navigation("SlowmodeIgnoredRoles"); - b.Navigation("SlowmodeIgnoredUsers"); + b.Navigation("SlowmodeIgnoredUsers"); - b.Navigation("StreamRole"); + b.Navigation("StreamRole"); - b.Navigation("UnbanTimer"); + b.Navigation("UnbanTimer"); - b.Navigation("UnmuteTimers"); + b.Navigation("UnmuteTimers"); - b.Navigation("UnroleTimer"); + b.Navigation("UnroleTimer"); - b.Navigation("VcRoleInfos"); + b.Navigation("VcRoleInfos"); - b.Navigation("XpSettings"); - }); + b.Navigation("WarnPunishments"); + + b.Navigation("XpSettings"); + }); modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => - { - b.Navigation("LogIgnores"); - }); + { + b.Navigation("LogIgnores"); + }); modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => - { - b.Navigation("Songs"); - }); + { + b.Navigation("Songs"); + }); modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => - { - b.Navigation("Items"); - }); + { + b.Navigation("Items"); + }); modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => - { - b.Navigation("Blacklist"); + { + b.Navigation("Blacklist"); - b.Navigation("Whitelist"); - }); + b.Navigation("Whitelist"); + }); modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => - { - b.Navigation("Items"); - }); + { + b.Navigation("Items"); + }); modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => - { - b.Navigation("CurrencyRewards"); + { + b.Navigation("CurrencyRewards"); - b.Navigation("ExclusionList"); + b.Navigation("ExclusionList"); - b.Navigation("RoleRewards"); - }); + b.Navigation("RoleRewards"); + }); #pragma warning restore 612, 618 } } diff --git a/src/EllieBot/Modules/Administration/AutoAssignableRoles/AutoAssignRoleCommands.cs b/src/EllieBot/Modules/Administration/AutoAssignableRoles/AutoAssignRoleCommands.cs index 7ff09d9..dc687cc 100644 --- a/src/EllieBot/Modules/Administration/AutoAssignableRoles/AutoAssignRoleCommands.cs +++ b/src/EllieBot/Modules/Administration/AutoAssignableRoles/AutoAssignRoleCommands.cs @@ -25,13 +25,6 @@ public partial class Administration return; } - // the user can't aar the role which is greater or equal to the bot's highest role - if (role.Position >= ((SocketGuild)ctx.Guild).CurrentUser.GetRoles().Max(x => x.Position)) - { - await Response().Error(strs.hierarchy).SendAsync(); - return; - } - var roles = await _service.ToggleAarAsync(ctx.Guild.Id, role.Id); if (roles.Count == 0) await Response().Confirm(strs.aar_disabled).SendAsync(); diff --git a/src/EllieBot/Modules/Administration/AutoPublishService.cs b/src/EllieBot/Modules/Administration/AutoPublishService.cs index 2e877bb..a0983d3 100644 --- a/src/EllieBot/Modules/Administration/AutoPublishService.cs +++ b/src/EllieBot/Modules/Administration/AutoPublishService.cs @@ -1,3 +1,4 @@ +#nullable disable using LinqToDB; using LinqToDB.EntityFrameworkCore; using EllieBot.Common.ModuleBehaviors; @@ -10,7 +11,7 @@ public class AutoPublishService : IExecNoCommand, IReadyExecutor, IEService private readonly DbService _db; private readonly DiscordSocketClient _client; private readonly IBotCredsProvider _creds; - private ConcurrentDictionary _enabled = new(); + private ConcurrentDictionary _enabled; public AutoPublishService(DbService db, DiscordSocketClient client, IBotCredsProvider creds) { @@ -19,7 +20,7 @@ public class AutoPublishService : IExecNoCommand, IReadyExecutor, IEService _creds = creds; } - public async Task ExecOnNoCommandAsync(IGuild? guild, IUserMessage msg) + public async Task ExecOnNoCommandAsync(IGuild guild, IUserMessage msg) { if (guild is null) return; @@ -36,37 +37,27 @@ public class AutoPublishService : IExecNoCommand, IReadyExecutor, IEService }); } + // todo GUILDS + public async Task OnReadyAsync() { var creds = _creds.GetCreds(); await using var ctx = _db.GetDbContext(); var items = await ctx.GetTable() - .Where(x => Linq2DbExpressions.GuildOnShard(x.GuildId, creds.TotalShards, _client.ShardId)) - .ToListAsyncLinqToDB(); + .Where(x => Linq2DbExpressions.GuildOnShard(x.GuildId, creds.TotalShards, _client.ShardId)) + .ToListAsyncLinqToDB(); _enabled = items - .ToDictionary(x => x.GuildId, x => x.ChannelId) - .ToConcurrent(); - - _client.LeftGuild += ClientOnLeftGuild; + .ToDictionary(x => x.GuildId, x => x.ChannelId) + .ToConcurrent(); } - - public async Task ClientOnLeftGuild(SocketGuild guild) - { - await using var ctx = _db.GetDbContext(); - _enabled.TryRemove(guild.Id, out _); - - await ctx.GetTable() - .Where(x => x.GuildId == guild.Id) - .DeleteAsync(); - } - + public async Task ToggleAutoPublish(ulong guildId, ulong channelId) { await using var ctx = _db.GetDbContext(); var deleted = await ctx.GetTable() - .DeleteAsync(x => x.GuildId == guildId && x.ChannelId == channelId); + .DeleteAsync(x => x.GuildId == guildId && x.ChannelId == channelId); if (deleted != 0) { @@ -75,22 +66,22 @@ public class AutoPublishService : IExecNoCommand, IReadyExecutor, IEService } await ctx.GetTable() - .InsertOrUpdateAsync(() => new() - { - GuildId = guildId, - ChannelId = channelId, - DateAdded = DateTime.UtcNow, - }, - old => new() - { - ChannelId = channelId, - DateAdded = DateTime.UtcNow, - }, - () => new() - { - GuildId = guildId - }); - + .InsertOrUpdateAsync(() => new() + { + GuildId = guildId, + ChannelId = channelId, + DateAdded = DateTime.UtcNow, + }, + old => new() + { + ChannelId = channelId, + DateAdded = DateTime.UtcNow, + }, + () => new() + { + GuildId = guildId + }); + _enabled[guildId] = channelId; return true; diff --git a/src/EllieBot/Modules/Administration/DangerousCommands/CleanupCommands.cs b/src/EllieBot/Modules/Administration/DangerousCommands/CleanupCommands.cs index 742e869..e6ba515 100644 --- a/src/EllieBot/Modules/Administration/DangerousCommands/CleanupCommands.cs +++ b/src/EllieBot/Modules/Administration/DangerousCommands/CleanupCommands.cs @@ -46,7 +46,7 @@ public partial class Administration [Cmd] [OwnerOnly] - public async Task LeaveUnkeptServers(int startShardId, int shardMultiplier = 3000) + public async Task LeaveUnkeptServers(int startShardId) { var keptGuildCount = await _svc.GetKeptGuildCount(); @@ -65,7 +65,7 @@ public partial class Administration for (var shardId = startShardId; shardId < _creds.GetCreds().TotalShards; shardId++) { await _svc.StartLeavingUnkeptServers(shardId); - await Task.Delay(shardMultiplier * 1000); + await Task.Delay(3000 * 1000); } await ctx.OkAsync(); diff --git a/src/EllieBot/Modules/Administration/DangerousCommands/CleanupService.cs b/src/EllieBot/Modules/Administration/DangerousCommands/CleanupService.cs index fcf5612..ee99b49 100644 --- a/src/EllieBot/Modules/Administration/DangerousCommands/CleanupService.cs +++ b/src/EllieBot/Modules/Administration/DangerousCommands/CleanupService.cs @@ -61,21 +61,20 @@ public sealed class CleanupService : ICleanupService, IReadyExecutor, IEService HashSet dontDelete; await using (var db = _db.GetDbContext()) { - await using var ctx = db.CreateLinqToDBContext(); + await using var ctx = db.CreateLinqToDBConnection(); var table = ctx.CreateTable(tableOptions: TableOptions.CheckExistence); var dontDeleteList = await table - .Where(x => allGuildIds.Contains(x.GuildId)) - .Select(x => x.GuildId) - .ToListAsyncLinqToDB(); + .Where(x => allGuildIds.Contains(x.GuildId)) + .Select(x => x.GuildId) + .ToListAsyncLinqToDB(); dontDelete = dontDeleteList.ToHashSet(); } - Log.Information("Leaving {RemainingCount} guilds, 1 every second. {DontDeleteCount} will remain", + Log.Information("Leaving {RemainingCount} guilds every, 1 seconds. {DontDeleteCount} will remain", allGuildIds.Length - dontDelete.Count, dontDelete.Count); - foreach (var guildId in allGuildIds) { if (dontDelete.Contains(guildId)) @@ -207,18 +206,6 @@ public sealed class CleanupService : ICleanupService, IReadyExecutor, IEService .Contains(x.GuildId)) .DeleteAsync(); - // delete autopublish channels - await ctx.GetTable() - .Where(x => !tempTable.Select(x => x.GuildId) - .Contains(x.GuildId)) - .DeleteAsync(); - - // delete greet settings - await ctx.GetTable() - .Where(x => !tempTable.Select(x => x.GuildId) - .Contains(x.GuildId)) - .DeleteAsync(); - return new() { GuildCount = guildIds.Keys.Count, @@ -228,7 +215,7 @@ public sealed class CleanupService : ICleanupService, IReadyExecutor, IEService public async Task KeepGuild(ulong guildId) { await using var db = _db.GetDbContext(); - await using var ctx = db.CreateLinqToDBContext(); + await using var ctx = db.CreateLinqToDbContext(); var table = ctx.CreateTable(tableOptions: TableOptions.CheckExistence); if (await table.AnyAsyncLinqToDB(x => x.GuildId == guildId)) return false; diff --git a/src/EllieBot/Modules/Administration/DangerousCommands/DangerousCommands.cs b/src/EllieBot/Modules/Administration/DangerousCommands/DangerousCommands.cs index 2e6444f..80484c3 100644 --- a/src/EllieBot/Modules/Administration/DangerousCommands/DangerousCommands.cs +++ b/src/EllieBot/Modules/Administration/DangerousCommands/DangerousCommands.cs @@ -139,6 +139,7 @@ public partial class Administration public Task DeleteXp() => ConfirmActionInternalAsync("Delete Xp", () => _xcs.DeleteXp()); + [Cmd] [OwnerOnly] public Task DeleteWaifus() diff --git a/src/EllieBot/Modules/Administration/GreetBye/GreetCommands.cs b/src/EllieBot/Modules/Administration/GreetBye/GreetCommands.cs index fa404db..c7ee52a 100644 --- a/src/EllieBot/Modules/Administration/GreetBye/GreetCommands.cs +++ b/src/EllieBot/Modules/Administration/GreetBye/GreetCommands.cs @@ -200,21 +200,17 @@ public partial class Administration if (!isEnabled) { - await SendGreetEnableHint(type); - } - } + var cmdName = type switch + { + GreetType.Greet => "greet", + GreetType.Bye => "bye", + GreetType.Boost => "boost", + GreetType.GreetDm => "greetdm", + _ => "unknown_command" + }; - private static string GetCmdName(GreetType type) - { - var cmdName = type switch - { - GreetType.Greet => "greet", - GreetType.Bye => "bye", - GreetType.Boost => "boost", - GreetType.GreetDm => "greetdm", - _ => "unknown_command" - }; - return cmdName; + await Response().Pending(strs.boostmsg_enable($"`{prefix}{cmdName}`")).SendAsync(); + } } public async Task Test(GreetType type, IGuildUser? user = null) @@ -223,25 +219,8 @@ public partial class Administration await _service.Test(ctx.Guild.Id, type, (ITextChannel)ctx.Channel, user); var conf = await _service.GetGreetSettingsAsync(ctx.Guild.Id, type); - if (conf?.IsEnabled is not true) - await SendGreetEnableHint(type); - } - - private async Task SendGreetEnableHint(GreetType type) - { - var cmd = $"`{prefix}{GetCmdName(type)}`"; - - var str = type switch - { - GreetType.Greet => strs.greetmsg_enable(cmd), - GreetType.Bye => strs.byemsg_enable(cmd), - GreetType.Boost => strs.boostmsg_enable(cmd), - GreetType.GreetDm => strs.greetdmmsg_enable(cmd), - _ => strs.error - }; - - await Response().Pending(str).SendAsync(); + await Response().Pending(strs.boostmsg_enable($"`{prefix}boost`")).SendAsync(); } } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Administration/GreetBye/GreetService.cs b/src/EllieBot/Modules/Administration/GreetBye/GreetService.cs index ee51fe9..e47f743 100644 --- a/src/EllieBot/Modules/Administration/GreetBye/GreetService.cs +++ b/src/EllieBot/Modules/Administration/GreetBye/GreetService.cs @@ -75,27 +75,16 @@ public class GreetService : IEService, IReadyExecutor _client.GuildMemberUpdated += ClientOnGuildMemberUpdated; - while (true) + var timer = new PeriodicTimer(TimeSpan.FromSeconds(2)); + while (await timer.WaitForNextTickAsync()) { - try - { - var (conf, user, ch) = await _greetQueue.Reader.ReadAsync(); - await GreetUsers(conf, ch, user); - } - catch (Exception ex) - { - Log.Error(ex, "Greet Loop almost crashed. Please report this!"); - } - - await Task.Delay(2016); + var (conf, user, ch) = await _greetQueue.Reader.ReadAsync(); + await GreetUsers(conf, ch, user); } } private Task ClientOnGuildMemberUpdated(Cacheable optOldUser, SocketGuildUser newUser) { - if (!_enabled[GreetType.Boost].Contains(newUser.Guild.Id)) - return Task.CompletedTask; - // if user is a new booster // or boosted again the same server if ((optOldUser.Value is { PremiumSince: null } && newUser is { PremiumSince: not null }) @@ -137,63 +126,21 @@ public class GreetService : IEService, IReadyExecutor .DeleteAsync(); } - private Task OnUserJoined(IGuildUser user) - { - _ = Task.Run(async () => - { - try - { - if (_enabled[GreetType.Greet].Contains(user.GuildId)) - { - var conf = await GetGreetSettingsAsync(user.GuildId, GreetType.Greet); - if (conf?.ChannelId is ulong cid) - { - var channel = await user.Guild.GetTextChannelAsync(cid); - if (channel is not null) - { - await _greetQueue.Writer.WriteAsync((conf, user, channel)); - } - } - } - - - if (_enabled[GreetType.GreetDm].Contains(user.GuildId)) - { - var confDm = await GetGreetSettingsAsync(user.GuildId, GreetType.GreetDm); - if (confDm is not null) - { - await _greetQueue.Writer.WriteAsync((confDm, user, null)); - } - } - } - catch (Exception ex) - { - Log.Error(ex, "Error in GreetService.OnUserJoined. This should not happen. Please report it"); - } - }); - return Task.CompletedTask; - } - private Task OnUserLeft(SocketGuild guild, SocketUser user) { _ = Task.Run(async () => { - if (!_enabled[GreetType.Bye].Contains(guild.Id)) - return; - try { var conf = await GetGreetSettingsAsync(guild.Id, GreetType.Bye); - if (conf?.ChannelId is not { } cid) + if (conf is null) return; - var channel = guild.GetChannel(cid) as ITextChannel; + var channel = guild.TextChannels.FirstOrDefault(c => c.Id == conf.ChannelId); + if (channel is null) //maybe warn the server owner that the channel is missing { - Log.Warning("Channel {ChannelId} in {GuildId} was not found. Bye message will be disabled", - conf.ChannelId, - conf.GuildId); await SetGreet(guild.Id, null, GreetType.Bye, false); return; } @@ -208,11 +155,10 @@ public class GreetService : IEService, IReadyExecutor return Task.CompletedTask; } - private TypedKey GreetSettingsKey(ulong gid, GreetType type) - => new($"greet_settings:{gid}:{type}"); + private readonly TypedKey _greetSettingsKey = new("greet_settings"); public async Task GetGreetSettingsAsync(ulong gid, GreetType type) - => await _cache.GetOrAddAsync(GreetSettingsKey(gid, type), + => await _cache.GetOrAddAsync(_greetSettingsKey, () => InternalGetGreetSettingsAsync(gid, type), TimeSpan.FromSeconds(3)); @@ -261,10 +207,9 @@ public class GreetService : IEService, IReadyExecutor or DiscordErrorCode.UnknownChannel) { Log.Warning(ex, - "Missing permissions to send a {GreetType} message, it will be disabled on server: {GuildId}", - conf.GreetType, + "Missing permissions to send a bye message, the greet message will be disabled on server: {GuildId}", channel.GuildId); - await SetGreet(channel.GuildId, channel.Id, conf.GreetType, false); + await SetGreet(channel.GuildId, channel.Id, GreetType.Greet, false); } catch (Exception ex) { @@ -272,6 +217,14 @@ public class GreetService : IEService, IReadyExecutor } } + + private async Task GreetDmUser(GreetSettings conf, IGuildUser user) + { + var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + await _greetQueue.Writer.WriteAsync((conf, user, null)); + return await completionSource.Task; + } + private async Task GreetDmUserInternal(GreetSettings conf, IGuildUser user) { try @@ -337,9 +290,8 @@ public class GreetService : IEService, IReadyExecutor await _sender.Response(user).Text(smartText).Sanitize(false).SendAsync(); } - catch (Exception ex) + catch { - Log.Warning(ex, "Unable to send Greet DM. Probably the user has closed DMs"); return false; } @@ -353,6 +305,36 @@ public class GreetService : IEService, IReadyExecutor IconUrl = user.Guild.IconUrl }; + private Task OnUserJoined(IGuildUser user) + { + _ = Task.Run(async () => + { + try + { + var conf = await GetGreetSettingsAsync(user.GuildId, GreetType.Greet); + + if (conf is not null && conf.IsEnabled && conf.ChannelId is { } channelId) + { + var channel = await user.Guild.GetTextChannelAsync(channelId); + if (channel is not null) + { + await _greetQueue.Writer.WriteAsync((conf, user, channel)); + } + } + + var confDm = await GetGreetSettingsAsync(user.GuildId, GreetType.GreetDm); + + if (confDm?.IsEnabled ?? false) + await GreetDmUser(confDm, user); + } + catch + { + // ignored + } + }); + return Task.CompletedTask; + } + public static string GetDefaultGreet(GreetType greetType) => greetType switch @@ -475,17 +457,7 @@ public class GreetService : IEService, IReadyExecutor { var conf = await GetGreetSettingsAsync(guildId, type); if (conf is null) - { - conf = new GreetSettings() - { - ChannelId = channel.Id, - GreetType = type, - IsEnabled = false, - GuildId = guildId, - AutoDeleteTimer = 30, - MessageText = GetDefaultGreet(type) - }; - } + return false; await SendMessage(conf, channel, user); return true; @@ -495,8 +467,8 @@ public class GreetService : IEService, IReadyExecutor { if (conf.GreetType == GreetType.GreetDm) { - await _greetQueue.Writer.WriteAsync((conf, user, null)); - return true; + await _greetQueue.Writer.WriteAsync((conf, user, channel as ITextChannel)); + return await GreetDmUser(conf, user); } if (channel is not ITextChannel ch) diff --git a/src/EllieBot/Modules/Administration/GreetBye/GreetSettings.cs b/src/EllieBot/Modules/Administration/GreetBye/GreetSettings.cs index d798f4f..76579e6 100644 --- a/src/EllieBot/Modules/Administration/GreetBye/GreetSettings.cs +++ b/src/EllieBot/Modules/Administration/GreetBye/GreetSettings.cs @@ -1,3 +1,5 @@ +using EllieBot.Db.Models; + namespace EllieBot.Services; public enum GreetType @@ -11,11 +13,32 @@ public enum GreetType public class GreetSettings { public int Id { get; set; } - + public ulong GuildId { get; set; } public GreetType GreetType { get; set; } public string? MessageText { get; set; } public bool IsEnabled { get; set; } public ulong? ChannelId { get; set; } + public int AutoDeleteTimer { get; set; } + + // public int AutoDeleteGreetMessagesTimer { get; set; } + // public int AutoDeleteByeMessagesTimer { get; set; } + // + // public ulong GreetMessageChannelId { get; set; } + // public ulong ByeMessageChannelId { get; set; } + // + // public bool SendDmGreetMessage { get; set; } + // public string? DmGreetMessageText { get; set; } + // + // public bool SendChannelGreetMessage { get; set; } + // public string? ChannelGreetMessageText { get; set; } + // + // public bool SendChannelByeMessage { get; set; } + // public string? ChannelByeMessageText { get; set; } + // + // public bool SendBoostMessage { get; set; } + // public string? BoostMessage { get; set; } + // public int BoostMessageDeleteAfter { get; set; } + // public ulong BoostMessageChannelId { get; set; } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Administration/PlayingRotate/PlayingRotateCommands.cs b/src/EllieBot/Modules/Administration/PlayingRotate/PlayingRotateCommands.cs index 16120f2..cb0384f 100644 --- a/src/EllieBot/Modules/Administration/PlayingRotate/PlayingRotateCommands.cs +++ b/src/EllieBot/Modules/Administration/PlayingRotate/PlayingRotateCommands.cs @@ -18,12 +18,11 @@ public partial class Administration await Response().Confirm(strs.ropl_disabled).SendAsync(); } - [Cmd] [OwnerOnly] public Task AddPlaying([Leftover] string status) => AddPlaying(ActivityType.CustomStatus, status); - + [Cmd] [OwnerOnly] public async Task AddPlaying(ActivityType statusType, [Leftover] string status) diff --git a/src/EllieBot/Modules/Administration/Prune/PruneService.cs b/src/EllieBot/Modules/Administration/Prune/PruneService.cs index b44406f..cad3d01 100644 --- a/src/EllieBot/Modules/Administration/Prune/PruneService.cs +++ b/src/EllieBot/Modules/Administration/Prune/PruneService.cs @@ -33,7 +33,7 @@ public class PruneService : IEService using var cancelSource = new CancellationTokenSource(); if (!_pruningGuilds.TryAdd(channel.GuildId, cancelSource)) return PruneResult.AlreadyRunning; - + try { if (!await _ps.LimitHitAsync(LimitedFeatureName.Prune, channel.Guild.OwnerId)) diff --git a/src/EllieBot/Modules/Administration/Role/ReactionRolesService.cs b/src/EllieBot/Modules/Administration/Role/ReactionRolesService.cs index f8550ed..caa3e19 100644 --- a/src/EllieBot/Modules/Administration/Role/ReactionRolesService.cs +++ b/src/EllieBot/Modules/Administration/Role/ReactionRolesService.cs @@ -13,7 +13,7 @@ public sealed class ReactionRolesService : IReadyExecutor, IEService, IReactionR { private readonly DbService _db; private readonly DiscordSocketClient _client; - private readonly IBotCreds _creds; + private readonly IBotCredentials _creds; private ConcurrentDictionary> _cache; private readonly object _cacheLock = new(); @@ -24,7 +24,7 @@ public sealed class ReactionRolesService : IReadyExecutor, IEService, IReactionR DiscordSocketClient client, IPatronageService ps, DbService db, - IBotCreds creds) + IBotCredentials creds) { _db = db; _client = client; diff --git a/src/EllieBot/Modules/Administration/Role/StickyRolesService.cs b/src/EllieBot/Modules/Administration/Role/StickyRolesService.cs index 5147daf..ede5b63 100644 --- a/src/EllieBot/Modules/Administration/Role/StickyRolesService.cs +++ b/src/EllieBot/Modules/Administration/Role/StickyRolesService.cs @@ -9,13 +9,13 @@ namespace EllieBot.Modules.Administration; public sealed class StickyRolesService : IEService, IReadyExecutor { private readonly DiscordSocketClient _client; - private readonly IBotCreds _creds; + private readonly IBotCredentials _creds; private readonly DbService _db; private HashSet _stickyRoles = new(); public StickyRolesService( DiscordSocketClient client, - IBotCreds creds, + IBotCredentials creds, DbService db) { _client = client; diff --git a/src/EllieBot/Modules/Administration/Self/SelfService.cs b/src/EllieBot/Modules/Administration/Self/SelfService.cs index c07c16e..bbed3f7 100644 --- a/src/EllieBot/Modules/Administration/Self/SelfService.cs +++ b/src/EllieBot/Modules/Administration/Self/SelfService.cs @@ -15,7 +15,7 @@ public sealed class SelfService : IExecNoCommand, IReadyExecutor, IEService private readonly IBotStrings _strings; private readonly DiscordSocketClient _client; - private readonly IBotCreds _creds; + private readonly IBotCredentials _creds; private ImmutableDictionary ownerChannels = new Dictionary().ToImmutableDictionary(); @@ -36,7 +36,7 @@ public sealed class SelfService : IExecNoCommand, IReadyExecutor, IEService CommandHandler cmdHandler, DbService db, IBotStrings strings, - IBotCreds creds, + IBotCredentials creds, IHttpClientFactory factory, BotConfigService bss, IPubSub pubSub, @@ -71,6 +71,7 @@ public sealed class SelfService : IExecNoCommand, IReadyExecutor, IEService if (server.OwnerId != _client.CurrentUser.Id) { await server.LeaveAsync(); + Log.Information("Left server {Name} [{Id}]", server.Name, server.Id); } else { @@ -452,6 +453,7 @@ public sealed class SelfService : IExecNoCommand, IReadyExecutor, IEService { x.UserId, x.Username, + x.Discriminator }) .Where(x => users.Select(y => y.Id).Contains(x.UserId)) .ToArrayAsyncEF(); @@ -463,11 +465,12 @@ public sealed class SelfService : IExecNoCommand, IReadyExecutor, IEService UserId = x.Id, AvatarId = x.AvatarId, Username = x.Username, + Discriminator = x.Discriminator }); var added = (await ctx.BulkCopyAsync(usersToAdd)).RowsCopied; var toUpdateUserIds = presentDbUsers - .Where(x => x.Username.StartsWith("??")) + .Where(x => x.Username == "Unknown" && x.Discriminator == "????") .Select(x => x.UserId) .ToArray(); @@ -478,6 +481,7 @@ public sealed class SelfService : IExecNoCommand, IReadyExecutor, IEService .UpdateAsync(x => new DiscordUser() { Username = user.Username, + Discriminator = user.Discriminator, // .award tends to set AvatarId and DateAdded to NULL, so account for that. AvatarId = user.AvatarId, diff --git a/src/EllieBot/Modules/Administration/UserPunish/UserPunishCommands.cs b/src/EllieBot/Modules/Administration/UserPunish/UserPunishCommands.cs index 85e5026..3c43b1f 100644 --- a/src/EllieBot/Modules/Administration/UserPunish/UserPunishCommands.cs +++ b/src/EllieBot/Modules/Administration/UserPunish/UserPunishCommands.cs @@ -66,10 +66,10 @@ public partial class Administration { await _sender.Response(user) .Embed(_sender.CreateEmbed() - .WithErrorColor() - .WithDescription(GetText(strs.warned_on(ctx.Guild.ToString()))) - .AddField(GetText(strs.moderator), ctx.User.ToString()) - .AddField(GetText(strs.reason), reason ?? "-")) + .WithErrorColor() + .WithDescription(GetText(strs.warned_on(ctx.Guild.ToString()))) + .AddField(GetText(strs.moderator), ctx.User.ToString()) + .AddField(GetText(strs.reason), reason ?? "-")) .SendAsync(); } catch @@ -85,9 +85,8 @@ public partial class Administration catch (Exception ex) { Log.Warning(ex, "Exception occured while warning a user"); - var errorEmbed = _sender.CreateEmbed() - .WithErrorColor() - .WithDescription(GetText(strs.cant_apply_punishment)); + var errorEmbed = _sender.CreateEmbed().WithErrorColor() + .WithDescription(GetText(strs.cant_apply_punishment)); if (dmFailed) errorEmbed.WithFooter("⚠️ " + GetText(strs.unable_to_dm_user)); @@ -118,7 +117,7 @@ public partial class Administration [Priority(1)] public async Task WarnExpire() { - var (expireDays, _) = await _service.GetWarnExpire(ctx.Guild.Id); + var expireDays = await _service.GetWarnExpire(ctx.Guild.Id); if (expireDays == 0) await Response().Confirm(strs.warns_dont_expire).SendAsync(); @@ -267,9 +266,9 @@ public partial class Administration }); return _sender.CreateEmbed() - .WithOkColor() - .WithTitle(GetText(strs.warnings_list)) - .WithDescription(string.Join("\n", ws)); + .WithOkColor() + .WithTitle(GetText(strs.warnings_list)) + .WithDescription(string.Join("\n", ws)); }) .SendAsync(); } @@ -282,13 +281,13 @@ public partial class Administration [Cmd] [RequireContext(ContextType.Guild)] - [UserPerm(GuildPerm.Administrator)] + [UserPerm(GuildPermission.Administrator)] public async Task WarnDelete(ulong userId, int index) { if (--index < 0) return; - var warn = await _service.WarnDelete(ctx.Guild.Id, userId, index); + var warn = await _service.WarnDelete(userId, index); if (warn is null) { @@ -345,7 +344,7 @@ public partial class Administration return; } - var success = await _service.WarnPunish(ctx.Guild.Id, number, punish, time, role); + var success = _service.WarnPunish(ctx.Guild.Id, number, punish, time, role); if (!success) return; @@ -381,7 +380,7 @@ public partial class Administration if (punish is PunishmentAction.TimeOut && time is null) return; - var success = await _service.WarnPunish(ctx.Guild.Id, number, punish, time); + var success = _service.WarnPunish(ctx.Guild.Id, number, punish, time); if (!success) return; @@ -408,7 +407,7 @@ public partial class Administration [UserPerm(GuildPerm.BanMembers)] public async Task WarnPunish(int number) { - if (!await _service.WarnPunishRemove(ctx.Guild.Id, number)) + if (!_service.WarnPunishRemove(ctx.Guild.Id, number)) return; await Response().Confirm(strs.warn_punish_rem(Format.Bold(number.ToString()))).SendAsync(); @@ -418,7 +417,7 @@ public partial class Administration [RequireContext(ContextType.Guild)] public async Task WarnPunishList() { - var ps = await _service.WarnPunishList(ctx.Guild.Id); + var ps = _service.WarnPunishList(ctx.Guild.Id); string list; if (ps.Any()) @@ -479,13 +478,13 @@ public partial class Administration var banPrune = await _service.GetBanPruneAsync(ctx.Guild.Id) ?? 7; await _mute.TimedBan(ctx.Guild, userId, time.Time, (ctx.User + " | " + msg).TrimTo(512), banPrune); var toSend = _sender.CreateEmbed() - .WithOkColor() - .WithTitle("⛔️ " + GetText(strs.banned_user)) - .AddField(GetText(strs.username), user?.ToString() ?? userId.ToString(), true) - .AddField("ID", userId.ToString(), true) - .AddField(GetText(strs.duration), - time.Time.ToPrettyStringHm(), - true); + .WithOkColor() + .WithTitle("⛔️ " + GetText(strs.banned_user)) + .AddField(GetText(strs.username), user?.ToString() ?? userId.ToString(), true) + .AddField("ID", userId.ToString(), true) + .AddField(GetText(strs.duration), + time.Time.ToPrettyStringHm(), + true); if (dmFailed) toSend.WithFooter("⚠️ " + GetText(strs.unable_to_dm_user)); @@ -506,12 +505,11 @@ public partial class Administration var banPrune = await _service.GetBanPruneAsync(ctx.Guild.Id) ?? 7; await ctx.Guild.AddBanAsync(userId, banPrune, (ctx.User + " | " + msg).TrimTo(512)); - await Response() - .Embed(_sender.CreateEmbed() - .WithOkColor() - .WithTitle("⛔️ " + GetText(strs.banned_user)) - .AddField("ID", userId.ToString(), true)) - .SendAsync(); + await Response().Embed(_sender.CreateEmbed() + .WithOkColor() + .WithTitle("⛔️ " + GetText(strs.banned_user)) + .AddField("ID", userId.ToString(), true)) + .SendAsync(); } else await Ban(user, msg); @@ -545,10 +543,10 @@ public partial class Administration await ctx.Guild.AddBanAsync(user, banPrune, (ctx.User + " | " + msg).TrimTo(512)); var toSend = _sender.CreateEmbed() - .WithOkColor() - .WithTitle("⛔️ " + GetText(strs.banned_user)) - .AddField(GetText(strs.username), user.ToString(), true) - .AddField("ID", user.Id.ToString(), true); + .WithOkColor() + .WithTitle("⛔️ " + GetText(strs.banned_user)) + .AddField(GetText(strs.username), user.ToString(), true) + .AddField("ID", user.Id.ToString(), true); if (dmFailed) toSend.WithFooter("⚠️ " + GetText(strs.unable_to_dm_user)); @@ -736,15 +734,14 @@ public partial class Administration var banPrune = await _service.GetBanPruneAsync(ctx.Guild.Id) ?? 7; await ctx.Guild.AddBanAsync(user, banPrune, ("Softban | " + ctx.User + " | " + msg).TrimTo(512)); - try - { await ctx.Guild.RemoveBanAsync(user); } + try { await ctx.Guild.RemoveBanAsync(user); } catch { await ctx.Guild.RemoveBanAsync(user); } var toSend = _sender.CreateEmbed() - .WithOkColor() - .WithTitle("☣ " + GetText(strs.sb_user)) - .AddField(GetText(strs.username), user.ToString(), true) - .AddField("ID", user.Id.ToString(), true); + .WithOkColor() + .WithTitle("☣ " + GetText(strs.sb_user)) + .AddField(GetText(strs.username), user.ToString(), true) + .AddField("ID", user.Id.ToString(), true); if (dmFailed) toSend.WithFooter("⚠️ " + GetText(strs.unable_to_dm_user)); @@ -796,10 +793,10 @@ public partial class Administration await user.KickAsync((ctx.User + " | " + msg).TrimTo(512)); var toSend = _sender.CreateEmbed() - .WithOkColor() - .WithTitle(GetText(strs.kicked_user)) - .AddField(GetText(strs.username), user.ToString(), true) - .AddField("ID", user.Id.ToString(), true); + .WithOkColor() + .WithTitle(GetText(strs.kicked_user)) + .AddField(GetText(strs.username), user.ToString(), true) + .AddField("ID", user.Id.ToString(), true); if (dmFailed) toSend.WithFooter("⚠️ " + GetText(strs.unable_to_dm_user)); @@ -829,8 +826,8 @@ public partial class Administration var dmMessage = GetText(strs.timeoutdm(Format.Bold(ctx.Guild.Name), msg)); await _sender.Response(user) .Embed(_sender.CreateEmbed() - .WithPendingColor() - .WithDescription(dmMessage)) + .WithPendingColor() + .WithDescription(dmMessage)) .SendAsync(); } catch @@ -841,10 +838,10 @@ public partial class Administration await user.SetTimeOutAsync(time.Time); var toSend = _sender.CreateEmbed() - .WithOkColor() - .WithTitle("⏳ " + GetText(strs.timedout_user)) - .AddField(GetText(strs.username), user.ToString(), true) - .AddField("ID", user.Id.ToString(), true); + .WithOkColor() + .WithTitle("⏳ " + GetText(strs.timedout_user)) + .AddField(GetText(strs.username), user.ToString(), true) + .AddField("ID", user.Id.ToString(), true); if (dmFailed) toSend.WithFooter("⚠️ " + GetText(strs.unable_to_dm_user)); @@ -902,9 +899,9 @@ public partial class Administration missStr = "-"; var toSend = _sender.CreateEmbed() - .WithDescription(GetText(strs.mass_ban_in_progress(banning.Count))) - .AddField(GetText(strs.invalid(missing.Count)), missStr) - .WithPendingColor(); + .WithDescription(GetText(strs.mass_ban_in_progress(banning.Count))) + .AddField(GetText(strs.invalid(missing.Count)), missStr) + .WithPendingColor(); var banningMessage = await Response().Embed(toSend).SendAsync(); @@ -922,13 +919,11 @@ public partial class Administration } await banningMessage.ModifyAsync(x => x.Embed = _sender.CreateEmbed() - .WithDescription( - GetText(strs.mass_ban_completed( - banning.Count()))) - .AddField(GetText(strs.invalid(missing.Count)), - missStr) - .WithOkColor() - .Build()); + .WithDescription( + GetText(strs.mass_ban_completed(banning.Count()))) + .AddField(GetText(strs.invalid(missing.Count)), missStr) + .WithOkColor() + .Build()); } [Cmd] @@ -950,10 +945,10 @@ public partial class Administration //send a message but don't wait for it var banningMessageTask = Response() .Embed(_sender.CreateEmbed() - .WithDescription( - GetText(strs.mass_kill_in_progress(bans.Count()))) - .AddField(GetText(strs.invalid(missing)), missStr) - .WithPendingColor()) + .WithDescription( + GetText(strs.mass_kill_in_progress(bans.Count()))) + .AddField(GetText(strs.invalid(missing)), missStr) + .WithPendingColor()) .SendAsync(); var banPrune = await _service.GetBanPruneAsync(ctx.Guild.Id) ?? 7; @@ -971,11 +966,11 @@ public partial class Administration var banningMessage = await banningMessageTask; await banningMessage.ModifyAsync(x => x.Embed = _sender.CreateEmbed() - .WithDescription( - GetText(strs.mass_kill_completed(bans.Count()))) - .AddField(GetText(strs.invalid(missing)), missStr) - .WithOkColor() - .Build()); + .WithDescription( + GetText(strs.mass_kill_completed(bans.Count()))) + .AddField(GetText(strs.invalid(missing)), missStr) + .WithOkColor() + .Build()); } public class WarnExpireOptions : IEllieCommandOptions diff --git a/src/EllieBot/Modules/Administration/UserPunish/UserPunishService.cs b/src/EllieBot/Modules/Administration/UserPunish/UserPunishService.cs index 7b31658..2b9e00d 100644 --- a/src/EllieBot/Modules/Administration/UserPunish/UserPunishService.cs +++ b/src/EllieBot/Modules/Administration/UserPunish/UserPunishService.cs @@ -1,7 +1,9 @@ #nullable disable using LinqToDB; using LinqToDB.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using EllieBot.Common.ModuleBehaviors; +using EllieBot.Common.TypeReaders.Models; using EllieBot.Modules.Permissions.Services; using EllieBot.Db.Models; using Newtonsoft.Json; @@ -81,24 +83,17 @@ public class UserPunishService : IEService, IReadyExecutor }; long previousCount; - var ps = await WarnPunishList(guildId); + List ps; await using (var uow = _db.GetDbContext()) { - previousCount = uow.GetTable() - .Where(w => w.GuildId == guildId && w.UserId == userId && !w.Forgiven) + ps = uow.GuildConfigsForId(guildId, set => set.Include(x => x.WarnPunishments)).WarnPunishments; + + previousCount = uow.Set() + .ForId(guildId, userId) + .Where(w => !w.Forgiven && w.UserId == userId) .Sum(x => x.Weight); - await uow.GetTable() - .InsertAsync(() => new() - { - UserId = userId, - GuildId = guildId, - Forgiven = false, - Reason = reason, - Moderator = modName, - Weight = weight, - DateAdded = DateTime.UtcNow, - }); + uow.Set().Add(warn); await uow.SaveChangesAsync(); } @@ -249,7 +244,7 @@ public class UserPunishService : IEService, IReadyExecutor { await using var uow = _db.GetDbContext(); - var toClear = await uow.GetTable() + var cleared = await uow.GetTable() .Where(x => uow.GetTable() .Count(y => y.GuildId == x.GuildId && y.WarnExpireHours > 0 @@ -261,40 +256,30 @@ public class UserPunishService : IEService, IReadyExecutor .Where(y => x.GuildId == y.GuildId) .Select(y => y.WarnExpireHours) .First())) - .Select(x => x.Id) - .ToListAsyncLinqToDB(); - - var cleared = await uow.GetTable() - .Where(x => toClear.Contains(x.Id)) .UpdateAsync(_ => new() { Forgiven = true, ForgivenBy = "expiry" }); - var toDelete = await uow.GetTable() - .Where(x => uow.GetTable() - .Count(y => y.GuildId == x.GuildId - && y.WarnExpireHours > 0 - && y.WarnExpireAction == WarnExpireAction.Delete) - > 0 - && x.DateAdded - < DateTime.UtcNow.AddHours(-uow.GetTable() - .Where(y => x.GuildId == y.GuildId) - .Select(y => y.WarnExpireHours) - .First())) - .Select(x => x.Id) - .ToListAsyncLinqToDB(); - var deleted = await uow.GetTable() - .Where(x => toDelete.Contains(x.Id)) + .Where(x => uow.GetTable() + .Count(y => y.GuildId == x.GuildId + && y.WarnExpireHours > 0 + && y.WarnExpireAction == WarnExpireAction.Delete) + > 0 + && x.DateAdded + < DateTime.UtcNow.AddHours(-uow.GetTable() + .Where(y => x.GuildId == y.GuildId) + .Select(y => y.WarnExpireHours) + .First())) .DeleteAsync(); if (cleared > 0 || deleted > 0) { Log.Information("Cleared {ClearedWarnings} warnings and deleted {DeletedWarnings} warnings due to expiry", cleared, - toDelete.Count); + deleted); } } @@ -329,11 +314,11 @@ public class UserPunishService : IEService, IReadyExecutor await uow.SaveChangesAsync(); } - public Task<(int, bool)> GetWarnExpire(ulong guildId) + public Task GetWarnExpire(ulong guildId) { using var uow = _db.GetDbContext(); var config = uow.GuildConfigsForId(guildId, set => set); - return Task.FromResult((config.WarnExpireHours / 24, config.WarnExpireAction == WarnExpireAction.Delete)); + return Task.FromResult(config.WarnExpireHours / 24); } public async Task WarnExpireAsync(ulong guildId, int days, bool delete) @@ -382,19 +367,18 @@ public class UserPunishService : IEService, IReadyExecutor return toReturn; } - public async Task WarnPunish( + public bool WarnPunish( ulong guildId, int number, PunishmentAction punish, - TimeSpan? time, + StoopidTime time, IRole role = null) { // these 3 don't make sense with time if (punish is PunishmentAction.Softban or PunishmentAction.Kick or PunishmentAction.RemoveRoles && time is not null) return false; - - if (number <= 0 || (time is not null && time > TimeSpan.FromDays(59))) + if (number <= 0 || (time is not null && time.Time > TimeSpan.FromDays(49))) return false; if (punish is PunishmentAction.AddRole && role is null) @@ -403,51 +387,47 @@ public class UserPunishService : IEService, IReadyExecutor if (punish is PunishmentAction.TimeOut && time is null) return false; - var timeMinutes = (int?)time?.TotalMinutes ?? 0; - var roleId = punish == PunishmentAction.AddRole ? role!.Id : default(ulong?); - await using var uow = _db.GetDbContext(); - await uow.GetTable() - .InsertOrUpdateAsync(() => new() - { - GuildId = guildId, - Count = number, - Punishment = punish, - Time = timeMinutes, - RoleId = roleId - }, - _ => new() - { - Punishment = punish, - Time = timeMinutes, - RoleId = roleId - }, - () => new() - { - GuildId = guildId, - Count = number - }); + using var uow = _db.GetDbContext(); + var ps = uow.GuildConfigsForId(guildId, set => set.Include(x => x.WarnPunishments)).WarnPunishments; + var toDelete = ps.Where(x => x.Count == number); + + uow.RemoveRange(toDelete); + + ps.Add(new() + { + Count = number, + Punishment = punish, + Time = (int?)time?.Time.TotalMinutes ?? 0, + RoleId = punish == PunishmentAction.AddRole ? role!.Id : default(ulong?) + }); + uow.SaveChanges(); return true; } - public async Task WarnPunishRemove(ulong guildId, int count) + public bool WarnPunishRemove(ulong guildId, int number) { - await using var uow = _db.GetDbContext(); - var numDeleted = await uow.GetTable() - .DeleteAsync(x => x.GuildId == guildId && x.Count == count); + if (number <= 0) + return false; - return numDeleted > 0; + using var uow = _db.GetDbContext(); + var ps = uow.GuildConfigsForId(guildId, set => set.Include(x => x.WarnPunishments)).WarnPunishments; + var p = ps.FirstOrDefault(x => x.Count == number); + + if (p is not null) + { + uow.Remove(p); + uow.SaveChanges(); + } + + return true; } - - public async Task WarnPunishList(ulong guildId) + public WarningPunishment[] WarnPunishList(ulong guildId) { - await using var uow = _db.GetDbContext(); - - var wps = uow.GetTable() - .Where(x => x.GuildId == guildId) - .OrderBy(x => x.Count) - .ToArray(); - return wps; + using var uow = _db.GetDbContext(); + return uow.GuildConfigsForId(guildId, gc => gc.Include(x => x.WarnPunishments)) + .WarnPunishments.OrderBy(x => x.Count) + .ToArray(); } public (IReadOnlyCollection<(string Original, ulong? Id, string Reason)> Bans, int Missing) MassKill( @@ -617,12 +597,12 @@ public class UserPunishService : IEService, IReadyExecutor return await _repSvc.ReplaceAsync(output, repCtx); } - public async Task WarnDelete(ulong guildId, ulong userId, int index) + public async Task WarnDelete(ulong userId, int index) { await using var uow = _db.GetDbContext(); var warn = await uow.GetTable() - .Where(x => x.GuildId == guildId && x.UserId == userId) + .Where(x => x.UserId == userId) .OrderByDescending(x => x.DateAdded) .Skip(index) .FirstOrDefaultAsyncLinqToDB(); @@ -636,73 +616,4 @@ public class UserPunishService : IEService, IReadyExecutor return warn; } - - public async Task WarnDelete(ulong guildId, int id) - { - await using var uow = _db.GetDbContext(); - - var numDeleted = await uow.GetTable() - .Where(x => x.GuildId == guildId && x.Id == id) - .DeleteAsync(); - - return numDeleted > 0; - } - - public async Task<(IReadOnlyCollection latest, int totalCount)> GetLatestWarnings( - ulong guildId, - int page = 1) - { - ArgumentOutOfRangeException.ThrowIfNegativeOrZero(page); - - await using var uow = _db.GetDbContext(); - var latest = await uow.GetTable() - .Where(x => x.GuildId == guildId) - .OrderByDescending(x => x.DateAdded) - .Skip(10 * (page - 1)) - .Take(10) - .ToListAsyncLinqToDB(); - - var totalCount = await uow.GetTable() - .Where(x => x.GuildId == guildId) - .CountAsyncLinqToDB(); - - return (latest, totalCount); - } - - public async Task ForgiveWarning(ulong requestGuildId, int warnId, string modName) - { - await using var uow = _db.GetDbContext(); - var success = await uow.GetTable() - .Where(x => x.GuildId == requestGuildId && x.Id == warnId) - .UpdateAsync(_ => new() - { - Forgiven = true, - ForgivenBy = modName, - }) - == 1; - - return success; - } - - public async Task<(IReadOnlyCollection latest, int totalCount)> GetUserWarnings( - ulong guildId, - ulong userId, - int page) - { - ArgumentOutOfRangeException.ThrowIfNegativeOrZero(page); - - await using var uow = _db.GetDbContext(); - var latest = await uow.GetTable() - .Where(x => x.GuildId == guildId && x.UserId == userId) - .OrderByDescending(x => x.DateAdded) - .Skip(10 * (page - 1)) - .Take(10) - .ToListAsyncLinqToDB(); - - var totalCount = await uow.GetTable() - .Where(x => x.GuildId == guildId && x.UserId == userId) - .CountAsyncLinqToDB(); - - return (latest, totalCount); - } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Expressions/EllieExpressionExtensions.cs b/src/EllieBot/Modules/Expressions/EllieExpressionExtensions.cs index 6d8b89c..1ed9504 100644 --- a/src/EllieBot/Modules/Expressions/EllieExpressionExtensions.cs +++ b/src/EllieBot/Modules/Expressions/EllieExpressionExtensions.cs @@ -6,6 +6,49 @@ namespace EllieBot.Modules.EllieExpressions; public static class EllieExpressionExtensions { + private static string ResolveTriggerString(this string str, DiscordSocketClient client) + => str.Replace("%bot.mention%", client.CurrentUser.Mention, StringComparison.Ordinal); + + public static async Task Send( + this EllieExpression cr, + IUserMessage ctx, + IReplacementService repSvc, + DiscordSocketClient client, + IMessageSenderService sender) + { + var channel = cr.DmResponse ? await ctx.Author.CreateDMChannelAsync() : ctx.Channel; + + var trigger = cr.Trigger.ResolveTriggerString(client); + var substringIndex = trigger.Length; + if (cr.ContainsAnywhere) + { + var pos = ctx.Content.AsSpan().GetWordPosition(trigger); + if (pos == WordPosition.Start) + substringIndex += 1; + else if (pos == WordPosition.End) + substringIndex = ctx.Content.Length; + else if (pos == WordPosition.Middle) + substringIndex += ctx.Content.IndexOf(trigger, StringComparison.InvariantCulture); + } + + var canMentionEveryone = (ctx.Author as IGuildUser)?.GuildPermissions.MentionEveryone ?? true; + + var repCtx = new ReplacementContext(client: client, + guild: (ctx.Channel as ITextChannel)?.Guild as SocketGuild, + channel: ctx.Channel, + user: ctx.Author + ) + .WithOverride("%target%", + () => canMentionEveryone + ? ctx.Content[substringIndex..].Trim() + : ctx.Content[substringIndex..].Trim().SanitizeMentions(true)); + + var text = SmartText.CreateFrom(cr.Response); + text = await repSvc.ReplaceAsync(text, repCtx); + + return await sender.Response(channel).Text(text).Sanitize(false).SendAsync(); + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static WordPosition GetWordPosition(this ReadOnlySpan str, in ReadOnlySpan word) { diff --git a/src/EllieBot/Modules/Expressions/EllieExpressions.cs b/src/EllieBot/Modules/Expressions/EllieExpressions.cs index a90b52a..d79539c 100644 --- a/src/EllieBot/Modules/Expressions/EllieExpressions.cs +++ b/src/EllieBot/Modules/Expressions/EllieExpressions.cs @@ -11,10 +11,10 @@ public partial class EllieExpressions : EllieModule All } - private readonly IBotCreds _creds; + private readonly IBotCredentials _creds; private readonly IHttpClientFactory _clientFactory; - public EllieExpressions(IBotCreds creds, IHttpClientFactory clientFactory) + public EllieExpressions(IBotCredentials creds, IHttpClientFactory clientFactory) { _creds = creds; _clientFactory = clientFactory; @@ -404,6 +404,8 @@ public partial class EllieExpressions : EllieModule [Ratelimit(300)] public async Task ExprsImport([Leftover] string input = null) { + // todo cooldown on public bot for 1 day, limit 100 + if (!AdminInGuildOrOwnerInDm()) { await Response().Error(strs.expr_insuff_perms).SendAsync(); diff --git a/src/EllieBot/Modules/Expressions/EllieExpressionsService.cs b/src/EllieBot/Modules/Expressions/EllieExpressionsService.cs index 5e3561d..a660b4d 100644 --- a/src/EllieBot/Modules/Expressions/EllieExpressionsService.cs +++ b/src/EllieBot/Modules/Expressions/EllieExpressionsService.cs @@ -67,6 +67,7 @@ public sealed class EllieExpressionsService : IExecOnMessage, IReadyExecutor // private readonly GlobalPermissionService _gperm; // private readonly CmdCdService _cmdCds; private readonly IPermissionChecker _permChecker; + private readonly ICommandHandler _cmd; private readonly IBotStrings _strings; private readonly IBot _bot; private readonly IPubSub _pubSub; @@ -83,6 +84,7 @@ public sealed class EllieExpressionsService : IExecOnMessage, IReadyExecutor IBotStrings strings, IBot bot, DiscordSocketClient client, + ICommandHandler cmd, IPubSub pubSub, IMessageSenderService sender, IReplacementService repSvc, @@ -91,6 +93,7 @@ public sealed class EllieExpressionsService : IExecOnMessage, IReadyExecutor { _db = db; _client = client; + _cmd = cmd; _strings = strings; _bot = bot; _pubSub = pubSub; @@ -246,54 +249,46 @@ public sealed class EllieExpressionsService : IExecOnMessage, IReadyExecutor try { - if (guild is not SocketGuild sg) - return false; - - var result = await _permChecker.CheckPermsAsync( - guild, - msg.Channel, - msg.Author, - "ACTUALEXPRESSIONS", - expr.Trigger - ); - - if (!result.IsAllowed) + if (guild is SocketGuild sg) { - var cache = _pc.GetCacheFor(guild.Id); - if (cache.Verbose) + var result = await _permChecker.CheckPermsAsync( + guild, + msg.Channel, + msg.Author, + "ACTUALEXPRESSIONS", + expr.Trigger + ); + + if (!result.IsAllowed) { - if (result.TryPickT3(out var disallowed, out _)) + var cache = _pc.GetCacheFor(guild.Id); + if (cache.Verbose) { - var permissionMessage = _strings.GetText(strs.perm_prevent(disallowed.PermIndex + 1, - Format.Bold(disallowed.PermText)), - sg.Id); - - try + if (result.TryPickT3(out var disallowed, out _)) { - await _sender.Response(msg.Channel) - .Error(permissionMessage) - .SendAsync(); - } - catch - { - } + var permissionMessage = _strings.GetText(strs.perm_prevent(disallowed.PermIndex + 1, + Format.Bold(disallowed.PermText)), + sg.Id); - Log.Information("{PermissionMessage}", permissionMessage); + try + { + await _sender.Response(msg.Channel) + .Error(permissionMessage) + .SendAsync(); + } + catch + { + } + + Log.Information("{PermissionMessage}", permissionMessage); + } } - } - return true; + return true; + } } - var cu = sg.CurrentUser; - - var channel = expr.DmResponse ? await msg.Author.CreateDMChannelAsync() : msg.Channel; - - // have no perms to speak in that channel - if (channel is ITextChannel tc && !cu.GetPermissions(tc).SendMessages) - return false; - - var sentMsg = await Send(expr, msg, channel); + var sentMsg = await expr.Send(msg, _repSvc, _client, _sender); var reactions = expr.GetReactions(); foreach (var reaction in reactions) @@ -341,47 +336,6 @@ public sealed class EllieExpressionsService : IExecOnMessage, IReadyExecutor return false; } - - public string ResolveTriggerString(string str) - => str.Replace("%bot.mention%", _client.CurrentUser.Mention, StringComparison.Ordinal); - - public async Task Send( - EllieExpression cr, - IUserMessage ctx, - IMessageChannel channel - ) - { - var trigger = ResolveTriggerString(cr.Trigger); - var substringIndex = trigger.Length; - if (cr.ContainsAnywhere) - { - var pos = ctx.Content.AsSpan().GetWordPosition(trigger); - if (pos == WordPosition.Start) - substringIndex += 1; - else if (pos == WordPosition.End) - substringIndex = ctx.Content.Length; - else if (pos == WordPosition.Middle) - substringIndex += ctx.Content.IndexOf(trigger, StringComparison.InvariantCulture); - } - - var canMentionEveryone = (ctx.Author as IGuildUser)?.GuildPermissions.MentionEveryone ?? true; - - var repCtx = new ReplacementContext(client: _client, - guild: (ctx.Channel as ITextChannel)?.Guild as SocketGuild, - channel: ctx.Channel, - user: ctx.Author - ) - .WithOverride("%target%", - () => canMentionEveryone - ? ctx.Content[substringIndex..].Trim() - : ctx.Content[substringIndex..].Trim().SanitizeMentions(true)); - - var text = SmartText.CreateFrom(cr.Response); - text = await _repSvc.ReplaceAsync(text, repCtx); - - return await _sender.Response(channel).Text(text).Sanitize(false).SendAsync(); - } - public async Task ResetExprReactions(ulong? maybeGuildId, int id) { EllieExpression expr; @@ -835,7 +789,7 @@ public sealed class EllieExpressionsService : IExecOnMessage, IReadyExecutor if (newguildExpressions.TryGetValue(guildId, out var exprs)) { - return (exprs.Where(x => x.Trigger.Contains(query) || x.Response.Contains(query)) + return (exprs.Where(x => x.Trigger.Contains(query)) .Skip(page * 9) .Take(9) .ToArray(), exprs.Length); diff --git a/src/EllieBot/Modules/Gambling/AnimalRacing/AnimalRace.cs b/src/EllieBot/Modules/Gambling/AnimalRacing/AnimalRace.cs index 65d7ae0..84f10d4 100644 --- a/src/EllieBot/Modules/Gambling/AnimalRacing/AnimalRace.cs +++ b/src/EllieBot/Modules/Gambling/AnimalRacing/AnimalRace.cs @@ -6,10 +6,6 @@ namespace EllieBot.Modules.Gambling.Common.AnimalRacing; public sealed class AnimalRace : IDisposable { - public const double BASE_MULTIPLIER = 0.82; - public const double MAX_MULTIPLIER = 0.94; - public const double MULTI_PER_USER = 0.01; - public enum Phase { WaitingForPlayers, @@ -104,7 +100,7 @@ public sealed class AnimalRace : IDisposable foreach (var user in _users) { if (user.Bet > 0) - await _currency.AddAsync(user.UserId, (long)(user.Bet + BASE_MULTIPLIER), new("animalrace", "refund")); + await _currency.AddAsync(user.UserId, user.Bet, new("animalrace", "refund")); } _ = OnStartingFailed?.Invoke(this); @@ -120,7 +116,7 @@ public sealed class AnimalRace : IDisposable { foreach (var user in _users) { - user.Progress += rng.Next(1, 10); + user.Progress += rng.Next(1, 11); if (user.Progress >= 60) user.Progress = 60; } @@ -130,15 +126,13 @@ public sealed class AnimalRace : IDisposable FinishedUsers.AddRange(finished); _ = OnStateUpdate?.Invoke(this); - await Task.Delay(1750); + await Task.Delay(2500); } if (FinishedUsers[0].Bet > 0) { - Multi = FinishedUsers.Count - * Math.Min(MAX_MULTIPLIER, BASE_MULTIPLIER + (MULTI_PER_USER * FinishedUsers.Count)); await _currency.AddAsync(FinishedUsers[0].UserId, - (long)(FinishedUsers[0].Bet * Multi), + FinishedUsers[0].Bet * (_users.Count - 1), new("animalrace", "win")); } @@ -146,8 +140,6 @@ public sealed class AnimalRace : IDisposable }); } - public double Multi { get; set; } = BASE_MULTIPLIER; - public void Dispose() { CurrentPhase = Phase.Ended; diff --git a/src/EllieBot/Modules/Gambling/AnimalRacing/AnimalRacingCommands.cs b/src/EllieBot/Modules/Gambling/AnimalRacing/AnimalRacingCommands.cs index 04356df..1f23cf6 100644 --- a/src/EllieBot/Modules/Gambling/AnimalRacing/AnimalRacingCommands.cs +++ b/src/EllieBot/Modules/Gambling/AnimalRacing/AnimalRacingCommands.cs @@ -12,7 +12,7 @@ namespace EllieBot.Modules.Gambling; public partial class Gambling { [Group] - public partial class AnimalRacingCommands : GamblingModule + public partial class AnimalRacingCommands : GamblingSubmodule { private readonly ICurrencyService _cs; private readonly DiscordSocketClient _client; @@ -74,14 +74,10 @@ public partial class Gambling if (race.FinishedUsers[0].Bet > 0) { return Response() - .Embed(_sender.CreateEmbed() - .WithOkColor() - .WithTitle(GetText(strs.animal_race)) - .WithDescription(GetText(strs.animal_race_won_money( - Format.Bold(winner.Username), - winner.Animal.Icon, - N(race.FinishedUsers[0].Bet * race.Multi)))) - .WithFooter($"x{race.Multi:F2}")) + .Confirm(GetText(strs.animal_race), + GetText(strs.animal_race_won_money(Format.Bold(winner.Username), + winner.Animal.Icon, + (race.FinishedUsers[0].Bet * (race.Users.Count - 1)) + CurrencySign))) .SendAsync(); } @@ -117,14 +113,14 @@ public partial class Gambling private async Task Ar_OnStateUpdate(AnimalRace race) { - var text = $@"|🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁🔚| + var text = $@"|🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🔚| {string.Join("\n", race.Users.Select(p => { var index = race.FinishedUsers.IndexOf(p); var extra = index == -1 ? "" : $"#{index + 1} {(index == 0 ? "🏆" : "")}"; return $"{(int)(p.Progress / 60f * 100),-2}%|{new string('‣', p.Progress) + p.Animal.Icon + extra}"; }))} -|🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁 🏁🔚|"; +|🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🏁🔚|"; var msg = raceMessage; @@ -133,10 +129,10 @@ public partial class Gambling else { await msg.ModifyAsync(x => x.Embed = _sender.CreateEmbed() - .WithTitle(GetText(strs.animal_race)) - .WithDescription(text) - .WithOkColor() - .Build()); + .WithTitle(GetText(strs.animal_race)) + .WithDescription(text) + .WithOkColor() + .Build()); } } diff --git a/src/EllieBot/Modules/Gambling/Bank/BankCommands.cs b/src/EllieBot/Modules/Gambling/Bank/BankCommands.cs index 1005763..ee66b6e 100644 --- a/src/EllieBot/Modules/Gambling/Bank/BankCommands.cs +++ b/src/EllieBot/Modules/Gambling/Bank/BankCommands.cs @@ -73,7 +73,7 @@ public partial class Gambling await Response().Error(strs.cant_dm).SendAsync(); } } - + [Cmd] [OwnerOnly] public async Task BankBalance([Leftover] IUser user) diff --git a/src/EllieBot/Modules/Gambling/BetStatsCommands.cs b/src/EllieBot/Modules/Gambling/BetStatsCommands.cs deleted file mode 100644 index 4fe5c11..0000000 --- a/src/EllieBot/Modules/Gambling/BetStatsCommands.cs +++ /dev/null @@ -1,175 +0,0 @@ -#nullable disable -using EllieBot.Modules.Gambling.Common; -using EllieBot.Modules.Gambling.Services; - -namespace EllieBot.Modules.Gambling; - -public partial class Gambling -{ - [Group] - public sealed class BetStatsCommands : GamblingModule - { - private readonly GamblingTxTracker _gamblingTxTracker; - - public BetStatsCommands( - GamblingTxTracker gamblingTxTracker, - GamblingConfigService gcs) - : base(gcs) - { - _gamblingTxTracker = gamblingTxTracker; - } - - [Cmd] - public async Task BetStatsReset(GamblingGame? game = null) - { - var price = await _service.GetResetStatsPriceAsync(ctx.User.Id, game); - - var result = await PromptUserConfirmAsync(_sender.CreateEmbed() - .WithDescription( - $""" - Are you sure you want to reset your bet stats for **{GetGameName(game)}**? - - It will cost you {N(price)} - """)); - - if (!result) - return; - - var success = await _service.ResetStatsAsync(ctx.User.Id, game); - - if (success) - { - await ctx.OkAsync(); - } - else - { - await Response() - .Error(strs.not_enough(CurrencySign)) - .SendAsync(); - } - } - - private string GetGameName(GamblingGame? game) - { - if (game is null) - return "all games"; - - return game.ToString(); - } - - [Cmd] - [Priority(3)] - public async Task BetStats() - => await BetStats(ctx.User, null); - - [Cmd] - [Priority(2)] - public async Task BetStats(GamblingGame game) - => await BetStats(ctx.User, game); - - [Cmd] - [Priority(1)] - public async Task BetStats([Leftover] IUser user) - => await BetStats(user, null); - - [Cmd] - [Priority(0)] - public async Task BetStats(IUser user, GamblingGame? game) - { - var stats = await _gamblingTxTracker.GetUserStatsAsync(user.Id, game); - - if (stats.Count == 0) - stats = new() - { - new() - { - TotalBet = 1 - } - }; - - var eb = _sender.CreateEmbed() - .WithOkColor() - .WithAuthor(user) - .AddField("Total Won", N(stats.Sum(x => x.PaidOut)), true) - .AddField("Biggest Win", N(stats.Max(x => x.MaxWin)), true) - .AddField("Biggest Bet", N(stats.Max(x => x.MaxBet)), true) - .AddField("# Bets", stats.Sum(x => x.WinCount + x.LoseCount), true) - .AddField("Payout", - (stats.Sum(x => x.PaidOut) / stats.Sum(x => x.TotalBet)).ToString("P2", Culture), - true); - if (game == null) - { - var favGame = stats.MaxBy(x => x.WinCount + x.LoseCount); - eb.AddField("Favorite Game", - favGame.Game + "\n" + Format.Italics((favGame.WinCount + favGame.LoseCount) + " plays"), - true); - } - else - { - eb.WithDescription(game.ToString()) - .AddField("# Wins", stats.Sum(x => x.WinCount), true); - } - - await Response() - .Embed(eb) - .SendAsync(); - } - - [Cmd] - public async Task GambleStats() - { - var stats = await _gamblingTxTracker.GetAllAsync(); - - var eb = _sender.CreateEmbed() - .WithOkColor(); - - var str = "` Feature `|` Bet `|`Paid Out`|` RoI `\n"; - str += "――――――――――――――――――――\n"; - foreach (var stat in stats) - { - var perc = (stat.PaidOut / stat.Bet).ToString("P2", Culture); - str += $"`{stat.Feature.PadBoth(9)}`" - + $"|`{stat.Bet.ToString("N0").PadLeft(8, ' ')}`" - + $"|`{stat.PaidOut.ToString("N0").PadLeft(8, ' ')}`" - + $"|`{perc.PadLeft(6, ' ')}`\n"; - } - - var bet = stats.Sum(x => x.Bet); - var paidOut = stats.Sum(x => x.PaidOut); - - if (bet == 0) - bet = 1; - - var tPerc = (paidOut / bet).ToString("P2", Culture); - str += "――――――――――――――――――――\n"; - str += $"` {("TOTAL").PadBoth(7)}` " - + $"|**{N(bet).PadLeft(8, ' ')}**" - + $"|**{N(paidOut).PadLeft(8, ' ')}**" - + $"|`{tPerc.PadLeft(6, ' ')}`"; - - eb.WithDescription(str); - - await Response().Embed(eb).SendAsync(); - } - - [Cmd] - [OwnerOnly] - public async Task GambleStatsReset() - { - if (!await PromptUserConfirmAsync(_sender.CreateEmbed() - .WithDescription( - """ - Are you sure? - This will completely reset Gambling Stats. - - This action is irreversible. - """))) - return; - - await GambleStats(); - await _service.ResetGamblingStatsAsync(); - - await ctx.OkAsync(); - } - } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Gambling/BlackJack/BlackJackCommands.cs b/src/EllieBot/Modules/Gambling/BlackJack/BlackJackCommands.cs index 14798e9..772cb4f 100644 --- a/src/EllieBot/Modules/Gambling/BlackJack/BlackJackCommands.cs +++ b/src/EllieBot/Modules/Gambling/BlackJack/BlackJackCommands.cs @@ -8,7 +8,7 @@ namespace EllieBot.Modules.Gambling; public partial class Gambling { - public partial class BlackJackCommands : GamblingModule + public partial class BlackJackCommands : GamblingSubmodule { public enum BjAction { diff --git a/src/EllieBot/Modules/Gambling/Connect4/Connect4.cs b/src/EllieBot/Modules/Gambling/Connect4/Connect4.cs index 0824a68..02537fd 100644 --- a/src/EllieBot/Modules/Gambling/Connect4/Connect4.cs +++ b/src/EllieBot/Modules/Gambling/Connect4/Connect4.cs @@ -125,14 +125,14 @@ public sealed class Connect4Game : IDisposable CurrentPhase = Phase.P1Move; //start the game playerTimeoutTimer = new(async _ => + { + await _locker.WaitAsync(); + try { - await _locker.WaitAsync(); - try - { - EndGame(Result.OtherPlayerWon, OtherPlayer.UserId); - } - finally { _locker.Release(); } - }, + EndGame(Result.OtherPlayerWon, OtherPlayer.UserId); + } + finally { _locker.Release(); } + }, null, TimeSpan.FromSeconds(_options.TurnTimer), TimeSpan.FromSeconds(_options.TurnTimer)); diff --git a/src/EllieBot/Modules/Gambling/Connect4/Connect4Commands.cs b/src/EllieBot/Modules/Gambling/Connect4/Connect4Commands.cs index ca2900c..3b3aad1 100644 --- a/src/EllieBot/Modules/Gambling/Connect4/Connect4Commands.cs +++ b/src/EllieBot/Modules/Gambling/Connect4/Connect4Commands.cs @@ -9,7 +9,7 @@ namespace EllieBot.Modules.Gambling; public partial class Gambling { [Group] - public partial class Connect4Commands : GamblingModule + public partial class Connect4Commands : GamblingSubmodule { private static readonly string[] _numbers = [ @@ -81,7 +81,8 @@ public partial class Gambling if (success) { - try { await arg.DeleteAsync(); } + try + { await arg.DeleteAsync(); } catch { } } else @@ -91,7 +92,8 @@ public partial class Gambling RepostCounter++; if (RepostCounter == 0) { - try { msg = await Response().Embed(msg.Embeds.First().ToEmbedBuilder()).SendAsync(); } + try + { msg = await Response().Embed(msg.Embeds.First().ToEmbedBuilder()).SendAsync(); } catch { } } } diff --git a/src/EllieBot/Modules/Gambling/Draw/DrawCommands.cs b/src/EllieBot/Modules/Gambling/Draw/DrawCommands.cs index 1bf1986..e39003d 100644 --- a/src/EllieBot/Modules/Gambling/Draw/DrawCommands.cs +++ b/src/EllieBot/Modules/Gambling/Draw/DrawCommands.cs @@ -12,7 +12,7 @@ namespace EllieBot.Modules.Gambling; public partial class Gambling { [Group] - public partial class DrawCommands : GamblingModule + public partial class DrawCommands : GamblingSubmodule { private static readonly ConcurrentDictionary _allDecks = new(); private readonly IImageCache _images; diff --git a/src/EllieBot/Modules/Gambling/Events/CurrencyEventsCommands.cs b/src/EllieBot/Modules/Gambling/Events/CurrencyEventsCommands.cs index 2f959fc..c5e836c 100644 --- a/src/EllieBot/Modules/Gambling/Events/CurrencyEventsCommands.cs +++ b/src/EllieBot/Modules/Gambling/Events/CurrencyEventsCommands.cs @@ -9,7 +9,7 @@ namespace EllieBot.Modules.Gambling; public partial class Gambling { [Group] - public partial class CurrencyEventsCommands : GamblingModule + public partial class CurrencyEventsCommands : GamblingSubmodule { public CurrencyEventsCommands(GamblingConfigService gamblingConf) : base(gamblingConf) diff --git a/src/EllieBot/Modules/Gambling/Events/GameStatusEvent.cs b/src/EllieBot/Modules/Gambling/Events/GameStatusEvent.cs index 73b97c0..1c461d6 100644 --- a/src/EllieBot/Modules/Gambling/Events/GameStatusEvent.cs +++ b/src/EllieBot/Modules/Gambling/Events/GameStatusEvent.cs @@ -54,7 +54,6 @@ public class GameStatusEvent : ICurrencyEvent _opts = opt; _sender = sender; // generate code - _code = new kwum(_rng.Next(1_000_000, 10_000_000)).ToString(); _t = new(OnTimerTick, null, Timeout.InfiniteTimeSpan, TimeSpan.FromSeconds(2)); @@ -85,7 +84,7 @@ public class GameStatusEvent : ICurrencyEvent if (_isPotLimited) { await msg.ModifyAsync(m => - { + { m.Embed = GetEmbed(PotSize).Build(); }); } diff --git a/src/EllieBot/Modules/Gambling/FlipCoin/FlipCoinCommands.cs b/src/EllieBot/Modules/Gambling/FlipCoin/FlipCoinCommands.cs index 8f3f589..2704495 100644 --- a/src/EllieBot/Modules/Gambling/FlipCoin/FlipCoinCommands.cs +++ b/src/EllieBot/Modules/Gambling/FlipCoin/FlipCoinCommands.cs @@ -11,7 +11,7 @@ namespace EllieBot.Modules.Gambling; public partial class Gambling { [Group] - public partial class FlipCoinCommands : GamblingModule + public partial class FlipCoinCommands : GamblingSubmodule { public enum BetFlipGuess : byte { diff --git a/src/EllieBot/Modules/Gambling/Gambling.cs b/src/EllieBot/Modules/Gambling/Gambling.cs index 95f66a9..64fedf5 100644 --- a/src/EllieBot/Modules/Gambling/Gambling.cs +++ b/src/EllieBot/Modules/Gambling/Gambling.cs @@ -1,7 +1,6 @@ #nullable disable using LinqToDB; using LinqToDB.EntityFrameworkCore; -using LinqToDB.Tools; using EllieBot.Db.Models; using EllieBot.Modules.Gambling.Bank; using EllieBot.Modules.Gambling.Common; @@ -14,13 +13,6 @@ using System.Text; using EllieBot.Modules.Gambling.Rps; using EllieBot.Common.TypeReaders; using EllieBot.Modules.Patronage; -using SixLabors.Fonts; -using SixLabors.Fonts.Unicode; -using SixLabors.ImageSharp; -using SixLabors.ImageSharp.Drawing.Processing; -using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing; -using Color = SixLabors.ImageSharp.Color; namespace EllieBot.Modules.Gambling; @@ -33,12 +25,10 @@ public partial class Gambling : GamblingModule private readonly NumberFormatInfo _enUsCulture; private readonly DownloadTracker _tracker; private readonly GamblingConfigService _configService; - private readonly FontProvider _fonts; private readonly IBankService _bank; private readonly IRemindService _remind; private readonly GamblingTxTracker _gamblingTxTracker; private readonly IPatronageService _ps; - private readonly RakebackService _rb; public Gambling( IGamblingService gs, @@ -47,12 +37,10 @@ public partial class Gambling : GamblingModule DiscordSocketClient client, DownloadTracker tracker, GamblingConfigService configService, - FontProvider fonts, IBankService bank, IRemindService remind, IPatronageService patronage, - GamblingTxTracker gamblingTxTracker, - RakebackService rb) + GamblingTxTracker gamblingTxTracker) : base(configService) { _gs = gs; @@ -62,16 +50,13 @@ public partial class Gambling : GamblingModule _bank = bank; _remind = remind; _gamblingTxTracker = gamblingTxTracker; - _rb = rb; _ps = patronage; - _rng = new EllieRandom(); _enUsCulture = new CultureInfo("en-US", false).NumberFormat; _enUsCulture.NumberDecimalDigits = 0; _enUsCulture.NumberGroupSeparator = " "; _tracker = tracker; _configService = configService; - _fonts = fonts; } public async Task GetBalanceStringAsync(ulong userId) @@ -80,6 +65,42 @@ public partial class Gambling : GamblingModule return N(bal); } + [Cmd] + public async Task BetStats() + { + var stats = await _gamblingTxTracker.GetAllAsync(); + + var eb = _sender.CreateEmbed() + .WithOkColor(); + + var str = "` Feature `|`   Bet  `|`Paid Out`|`  RoI  `\n"; + str += "――――――――――――――――――――\n"; + foreach (var stat in stats) + { + var perc = (stat.PaidOut / stat.Bet).ToString("P2", Culture); + str += $"`{stat.Feature.PadBoth(9)}`" + + $"|`{stat.Bet.ToString("N0").PadLeft(8, ' ')}`" + + $"|`{stat.PaidOut.ToString("N0").PadLeft(8, ' ')}`" + + $"|`{perc.PadLeft(6, ' ')}`\n"; + } + + var bet = stats.Sum(x => x.Bet); + var paidOut = stats.Sum(x => x.PaidOut); + + if (bet == 0) + bet = 1; + + var tPerc = (paidOut / bet).ToString("P2", Culture); + str += "――――――――――――――――――――\n"; + str += $"` {("TOTAL").PadBoth(7)}` " + + $"|**{N(bet).PadLeft(8, ' ')}**" + + $"|**{N(paidOut).PadLeft(8, ' ')}**" + + $"|`{tPerc.PadLeft(6, ' ')}`"; + + eb.WithDescription(str); + + await Response().Embed(eb).SendAsync(); + } private async Task RemindTimelyAction(SocketMessageComponent smc, DateTime when) { @@ -106,7 +127,7 @@ public partial class Gambling : GamblingModule customId: "timely:remind_me"), (smc) => RemindTimelyAction(smc, DateTime.UtcNow.Add(TimeSpan.FromHours(period))) ); - + // Creates timely reminder button, parameter in milliseconds. private EllieInteractionBase CreateRemindMeInteraction(double ms) => _inter @@ -118,21 +139,7 @@ public partial class Gambling : GamblingModule (smc) => RemindTimelyAction(smc, DateTime.UtcNow.Add(TimeSpan.FromMilliseconds(ms))) ); - private EllieInteractionBase CreateTimelyInteraction() - => _inter - .Create(ctx.User.Id, - new ButtonBuilder( - label: "Timely", - emote: Emoji.Parse("💰"), - customId: "timely:" + _rng.Next(123456, 999999)), - async (smc) => - { - await smc.DeferAsync(); - await ClaimTimely(); - }); - [Cmd] - [RequireContext(ContextType.Guild)] public async Task Timely() { var val = Config.Timely.Amount; @@ -143,71 +150,6 @@ public partial class Gambling : GamblingModule return; } - if (Config.Timely.ProtType == TimelyProt.Button) - { - var interaction = CreateTimelyInteraction(); - var msg = await Response().Pending(strs.timely_button).Interaction(interaction).SendAsync(); - await msg.DeleteAsync(); - return; - } - else if (Config.Timely.ProtType == TimelyProt.Captcha) - { - var password = _service.GeneratePassword(); - - var img = new Image(70, 35); - - var font = _fonts.NotoSans.CreateFont(30); - var outlinePen = new SolidPen(Color.Black, 1f); - var strikeoutRun = new RichTextRun - { - Start = 0, - End = password.GetGraphemeCount(), - Font = font, - StrikeoutPen = new SolidPen(Color.White, 3), - TextDecorations = TextDecorations.Strikeout - }; - // draw password on the image - img.Mutate(x => - { - x.DrawText(new RichTextOptions(font) - { - HorizontalAlignment = HorizontalAlignment.Center, - VerticalAlignment = VerticalAlignment.Center, - FallbackFontFamilies = _fonts.FallBackFonts, - Origin = new(35, 17), - TextRuns = [strikeoutRun] - }, - password, - Brushes.Solid(Color.White), - outlinePen); - }); - using var stream = await img.ToStreamAsync(); - var captcha = await Response() - // .Embed(_sender.CreateEmbed() - // .WithOkColor() - // .WithImageUrl("attachment://timely.png")) - .File(stream, "timely.png") - .SendAsync(); - try - { - var userInput = await GetUserInputAsync(ctx.User.Id, ctx.Channel.Id); - if (userInput?.ToLowerInvariant() != password?.ToLowerInvariant()) - { - return; - } - } - finally - { - _ = captcha.DeleteAsync(); - } - } - - await ClaimTimely(); - } - - private async Task ClaimTimely() - { - var period = Config.Timely.Cooldown; if (await _service.ClaimTimelyAsync(ctx.User.Id, period) is { } remainder) { // Get correct time form remainder @@ -224,31 +166,7 @@ public partial class Gambling : GamblingModule await Response().Pending(strs.timely_already_claimed(relativeTag)).Interaction(interaction).SendAsync(); return; } - - - var val = Config.Timely.Amount; - var boostGuilds = Config.BoostBonus.GuildIds ?? new(); - var guildUsers = await boostGuilds - .Select(async gid => - { - try - { - var guild = await _client.Rest.GetGuildAsync(gid, false); - var user = await _client.Rest.GetGuildUserAsync(gid, ctx.User.Id); - return (guild, user); - } - catch - { - return default; - } - }) - .WhenAll(); - - var userInfo = guildUsers.FirstOrDefault(x => x.user?.PremiumSince is not null); - var booster = userInfo != default; - - if (booster) - val += Config.BoostBonus.BaseTimelyBonus; + var patron = await _ps.GetPatronAsync(ctx.User.Id); @@ -260,21 +178,7 @@ public partial class Gambling : GamblingModule await _cs.AddAsync(ctx.User.Id, val, new("timely", "claim")); - var msg = GetText(strs.timely(N(val), period)); - if (booster || percentBonus > float.Epsilon) - { - msg += "\n\n"; - if (booster) - msg += $"*+{N(Config.BoostBonus.BaseTimelyBonus)} bonus for boosting {userInfo.guild}!*\n"; - - if (percentBonus > float.Epsilon) - msg += - $"*+{percentBonus:P0} bonus for the [Patreon](https://patreon.com/elliebot) pledge! <:hart:746995901758832712>*"; - - await Response().Confirm(msg).Interaction(inter).SendAsync(); - } - else - await Response().Confirm(strs.timely(N(val), period)).Interaction(inter).SendAsync(); + await Response().Confirm(strs.timely(N(val), period)).Interaction(inter).SendAsync(); } [Cmd] @@ -385,9 +289,8 @@ public partial class Gambling : GamblingModule } var embed = _sender.CreateEmbed() - .WithTitle(GetText(strs.transactions( - ((SocketGuild)ctx.Guild)?.GetUser(userId)?.ToString() - ?? $"{userId}"))) + .WithTitle(GetText(strs.transactions(((SocketGuild)ctx.Guild)?.GetUser(userId)?.ToString() + ?? $"{userId}"))) .WithOkColor(); var sb = new StringBuilder(); @@ -643,9 +546,7 @@ public partial class Gambling : GamblingModule } else { - await Response() - .Error(strs.take_fail(N(amount), Format.Bold(user.ToString()), CurrencySign)) - .SendAsync(); + await Response().Error(strs.take_fail(N(amount), Format.Bold(user.ToString()), CurrencySign)).SendAsync(); } } @@ -666,9 +567,7 @@ public partial class Gambling : GamblingModule } else { - await Response() - .Error(strs.take_fail(N(amount), Format.Code(usrId.ToString()), CurrencySign)) - .SendAsync(); + await Response().Error(strs.take_fail(N(amount), Format.Code(usrId.ToString()), CurrencySign)).SendAsync(); } } @@ -726,6 +625,8 @@ public partial class Gambling : GamblingModule var (opts, _) = OptionsParser.ParseFrom(new LbOpts(), args); + // List cleanRichest; + // it's pointless to have clean on dm context if (ctx.Guild is null) { opts.Clean = false; @@ -739,18 +640,13 @@ public partial class Gambling : GamblingModule await ctx.Channel.TriggerTypingAsync(); await _tracker.EnsureUsersDownloadedAsync(ctx.Guild); - var users = ((SocketGuild)ctx.Guild).Users.Map(x => x.Id); - var perPage = 9; - await using var uow = _db.GetDbContext(); - var cleanRichest = await uow.GetTable() - .Where(x => x.UserId.In(users)) - .OrderByDescending(x => x.CurrencyAmount) - .Skip(curPage * perPage) - .Take(perPage) - .ToListAsync(); - return cleanRichest; + var cleanRichest = await uow.Set() + .GetTopRichest(_client.CurrentUser.Id, 0, 1000); + + var sg = (SocketGuild)ctx.Guild!; + return cleanRichest.Where(x => sg.GetUser(x.UserId) is not null).ToList(); } else { @@ -759,9 +655,13 @@ public partial class Gambling : GamblingModule } } + var res = Response() + .Paginated(); + await Response() .Paginated() .PageItems(GetTopRichest) + .TotalElements(900) .PageSize(9) .CurrentPage(page) .Page((toSend, curPage) => @@ -862,8 +762,6 @@ public partial class Gambling : GamblingModule private static readonly ImmutableArray _emojis = new[] { "⬆", "↖", "⬅", "↙", "⬇", "↘", "➡", "↗" }.ToImmutableArray(); - private readonly EllieRandom _rng; - [Cmd] public async Task LuckyLadder([OverrideTypeReader(typeof(BalanceTypeReader))] long amount) @@ -1002,45 +900,4 @@ public partial class Gambling : GamblingModule footer: $"Total Bet: {tests} | Payout: {payout:F0} | {payout * 1.0M / tests * 100}%") .SendAsync(); } - - private EllieInteractionBase CreateRakebackInteraction() - => _inter.Create(ctx.User.Id, - new ButtonBuilder( - customId: "cash:rakeback", - emote: new Emoji("💸")), - RakebackAction); - - private async Task RakebackAction(SocketMessageComponent arg) - { - var rb = await _rb.ClaimRakebackAsync(ctx.User.Id); - - if (rb == 0) - { - await arg.DeferAsync(); - return; - } - - await arg.RespondAsync(_sender, GetText(strs.rakeback_claimed(N(rb))), MsgType.Ok); - } - - [Cmd] - public async Task Rakeback() - { - var rb = await _rb.GetRakebackAsync(ctx.User.Id); - - if (rb < 1) - { - await Response() - .Error(strs.rakeback_none) - .SendAsync(); - - return; - } - - var inter = CreateRakebackInteraction(); - await Response() - .Pending(strs.rakeback_available(N(rb))) - .Interaction(inter) - .SendAsync(); - } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Gambling/GamblingConfig.cs b/src/EllieBot/Modules/Gambling/GamblingConfig.cs index 385945d..2571890 100644 --- a/src/EllieBot/Modules/Gambling/GamblingConfig.cs +++ b/src/EllieBot/Modules/Gambling/GamblingConfig.cs @@ -11,7 +11,7 @@ namespace EllieBot.Modules.Gambling.Common; public sealed partial class GamblingConfig : ICloneable { [Comment("""DO NOT CHANGE""")] - public int Version { get; set; } = 12; + public int Version { get; set; } = 8; [Comment("""Currency settings""")] public CurrencyConfig Currency { get; set; } @@ -67,11 +67,6 @@ public sealed partial class GamblingConfig : ICloneable [Comment("""Slot config""")] public SlotsConfig Slots { get; set; } - [Comment(""" - Bonus config for server boosts - """)] - public BoostBonusConfig BoostBonus { get; set; } - public GamblingConfig() { BetRoll = new(); @@ -84,7 +79,6 @@ public sealed partial class GamblingConfig : ICloneable Slots = new(); LuckyLadder = new(); BotCuts = new(); - BoostBonus = new(); } } @@ -110,26 +104,13 @@ public partial class TimelyConfig How much currency will the users get every time they run .timely command setting to 0 or less will disable this feature """)] - public long Amount { get; set; } = 0; + public int Amount { get; set; } = 0; [Comment(""" How often (in hours) can users claim currency with .timely command setting to 0 or less will disable this feature """)] public int Cooldown { get; set; } = 24; - - [Comment(""" - How will timely be protected? - None, Button (users have to click the button) or Captcha (users have to type the captcha from an image) - """)] - public TimelyProt ProtType { get; set; } = TimelyProt.Button; -} - -public enum TimelyProt -{ - None, - Button, - Captcha } [Cloneable] @@ -164,7 +145,7 @@ public partial class BetRollConfig }, new() { - WhenAbove = 65, + WhenAbove = 66, MultiplyBy = 2 } ]; @@ -226,7 +207,7 @@ public partial class LuckyLadderSettings public decimal[] Multipliers { get; set; } public LuckyLadderSettings() - => Multipliers = [2.4M, 1.7M, 1.5M, 1.1M, 0.5M, 0.3M, 0.2M, 0.1M]; + => Multipliers = [2.4M, 1.7M, 1.5M, 1.2M, 0.5M, 0.3M, 0.2M, 0.1M]; } [Cloneable] @@ -293,8 +274,8 @@ public sealed partial class WaifuConfig public class WaifuDecayConfig { [Comment(""" - Unclaimed waifus will decay by this percentage (0 - 100). - Default is 0 (disabled) + Percentage (0 - 100) of the waifu value to reduce. + Set 0 to disable For example if a waifu has a price of 500$, setting this value to 10 would reduce the waifu value by 10% (50$) """)] public int UnclaimedDecayPercent { get; set; } = 0; @@ -302,7 +283,6 @@ public sealed partial class WaifuConfig [Comment(""" Claimed waifus will decay by this percentage (0 - 100). Default is 0 (disabled) - For example if a waifu has a price of 500$, setting this value to 10 would reduce the waifu value by 10% (50$) """)] public int ClaimedDecayPercent { get; set; } = 0; @@ -427,15 +407,4 @@ public sealed partial class BotCutConfig Default 0.1 (10%). """)] public decimal ShopSaleCut { get; set; } = 0.1m; -} - -[Cloneable] -public sealed partial class BoostBonusConfig -{ - [Comment("Users will receive a bonus if they boost any of these servers")] - public List GuildIds { get; set; } = new(); - - [Comment("This bonus will be added before any other multiplier is applied to the .timely command")] - - public long BaseTimelyBonus { get; set; } = 50; } \ No newline at end of file diff --git a/src/EllieBot/Modules/Gambling/GamblingConfigService.cs b/src/EllieBot/Modules/Gambling/GamblingConfigService.cs index c9ed91f..c1ad447 100644 --- a/src/EllieBot/Modules/Gambling/GamblingConfigService.cs +++ b/src/EllieBot/Modules/Gambling/GamblingConfigService.cs @@ -144,11 +144,6 @@ public sealed class GamblingConfigService : ConfigServiceBase ConfigPrinters.ToString, val => val >= 0); - AddParsedProp("timely.prot", - gs => gs.Timely.ProtType, - ConfigParsers.InsensitiveEnum, - ConfigPrinters.ToString); - Migrate(); } @@ -172,6 +167,22 @@ public sealed class GamblingConfigService : ConfigServiceBase }); } + if (data.Version < 5) + { + ModifyConfig(c => + { + c.Version = 5; + }); + } + + if (data.Version < 6) + { + ModifyConfig(c => + { + c.Version = 6; + }); + } + if (data.Version < 7) { ModifyConfig(c => @@ -188,18 +199,5 @@ public sealed class GamblingConfigService : ConfigServiceBase c.Waifu.Decay.UnclaimedDecayPercent = 0; }); } - - if (data.Version < 12) - { - ModifyConfig(c => - { - c.Version = 12; - - if (c.BetRoll.Pairs.Length == 3 && c.BetRoll.Pairs[2].WhenAbove == 66) - { - c.BetRoll.Pairs[2].WhenAbove = 65; - } - }); - } } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Gambling/GamblingService.cs b/src/EllieBot/Modules/Gambling/GamblingService.cs index da76900..f9a55bc 100644 --- a/src/EllieBot/Modules/Gambling/GamblingService.cs +++ b/src/EllieBot/Modules/Gambling/GamblingService.cs @@ -16,7 +16,6 @@ public class GamblingService : IEService, IReadyExecutor private readonly DiscordSocketClient _client; private readonly IBotCache _cache; private readonly GamblingConfigService _gss; - private readonly EllieRandom _rng; private static readonly TypedKey _curDecayKey = new("currency:last_decay"); @@ -30,19 +29,11 @@ public class GamblingService : IEService, IReadyExecutor _client = client; _cache = cache; _gss = gss; - _rng = new EllieRandom(); } public Task OnReadyAsync() => Task.WhenAll(CurrencyDecayLoopAsync(), TransactionClearLoopAsync()); - - public string GeneratePassword() - { - var num = _rng.Next((int)Math.Pow(31, 2), (int)Math.Pow(32, 3)); - return new kwum(num).ToString(); - } - private async Task TransactionClearLoopAsync() { if (_client.ShardId != 0) @@ -61,7 +52,7 @@ public class GamblingService : IEService, IReadyExecutor var days = TimeSpan.FromDays(lifetime); await using var uow = _db.GetDbContext(); await uow.Set() - .DeleteAsync(ct => ct.DateAdded == null || now - ct.DateAdded < days); + .DeleteAsync(ct => ct.DateAdded == null || now - ct.DateAdded < days); } catch (Exception ex) { @@ -99,11 +90,11 @@ public class GamblingService : IEService, IReadyExecutor } Log.Information(""" - --- Decaying users' currency --- - | decay: {ConfigDecayPercent}% - | max: {MaxDecay} - | threshold: {DecayMinTreshold} - """, + --- Decaying users' currency --- + | decay: {ConfigDecayPercent}% + | max: {MaxDecay} + | threshold: {DecayMinTreshold} + """, config.Decay.Percent * 100, maxDecay, config.Decay.MinThreshold); @@ -113,14 +104,14 @@ public class GamblingService : IEService, IReadyExecutor var decay = (double)config.Decay.Percent; await uow.Set() - .Where(x => x.CurrencyAmount > config.Decay.MinThreshold && x.UserId != _client.CurrentUser.Id) - .UpdateAsync(old => new() - { - CurrencyAmount = - maxDecay > Sql.Round((old.CurrencyAmount * decay) - 0.5) - ? (long)(old.CurrencyAmount - Sql.Round((old.CurrencyAmount * decay) - 0.5)) - : old.CurrencyAmount - maxDecay - }); + .Where(x => x.CurrencyAmount > config.Decay.MinThreshold && x.UserId != _client.CurrentUser.Id) + .UpdateAsync(old => new() + { + CurrencyAmount = + maxDecay > Sql.Round((old.CurrencyAmount * decay) - 0.5) + ? (long)(old.CurrencyAmount - Sql.Round((old.CurrencyAmount * decay) - 0.5)) + : old.CurrencyAmount - maxDecay + }); await uow.SaveChangesAsync(); @@ -187,9 +178,8 @@ public class GamblingService : IEService, IReadyExecutor public bool UserHasTimelyReminder(ulong userId) { var db = _db.GetDbContext(); - return db.GetTable() - .Any(x => x.UserId == userId - && x.Type == ReminderType.Timely); + return db.GetTable().Any(x => x.UserId == userId + && x.Type == ReminderType.Timely); } public async Task RemoveAllTimelyClaimsAsync() diff --git a/src/EllieBot/Modules/Gambling/GamblingTopLevelModule.cs b/src/EllieBot/Modules/Gambling/GamblingTopLevelModule.cs index ae73908..25cbb73 100644 --- a/src/EllieBot/Modules/Gambling/GamblingTopLevelModule.cs +++ b/src/EllieBot/Modules/Gambling/GamblingTopLevelModule.cs @@ -57,4 +57,12 @@ public abstract class GamblingModule : EllieModule return Task.FromResult(true); return InternalCheckBet(amount); } +} + +public abstract class GamblingSubmodule : GamblingModule +{ + protected GamblingSubmodule(GamblingConfigService gamblingConfService) + : base(gamblingConfService) + { + } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Gambling/PlantPick/PlantAndPickCommands.cs b/src/EllieBot/Modules/Gambling/PlantPick/PlantAndPickCommands.cs index 7723a6a..67994c8 100644 --- a/src/EllieBot/Modules/Gambling/PlantPick/PlantAndPickCommands.cs +++ b/src/EllieBot/Modules/Gambling/PlantPick/PlantAndPickCommands.cs @@ -8,7 +8,7 @@ namespace EllieBot.Modules.Gambling; public partial class Gambling { [Group] - public partial class PlantPickCommands : GamblingModule + public partial class PlantPickCommands : GamblingSubmodule { private readonly ILogCommandService _logService; diff --git a/src/EllieBot/Modules/Gambling/PlantPick/PlantPickService.cs b/src/EllieBot/Modules/Gambling/PlantPick/PlantPickService.cs index 5a732a5..37aba9f 100644 --- a/src/EllieBot/Modules/Gambling/PlantPick/PlantPickService.cs +++ b/src/EllieBot/Modules/Gambling/PlantPick/PlantPickService.cs @@ -1,11 +1,8 @@ #nullable disable -using LinqToDB; -using LinqToDB.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using EllieBot.Common.ModuleBehaviors; using EllieBot.Db.Models; using SixLabors.Fonts; -using SixLabors.Fonts.Unicode; using SixLabors.ImageSharp; using SixLabors.ImageSharp.Drawing.Processing; using SixLabors.ImageSharp.PixelFormats; @@ -28,7 +25,6 @@ public class PlantPickService : IEService, IExecNoCommand private readonly EllieRandom _rng; private readonly DiscordSocketClient _client; private readonly GamblingConfigService _gss; - private readonly GamblingService _gs; private readonly ConcurrentHashSet _generationChannels; private readonly SemaphoreSlim _pickLock = new(1, 1); @@ -41,8 +37,7 @@ public class PlantPickService : IEService, IExecNoCommand ICurrencyService cs, CommandHandler cmdHandler, DiscordSocketClient client, - GamblingConfigService gss, - GamblingService gs) + GamblingConfigService gss) { _db = db; _strings = strings; @@ -53,8 +48,7 @@ public class PlantPickService : IEService, IExecNoCommand _rng = new(); _client = client; _gss = gss; - _gs = gs; - + using var uow = db.GetDbContext(); var guildIds = client.Guilds.Select(x => x.Id).ToList(); var configs = uow.Set() @@ -93,7 +87,6 @@ public class PlantPickService : IEService, IExecNoCommand var toDelete = guildConfig.GenerateCurrencyChannelIds.FirstOrDefault(x => x.Equals(toAdd)); if (toDelete is not null) uow.Remove(toDelete); - _generationChannels.TryRemove(cid); enabled = false; } @@ -147,47 +140,29 @@ public class PlantPickService : IEService, IExecNoCommand pass = pass.TrimTo(10, true).ToLowerInvariant(); using var img = Image.Load(curImg); // choose font size based on the image height, so that it's visible - var font = _fonts.NotoSans.CreateFont(img.Height / 11.0f, FontStyle.Bold); + var font = _fonts.NotoSans.CreateFont(img.Height / 12.0f, FontStyle.Bold); img.Mutate(x => { // measure the size of the text to be drawing var size = TextMeasurer.MeasureSize(pass, - new RichTextOptions(font) + new TextOptions(font) { Origin = new PointF(0, 0) }); // fill the background with black, add 5 pixels on each side to make it look better x.FillPolygon(Color.ParseHex("00000080"), - new PointF(1, 1), + new PointF(0, 0), new PointF(size.Width + 5, 0), new PointF(size.Width + 5, size.Height + 10), new PointF(0, size.Height + 10)); - var strikeoutRun = new RichTextRun - { - Start = 0, - End = pass.GetGraphemeCount(), - Font = font, - StrikeoutPen = new SolidPen(Color.White, 2), - TextDecorations = TextDecorations.Strikeout - }; - // draw the password over the background - x.DrawText(new RichTextOptions(font) - { - Origin = new(0, 0), - TextRuns = - [ - strikeoutRun - ] - }, - pass, - new SolidBrush(Color.White)); + x.DrawText(pass, font, Color.White, new(0, 0)); }); // return image as a stream for easy sending var format = img.Metadata.DecodedImageFormat; - return (img.ToStream(format), format?.FileExtensions.FirstOrDefault() ?? "png"); + return (img.ToStream(format), format.FileExtensions.FirstOrDefault() ?? "png"); } private Task PotentialFlowerGeneration(IUserMessage imsg) @@ -233,7 +208,7 @@ public class PlantPickService : IEService, IExecNoCommand + " " + GetText(channel.GuildId, strs.pick_pl(prefix)); - var pw = config.Generation.HasPassword ? _gs.GeneratePassword().ToUpperInvariant() : null; + var pw = config.Generation.HasPassword ? GenerateCurrencyPassword().ToUpperInvariant() : null; IUserMessage sent; var (stream, ext) = await GetRandomCurrencyImageAsync(pw); @@ -257,44 +232,67 @@ public class PlantPickService : IEService, IExecNoCommand return Task.CompletedTask; } + /// + /// Generate a hexadecimal string from 1000 to ffff. + /// + /// A hexadecimal string from 1000 to ffff + private string GenerateCurrencyPassword() + { + // generate a number from 1000 to ffff + var num = _rng.Next(4096, 65536); + // convert it to hexadecimal + return num.ToString("x4"); + } + public async Task PickAsync( ulong gid, ITextChannel ch, ulong uid, string pass) { - long amount; - ulong[] ids; - await using (var uow = _db.GetDbContext()) - { - // this method will sum all plants with that password, - // remove them, and get messageids of the removed plants - - pass = pass?.Trim().TrimTo(10, true)?.ToUpperInvariant(); - // gets all plants in this channel with the same password - var entries = await uow.GetTable() - .Where(x => x.ChannelId == ch.Id && pass == x.Password) - .DeleteWithOutputAsync(); - - if (!entries.Any()) - return 0; - - amount = entries.Sum(x => x.Amount); - ids = entries.Select(x => x.MessageId).ToArray(); - } - - if (amount > 0) - await _cs.AddAsync(uid, amount, new("currency", "collect")); - - + await _pickLock.WaitAsync(); try { - _ = ch.DeleteMessagesAsync(ids); - } - catch { } + long amount; + ulong[] ids; + await using (var uow = _db.GetDbContext()) + { + // this method will sum all plants with that password, + // remove them, and get messageids of the removed plants - // return the amount of currency the user picked - return amount; + pass = pass?.Trim().TrimTo(10, true).ToUpperInvariant(); + // gets all plants in this channel with the same password + var entries = uow.Set() + .AsQueryable() + .Where(x => x.ChannelId == ch.Id && pass == x.Password) + .ToList(); + // sum how much currency that is, and get all of the message ids (so that i can delete them) + amount = entries.Sum(x => x.Amount); + ids = entries.Select(x => x.MessageId).ToArray(); + // remove them from the database + uow.RemoveRange(entries); + + + if (amount > 0) + // give the picked currency to the user + await _cs.AddAsync(uid, amount, new("currency", "collect")); + await uow.SaveChangesAsync(); + } + + try + { + // delete all of the plant messages which have just been picked + _ = ch.DeleteMessagesAsync(ids); + } + catch { } + + // return the amount of currency the user picked + return amount; + } + finally + { + _pickLock.Release(); + } } public async Task SendPlantMessageAsync( diff --git a/src/EllieBot/Modules/Gambling/Shop/ShopCommands.cs b/src/EllieBot/Modules/Gambling/Shop/ShopCommands.cs index 2c2dca6..2d0749e 100644 --- a/src/EllieBot/Modules/Gambling/Shop/ShopCommands.cs +++ b/src/EllieBot/Modules/Gambling/Shop/ShopCommands.cs @@ -10,7 +10,7 @@ namespace EllieBot.Modules.Gambling; public partial class Gambling { [Group] - public partial class ShopCommands : GamblingModule + public partial class ShopCommands : GamblingSubmodule { public enum List { diff --git a/src/EllieBot/Modules/Gambling/Slot/SlotCommands.cs b/src/EllieBot/Modules/Gambling/Slot/SlotCommands.cs index 239b7bc..18c294a 100644 --- a/src/EllieBot/Modules/Gambling/Slot/SlotCommands.cs +++ b/src/EllieBot/Modules/Gambling/Slot/SlotCommands.cs @@ -21,7 +21,7 @@ public enum GamblingError public partial class Gambling { [Group] - public partial class SlotCommands : GamblingModule + public partial class SlotCommands : GamblingSubmodule { private readonly IImageCache _images; private readonly FontProvider _fonts; @@ -167,8 +167,7 @@ public partial class Gambling long ownedAmount; await using (var uow = _db.GetDbContext()) { - ownedAmount = uow.Set() - .FirstOrDefault(x => x.UserId == ctx.User.Id)?.CurrencyAmount + ownedAmount = uow.Set().FirstOrDefault(x => x.UserId == ctx.User.Id)?.CurrencyAmount ?? 0; } diff --git a/src/EllieBot/Modules/Gambling/UserBetStatsService.cs b/src/EllieBot/Modules/Gambling/UserBetStatsService.cs deleted file mode 100644 index 76f7781..0000000 --- a/src/EllieBot/Modules/Gambling/UserBetStatsService.cs +++ /dev/null @@ -1,55 +0,0 @@ -#nullable disable -using LinqToDB; -using LinqToDB.EntityFrameworkCore; -using EllieBot.Db.Models; - -namespace EllieBot.Modules.Gambling.Services; - -public sealed class UserBetStatsService : IEService -{ - private const long RESET_MIN_PRICE = 1000; - private const decimal RESET_TOTAL_MULTIPLIER = 0.002m; - - private readonly DbService _db; - private readonly ICurrencyService _cs; - - public UserBetStatsService(DbService db, ICurrencyService cs) - { - _db = db; - _cs = cs; - } - - public async Task GetResetStatsPriceAsync(ulong userId, GamblingGame? game) - { - await using var ctx = _db.GetDbContext(); - - var totalBet = await ctx.GetTable() - .Where(x => x.UserId == userId && (game == null || x.Game == game)) - .SumAsyncLinqToDB(x => x.TotalBet); - - return Math.Max(RESET_MIN_PRICE, (long)Math.Ceiling(totalBet * RESET_TOTAL_MULTIPLIER)); - } - - public async Task ResetStatsAsync(ulong userId, GamblingGame? game) - { - var price = await GetResetStatsPriceAsync(userId, game); - - if (!await _cs.RemoveAsync(userId, price, new("betstats", "reset"))) - { - return false; - } - - await using var ctx = _db.GetDbContext(); - await ctx.GetTable() - .DeleteAsync(x => x.UserId == userId && (game == null || x.Game == game)); - - return true; - } - - public async Task ResetGamblingStatsAsync() - { - await using var ctx = _db.GetDbContext(); - await ctx.GetTable() - .DeleteAsync(); - } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Gambling/VoteRewardService.cs b/src/EllieBot/Modules/Gambling/VoteRewardService.cs index 6886102..62d861b 100644 --- a/src/EllieBot/Modules/Gambling/VoteRewardService.cs +++ b/src/EllieBot/Modules/Gambling/VoteRewardService.cs @@ -14,13 +14,13 @@ public class VoteModel public class VoteRewardService : IEService, IReadyExecutor { private readonly DiscordSocketClient _client; - private readonly IBotCreds _creds; + private readonly IBotCredentials _creds; private readonly ICurrencyService _currencyService; private readonly GamblingConfigService _gamb; public VoteRewardService( DiscordSocketClient client, - IBotCreds creds, + IBotCredentials creds, ICurrencyService currencyService, GamblingConfigService gamb) { diff --git a/src/EllieBot/Modules/Gambling/Waifus/WaifuClaimCommands.cs b/src/EllieBot/Modules/Gambling/Waifus/WaifuClaimCommands.cs index d52a22b..a25bdd9 100644 --- a/src/EllieBot/Modules/Gambling/Waifus/WaifuClaimCommands.cs +++ b/src/EllieBot/Modules/Gambling/Waifus/WaifuClaimCommands.cs @@ -10,7 +10,7 @@ namespace EllieBot.Modules.Gambling; public partial class Gambling { [Group] - public partial class WaifuClaimCommands : GamblingModule + public partial class WaifuClaimCommands : GamblingSubmodule { public WaifuClaimCommands(GamblingConfigService gamblingConfService) : base(gamblingConfService) @@ -37,45 +37,6 @@ public partial class Gambling await Response().Error(strs.waifu_reset_fail).SendAsync(); } - [Cmd] - [RequireContext(ContextType.Guild)] - public async Task WaifuClaims() - { - await Response() - .Paginated() - .PageItems(async (page) => await _service.GetClaimsAsync(ctx.User.Id, page)) - .Page((items, page) => - { - var eb = _sender.CreateEmbed() - .WithOkColor() - .WithTitle("Waifus"); - - if (items.Count == 0) - { - eb - .WithPendingColor() - .WithDescription(GetText(strs.empty_page)); - - return eb; - } - - for (var i = 0; i < items.Count; i++) - { - var item = items[i]; - eb.AddField($"`#{(page * 9) + 1 + i}` {N(item.Price)}", - $""" - {item.Username} - ||{item.UserId}|| - """, - true - ); - } - - return eb; - }) - .SendAsync(); - } - [Cmd] [RequireContext(ContextType.Guild)] public async Task WaifuClaim(long amount, [Leftover] IUser target) @@ -183,7 +144,7 @@ public partial class Gambling if (targetId == ctx.User.Id) return; - var (w, result, amount) = await _service.DivorceWaifuAsync(ctx.User, targetId); + var (w, result, amount, remaining) = await _service.DivorceWaifuAsync(ctx.User, targetId); if (result == DivorceResult.SucessWithPenalty) { @@ -196,6 +157,14 @@ public partial class Gambling await Response().Confirm(strs.waifu_divorced_notlike(N(amount))).SendAsync(); else if (result == DivorceResult.NotYourWife) await Response().Error(strs.waifu_not_yours).SendAsync(); + else if (remaining is { } rem) + { + await Response() + .Error(strs.waifu_recent_divorce( + Format.Bold(((int)rem.TotalHours).ToString()), + Format.Bold(rem.Minutes.ToString()))) + .SendAsync(); + } } [Cmd] @@ -258,7 +227,7 @@ public partial class Gambling if (page > 100) page = 100; - var waifus = await _service.GetTopWaifusAtPage(page); + var waifus = _service.GetTopWaifusAtPage(page).ToList(); if (waifus.Count == 0) { @@ -283,18 +252,18 @@ public partial class Gambling var claimer = "no one"; string status; - var waifuUsername = w.WaifuName.TrimTo(20); - var claimerUsername = w.ClaimerName?.TrimTo(20); + var waifuUsername = w.Username.TrimTo(20); + var claimerUsername = w.Claimer?.TrimTo(20); - if (w.ClaimerName is not null) - claimer = $"{claimerUsername}"; + if (w.Claimer is not null) + claimer = $"{claimerUsername}#{w.ClaimerDiscrim}"; if (w.Affinity is null) status = $"... but {waifuUsername}'s heart is empty"; - else if (w.Affinity == w.ClaimerName) + else if (w.Affinity + w.AffinityDiscrim == w.Claimer + w.ClaimerDiscrim) status = $"... and {waifuUsername} likes {claimerUsername} too <3"; else - status = $"... but {waifuUsername}'s heart belongs to {w.Affinity.TrimTo(20)}"; - return $"**{waifuUsername}** - claimed by **{claimer}**\n\t{status}"; + status = $"... but {waifuUsername}'s heart belongs to {w.Affinity.TrimTo(20)}#{w.AffinityDiscrim}"; + return $"**{waifuUsername}#{w.Discrim}** - claimed by **{claimer}**\n\t{status}"; } [Cmd] diff --git a/src/EllieBot/Modules/Gambling/Waifus/WaifuService.cs b/src/EllieBot/Modules/Gambling/Waifus/WaifuService.cs index e929ce9..286d9e8 100644 --- a/src/EllieBot/Modules/Gambling/Waifus/WaifuService.cs +++ b/src/EllieBot/Modules/Gambling/Waifus/WaifuService.cs @@ -15,7 +15,7 @@ public class WaifuService : IEService, IReadyExecutor private readonly ICurrencyService _cs; private readonly IBotCache _cache; private readonly GamblingConfigService _gss; - private readonly IBotCreds _creds; + private readonly IBotCredentials _creds; private readonly DiscordSocketClient _client; public WaifuService( @@ -23,7 +23,7 @@ public class WaifuService : IEService, IReadyExecutor ICurrencyService cs, IBotCache cache, GamblingConfigService gss, - IBotCreds creds, + IBotCredentials creds, DiscordSocketClient client) { _db = db; @@ -300,10 +300,10 @@ public class WaifuService : IEService, IReadyExecutor return (oldAff, success, remaining); } - public async Task> GetTopWaifusAtPage(int page, int perPage = 9) + public IEnumerable GetTopWaifusAtPage(int page, int perPage = 9) { - await using var uow = _db.GetDbContext(); - return await uow.Set().GetTop(perPage, page * perPage); + using var uow = _db.GetDbContext(); + return uow.Set().GetTop(perPage, page * perPage); } public ulong GetWaifuUserId(ulong ownerId, string name) @@ -318,20 +318,25 @@ public class WaifuService : IEService, IReadyExecutor private static TypedKey GetAffinityKey(ulong userId) => new($"waifu:affinity:{userId}"); - public async Task<(WaifuInfo, DivorceResult, long)> DivorceWaifuAsync(IUser user, ulong targetId) + public async Task<(WaifuInfo, DivorceResult, long, TimeSpan?)> DivorceWaifuAsync(IUser user, ulong targetId) { DivorceResult result; + TimeSpan? remaining = null; long amount = 0; WaifuInfo w; await using (var uow = _db.GetDbContext()) { w = uow.Set().ByWaifuUserId(targetId); if (w?.Claimer is null || w.Claimer.UserId != user.Id) - { result = DivorceResult.NotYourWife; - } else { + remaining = await _cache.GetRatelimitAsync(GetDivorceKey(user.Id), 6.Hours()); + if (remaining is TimeSpan rem) + { + result = DivorceResult.Cooldown; + return (w, result, amount, rem); + } amount = w.Price / 2; @@ -364,7 +369,7 @@ public class WaifuService : IEService, IReadyExecutor await uow.SaveChangesAsync(); } - return (w, result, amount); + return (w, result, amount, remaining); } public async Task GiftWaifuAsync( @@ -572,7 +577,7 @@ public class WaifuService : IEService, IReadyExecutor { await using var uow = _db.GetDbContext(); await uow.GetTable() - .Where(x => x.Price > minPrice && x.ClaimerId != null) + .Where(x => x.Price > minPrice && x.ClaimerId == null) .UpdateAsync(old => new() { Price = (long)(old.Price * claimedMulti) @@ -598,7 +603,7 @@ public class WaifuService : IEService, IReadyExecutor .Where(wi => wi.ClaimerId == waifuId) .Select(wi => wi.WaifuId) .Contains(x.Id)) - .Select(x => x.Username) + .Select(x => $"{x.Username}#{x.Discriminator}") .ToListAsyncEF(); } @@ -610,7 +615,7 @@ public class WaifuService : IEService, IReadyExecutor .Where(wi => wi.AffinityId == waifuId) .Select(wi => wi.WaifuId) .Contains(x.Id)) - .Select(x => x.Username) + .Select(x => $"{x.Username}#{x.Discriminator}") .ToListAsyncEF(); } @@ -625,38 +630,4 @@ public class WaifuService : IEService, IReadyExecutor .FirstOrDefault()) .ToListAsyncEF(); } - - public async Task> GetClaimsAsync(ulong userId, int page) - { - await using var ctx = _db.GetDbContext(); - - var wid = ctx.GetTable() - .Where(x => x.UserId == userId) - .Select(x => x.Id) - .FirstOrDefault(); - - if (wid == 0) - return []; - - return await ctx.GetTable() - .Where(x => x.ClaimerId == wid) - .LeftJoin(ctx.GetTable(), - (wi, du) => wi.WaifuId == du.Id, - (wi, du) => new WaifuClaimsResult( - du.Username, - du.UserId, - wi.Price - )) - .OrderByDescending(x => x.Price) - .Skip(page * 9) - .Take(9) - .ToListAsyncLinqToDB(); - } -} - -public sealed class WaifuClaimsResult(string username, ulong userId, long price) -{ - public string Username { get; } = username; - public ulong UserId { get; } = userId; - public long Price { get; } = price; } \ No newline at end of file diff --git a/src/EllieBot/Modules/Gambling/Waifus/_common/MultipleWaifuItemsTypeReader.cs b/src/EllieBot/Modules/Gambling/Waifus/_common/MultipleWaifuItemsTypeReader.cs index 21b4c60..bac72c1 100644 --- a/src/EllieBot/Modules/Gambling/Waifus/_common/MultipleWaifuItemsTypeReader.cs +++ b/src/EllieBot/Modules/Gambling/Waifus/_common/MultipleWaifuItemsTypeReader.cs @@ -8,7 +8,7 @@ namespace EllieBot.Modules.Gambling; public partial class MultipleWaifuItemsTypeReader : EllieTypeReader { private readonly WaifuService _service; - + [GeneratedRegex(@"(?:(?\d+)[x*])?(?.+)")] private static partial Regex ItemRegex(); @@ -33,7 +33,7 @@ public partial class MultipleWaifuItemsTypeReader : EllieTypeReader x.Name.ToLowerInvariant() == itemName); @@ -41,7 +41,7 @@ public partial class MultipleWaifuItemsTypeReader : EllieTypeReader wi.Waifu.UserId == userId); } - public static async Task> GetTop(this DbSet waifus, int count, int skip = 0) + public static IEnumerable GetTop(this DbSet waifus, int count, int skip = 0) { ArgumentOutOfRangeException.ThrowIfNegative(count); if (count == 0) return []; - return await waifus.Include(wi => wi.Waifu) - .Include(wi => wi.Affinity) - .Include(wi => wi.Claimer) - .OrderByDescending(wi => wi.Price) - .Skip(skip) - .Take(count) - .Select(x => new WaifuLbResult - { - Affinity = x.Affinity == null - ? null - : x.Affinity.Username, - ClaimerName = - x.Claimer == null - ? null - : x.Claimer.Username, - WaifuName = x.Waifu.Username, - Price = x.Price - }) - .ToListAsyncEF(); + return waifus.Include(wi => wi.Waifu) + .Include(wi => wi.Affinity) + .Include(wi => wi.Claimer) + .OrderByDescending(wi => wi.Price) + .Skip(skip) + .Take(count) + .Select(x => new WaifuLbResult + { + Affinity = x.Affinity == null ? null : x.Affinity.Username, + AffinityDiscrim = x.Affinity == null ? null : x.Affinity.Discriminator, + Claimer = x.Claimer == null ? null : x.Claimer.Username, + ClaimerDiscrim = x.Claimer == null ? null : x.Claimer.Discriminator, + Username = x.Waifu.Username, + Discrim = x.Waifu.Discriminator, + Price = x.Price + }) + .ToList(); } public static decimal GetTotalValue(this DbSet waifus) @@ -59,14 +57,14 @@ public static class WaifuExtensions public static ulong GetWaifuUserId(this DbSet waifus, ulong ownerId, string name) => waifus.AsQueryable() .AsNoTracking() - .Where(x => x.Claimer.UserId == ownerId && x.Waifu.Username == name) + .Where(x => x.Claimer.UserId == ownerId && x.Waifu.Username + "#" + x.Waifu.Discriminator == name) .Select(x => x.Waifu.UserId) .FirstOrDefault(); public static async Task GetWaifuInfoAsync(this DbContext ctx, ulong userId) { await ctx.EnsureUserCreatedAsync(userId); - + await ctx.Set() .ToLinqToDBTable() .InsertOrUpdateAsync(() => new() @@ -97,7 +95,7 @@ public static class WaifuExtensions ctx.Set() .AsQueryable() .Where(u => u.UserId == userId) - .Select(u => u.Username) + .Select(u => u.Username + "#" + u.Discriminator) .FirstOrDefault(), AffinityCount = ctx.Set() @@ -109,14 +107,14 @@ public static class WaifuExtensions ctx.Set() .AsQueryable() .Where(u => u.Id == w.AffinityId) - .Select(u => u.Username) + .Select(u => u.Username + "#" + u.Discriminator) .FirstOrDefault(), ClaimCount = ctx.Set().AsQueryable().Count(x => x.ClaimerId == w.WaifuId), ClaimerName = ctx.Set() .AsQueryable() .Where(u => u.Id == w.ClaimerId) - .Select(u => u.Username) + .Select(u => u.Username + "#" + u.Discriminator) .FirstOrDefault(), DivorceCount = ctx.Set() diff --git a/src/EllieBot/Modules/Gambling/Waifus/db/WaifuItem.cs b/src/EllieBot/Modules/Gambling/Waifus/db/WaifuItem.cs index 8012b02..5b8630f 100644 --- a/src/EllieBot/Modules/Gambling/Waifus/db/WaifuItem.cs +++ b/src/EllieBot/Modules/Gambling/Waifus/db/WaifuItem.cs @@ -7,4 +7,4 @@ public class WaifuItem : DbEntity public int? WaifuInfoId { get; set; } public string ItemEmoji { get; set; } public string Name { get; set; } -} +} \ No newline at end of file diff --git a/src/EllieBot/Modules/Gambling/Waifus/db/WaifuLbResult.cs b/src/EllieBot/Modules/Gambling/Waifus/db/WaifuLbResult.cs index 02c83f2..f83af4f 100644 --- a/src/EllieBot/Modules/Gambling/Waifus/db/WaifuLbResult.cs +++ b/src/EllieBot/Modules/Gambling/Waifus/db/WaifuLbResult.cs @@ -3,11 +3,14 @@ namespace EllieBot.Db.Models; public class WaifuLbResult { - public string WaifuName { get; set; } + public string Username { get; set; } + public string Discrim { get; set; } - public string ClaimerName { get; set; } + public string Claimer { get; set; } + public string ClaimerDiscrim { get; set; } public string Affinity { get; set; } + public string AffinityDiscrim { get; set; } public long Price { get; set; } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Gambling/_common/IGamblingService.cs b/src/EllieBot/Modules/Gambling/_common/IGamblingService.cs index 087950a..77cc2d7 100644 --- a/src/EllieBot/Modules/Gambling/_common/IGamblingService.cs +++ b/src/EllieBot/Modules/Gambling/_common/IGamblingService.cs @@ -13,10 +13,5 @@ public interface IGamblingService Task> SlotAsync(ulong userId, long amount); Task FlipAsync(int count); Task> RpsAsync(ulong userId, long amount, byte pick); - - Task> BetDrawAsync( - ulong userId, - long amount, - byte? maybeGuessValue, - byte? maybeGuessColor); + Task> BetDrawAsync(ulong userId, long amount, byte? maybeGuessValue, byte? maybeGuessColor); } \ No newline at end of file diff --git a/src/EllieBot/Modules/Gambling/_common/NewGamblingService.cs b/src/EllieBot/Modules/Gambling/_common/NewGamblingService.cs index 613cfae..85fa703 100644 --- a/src/EllieBot/Modules/Gambling/_common/NewGamblingService.cs +++ b/src/EllieBot/Modules/Gambling/_common/NewGamblingService.cs @@ -1,6 +1,4 @@ #nullable disable -using LinqToDB; -using LinqToDB.EntityFrameworkCore; using EllieBot.Modules.Gambling.Betdraw; using EllieBot.Modules.Gambling.Rps; using EllieBot.Modules.Gambling.Services; @@ -10,15 +8,15 @@ namespace EllieBot.Modules.Gambling; public sealed class NewGamblingService : IGamblingService, IEService { - private readonly GamblingConfigService _gcs; + private readonly GamblingConfigService _bcs; private readonly ICurrencyService _cs; - public NewGamblingService(GamblingConfigService gcs, ICurrencyService cs) + public NewGamblingService(GamblingConfigService bcs, ICurrencyService cs) { - _gcs = gcs; + _bcs = bcs; _cs = cs; } - + public async Task> LulaAsync(ulong userId, long amount) { ArgumentOutOfRangeException.ThrowIfNegative(amount); @@ -33,13 +31,13 @@ public sealed class NewGamblingService : IGamblingService, IEService } } - var game = new LulaGame(_gcs.Data.LuckyLadder.Multipliers); + var game = new LulaGame(_bcs.Data.LuckyLadder.Multipliers); var result = game.Spin(amount); - + var won = (long)result.Won; if (won > 0) { - await _cs.AddAsync(userId, won, new("lula", result.Multiplier >= 1 ? "win" : "lose")); + await _cs.AddAsync(userId, won, new("lula", "win")); } return result; @@ -59,9 +57,9 @@ public sealed class NewGamblingService : IGamblingService, IEService } } - var game = new BetrollGame(_gcs.Data.BetRoll.Pairs - .Select(x => (x.WhenAbove, (decimal)x.MultiplyBy)) - .ToList()); + var game = new BetrollGame(_bcs.Data.BetRoll.Pairs + .Select(x => (x.WhenAbove, (decimal)x.MultiplyBy)) + .ToList()); var result = game.Roll(amount); @@ -90,23 +88,19 @@ public sealed class NewGamblingService : IGamblingService, IEService } } - var game = new BetflipGame(_gcs.Data.BetFlip.Multiplier); + var game = new BetflipGame(_bcs.Data.BetFlip.Multiplier); var result = game.Flip(guess, amount); - + var won = (long)result.Won; if (won > 0) { await _cs.AddAsync(userId, won, new("betflip", "win")); } - + return result; } - - public async Task> BetDrawAsync( - ulong userId, - long amount, - byte? maybeGuessValue, - byte? maybeGuessColor) + + public async Task> BetDrawAsync(ulong userId, long amount, byte? maybeGuessValue, byte? maybeGuessColor) { ArgumentOutOfRangeException.ThrowIfNegative(amount); @@ -115,7 +109,7 @@ public sealed class NewGamblingService : IGamblingService, IEService if (maybeGuessColor > 1) throw new ArgumentOutOfRangeException(nameof(maybeGuessColor)); - + if (maybeGuessValue > 1) throw new ArgumentOutOfRangeException(nameof(maybeGuessValue)); @@ -131,13 +125,13 @@ public sealed class NewGamblingService : IGamblingService, IEService var game = new BetdrawGame(); var result = game.Draw((BetdrawValueGuess?)maybeGuessValue, (BetdrawColorGuess?)maybeGuessColor, amount); - + var won = (long)result.Won; if (won > 0) { await _cs.AddAsync(userId, won, new("betdraw", "win")); } - + return result; } @@ -161,7 +155,7 @@ public sealed class NewGamblingService : IGamblingService, IEService var won = (long)result.Won; if (won > 0) { - await _cs.AddAsync(userId, won, new("slot", "win")); + await _cs.AddAsync(userId, won, new("slot", "won")); } return result; @@ -184,7 +178,7 @@ public sealed class NewGamblingService : IGamblingService, IEService return Task.FromResult(results); } - + // // // private readonly ConcurrentDictionary _decks = new ConcurrentDictionary(); @@ -242,7 +236,7 @@ public sealed class NewGamblingService : IGamblingService, IEService { ArgumentOutOfRangeException.ThrowIfNegative(amount); ArgumentOutOfRangeException.ThrowIfGreaterThan(pick, 2); - + if (amount > 0) { var isTakeSuccess = await _cs.RemoveAsync(userId, amount, new("rps", "bet")); @@ -255,7 +249,7 @@ public sealed class NewGamblingService : IGamblingService, IEService var rps = new RpsGame(); var result = rps.Play((RpsPick)pick, amount); - + var won = (long)result.Won; if (won > 0) { @@ -271,46 +265,4 @@ public sealed class NewGamblingService : IGamblingService, IEService return result; } -} - -public sealed class RakebackService : IEService -{ - private readonly DbService _db; - private readonly ICurrencyService _cs; - - public RakebackService(DbService db, ICurrencyService cs) - { - _db = db; - _cs = cs; - } - - public async Task GetRakebackAsync(ulong userId) - { - await using var uow = _db.GetDbContext(); - - var rb = uow.GetTable() - .Where(x => x.UserId == userId) - .Select(x => x.Amount) - .FirstOrDefault(); - - return (long)rb; - } - - public async Task ClaimRakebackAsync(ulong userId) - { - await using var uow = _db.GetDbContext(); - - var rbs = await uow.GetTable() - .Where(x => x.UserId == userId) - .DeleteWithOutputAsync((x) => x.Amount); - - if (rbs.Length == 0) - return 0; - - var rb = (long)rbs[0]; - - await _cs.AddAsync(userId, rb, new("rakeback", "claim")); - - return rb; - } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Games/ChatterBot/ChatterBotCommands.cs b/src/EllieBot/Modules/Games/ChatterBot/ChatterBotCommands.cs index 194cf79..ea902c2 100644 --- a/src/EllieBot/Modules/Games/ChatterBot/ChatterBotCommands.cs +++ b/src/EllieBot/Modules/Games/ChatterBot/ChatterBotCommands.cs @@ -29,7 +29,6 @@ public partial class Games } await Response().Confirm(strs.chatbot_enabled).SendAsync(); - } } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Games/ChatterBot/ChatterBotService.cs b/src/EllieBot/Modules/Games/ChatterBot/ChatterbotService.cs similarity index 99% rename from src/EllieBot/Modules/Games/ChatterBot/ChatterBotService.cs rename to src/EllieBot/Modules/Games/ChatterBot/ChatterbotService.cs index 0d2c841..e088319 100644 --- a/src/EllieBot/Modules/Games/ChatterBot/ChatterBotService.cs +++ b/src/EllieBot/Modules/Games/ChatterBot/ChatterbotService.cs @@ -19,7 +19,7 @@ public class ChatterBotService : IExecOnMessage private readonly DiscordSocketClient _client; private readonly IPermissionChecker _perms; - private readonly IBotCreds _creds; + private readonly IBotCredentials _creds; private readonly IHttpClientFactory _httpFactory; private readonly GamesConfigService _gcs; private readonly IMessageSenderService _sender; @@ -32,7 +32,7 @@ public class ChatterBotService : IExecOnMessage IBot bot, IPatronageService ps, IHttpClientFactory factory, - IBotCreds creds, + IBotCredentials creds, GamesConfigService gcs, IMessageSenderService sender, DbService db) diff --git a/src/EllieBot/Modules/Games/ChatterBot/_common/OpenAiApi/OpenAiApiMessage.cs b/src/EllieBot/Modules/Games/ChatterBot/_common/OpenAiApi/OpenAiApiMessage.cs index 9f0a028..20ee90d 100644 --- a/src/EllieBot/Modules/Games/ChatterBot/_common/OpenAiApi/OpenAiApiMessage.cs +++ b/src/EllieBot/Modules/Games/ChatterBot/_common/OpenAiApi/OpenAiApiMessage.cs @@ -6,10 +6,10 @@ public class OpenAiApiMessage { [JsonPropertyName("role")] public required string Role { get; init; } - + [JsonPropertyName("content")] public required string Content { get; init; } - + [JsonPropertyName("name")] public required string Name { get; init; } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Games/ChatterBot/_common/OpenAiApi/OpenAiApiUsageData.cs b/src/EllieBot/Modules/Games/ChatterBot/_common/OpenAiApi/OpenAiApiUsageData.cs index 174af3e..1525dac 100644 --- a/src/EllieBot/Modules/Games/ChatterBot/_common/OpenAiApi/OpenAiApiUsageData.cs +++ b/src/EllieBot/Modules/Games/ChatterBot/_common/OpenAiApi/OpenAiApiUsageData.cs @@ -6,10 +6,10 @@ public class OpenAiApiUsageData { [JsonPropertyName("prompt_tokens")] public int PromptTokens { get; set; } - + [JsonPropertyName("completion_tokens")] public int CompletionTokens { get; set; } - + [JsonPropertyName("total_tokens")] public int TotalTokens { get; set; } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Games/ChatterBot/_common/OpenAiApi/OpenAiCompletionResponse.cs b/src/EllieBot/Modules/Games/ChatterBot/_common/OpenAiApi/OpenAiCompletionResponse.cs index db0b92f..1b7bdcf 100644 --- a/src/EllieBot/Modules/Games/ChatterBot/_common/OpenAiApi/OpenAiCompletionResponse.cs +++ b/src/EllieBot/Modules/Games/ChatterBot/_common/OpenAiApi/OpenAiCompletionResponse.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable using System.Text.Json.Serialization; namespace EllieBot.Modules.Games.Common.ChatterBot; @@ -7,7 +7,7 @@ public class OpenAiCompletionResponse { [JsonPropertyName("choices")] public Choice[] Choices { get; set; } - + [JsonPropertyName("usage")] public OpenAiApiUsageData Usage { get; set; } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Games/ChatterBot/_common/ThinkResult.cs b/src/EllieBot/Modules/Games/ChatterBot/_common/ThinkResult.cs index 3d881e2..d6aa75e 100644 --- a/src/EllieBot/Modules/Games/ChatterBot/_common/ThinkResult.cs +++ b/src/EllieBot/Modules/Games/ChatterBot/_common/ThinkResult.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable namespace EllieBot.Modules.Games.Common.ChatterBot; public sealed class ThinkResult diff --git a/src/EllieBot/Modules/Games/Hangman/HangmanGame.cs b/src/EllieBot/Modules/Games/Hangman/HangmanGame.cs index 58e779b..1625b55 100644 --- a/src/EllieBot/Modules/Games/Hangman/HangmanGame.cs +++ b/src/EllieBot/Modules/Games/Hangman/HangmanGame.cs @@ -1,5 +1,4 @@ #nullable disable - namespace EllieBot.Modules.Games.Hangman; public sealed class HangmanGame diff --git a/src/EllieBot/Modules/Games/NCanvas/INCanvasService.cs b/src/EllieBot/Modules/Games/NCanvas/INCanvasService.cs deleted file mode 100644 index f1c3e02..0000000 --- a/src/EllieBot/Modules/Games/NCanvas/INCanvasService.cs +++ /dev/null @@ -1,24 +0,0 @@ -using EllieBot.Db.Models; - -namespace EllieBot.Modules.Games; - -public interface INCanvasService -{ - Task GetCanvas(); - Task GetPixelGroup(int position); - - Task SetPixel( - int position, - uint color, - string text, - ulong userId, - long price); - - Task SetImage(uint[] img); - - Task GetPixel(int x, int y); - Task GetPixel(int position); - int GetHeight(); - int GetWidth(); - Task ResetAsync(); -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Games/NCanvas/NCanvasCommands.cs b/src/EllieBot/Modules/Games/NCanvas/NCanvasCommands.cs deleted file mode 100644 index 6d37a5e..0000000 --- a/src/EllieBot/Modules/Games/NCanvas/NCanvasCommands.cs +++ /dev/null @@ -1,305 +0,0 @@ -using EllieBot.Modules.Gambling.Services; -using SixLabors.Fonts; -using SixLabors.ImageSharp; -using SixLabors.ImageSharp.Advanced; -using SixLabors.ImageSharp.Drawing.Processing; -using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing; -using Image = SixLabors.ImageSharp.Image; - -namespace EllieBot.Modules.Games; - -public partial class Games -{ - public sealed class NCanvasCommands : EllieModule - { - private readonly INCanvasService _service; - private readonly IHttpClientFactory _http; - private readonly FontProvider _fonts; - private readonly GamblingConfigService _gcs; - - public NCanvasCommands( - INCanvasService service, - IHttpClientFactory http, - FontProvider fonts, - GamblingConfigService gcs) - { - _service = service; - _http = http; - _fonts = fonts; - _gcs = gcs; - } - - [Cmd] - public async Task NCanvas() - { - var pixels = await _service.GetCanvas(); - var image = new Image(_service.GetWidth(), _service.GetHeight()); - - Parallel.For(0, - image.Height, - y => - { - var pixelAccessor = image.DangerousGetPixelRowMemory(y); - var row = pixelAccessor.Span; - for (int x = 0; x < image.Width; x++) - { - row[x] = new Rgba32(pixels[(y * image.Width) + x]); - } - }); - - await using var stream = await image.ToStreamAsync(); - - var hint = GetText(strs.nc_hint(prefix, _service.GetWidth(), _service.GetHeight())); - await Response() - .File(stream, "ncanvas.png") - .Embed(_sender.CreateEmbed() - .WithOkColor() -#if GLOBAL_ELLIE - .WithDescription("This is not available yet.") -#endif - .WithFooter(hint) - .WithImageUrl("attachment://ncanvas.png")) - .SendAsync(); - } - - [Cmd] - public Task NCzoom(int row, int col) - => NCzoom((col * _service.GetWidth()) + row); - - [Cmd] - public async Task NCzoom(kwum position) - { - var w = _service.GetWidth(); - var h = _service.GetHeight(); - - if (position < 0 || position >= w * h) - { - await Response().Error(strs.invalid_input).SendAsync(); - return; - } - - using var img = await GetZoomImage(position); - await using var stream = await img.ToStreamAsync(); - await ctx.Channel.SendFileAsync(stream, $"zoom_{position}.png"); - } - - private async Task> GetZoomImage(kwum position) - { - var w = _service.GetWidth(); - var pixels = await _service.GetPixelGroup(position); - - var origX = ((position % w) - 2) * 100; - var origY = ((position / w) - 2) * 100; - - var image = new Image(500, 500); - - const float fontSize = 30; - - var posFont = _fonts.NotoSans.CreateFont(fontSize, FontStyle.Bold); - var size = TextMeasurer.MeasureSize("wwww", new TextOptions(posFont)); - var scale = 100f / size.Width; - if (scale < 1) - posFont = _fonts.NotoSans.CreateFont(fontSize * scale, FontStyle.Bold); - var outlinePen = new SolidPen(SixLabors.ImageSharp.Color.Black, 1f); - - Parallel.For(0, - pixels.Length, - i => - { - var pix = pixels[i]; - var startX = pix.Position % w * 100 - origX; - var startY = pix.Position / w * 100 - origY; - - var color = new Rgba32(pix.Color); - image.Mutate(x => FillRectangleExtensions.Fill(x, - new SolidBrush(color), - new RectangleF(startX, startY, 100, 100))); - - image.Mutate(x => - { - x.DrawText(new RichTextOptions(posFont) - { - HorizontalAlignment = HorizontalAlignment.Center, - VerticalAlignment = VerticalAlignment.Center, - Origin = new(startX + 50, startY + 50) - }, - ((kwum)pix.Position).ToString().PadLeft(2, '2'), - Brushes.Solid(SixLabors.ImageSharp.Color.White), - outlinePen); - }); - }); - - // write the position on each section of the image - return image; - } - - [Cmd] - public async Task NcSetPixel(kwum position, string colorHex, [Leftover] string text = "") - { - if (position < 0 || position >= _service.GetWidth() * _service.GetHeight()) - { - await Response().Error(strs.invalid_input).SendAsync(); - return; - } - - if (colorHex.StartsWith("0x", StringComparison.OrdinalIgnoreCase)) - colorHex = colorHex[2..]; - - if (!Rgba32.TryParseHex(colorHex, out var clr)) - { - await Response().Error(strs.invalid_color).SendAsync(); - return; - } - - var pixel = await _service.GetPixel(position); - if (pixel is null) - { - await Response().Error(strs.nc_pixel_not_found).SendAsync(); - return; - } - - var prompt = GetText(strs.nc_pixel_set_confirm(Format.Code(position.ToString()), - Format.Bold(CurrencyHelper.N(pixel.Price, - Culture, - _gcs.Data.Currency.Sign)))); - - if (!await PromptUserConfirmAsync(_sender.CreateEmbed() - .WithPendingColor() - .WithDescription(prompt))) - { - return; - } - - var result = await _service.SetPixel(position, clr.PackedValue, text, ctx.User.Id, pixel.Price); - - if (result == SetPixelResult.NotEnoughMoney) - { - await Response().Error(strs.not_enough(_gcs.Data.Currency.Sign)).SendAsync(); - return; - } - else if (result == SetPixelResult.InsufficientPayment) - { - await Response().Error(strs.nc_insuff_payment).SendAsync(); - return; - } - else if (result == SetPixelResult.InvalidInput) - { - await Response().Error(strs.invalid_input).SendAsync(); - return; - } - - using var img = await GetZoomImage(position); - await using var stream = await img.ToStreamAsync(); - - await Response() - .Embed(_sender.CreateEmbed() - .WithOkColor() - .WithDescription(GetText(strs.nc_pixel_set(Format.Code(position.ToString())))) - .WithImageUrl($"attachment://zoom_{position}.png")) - .File(stream, $"zoom_{position}.png") - .SendAsync(); - } - - [Cmd] - public async Task NcPixel(int x, int y) - => await NcPixel((y * _service.GetWidth()) + x); - - [Cmd] - public async Task NcPixel(kwum position) - { - if (position < 0 || position >= _service.GetWidth() * _service.GetHeight()) - { - await Response().Error(strs.invalid_input).SendAsync(); - return; - } - - var pixel = await _service.GetPixel(position); - if (pixel is null) - { - await Response().Error(strs.nc_pixel_not_found).SendAsync(); - return; - } - - var image = new Image(100, 100); - image.Mutate(x - => x.Fill(new SolidBrush(new Rgba32(pixel.Color)), - new RectangleF(0, 0, 100, 100))); - - await using var stream = await image.ToStreamAsync(); - - var pos = new kwum(pixel.Position); - await Response() - .File(stream, $"{pixel.Position}.png") - .Embed(_sender.CreateEmbed() - .WithOkColor() - .WithDescription(string.IsNullOrWhiteSpace(pixel.Text) ? string.Empty : pixel.Text) - .WithTitle(GetText(strs.nc_pixel(pos))) - .AddField(GetText(strs.nc_position), - $"{pixel.Position % _service.GetWidth()} {pixel.Position / _service.GetWidth()}", - true) - .AddField(GetText(strs.price), pixel.Price.ToString(), true) - .AddField(GetText(strs.color), "#" + new Rgba32(pixel.Color).ToHex()) - .WithImageUrl($"attachment://{pixel.Position}.png")) - .SendAsync(); - } - - [Cmd] - [OwnerOnly] - public async Task NcSetImg() - { - var attach = ctx.Message.Attachments.FirstOrDefault(); - if (attach is null) - { - await Response().Error(strs.no_attach_found).SendAsync(); - return; - } - - var w = _service.GetWidth(); - var h = _service.GetHeight(); - if (attach.Width != w || attach.Height != h) - { - await Response().Error(strs.invalid_img_size(w, h)).SendAsync(); - return; - } - - if (!await PromptUserConfirmAsync(_sender.CreateEmbed() - .WithDescription( - "This will reset the canvas to the specified image. All prices, text and colors will be reset.\n\n" - + "Are you sure you want to continue?"))) - return; - - using var http = _http.CreateClient(); - await using var stream = await http.GetStreamAsync(attach.Url); - using var img = await Image.LoadAsync(stream); - - var pixels = new uint[_service.GetWidth() * _service.GetHeight()]; - - Parallel.For(0, - _service.GetWidth() * _service.GetHeight(), - i => pixels[i] = img[i % _service.GetWidth(), i / _service.GetWidth()].PackedValue); - - // for (var y = 0; y < _service.GetHeight(); y++) - // for (var x = 0; x < _service.GetWidth(); x++) - // pixels[(y * _service.GetWidth()) + x] = img[x, y].PackedValue; - - await _service.SetImage(pixels); - await ctx.OkAsync(); - } - - [Cmd] - [OwnerOnly] - public async Task NcReset() - { - await _service.ResetAsync(); - - if (!await PromptUserConfirmAsync(_sender.CreateEmbed() - .WithDescription( - "This will delete all pixels and reset the canvas.\n\n" - + "Are you sure you want to continue?"))) - return; - - await ctx.OkAsync(); - } - } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Games/NCanvas/NCanvasService.cs b/src/EllieBot/Modules/Games/NCanvas/NCanvasService.cs deleted file mode 100644 index c0a4b1b..0000000 --- a/src/EllieBot/Modules/Games/NCanvas/NCanvasService.cs +++ /dev/null @@ -1,206 +0,0 @@ -using LinqToDB; -using LinqToDB.Data; -using LinqToDB.EntityFrameworkCore; -using EllieBot.Common.ModuleBehaviors; -using EllieBot.Db.Models; -using SixLabors.ImageSharp.ColorSpaces; -using SixLabors.ImageSharp.ColorSpaces.Conversion; -using SixLabors.ImageSharp.PixelFormats; - -namespace EllieBot.Modules.Games; - -public sealed class NCanvasService : INCanvasService, IReadyExecutor, IEService -{ - private readonly TypedKey _canvasKey = new("ncanvas"); - - private readonly DbService _db; - private readonly IBotCache _cache; - private readonly DiscordSocketClient _client; - private readonly ICurrencyService _cs; - - public const int CANVAS_WIDTH = 500; - public const int CANVAS_HEIGHT = 350; - public const int INITIAL_PRICE = 3; - - public NCanvasService( - DbService db, - IBotCache cache, - DiscordSocketClient client, - ICurrencyService cs) - { - _db = db; - _cache = cache; - _client = client; - _cs = cs; - } - - public async Task OnReadyAsync() - { - if (_client.ShardId != 0) - return; - - await using var uow = _db.GetDbContext(); - - if (await uow.GetTable().CountAsyncLinqToDB() > 0) - return; - - await ResetAsync(); - } - - public async Task ResetAsync() - { - await using var uow = _db.GetDbContext(); - await uow.GetTable().DeleteAsync(); - - var toAdd = new List(); - for (var i = 0; i < CANVAS_WIDTH * CANVAS_HEIGHT; i++) - { - toAdd.Add(i); - } - - await uow.GetTable() - .BulkCopyAsync(toAdd.Select(x => - { - var clr = ColorSpaceConverter.ToRgb(new Hsv(((float)Random.Shared.NextDouble() * 360), - (float)(0.5 + (Random.Shared.NextDouble() * 0.49)), - (float)(0.4 + (Random.Shared.NextDouble() / 5 + (x % 100 * 0.2))))) - .ToVector3(); - - var packed = new Rgba32(clr).PackedValue; - return new NCPixel() - { - Color = packed, - Price = 1, - Position = x, - Text = "", - OwnerId = 0 - }; - })); - } - - - private async Task InternalGetCanvas() - { - await using var uow = _db.GetDbContext(); - var colors = await uow.GetTable() - .OrderBy(x => x.Position) - .Select(x => x.Color) - .ToArrayAsyncLinqToDB(); - - return colors; - } - - public async Task GetCanvas() - { - return await _cache.GetOrAddAsync(_canvasKey, - async () => await InternalGetCanvas(), - TimeSpan.FromSeconds(15)) - ?? []; - } - - public async Task SetPixel( - int position, - uint color, - string text, - ulong userId, - long price) - { - if (position < 0 || position >= CANVAS_WIDTH * CANVAS_HEIGHT) - return SetPixelResult.InvalidInput; - - var wallet = await _cs.GetWalletAsync(userId); - - var paid = await wallet.Take(price, new("canvas", "pixel-buy", $"Bought pixel {new kwum(position)}")); - if (!paid) - { - return SetPixelResult.NotEnoughMoney; - } - - var success = false; - try - { - await using var uow = _db.GetDbContext(); - var updates = await uow.GetTable() - .Where(x => x.Position == position && x.Price <= price) - .UpdateAsync(old => new NCPixel() - { - Position = position, - Color = color, - Text = text, - OwnerId = userId, - Price = price + 1 - }); - success = updates > 0; - } - catch - { - } - - if (!success) - { - await wallet.Add(price, new("canvas", "pixel-refund", $"Refund pixel {new kwum(position)} purchase")); - } - - return success ? SetPixelResult.Success : SetPixelResult.InsufficientPayment; - } - - public async Task SetImage(uint[] colors) - { - if (colors.Length != CANVAS_WIDTH * CANVAS_HEIGHT) - return false; - - await using var uow = _db.GetDbContext(); - await uow.GetTable().DeleteAsync(); - await uow.GetTable() - .BulkCopyAsync(colors.Select((x, i) => new NCPixel() - { - Color = x, - Price = INITIAL_PRICE, - Position = i, - Text = "", - OwnerId = 0 - })); - - return true; - } - - public Task GetPixel(int x, int y) - { - ArgumentOutOfRangeException.ThrowIfNegative(x); - ArgumentOutOfRangeException.ThrowIfNegative(y); - - if (x >= CANVAS_WIDTH || y >= CANVAS_HEIGHT) - return Task.FromResult(null); - - return GetPixel(x + (y * CANVAS_WIDTH)); - } - - public async Task GetPixel(int position) - { - ArgumentOutOfRangeException.ThrowIfNegative(position); - - await using var uow = _db.GetDbContext(); - return await uow.GetTable().FirstOrDefaultAsync(x => x.Position == position); - } - - public async Task GetPixelGroup(int position) - { - ArgumentOutOfRangeException.ThrowIfNegative(position); - ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(position, CANVAS_WIDTH * CANVAS_HEIGHT); - - await using var uow = _db.GetDbContext(); - return await uow.GetTable() - .Where(x => x.Position % CANVAS_WIDTH >= (position % CANVAS_WIDTH) - 2 - && x.Position % CANVAS_WIDTH <= (position % CANVAS_WIDTH) + 2 - && x.Position / CANVAS_WIDTH >= (position / CANVAS_WIDTH) - 2 - && x.Position / CANVAS_WIDTH <= (position / CANVAS_WIDTH) + 2) - .OrderBy(x => x.Position) - .ToArrayAsyncLinqToDB(); - } - - public int GetHeight() - => CANVAS_HEIGHT; - - public int GetWidth() - => CANVAS_WIDTH; -} diff --git a/src/EllieBot/Modules/Games/NCanvas/SetPixelResult.cs b/src/EllieBot/Modules/Games/NCanvas/SetPixelResult.cs deleted file mode 100644 index 523135e..0000000 --- a/src/EllieBot/Modules/Games/NCanvas/SetPixelResult.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace EllieBot.Modules.Games; - -public enum SetPixelResult -{ - Success, - InsufficientPayment, - NotEnoughMoney, - InvalidInput -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Games/Nunchi/NunchiCommands.cs b/src/EllieBot/Modules/Games/Nunchi/NunchiCommands.cs index 0cdd8b7..80e6c42 100644 --- a/src/EllieBot/Modules/Games/Nunchi/NunchiCommands.cs +++ b/src/EllieBot/Modules/Games/Nunchi/NunchiCommands.cs @@ -29,7 +29,7 @@ public partial class Games if (!await nunchi.Join(ctx.User.Id, ctx.User.ToString())) return; - await Response().Confirm(strs.nunchi_joined(nunchi.ParticipantCount)).SendAsync(); + await Response().Error(strs.nunchi_joined(nunchi.ParticipantCount)).SendAsync(); return; } diff --git a/src/EllieBot/Modules/Help/CommandJsonObject.cs b/src/EllieBot/Modules/Help/CommandJsonObject.cs index 4339f7c..062a0b9 100644 --- a/src/EllieBot/Modules/Help/CommandJsonObject.cs +++ b/src/EllieBot/Modules/Help/CommandJsonObject.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable namespace EllieBot.Modules.Help; internal class CommandJsonObject diff --git a/src/EllieBot/Modules/Help/CommandsOptions.cs b/src/EllieBot/Modules/Help/CommandsOptions.cs index c8b1d6f..ecbb06c 100644 --- a/src/EllieBot/Modules/Help/CommandsOptions.cs +++ b/src/EllieBot/Modules/Help/CommandsOptions.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable using CommandLine; namespace EllieBot.Modules.Help.Common; diff --git a/src/EllieBot/Modules/Help/Help.cs b/src/EllieBot/Modules/Help/Help.cs index 8b7c006..aedb8e8 100644 --- a/src/EllieBot/Modules/Help/Help.cs +++ b/src/EllieBot/Modules/Help/Help.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable using EllieBot.Modules.Help.Common; using EllieBot.Modules.Help.Services; using Newtonsoft.Json; @@ -10,7 +10,7 @@ namespace EllieBot.Modules.Help; public sealed partial class Help : EllieModule { public const string PATREON_URL = "https://patreon.com/elliebot"; - public const string PAYPAL_URL = "https://paypal.me/toastie_t0ast"; + public const string PAYPAL_URL = "https://paypal.me/toastiet0ast"; private readonly ICommandsUtilityService _cus; private readonly CommandService _cmds; @@ -513,13 +513,34 @@ public sealed partial class Help : EllieModule public async Task Guide() => await Response() .Confirm(strs.guide("https://commands.elliebot.net", - "https://docs.elliebot.net")) + "https://docs.elliebot.net/")) .SendAsync(); + + private Task SelfhostAction(SocketMessageComponent smc) + => smc.RespondConfirmAsync(_sender, + """ + - In case you don't want or cannot Donate to EllieBot project, but you + - EllieBot is a free and [open source](https://toastielab.dev/Emotions-stuff/elliebot) project which means you can run your own "selfhosted" instance on your computer. + + *Keep in mind that running the bot on your computer means that the bot will be offline when you turn off your computer* + + - You can find the selfhosting guides by using the `.guide` command and clicking on the second link that pops up. + - If you decide to selfhost the bot, still consider [supporting the project](https://patreon.com/join/elliebot) to keep the development going :) + """, + true); + [Cmd] [OnlyPublicBot] public async Task Donate() { + var selfhostInter = _inter.Create(ctx.User.Id, + new ButtonBuilder( + emote: new Emoji("🖥️"), + customId: "donate:selfhosting", + label: "Selfhosting"), + SelfhostAction); + var eb = _sender.CreateEmbed() .WithOkColor() .WithTitle("Thank you for considering to donate to the EllieBot project!"); @@ -556,6 +577,7 @@ public sealed partial class Help : EllieModule await Response() .Channel(await ctx.User.CreateDMChannelAsync()) .Embed(eb) + .Interaction(selfhostInter) .SendAsync(); _ = ctx.OkAsync(); diff --git a/src/EllieBot/Modules/Help/HelpService.cs b/src/EllieBot/Modules/Help/HelpService.cs index 1f9a045..fd1b18b 100644 --- a/src/EllieBot/Modules/Help/HelpService.cs +++ b/src/EllieBot/Modules/Help/HelpService.cs @@ -1,4 +1,4 @@ -using EllieBot.Common.ModuleBehaviors; +using EllieBot.Common.ModuleBehaviors; namespace EllieBot.Modules.Help.Services; diff --git a/src/EllieBot/Modules/Music/PlaylistCommands.cs b/src/EllieBot/Modules/Music/PlaylistCommands.cs index 68a651d..0e4137b 100644 --- a/src/EllieBot/Modules/Music/PlaylistCommands.cs +++ b/src/EllieBot/Modules/Music/PlaylistCommands.cs @@ -12,9 +12,9 @@ public sealed partial class Music { private static readonly SemaphoreSlim _playlistLock = new(1, 1); private readonly DbService _db; - private readonly IBotCreds _creds; + private readonly IBotCredentials _creds; - public PlaylistCommands(DbService db, IBotCreds creds) + public PlaylistCommands(DbService db, IBotCredentials creds) { _db = db; _creds = creds; @@ -136,7 +136,7 @@ public sealed partial class Music Provider = s.Platform.ToString(), ProviderType = (MusicType)s.Platform, Title = s.Title, - Query = s.Url + Query = s.Platform == MusicPlatform.Local ? s.GetStreamUrl().Result!.Trim('"') : s.Url }) .ToList(); diff --git a/src/EllieBot/Modules/Music/Services/MusicService.cs b/src/EllieBot/Modules/Music/Services/MusicService.cs index 89c848d..8495211 100644 --- a/src/EllieBot/Modules/Music/Services/MusicService.cs +++ b/src/EllieBot/Modules/Music/Services/MusicService.cs @@ -1,5 +1,4 @@ using EllieBot.Db.Models; -using EllieBot.Modules.Music.Resolvers; using System.Diagnostics.CodeAnalysis; namespace EllieBot.Modules.Music.Services; @@ -9,7 +8,7 @@ public sealed class MusicService : IMusicService, IPlaceholderProvider private readonly AyuVoiceStateService _voiceStateService; private readonly ITrackResolveProvider _trackResolveProvider; private readonly DbService _db; - private readonly IYoutubeResolverFactory _ytResolver; + private readonly IYoutubeResolver _ytResolver; private readonly ILocalTrackResolver _localResolver; private readonly DiscordSocketClient _client; private readonly IBotStrings _strings; @@ -25,7 +24,7 @@ public sealed class MusicService : IMusicService, IPlaceholderProvider AyuVoiceStateService voiceStateService, ITrackResolveProvider trackResolveProvider, DbService db, - IYoutubeResolverFactory ytResolver, + IYoutubeResolver ytResolver, ILocalTrackResolver localResolver, DiscordSocketClient client, IBotStrings strings, @@ -94,7 +93,7 @@ public sealed class MusicService : IMusicService, IPlaceholderProvider public async Task EnqueueYoutubePlaylistAsync(IMusicPlayer mp, string query, string queuer) { var count = 0; - await foreach (var track in _ytResolver.GetYoutubeResolver().ResolveTracksFromPlaylistAsync(query)) + await foreach (var track in _ytResolver.ResolveTracksFromPlaylistAsync(query)) { if (mp.IsKilled) break; @@ -140,7 +139,6 @@ public sealed class MusicService : IMusicService, IPlaceholderProvider var mp = new MusicPlayer(queue, resolver, - _ytResolver, proxy, _googleApiService, settings.QualityPreset, diff --git a/src/EllieBot/Modules/Music/_common/ITrackInfo.cs b/src/EllieBot/Modules/Music/_common/ITrackInfo.cs index 3525b59..347e8fa 100644 --- a/src/EllieBot/Modules/Music/_common/ITrackInfo.cs +++ b/src/EllieBot/Modules/Music/_common/ITrackInfo.cs @@ -8,4 +8,5 @@ public interface ITrackInfo public string Thumbnail { get; } public TimeSpan Duration { get; } public MusicPlatform Platform { get; } + public ValueTask GetStreamUrl(); } \ No newline at end of file diff --git a/src/EllieBot/Modules/Music/_common/IYoutubeResolver.cs b/src/EllieBot/Modules/Music/_common/IYoutubeResolver.cs index e4c2f53..433012d 100644 --- a/src/EllieBot/Modules/Music/_common/IYoutubeResolver.cs +++ b/src/EllieBot/Modules/Music/_common/IYoutubeResolver.cs @@ -4,8 +4,8 @@ namespace EllieBot.Modules.Music; public interface IYoutubeResolver : IPlatformQueryResolver { + public Regex YtVideoIdRegex { get; } public Task ResolveByIdAsync(string id); IAsyncEnumerable ResolveTracksFromPlaylistAsync(string query); Task ResolveByQueryAsync(string query, bool tryExtractingId); - Task GetStreamUrl(string query); } \ No newline at end of file diff --git a/src/EllieBot/Modules/Music/_common/Impl/MusicPlayer.cs b/src/EllieBot/Modules/Music/_common/Impl/MusicPlayer.cs index 02cb4e2..6819d4e 100644 --- a/src/EllieBot/Modules/Music/_common/Impl/MusicPlayer.cs +++ b/src/EllieBot/Modules/Music/_common/Impl/MusicPlayer.cs @@ -1,6 +1,5 @@ using EllieBot.Voice; using EllieBot.Db.Models; -using EllieBot.Modules.Music.Resolvers; using System.ComponentModel; using System.Diagnostics; using System.Runtime.CompilerServices; @@ -28,7 +27,6 @@ public sealed class MusicPlayer : IMusicPlayer private readonly IMusicQueue _queue; private readonly ITrackResolveProvider _trackResolveProvider; - private readonly IYoutubeResolverFactory _ytResolverFactory; private readonly IVoiceProxy _proxy; private readonly IGoogleApiService _googleApiService; private readonly ISongBuffer _songBuffer; @@ -43,7 +41,6 @@ public sealed class MusicPlayer : IMusicPlayer public MusicPlayer( IMusicQueue queue, ITrackResolveProvider trackResolveProvider, - IYoutubeResolverFactory ytResolverFactory, IVoiceProxy proxy, IGoogleApiService googleApiService, QualityPreset qualityPreset, @@ -51,7 +48,6 @@ public sealed class MusicPlayer : IMusicPlayer { _queue = queue; _trackResolveProvider = trackResolveProvider; - _ytResolverFactory = ytResolverFactory; _proxy = proxy; _googleApiService = googleApiService; AutoPlay = autoPlay; @@ -122,7 +118,7 @@ public sealed class MusicPlayer : IMusicPlayer // make sure song buffer is ready to be (re)used _songBuffer.Reset(); - var streamUrl = await GetStreamUrl(track); + var streamUrl = await track.GetStreamUrl(); // start up the data source using var source = FfmpegTrackDataSource.CreateAsync( _vc.BitDepth, @@ -260,7 +256,6 @@ public sealed class MusicPlayer : IMusicPlayer IsStopped = true; Log.Error("Please install ffmpeg and make sure it's added to your " + "PATH environment variable before trying again"); - } catch (OperationCanceledException) { @@ -269,7 +264,6 @@ public sealed class MusicPlayer : IMusicPlayer catch (Exception ex) { Log.Error(ex, "Unknown error in music loop: {ErrorMessage}", ex.Message); - await Task.Delay(3_000); } finally { @@ -309,14 +303,6 @@ public sealed class MusicPlayer : IMusicPlayer } } - private async Task GetStreamUrl(IQueuedTrackInfo track) - { - if (track.TrackInfo is SimpleTrackInfo sti) - return sti.StreamUrl; - - return await _ytResolverFactory.GetYoutubeResolver().GetStreamUrl(track.TrackInfo.Id); - } - private bool? CopyChunkToOutput(ISongBuffer sb, VoiceClient vc) { var data = sb.Read(vc.InputLength, out var length); diff --git a/src/EllieBot/Modules/Music/_common/Impl/MusicQueue.cs b/src/EllieBot/Modules/Music/_common/Impl/MusicQueue.cs index 9b1c7aa..1b1ce9c 100644 --- a/src/EllieBot/Modules/Music/_common/Impl/MusicQueue.cs +++ b/src/EllieBot/Modules/Music/_common/Impl/MusicQueue.cs @@ -28,6 +28,9 @@ public sealed partial class MusicQueue TrackInfo = trackInfo; Queuer = queuer; } + + public ValueTask GetStreamUrl() + => TrackInfo.GetStreamUrl(); } } diff --git a/src/EllieBot/Modules/Music/_common/Impl/RemoteTrackInfo.cs b/src/EllieBot/Modules/Music/_common/Impl/RemoteTrackInfo.cs index b846b25..b002779 100644 --- a/src/EllieBot/Modules/Music/_common/Impl/RemoteTrackInfo.cs +++ b/src/EllieBot/Modules/Music/_common/Impl/RemoteTrackInfo.cs @@ -6,4 +6,11 @@ public sealed record RemoteTrackInfo( string Url, string Thumbnail, TimeSpan Duration, - MusicPlatform Platform) : ITrackInfo; \ No newline at end of file + MusicPlatform Platform, + Func> _streamFactory) : ITrackInfo +{ + private readonly Func> _streamFactory = _streamFactory; + + public async ValueTask GetStreamUrl() + => await _streamFactory(); +} \ No newline at end of file diff --git a/src/EllieBot/Modules/Music/_common/Impl/SimpleTrackInfo.cs b/src/EllieBot/Modules/Music/_common/Impl/SimpleTrackInfo.cs index c7828cc..9ae1c30 100644 --- a/src/EllieBot/Modules/Music/_common/Impl/SimpleTrackInfo.cs +++ b/src/EllieBot/Modules/Music/_common/Impl/SimpleTrackInfo.cs @@ -24,4 +24,7 @@ public sealed class SimpleTrackInfo : ITrackInfo Platform = platform; StreamUrl = streamUrl; } + + public ValueTask GetStreamUrl() + => new(StreamUrl); } \ No newline at end of file diff --git a/src/EllieBot/Modules/Music/_common/Resolvers/InvTrackInfo.cs b/src/EllieBot/Modules/Music/_common/Resolvers/InvTrackInfo.cs deleted file mode 100644 index cca2727..0000000 --- a/src/EllieBot/Modules/Music/_common/Resolvers/InvTrackInfo.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace EllieBot.Modules.Music; - -public sealed class InvTrackInfo : ITrackInfo -{ - public required string Id { get; init; } - public required string Title { get; init; } - public required string Url { get; init; } - public required string Thumbnail { get; init; } - public required TimeSpan Duration { get; init; } - public required MusicPlatform Platform { get; init; } - public required string? StreamUrl { get; init; } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Music/_common/Resolvers/InvidiousYoutubeResolver.cs b/src/EllieBot/Modules/Music/_common/Resolvers/InvidiousYoutubeResolver.cs deleted file mode 100644 index fa21693..0000000 --- a/src/EllieBot/Modules/Music/_common/Resolvers/InvidiousYoutubeResolver.cs +++ /dev/null @@ -1,108 +0,0 @@ -using EllieBot.Modules.Searches; -using System.Net.Http.Json; - -namespace EllieBot.Modules.Music; - -public sealed class InvidiousYoutubeResolver : IYoutubeResolver -{ - private readonly IHttpClientFactory _httpFactory; - private readonly SearchesConfigService _sc; - private readonly EllieRandom _rng; - - private string InvidiousApiUrl - => _sc.Data.InvidiousInstances[_rng.Next(0, _sc.Data.InvidiousInstances.Count)]; - - public InvidiousYoutubeResolver(IHttpClientFactory httpFactory, SearchesConfigService sc) - { - _rng = new EllieRandom(); - _httpFactory = httpFactory; - _sc = sc; - } - - public async Task ResolveByQueryAsync(string query) - { - using var http = _httpFactory.CreateClient(); - - var items = await http.GetFromJsonAsync>( - $"{InvidiousApiUrl}/api/v1/search" - + $"?q={query}" - + $"&type=video"); - - if (items is null || items.Count == 0) - return null; - - - var res = items.First(); - - return new InvTrackInfo() - { - Id = res.VideoId, - Title = res.Title, - Url = $"https://youtube.com/watch?v={res.VideoId}", - Thumbnail = res.Thumbnails?.Select(x => x.Url).FirstOrDefault() ?? string.Empty, - Duration = TimeSpan.FromSeconds(res.LengthSeconds), - Platform = MusicPlatform.Youtube, - StreamUrl = null, - }; - } - - public async Task ResolveByIdAsync(string id) - => await InternalResolveByIdAsync(id); - - private async Task InternalResolveByIdAsync(string id) - { - using var http = _httpFactory.CreateClient(); - - var res = await http.GetFromJsonAsync( - $"{InvidiousApiUrl}/api/v1/videos/{id}"); - - if (res is null) - return null; - - return new InvTrackInfo() - { - Id = res.VideoId, - Title = res.Title, - Url = $"https://youtube.com/watch?v={res.VideoId}", - Thumbnail = res.Thumbnails?.Select(x => x.Url).FirstOrDefault() ?? string.Empty, - Duration = TimeSpan.FromSeconds(res.LengthSeconds), - Platform = MusicPlatform.Youtube, - StreamUrl = res.AdaptiveFormats.FirstOrDefault(x => x.AudioQuality == "AUDIO_QUALITY_HIGH")?.Url - ?? res.AdaptiveFormats.FirstOrDefault(x => x.AudioQuality == "AUDIO_QUALITY_MEDIUM")?.Url - ?? res.AdaptiveFormats.FirstOrDefault(x => x.AudioQuality == "AUDIO_QUALITY_LOW")?.Url - }; - } - - public async IAsyncEnumerable ResolveTracksFromPlaylistAsync(string query) - { - using var http = _httpFactory.CreateClient(); - var res = await http.GetFromJsonAsync( - $"{InvidiousApiUrl}/api/v1/search?type=video&q={query}"); - - if (res is null) - yield break; - - foreach (var video in res.Videos) - { - yield return new InvTrackInfo() - { - Id = video.VideoId, - Title = video.Title, - Url = $"https://youtube.com/watch?v={video.VideoId}", - Thumbnail = video.Thumbnails?.Select(x => x.Url).FirstOrDefault() ?? string.Empty, - Duration = TimeSpan.FromSeconds(video.LengthSeconds), - Platform = MusicPlatform.Youtube, - StreamUrl = null - }; - } - } - - public Task ResolveByQueryAsync(string query, bool tryExtractingId) - => ResolveByQueryAsync(query); - - public async Task GetStreamUrl(string videoId) - { - var video = await InternalResolveByIdAsync(videoId); - return video?.StreamUrl; - } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Music/_common/Resolvers/TrackResolveProvider.cs b/src/EllieBot/Modules/Music/_common/Resolvers/TrackResolveProvider.cs index 21a6adf..642edf1 100644 --- a/src/EllieBot/Modules/Music/_common/Resolvers/TrackResolveProvider.cs +++ b/src/EllieBot/Modules/Music/_common/Resolvers/TrackResolveProvider.cs @@ -1,15 +1,13 @@ -using EllieBot.Modules.Music.Resolvers; - -namespace EllieBot.Modules.Music; +namespace EllieBot.Modules.Music; public sealed class TrackResolveProvider : ITrackResolveProvider { - private readonly IYoutubeResolverFactory _ytResolver; + private readonly IYoutubeResolver _ytResolver; private readonly ILocalTrackResolver _localResolver; private readonly IRadioResolver _radioResolver; public TrackResolveProvider( - IYoutubeResolverFactory ytResolver, + IYoutubeResolver ytResolver, ILocalTrackResolver localResolver, IRadioResolver radioResolver) { @@ -25,22 +23,19 @@ public sealed class TrackResolveProvider : ITrackResolveProvider case MusicPlatform.Radio: return _radioResolver.ResolveByQueryAsync(query); case MusicPlatform.Youtube: - return _ytResolver.GetYoutubeResolver().ResolveByQueryAsync(query); + return _ytResolver.ResolveByQueryAsync(query); case MusicPlatform.Local: return _localResolver.ResolveByQueryAsync(query); case null: - var match = YoutubeHelpers.YtVideoIdRegex.Match(query); - + var match = _ytResolver.YtVideoIdRegex.Match(query); if (match.Success) - return _ytResolver.GetYoutubeResolver().ResolveByIdAsync(match.Groups["id"].Value); - - if (Uri.TryCreate(query, UriKind.Absolute, out var uri) && uri.IsFile) + return _ytResolver.ResolveByIdAsync(match.Groups["id"].Value); + else if (Uri.TryCreate(query, UriKind.Absolute, out var uri) && uri.IsFile) return _localResolver.ResolveByQueryAsync(uri.AbsolutePath); - - if (IsRadioLink(query)) + else if (IsRadioLink(query)) return _radioResolver.ResolveByQueryAsync(query); - - return _ytResolver.GetYoutubeResolver().ResolveByQueryAsync(query, false); + else + return _ytResolver.ResolveByQueryAsync(query, false); default: Log.Error("Unsupported platform: {MusicPlatform}", forcePlatform); return Task.FromResult(null); diff --git a/src/EllieBot/Modules/Music/_common/Resolvers/YoutubeHelpers.cs b/src/EllieBot/Modules/Music/_common/Resolvers/YoutubeHelpers.cs deleted file mode 100644 index 869102d..0000000 --- a/src/EllieBot/Modules/Music/_common/Resolvers/YoutubeHelpers.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Text.RegularExpressions; - -namespace EllieBot.Modules.Music; - -public sealed class YoutubeHelpers -{ - public static Regex YtVideoIdRegex { get; } = - new(@"(?:youtube\.com\/\S*(?:(?:\/e(?:mbed))?\/|watch\?(?:\S*?&?v\=))|youtu\.be\/)(?[a-zA-Z0-9_-]{6,11})", - RegexOptions.Compiled); -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Music/_common/Resolvers/YoutubeResolverFactory.cs b/src/EllieBot/Modules/Music/_common/Resolvers/YoutubeResolverFactory.cs deleted file mode 100644 index 955faca..0000000 --- a/src/EllieBot/Modules/Music/_common/Resolvers/YoutubeResolverFactory.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using EllieBot.Modules.Searches; -using EllieBot.Modules.Searches.Services; - -namespace EllieBot.Modules.Music.Resolvers; - -public interface IYoutubeResolverFactory -{ - IYoutubeResolver GetYoutubeResolver(); -} - -public sealed class YoutubeResolverFactory : IYoutubeResolverFactory -{ - private readonly SearchesConfigService _ss; - private readonly IServiceProvider _services; - - public YoutubeResolverFactory(SearchesConfigService ss, IServiceProvider services) - { - _ss = ss; - _services = services; - } - - public IYoutubeResolver GetYoutubeResolver() - { - var conf = _ss.Data; - if (conf.YtProvider == YoutubeSearcher.Invidious) - { - return _services.GetRequiredService(); - } - - return _services.GetRequiredService(); - } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Music/_common/Resolvers/YtdlYoutubeResolver.cs b/src/EllieBot/Modules/Music/_common/Resolvers/YtdlYoutubeResolver.cs index 4b0af89..70479d0 100644 --- a/src/EllieBot/Modules/Music/_common/Resolvers/YtdlYoutubeResolver.cs +++ b/src/EllieBot/Modules/Music/_common/Resolvers/YtdlYoutubeResolver.cs @@ -16,6 +16,9 @@ public sealed class YtdlYoutubeResolver : IYoutubeResolver private static readonly Regex _simplePlaylistRegex = new(@"&list=(?[\w\-]{12,})", RegexOptions.Compiled); + public Regex YtVideoIdRegex { get; } = + new(@"(?:youtube\.com\/\S*(?:(?:\/e(?:mbed))?\/|watch\?(?:\S*?&?v\=))|youtu\.be\/)(?[a-zA-Z0-9_-]{6,11})", + RegexOptions.Compiled); private readonly ITrackCacher _trackCacher; @@ -29,7 +32,7 @@ public sealed class YtdlYoutubeResolver : IYoutubeResolver { _trackCacher = trackCacher; _google = google; - + _ytdlPlaylistOperation = new("-4 " + "--geo-bypass " @@ -43,7 +46,7 @@ public sealed class YtdlYoutubeResolver : IYoutubeResolver + "--no-check-certificate " + "-i " + "--yes-playlist " - + "-- \"{0}\""); + + "-- \"{0}\"", scs.Data.YtProvider != YoutubeSearcher.Ytdl); _ytdlIdOperation = new("-4 " + "--geo-bypass " @@ -55,7 +58,7 @@ public sealed class YtdlYoutubeResolver : IYoutubeResolver + "--get-thumbnail " + "--get-duration " + "--no-check-certificate " - + "-- \"{0}\""); + + "-- \"{0}\"", scs.Data.YtProvider != YoutubeSearcher.Ytdl); _ytdlSearchOperation = new("-4 " + "--geo-bypass " @@ -68,7 +71,7 @@ public sealed class YtdlYoutubeResolver : IYoutubeResolver + "--get-duration " + "--no-check-certificate " + "--default-search " - + "\"ytsearch:\" -- \"{0}\""); + + "\"ytsearch:\" -- \"{0}\"", scs.Data.YtProvider != YoutubeSearcher.Ytdl); } private YtTrackData ResolveYtdlData(string ytdlOutputString) @@ -99,7 +102,8 @@ public sealed class YtdlYoutubeResolver : IYoutubeResolver $"https://youtube.com/watch?v={trackData.Id}", trackData.Thumbnail, trackData.Duration, - MusicPlatform.Youtube); + MusicPlatform.Youtube, + CreateCacherFactory(trackData.Id)); private Func> CreateCacherFactory(string id) => () => _trackCacher.GetOrCreateStreamLink(id, @@ -264,7 +268,7 @@ public sealed class YtdlYoutubeResolver : IYoutubeResolver { if (tryResolving) { - var match = YoutubeHelpers.YtVideoIdRegex.Match(query); + var match = YtVideoIdRegex.Match(query); if (match.Success) return await ResolveByIdAsync(match.Groups["id"].Value); } @@ -286,8 +290,6 @@ public sealed class YtdlYoutubeResolver : IYoutubeResolver return DataToInfo(new(cachedData.Title, cachedData.Id, cachedData.Thumbnail, null, cachedData.Duration)); } - public Task GetStreamUrl(string videoId) - => CreateCacherFactory(videoId)(); private readonly struct YtTrackData { public readonly string Title; diff --git a/src/EllieBot/Modules/Patronage/CurrencyRewardService.cs b/src/EllieBot/Modules/Patronage/CurrencyRewardService.cs index 391ebb4..b61c646 100644 --- a/src/EllieBot/Modules/Patronage/CurrencyRewardService.cs +++ b/src/EllieBot/Modules/Patronage/CurrencyRewardService.cs @@ -122,9 +122,9 @@ public sealed class CurrencyRewardService : IEService, IReadyExecutor var dollarValue = pledgeCents / 100; percentBonus = dollarValue switch { - >= 100 => 25, - >= 50 => 20, - >= 20 => 15, + >= 100 => 100, + >= 50 => 50, + >= 20 => 20, >= 10 => 10, >= 5 => 5, _ => 0 diff --git a/src/EllieBot/Modules/Patronage/PatronageService.cs b/src/EllieBot/Modules/Patronage/PatronageService.cs index 17e418c..0ea46e4 100644 --- a/src/EllieBot/Modules/Patronage/PatronageService.cs +++ b/src/EllieBot/Modules/Patronage/PatronageService.cs @@ -325,7 +325,7 @@ public sealed class PatronageService { if (!_pConf.Data.IsEnabled) return _infiniteQuota; - + var maybePatron = await GetPatronAsync(userId); if (maybePatron is not { } patron) @@ -404,9 +404,9 @@ public sealed class PatronageService { >= 10_000 => 100, >= 5000 => 50, - >= 2000 => 30, - >= 1000 => 20, - >= 500 => 10, + >= 2000 => 20, + >= 1000 => 10, + >= 500 => 5, _ => 0 }; diff --git a/src/EllieBot/Modules/Permissions/Blacklist/BlacklistCommands.cs b/src/EllieBot/Modules/Permissions/Blacklist/BlacklistCommands.cs index 5ce851b..b552636 100644 --- a/src/EllieBot/Modules/Permissions/Blacklist/BlacklistCommands.cs +++ b/src/EllieBot/Modules/Permissions/Blacklist/BlacklistCommands.cs @@ -18,39 +18,39 @@ public partial class Permissions { ArgumentOutOfRangeException.ThrowIfNegative(page); - var list = await _service.GetBlacklist(type); - var allItems = await list - .Select(i => - { - try - { - return Task.FromResult(type switch - { - BlacklistType.Channel => Format.Code(i.ItemId.ToString()) + var list = _service.GetBlacklist(); + var allItems = await list.Where(x => x.Type == type) + .Select(i => + { + try + { + return Task.FromResult(i.Type switch + { + BlacklistType.Channel => Format.Code(i.ItemId.ToString()) + + " " + + (_client.GetChannel(i.ItemId)?.ToString() + ?? ""), + BlacklistType.User => Format.Code(i.ItemId.ToString()) + + " " + + ((_client.GetUser(i.ItemId)) + ?.ToString() + ?? ""), + BlacklistType.Server => Format.Code(i.ItemId.ToString()) + " " - + (_client.GetChannel(i.ItemId)?.ToString() - ?? ""), - BlacklistType.User => Format.Code(i.ItemId.ToString()) - + " " - + ((_client.GetUser(i.ItemId)) - ?.ToString() - ?? ""), - BlacklistType.Server => Format.Code(i.ItemId.ToString()) - + " " - + (_client.GetGuild(i.ItemId)?.ToString() ?? ""), - _ => Format.Code(i.ItemId.ToString()) - }); - } - catch - { - Log.Warning("Can't get {BlacklistType} [{BlacklistItemId}]", - i.Type, - i.ItemId); - - return Task.FromResult(Format.Code(i.ItemId.ToString())); - } - }) - .WhenAll(); + + (_client.GetGuild(i.ItemId)?.ToString() ?? ""), + _ => Format.Code(i.ItemId.ToString()) + }); + } + catch + { + Log.Warning("Can't get {BlacklistType} [{BlacklistItemId}]", + i.Type, + i.ItemId); + + return Task.FromResult(Format.Code(i.ItemId.ToString())); + } + }) + .WhenAll(); await Response() .Paginated() @@ -61,14 +61,14 @@ public partial class Permissions { if (pageItems.Count == 0) return _sender.CreateEmbed() - .WithOkColor() - .WithTitle(title) - .WithDescription(GetText(strs.empty_page)); + .WithOkColor() + .WithTitle(title) + .WithDescription(GetText(strs.empty_page)); return _sender.CreateEmbed() - .WithTitle(title) - .WithDescription(pageItems.Join('\n')) - .WithOkColor(); + .WithTitle(title) + .WithDescription(allItems.Join('\n')) + .WithOkColor(); }) .SendAsync(); } diff --git a/src/EllieBot/Modules/Searches/Anime/AnimeSearchCommands.cs b/src/EllieBot/Modules/Searches/Anime/AnimeSearchCommands.cs index 4e95d39..d86cd14 100644 --- a/src/EllieBot/Modules/Searches/Anime/AnimeSearchCommands.cs +++ b/src/EllieBot/Modules/Searches/Anime/AnimeSearchCommands.cs @@ -58,18 +58,18 @@ public partial class Searches var embed = _sender.CreateEmbed() .WithOkColor() - .WithDescription(mangaData.Synopsis.Replace("
", - Environment.NewLine, - StringComparison.InvariantCulture)) - .WithTitle(mangaData.TitleEnglish) - .WithUrl(mangaData.Link) - .WithImageUrl(mangaData.ImageUrlLge) - .AddField(GetText(strs.chapters), mangaData.TotalChapters.ToString(), true) - .AddField(GetText(strs.status), mangaData.PublishingStatus, true) - .AddField(GetText(strs.genres), - string.Join(",\n", mangaData.Genres.Any() ? mangaData.Genres : ["none"]), - true) - .WithFooter($"{GetText(strs.score)} {mangaData.AverageScore} / 100"); + .WithDescription(mangaData.Synopsis.Replace("
", + Environment.NewLine, + StringComparison.InvariantCulture)) + .WithTitle(mangaData.TitleEnglish) + .WithUrl(mangaData.Link) + .WithImageUrl(mangaData.ImageUrlLge) + .AddField(GetText(strs.chapters), mangaData.TotalChapters.ToString(), true) + .AddField(GetText(strs.status), mangaData.PublishingStatus, true) + .AddField(GetText(strs.genres), + string.Join(",\n", mangaData.Genres.Any() ? mangaData.Genres : ["none"]), + true) + .WithFooter($"{GetText(strs.score)} {mangaData.AverageScore} / 100"); await Response().Embed(embed).SendAsync(); } diff --git a/src/EllieBot/Modules/Searches/Crypto/CryptoCommands.cs b/src/EllieBot/Modules/Searches/Crypto/CryptoCommands.cs index b5dabb3..290685d 100644 --- a/src/EllieBot/Modules/Searches/Crypto/CryptoCommands.cs +++ b/src/EllieBot/Modules/Searches/Crypto/CryptoCommands.cs @@ -221,7 +221,7 @@ public partial class Searches .AddFooter(false) .SendAsync(); } - + private static string GetArrowEmoji(decimal value) => value > 0 ? "▲" : "▼"; diff --git a/src/EllieBot/Modules/Searches/Crypto/CryptoService.cs b/src/EllieBot/Modules/Searches/Crypto/CryptoService.cs index 8bfeb8d..0ffd422 100644 --- a/src/EllieBot/Modules/Searches/Crypto/CryptoService.cs +++ b/src/EllieBot/Modules/Searches/Crypto/CryptoService.cs @@ -16,11 +16,11 @@ public class CryptoService : IEService { private readonly IBotCache _cache; private readonly IHttpClientFactory _httpFactory; - private readonly IBotCreds _creds; + private readonly IBotCredentials _creds; private readonly SemaphoreSlim _getCryptoLock = new(1, 1); - public CryptoService(IBotCache cache, IHttpClientFactory httpFactory, IBotCreds creds) + public CryptoService(IBotCache cache, IHttpClientFactory httpFactory, IBotCredentials creds) { _cache = cache; _httpFactory = httpFactory; diff --git a/src/EllieBot/Modules/Searches/Osu/OsuCommands.cs b/src/EllieBot/Modules/Searches/Osu/OsuCommands.cs index 81f354a..22c4a82 100644 --- a/src/EllieBot/Modules/Searches/Osu/OsuCommands.cs +++ b/src/EllieBot/Modules/Searches/Osu/OsuCommands.cs @@ -9,10 +9,10 @@ public partial class Searches [Group] public partial class OsuCommands : EllieModule { - private readonly IBotCreds _creds; + private readonly IBotCredentials _creds; private readonly IHttpClientFactory _httpFactory; - public OsuCommands(IBotCreds creds, IHttpClientFactory factory) + public OsuCommands(IBotCredentials creds, IHttpClientFactory factory) { _creds = creds; _httpFactory = factory; @@ -109,13 +109,13 @@ public partial class Searches await Response().Error("Please provide a username.").SendAsync(); return; } - + var plays = await _service.GetOsuPlay(user, mode); - + var eb = _sender.CreateEmbed().WithOkColor().WithTitle($"Top 5 plays for {user}"); - foreach(var (title, desc) in plays) + foreach (var (title, desc) in plays) eb.AddField(title, desc); await Response().Embed(eb).SendAsync(); diff --git a/src/EllieBot/Modules/Searches/Osu/OsuService.cs b/src/EllieBot/Modules/Searches/Osu/OsuService.cs index 9bdb319..18327c9 100644 --- a/src/EllieBot/Modules/Searches/Osu/OsuService.cs +++ b/src/EllieBot/Modules/Searches/Osu/OsuService.cs @@ -7,9 +7,9 @@ namespace EllieBot.Modules.Searches; public sealed class OsuService : IEService { private readonly IHttpClientFactory _httpFactory; - private readonly IBotCreds _creds; + private readonly IBotCredentials _creds; - public OsuService(IHttpClientFactory httpFactory, IBotCreds creds) + public OsuService(IHttpClientFactory httpFactory, IBotCredentials creds) { _httpFactory = httpFactory; _creds = creds; diff --git a/src/EllieBot/Modules/Searches/Religious/Common/BibleVerse.cs b/src/EllieBot/Modules/Searches/Religious/Common/BibleVerse.cs index 77b74f5..8edcd1d 100644 --- a/src/EllieBot/Modules/Searches/Religious/Common/BibleVerse.cs +++ b/src/EllieBot/Modules/Searches/Religious/Common/BibleVerse.cs @@ -1,4 +1,4 @@ -using System.Text.Json.Serialization; +using System.Text.Json.Serialization; namespace EllieBot.Modules.Searches; diff --git a/src/EllieBot/Modules/Searches/Religious/Common/BibleVerses.cs b/src/EllieBot/Modules/Searches/Religious/Common/BibleVerses.cs index 4e7b66d..e31ee04 100644 --- a/src/EllieBot/Modules/Searches/Religious/Common/BibleVerses.cs +++ b/src/EllieBot/Modules/Searches/Religious/Common/BibleVerses.cs @@ -1,4 +1,4 @@ -namespace EllieBot.Modules.Searches; +namespace EllieBot.Modules.Searches; public class BibleVerses { diff --git a/src/EllieBot/Modules/Searches/Religious/Common/QuranAyah.cs b/src/EllieBot/Modules/Searches/Religious/Common/QuranAyah.cs index 6880737..b299242 100644 --- a/src/EllieBot/Modules/Searches/Religious/Common/QuranAyah.cs +++ b/src/EllieBot/Modules/Searches/Religious/Common/QuranAyah.cs @@ -16,4 +16,5 @@ public sealed class QuranAyah [JsonPropertyName("text")] public string Text { get; set; } + } \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/Religious/ReligiousCommands.cs b/src/EllieBot/Modules/Searches/Religious/ReligiousCommands.cs index 074cff5..3bb7899 100644 --- a/src/EllieBot/Modules/Searches/Religious/ReligiousCommands.cs +++ b/src/EllieBot/Modules/Searches/Religious/ReligiousCommands.cs @@ -22,11 +22,11 @@ public partial class Searches } await Response() - .Embed(_sender.CreateEmbed() - .WithOkColor() - .WithTitle($"{verse.BookName} {verse.Chapter}:{verse.Verse}") - .WithDescription(verse.Text)) - .SendAsync(); + .Embed(_sender.CreateEmbed() + .WithOkColor() + .WithTitle($"{verse.BookName} {verse.Chapter}:{verse.Verse}") + .WithDescription(verse.Text)) + .SendAsync(); } [Cmd] diff --git a/src/EllieBot/Modules/Searches/Search/DefaultSearchServiceFactory.cs b/src/EllieBot/Modules/Searches/Search/DefaultSearchServiceFactory.cs index 40f802a..fa3c634 100644 --- a/src/EllieBot/Modules/Searches/Search/DefaultSearchServiceFactory.cs +++ b/src/EllieBot/Modules/Searches/Search/DefaultSearchServiceFactory.cs @@ -7,9 +7,10 @@ public sealed class DefaultSearchServiceFactory : ISearchServiceFactory, IEServi { private readonly SearchesConfigService _scs; private readonly SearxSearchService _sss; - private readonly YtDlpSearchService _ytdlp; private readonly GoogleSearchService _gss; + private readonly YtdlpYoutubeSearchService _ytdlp; + private readonly YtdlYoutubeSearchService _ytdl; private readonly YoutubeDataApiSearchService _ytdata; private readonly InvidiousYtSearchService _iYtSs; private readonly GoogleScrapeService _gscs; @@ -19,17 +20,19 @@ public sealed class DefaultSearchServiceFactory : ISearchServiceFactory, IEServi GoogleSearchService gss, GoogleScrapeService gscs, SearxSearchService sss, - YtDlpSearchService ytdlp, + YtdlpYoutubeSearchService ytdlp, + YtdlYoutubeSearchService ytdl, YoutubeDataApiSearchService ytdata, InvidiousYtSearchService iYtSs) { _scs = scs; _sss = sss; - _ytdlp = ytdlp; _gss = gss; _gscs = gscs; _iYtSs = iYtSs; + _ytdlp = ytdlp; + _ytdl = ytdl; _ytdata = ytdata; } @@ -54,8 +57,9 @@ public sealed class DefaultSearchServiceFactory : ISearchServiceFactory, IEServi => _scs.Data.YtProvider switch { YoutubeSearcher.YtDataApiv3 => _ytdata, - YoutubeSearcher.Invidious => _iYtSs, YoutubeSearcher.Ytdlp => _ytdlp, - _ => throw new ArgumentOutOfRangeException() + YoutubeSearcher.Ytdl => _ytdl, + YoutubeSearcher.Invidious => _iYtSs, + _ => _ytdl }; } \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/Search/SearchCommands.cs b/src/EllieBot/Modules/Searches/Search/SearchCommands.cs index 4bd4d2c..411600c 100644 --- a/src/EllieBot/Modules/Searches/Search/SearchCommands.cs +++ b/src/EllieBot/Modules/Searches/Search/SearchCommands.cs @@ -60,21 +60,21 @@ public partial class Searches descStr = descStr.TrimTo(4096); var embed = _sender.CreateEmbed() - .WithOkColor() - .WithAuthor(ctx.User) - .WithTitle(query.TrimTo(64)!) - .WithDescription(descStr) - .WithFooter( - GetText(strs.results_in(data.Info.TotalResults, data.Info.SearchTime)), - "https://i.imgur.com/G46fm8J.png"); + .WithOkColor() + .WithAuthor(ctx.User) + .WithTitle(query.TrimTo(64)!) + .WithDescription(descStr) + .WithFooter( + GetText(strs.results_in(data.Info.TotalResults, data.Info.SearchTime)), + "https://i.imgur.com/G46fm8J.png"); await Response().Embed(embed).SendAsync(); } [Cmd] - public async Task Image([Leftover] string query) + public async Task Image([Leftover] string? query) { - query = query.Trim(); + query = query?.Trim(); if (string.IsNullOrWhiteSpace(query)) { @@ -93,104 +93,110 @@ public partial class Searches return; } + var embeds = new List(4); + + EmbedBuilder CreateEmbed(IImageSearchResultEntry entry) { return _sender.CreateEmbed() - .WithOkColor() - .WithAuthor(ctx.User) - .WithTitle(query) - .WithImageUrl(entry.Link); + .WithOkColor() + .WithAuthor(ctx.User) + .WithTitle(query) + .WithUrl("https://google.com") + .WithImageUrl(entry.Link); } - await Response() - .Paginated() - .Items(data.Entries) - .PageSize(1) - .AddFooter(false) - .Page((items, _) => - { - var item = items.FirstOrDefault(); + embeds.Add(CreateEmbed(data.Entries.First()) + .WithFooter( + GetText(strs.results_in(data.Info.TotalResults, data.Info.SearchTime)), + "https://i.imgur.com/G46fm8J.png")); - if (item is null) - return _sender.CreateEmbed() - .WithDescription(GetText(strs.no_search_results)); + var random = data.Entries.Skip(1) + .Shuffle() + .Take(3) + .ToArray(); - var embed = CreateEmbed(item); + foreach (var entry in random) + { + embeds.Add(CreateEmbed(entry)); + } - return embed; - }) - .SendAsync(); + await Response().Embeds(embeds).SendAsync(); } - private TypedKey GetYtCacheKey(string query) - => new($"search:yt:{query}"); - - private async Task AddYoutubeUrlToCacheAsync(string query, string[] url) + private TypedKey GetYtCacheKey(string query) + => new($"search:youtube:{query}"); + + private async Task AddYoutubeUrlToCacheAsync(string query, string url) => await _cache.AddAsync(GetYtCacheKey(query), url, expiry: 1.Hours()); - private async Task GetYoutubeUrlFromCacheAsync(string query) + private async Task GetYoutubeUrlFromCacheAsync(string query) { var result = await _cache.GetAsync(GetYtCacheKey(query)); - if (!result.TryGetValue(out var urls) || urls.Length == 0) + if (!result.TryGetValue(out var url) || string.IsNullOrWhiteSpace(url)) return null; - return urls.Map(url => new VideoInfo() + return new VideoInfo() { Url = url - }); + }; } [Cmd] - public async Task Youtube([Leftover] string query) + public async Task Youtube([Leftover] string? query = null) { - query = query.Trim(); + query = query?.Trim(); + + if (string.IsNullOrWhiteSpace(query)) + { + await Response().Error(strs.specify_search_params).SendAsync(); + return; + } _ = ctx.Channel.TriggerTypingAsync(); - var maybeResults = await GetYoutubeUrlFromCacheAsync(query) - ?? await _searchFactory.GetYoutubeSearchService().SearchAsync(query); - - if (maybeResults is not { } result || result.Length == 0) + var maybeResult = await GetYoutubeUrlFromCacheAsync(query) + ?? await _searchFactory.GetYoutubeSearchService().SearchAsync(query); + if (maybeResult is not {} result || result is {Url: null}) { await Response().Error(strs.no_results).SendAsync(); return; } - await AddYoutubeUrlToCacheAsync(query, result.Map(x => x.Url)); - - await Response().Text(result[0].Url).SendAsync(); + await AddYoutubeUrlToCacheAsync(query, result.Url); + await Response().Text(result.Url).SendAsync(); } - // [Cmd] - // public async Task DuckDuckGo([Leftover] string query = null) - // { - // query = query?.Trim(); - // if (!await ValidateQuery(query)) - // return; - // - // _ = ctx.Channel.TriggerTypingAsync(); - // - // var data = await _service.DuckDuckGoSearchAsync(query); - // if (data is null) - // { - // await Response().Error(strs.no_results).SendAsync(); - // return; - // } - // - // var desc = data.Results.Take(5) - // .Select(res => $@"[**{res.Title}**]({res.Link}) - // {res.Text.TrimTo(380 - res.Title.Length - res.Link.Length)}"); - // - // var descStr = string.Join("\n\n", desc); - // - // var embed = _sender.CreateEmbed() - // .WithAuthor(ctx.User.ToString(), - // "https://upload.wikimedia.org/wikipedia/en/9/90/The_DuckDuckGo_Duck.png") - // .WithDescription($"{GetText(strs.search_for)} **{query}**\n\n" + descStr) - // .WithOkColor(); - // - // await Response().Embed(embed).SendAsync(); - // } +// [Cmd] +// public async Task DuckDuckGo([Leftover] string query = null) +// { +// query = query?.Trim(); +// if (!await ValidateQuery(query)) +// return; +// +// _ = ctx.Channel.TriggerTypingAsync(); +// +// var data = await _service.DuckDuckGoSearchAsync(query); +// if (data is null) +// { +// await Response().Error(strs.no_results).SendAsync(); +// return; +// } +// +// var desc = data.Results.Take(5) +// .Select(res => $@"[**{res.Title}**]({res.Link}) +// {res.Text.TrimTo(380 - res.Title.Length - res.Link.Length)}"); +// +// var descStr = string.Join("\n\n", desc); +// +// var embed = _sender.CreateEmbed() +// .WithAuthor(ctx.User.ToString(), +// "https://upload.wikimedia.org/wikipedia/en/9/90/The_DuckDuckGo_Duck.png") +// .WithDescription($"{GetText(strs.search_for)} **{query}**\n\n" + descStr) +// .WithOkColor(); +// +// await Response().Embed(embed).SendAsync(); +// } } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/Search/Youtube/IYoutubeSearchService.cs b/src/EllieBot/Modules/Searches/Search/Youtube/IYoutubeSearchService.cs index bbfca62..5b9bfab 100644 --- a/src/EllieBot/Modules/Searches/Search/Youtube/IYoutubeSearchService.cs +++ b/src/EllieBot/Modules/Searches/Search/Youtube/IYoutubeSearchService.cs @@ -2,5 +2,5 @@ public interface IYoutubeSearchService { - Task SearchAsync(string query); + Task SearchAsync(string query); } \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/Search/Youtube/InvidiousSearchResponse.cs b/src/EllieBot/Modules/Searches/Search/Youtube/InvidiousSearchResponse.cs index d9a3f89..9951db8 100644 --- a/src/EllieBot/Modules/Searches/Search/Youtube/InvidiousSearchResponse.cs +++ b/src/EllieBot/Modules/Searches/Search/Youtube/InvidiousSearchResponse.cs @@ -5,59 +5,5 @@ namespace EllieBot.Modules.Searches; public sealed class InvidiousSearchResponse { [JsonPropertyName("videoId")] - public required string VideoId { get; init; } - - [JsonPropertyName("title")] - public required string Title { get; init; } - - [JsonPropertyName("videoThumbnails")] - public required List Thumbnails { get; init; } - - [JsonPropertyName("lengthSeconds")] - public required int LengthSeconds { get; init; } - - [JsonPropertyName("description")] - public required string Description { get; init; } -} - -public sealed class InvidiousVideoResponse -{ - [JsonPropertyName("title")] - public required string Title { get; init; } - - [JsonPropertyName("videoId")] - public required string VideoId { get; init; } - - [JsonPropertyName("lengthSeconds")] - public required int LengthSeconds { get; init; } - - [JsonPropertyName("videoThumbnails")] - public required List Thumbnails { get; init; } - - [JsonPropertyName("adaptiveFormats")] - public required List AdaptiveFormats { get; init; } -} - -public sealed class InvidiousAdaptiveFormat -{ - [JsonPropertyName("url")] - public required string Url { get; init; } - - [JsonPropertyName("audioQuality")] - public string? AudioQuality { get; init; } -} - -public sealed class InvidiousPlaylistResponse -{ - [JsonPropertyName("title")] - public required string Title { get; init; } - - [JsonPropertyName("videos")] - public required List Videos { get; init; } -} - -public sealed class InvidiousThumbnail -{ - [JsonPropertyName("url")] - public required string Url { get; init; } + public string VideoId { get; set; } = null!; } \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/Search/Youtube/InvidiousYtSearchService.cs b/src/EllieBot/Modules/Searches/Search/Youtube/InvidiousYtSearchService.cs index 99ae4c2..6fc8bac 100644 --- a/src/EllieBot/Modules/Searches/Search/Youtube/InvidiousYtSearchService.cs +++ b/src/EllieBot/Modules/Searches/Search/Youtube/InvidiousYtSearchService.cs @@ -18,7 +18,7 @@ public sealed class InvidiousYtSearchService : IYoutubeSearchService, IEService _rng = new(); } - public async Task SearchAsync(string query) + public async Task SearchAsync(string query) { ArgumentNullException.ThrowIfNull(query); @@ -32,17 +32,15 @@ public sealed class InvidiousYtSearchService : IYoutubeSearchService, IEService var instance = instances[_rng.Next(0, instances.Count)]; - var url = $"{instance}/api/v1/search" - + $"?q={query}" - + $"&type=video"; - using var http = _http.CreateClient(); var res = await http.GetFromJsonAsync>( - url); + $"{instance}/api/v1/search" + + $"?q={query}" + + $"&type=video"); - if (res is null or { Count: 0 }) + if (res is null or {Count: 0}) return null; - return res.Map(r => new VideoInfo(r.VideoId)); + return new VideoInfo(res[0].VideoId); } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/Search/Youtube/YoutubeDataApiSearchService.cs b/src/EllieBot/Modules/Searches/Search/Youtube/YoutubeDataApiSearchService.cs index b39d035..e8bfcd2 100644 --- a/src/EllieBot/Modules/Searches/Search/Youtube/YoutubeDataApiSearchService.cs +++ b/src/EllieBot/Modules/Searches/Search/Youtube/YoutubeDataApiSearchService.cs @@ -9,18 +9,18 @@ public sealed class YoutubeDataApiSearchService : IYoutubeSearchService, IEServi _gapi = gapi; } - public async Task SearchAsync(string query) + public async Task SearchAsync(string query) { ArgumentNullException.ThrowIfNull(query); var results = await _gapi.GetVideoLinksByKeywordAsync(query); - - if (results.Count == 0) + var first = results.FirstOrDefault(); + if (first is null) return null; - return results.Map(r => new VideoInfo() + return new() { - Url = r - }); + Url = first + }; } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/Search/Youtube/YtDlpSearchService.cs b/src/EllieBot/Modules/Searches/Search/Youtube/YtDlpSearchService.cs deleted file mode 100644 index b36a726..0000000 --- a/src/EllieBot/Modules/Searches/Search/Youtube/YtDlpSearchService.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace EllieBot.Modules.Searches.Youtube; - -public class YtDlpSearchService : IYoutubeSearchService, IEService -{ - private YtdlOperation CreateYtdlOp(int count) - => new YtdlOperation("-4 " - + "--ignore-errors --flat-playlist --skip-download --quiet " - + "--geo-bypass " - + "--encoding UTF8 " - + "--get-id " - + "--no-check-certificate " - + "--default-search " - + $"\"ytsearch{count}:\" -- \"{{0}}\""); - - public async Task SearchAsync(string query) - { - var op = CreateYtdlOp(5); - var data = await op.GetDataAsync(query); - var items = data?.Split('\n'); - if (items is null or { Length: 0 }) - return null; - - return items - .Map(x => new VideoInfo(x)); - } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/Search/Youtube/YtdlYoutubeSearchService.cs b/src/EllieBot/Modules/Searches/Search/Youtube/YtdlYoutubeSearchService.cs new file mode 100644 index 0000000..3ac59f8 --- /dev/null +++ b/src/EllieBot/Modules/Searches/Search/Youtube/YtdlYoutubeSearchService.cs @@ -0,0 +1,7 @@ +namespace EllieBot.Modules.Searches.Youtube; + +public sealed class YtdlYoutubeSearchService : YoutubedlxServiceBase, IEService +{ + public override async Task SearchAsync(string query) + => await InternalGetInfoAsync(query, false); +} \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/Search/Youtube/YtdlpYoutubeSearchService.cs b/src/EllieBot/Modules/Searches/Search/Youtube/YtdlpYoutubeSearchService.cs new file mode 100644 index 0000000..d7e66fa --- /dev/null +++ b/src/EllieBot/Modules/Searches/Search/Youtube/YtdlpYoutubeSearchService.cs @@ -0,0 +1,7 @@ +namespace EllieBot.Modules.Searches.Youtube; + +public sealed class YtdlpYoutubeSearchService : YoutubedlxServiceBase, IEService +{ + public override async Task SearchAsync(string query) + => await InternalGetInfoAsync(query, true); +} \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/Search/Youtube/YtdlxServiceBase.cs b/src/EllieBot/Modules/Searches/Search/Youtube/YtdlxServiceBase.cs new file mode 100644 index 0000000..6239bdd --- /dev/null +++ b/src/EllieBot/Modules/Searches/Search/Youtube/YtdlxServiceBase.cs @@ -0,0 +1,34 @@ +namespace EllieBot.Modules.Searches.Youtube; + +public abstract class YoutubedlxServiceBase : IYoutubeSearchService +{ + private YtdlOperation CreateYtdlOp(bool isYtDlp) + => new YtdlOperation("-4 " + + "--geo-bypass " + + "--encoding UTF8 " + + "--get-id " + + "--no-check-certificate " + + "--default-search " + + "\"ytsearch:\" -- \"{0}\"", + isYtDlp: isYtDlp); + + protected async Task InternalGetInfoAsync(string query, bool isYtDlp) + { + var op = CreateYtdlOp(isYtDlp); + var data = await op.GetDataAsync(query); + var items = data?.Split('\n'); + if (items is null or { Length: 0 }) + return null; + + var id = items.FirstOrDefault(x => x.Length is > 5 and < 15); + if (id is null) + return null; + + return new VideoInfo() + { + Url = $"https://youtube.com/watch?v={id}" + }; + } + + public abstract Task SearchAsync(string query); +} \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/Searches.cs b/src/EllieBot/Modules/Searches/Searches.cs index ac7e60a..70e2556 100644 --- a/src/EllieBot/Modules/Searches/Searches.cs +++ b/src/EllieBot/Modules/Searches/Searches.cs @@ -13,14 +13,14 @@ namespace EllieBot.Modules.Searches; public partial class Searches : EllieModule { - private readonly IBotCreds _creds; + private readonly IBotCredentials _creds; private readonly IGoogleApiService _google; private readonly IHttpClientFactory _httpFactory; private readonly IMemoryCache _cache; private readonly ITimezoneService _tzSvc; public Searches( - IBotCreds creds, + IBotCredentials creds, IGoogleApiService google, IHttpClientFactory factory, IMemoryCache cache, diff --git a/src/EllieBot/Modules/Searches/SearchesService.cs b/src/EllieBot/Modules/Searches/SearchesService.cs index 039b574..05f2d90 100644 --- a/src/EllieBot/Modules/Searches/SearchesService.cs +++ b/src/EllieBot/Modules/Searches/SearchesService.cs @@ -34,7 +34,6 @@ public class SearchesService : IEService IGoogleApiService google, IBotCache c, IHttpClientFactory factory, - FontProvider fonts, IBotCredsProvider creds) { _httpFactory = factory; @@ -179,7 +178,7 @@ public class SearchesService : IEService }; - return $"https://ellie-pictures.nyc3.digitaloceanspaces.com/{subpath}/" + return $"https://nadeko-pictures.nyc3.digitaloceanspaces.com/{subpath}/" + _rng.Next(1, max).ToString("000") + ".png"; } @@ -518,7 +517,7 @@ public class SearchesService : IEService public async Task, ErrorType>> GetDefinitionsAsync(string query) { - if (string.IsNullOrWhiteSpace(query)) + if (string.IsNullOrEmpty(query)) { return ErrorType.InvalidInput; } @@ -549,7 +548,6 @@ public class SearchesService : IEService return ErrorType.NotFound; } - var items = new List(); foreach (var d in data) diff --git a/src/EllieBot/Modules/Searches/StreamNotification/StreamNotificationService.cs b/src/EllieBot/Modules/Searches/StreamNotification/StreamNotificationService.cs index 9870c13..03bcb13 100644 --- a/src/EllieBot/Modules/Searches/StreamNotification/StreamNotificationService.cs +++ b/src/EllieBot/Modules/Searches/StreamNotification/StreamNotificationService.cs @@ -657,7 +657,7 @@ public sealed class StreamNotificationService : IEService, IReadyExecutor .OrderBy(x => x.Id) .ToList(); - for (var index = all.Count - 1; index >= 0; index--) + for (var index = all.Count - 1; index >= 0; index--) { var fs = all[index]; if (guild.GetTextChannel(fs.ChannelId) is null) diff --git a/src/EllieBot/Modules/Searches/Translate/FlagTranslateService.cs b/src/EllieBot/Modules/Searches/Translate/FlagTranslateService.cs deleted file mode 100644 index 2b5baa5..0000000 --- a/src/EllieBot/Modules/Searches/Translate/FlagTranslateService.cs +++ /dev/null @@ -1,191 +0,0 @@ -#nullable disable -using LinqToDB; -using LinqToDB.EntityFrameworkCore; -using EllieBot.Common.ModuleBehaviors; -using EllieBot.Db.Models; -using System.Collections.Frozen; - -namespace EllieBot.Modules.Searches; - -public sealed partial class FlagTranslateService : IReadyExecutor, IEService -{ - private readonly IBotCreds _creds; - private readonly DiscordSocketClient _client; - private readonly TranslateService _ts; - private readonly IMessageSenderService _sender; - private IReadOnlyDictionary _supportedFlags; - private readonly DbService _db; - private ConcurrentHashSet _enabledChannels; - private readonly IBotCache _cache; - - // disallow same message being translated multiple times to the same language - private readonly ConcurrentHashSet<(ulong, string)> _msgLangs = new(); - - public FlagTranslateService( - IBotCreds creds, - DiscordSocketClient client, - TranslateService ts, - IMessageSenderService sender, - DbService db, - IBotCache cache) - { - _creds = creds; - _client = client; - _ts = ts; - _sender = sender; - _db = db; - _cache = cache; - } - - public async Task OnReadyAsync() - { - _supportedFlags = COUNTRIES - .Split('\n') - .Select(x => x.Split(' ')) - .ToDictionary(x => x[0], x => x[1].TrimEnd()) - .ToFrozenDictionary(); - - await using (var uow = _db.GetDbContext()) - { - _enabledChannels = (await uow.GetTable() - .Where(x => Linq2DbExpressions.GuildOnShard(x.GuildId, - _creds.TotalShards, - _client.ShardId)) - .Select(x => new - { - x.ChannelId, - x.GuildId - }) - .ToListAsyncLinqToDB()) - .Select(x => x.ChannelId) - .ToHashSet() - .ToConcurrentSet(); - } - - _client.ReactionAdded += OnReactionAdded; - - var periodicCleanup = new PeriodicTimer(TimeSpan.FromHours(24)); - - while (await periodicCleanup.WaitForNextTickAsync()) - { - _msgLangs.Clear(); - } - } - - private const int FLAG_START = 127462; - - private static TypedKey CdKey(ulong userId) - => new($"flagtranslate:{userId}"); - - private Task OnReactionAdded( - Cacheable arg1, - Cacheable arg2, - SocketReaction reaction) - { - if (!_enabledChannels.Contains(reaction.Channel.Id)) - return Task.CompletedTask; - - var runes = reaction.Emote.Name.EnumerateRunes(); - if (!runes.MoveNext() - || runes.Current is not { Value: >= 127462 and <= 127487 } l1 - || !runes.MoveNext() - || runes.Current is not { Value: >= 127462 and <= 127487 } l2) - { - return Task.CompletedTask; - } - - _ = Task.Run(async () => - { - if (reaction.Channel is not SocketTextChannel tc) - return; - - var user = await ((IGuild)tc.Guild).GetUserAsync(reaction.UserId); - - if (user is null) - return; - - if (!user.GetPermissions(tc).SendMessages) - return; - - if (!tc.Guild.CurrentUser.GetPermissions(tc).SendMessages - || !tc.Guild.CurrentUser.GetPermissions(tc).EmbedLinks) - { - await Disable(tc.Guild.Id, tc.Id); - return; - } - - var c1 = (char)(l1.Value - FLAG_START + 65); - var c2 = (char)(l2.Value - FLAG_START + 65); - - var code = $"{c1}{c2}".ToUpper(); - - if (!_supportedFlags.TryGetValue(code, out var lang)) - return; - - if (!_msgLangs.Add((reaction.MessageId, lang))) - return; - - var result = await _cache.GetAsync(CdKey(reaction.UserId)); - if (result.TryPickT0(out _, out _)) - return; - - await _cache.AddAsync(CdKey(reaction.UserId), true, TimeSpan.FromSeconds(5)); - - var msg = await arg1.GetOrDownloadAsync(); - - var response = await _ts.Translate("", lang, msg.Content).ConfigureAwait(false); - - await msg.ReplyAsync(embed: _sender.CreateEmbed() - .WithOkColor() - .WithFooter(user.ToString() ?? reaction.UserId.ToString(), - user.RealAvatarUrl().ToString()) - .WithDescription(response) - .WithAuthor(reaction.Emote.ToString()) - .Build(), - allowedMentions: AllowedMentions.None - ); - }); - - return Task.CompletedTask; - } - - public async Task Disable(ulong guildId, ulong tcId) - { - if (!_enabledChannels.TryRemove(tcId)) - return; - - await using var uow = _db.GetDbContext(); - await uow.GetTable() - .Where(x => x.GuildId == guildId - && x.ChannelId == tcId) - .DeleteAsync(); - } - - public async Task Toggle(ulong guildId, ulong tcId) - { - if (_enabledChannels.Contains(tcId)) - { - await Disable(guildId, tcId); - - return false; - } - - await Enable(guildId, tcId); - - return true; - } - - public async Task Enable(ulong guildId, ulong tcId) - { - if (!_enabledChannels.Add(tcId)) - return; - - await using var uow = _db.GetDbContext(); - await uow.GetTable() - .InsertAsync(() => new FlagTranslateChannel - { - GuildId = guildId, - ChannelId = tcId - }); - } -} diff --git a/src/EllieBot/Modules/Searches/Translate/FlagTranslateService_SupportedFlags.cs b/src/EllieBot/Modules/Searches/Translate/FlagTranslateService_SupportedFlags.cs deleted file mode 100644 index 3f058eb..0000000 --- a/src/EllieBot/Modules/Searches/Translate/FlagTranslateService_SupportedFlags.cs +++ /dev/null @@ -1,81 +0,0 @@ -namespace EllieBot.Modules.Searches; - -public partial class FlagTranslateService -{ - private const string COUNTRIES = """ - CN zh - IN hi - US en - ID id - PK ur - BR pt - NG ha - BD bn - RU ru - JP ja - MX es - PH tl - VN vi - EG ar - ET am - DE de - IR fa - TR tr - TH th - FR fr - CD fr - MM my - UG en - MZ pt - ZA zu - CO es - BG bg - HR hr - MY ms - NL nl - RO ro - CZ cs - GR el - SK sk - PT pt - KR ko - IT it - ES es - RS sr - TN ar - PL pl - SD ar - CM fr - SN fr - ML fr - NE ha - BI fr - AO pt - AF ps - MA ar - DZ ar - GB en - AR es - ZW ny - KE sw - GH en - SA ar - IL he - IQ ar - UA ua - LY ar - KW ar - OM ar - YE ar - AL sq - AE ar - AU en - NZ en - KZ kz - NO no - SE sv - DK da - FI fi - HU hu - """; -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/Translate/TranslateService.cs b/src/EllieBot/Modules/Searches/Translate/TranslateService.cs index 22e4338..9f50615 100644 --- a/src/EllieBot/Modules/Searches/Translate/TranslateService.cs +++ b/src/EllieBot/Modules/Searches/Translate/TranslateService.cs @@ -44,10 +44,12 @@ public sealed class TranslateService : ITranslateService, IExecNoCommand, IReady foreach (var c in cs) { _atcs[c.ChannelId] = c.AutoDelete; - _users[c.ChannelId] = new(c.Users.ToDictionary(x => x.UserId, x => (x.Source.ToLower(), x.Target.ToLower()))); + _users[c.ChannelId] = + new(c.Users.ToDictionary(x => x.UserId, x => (x.Source.ToLower(), x.Target.ToLower()))); } } + public async Task ExecOnNoCommandAsync(IGuild guild, IUserMessage msg) { if (string.IsNullOrWhiteSpace(msg.Content)) @@ -93,7 +95,7 @@ public sealed class TranslateService : ITranslateService, IExecNoCommand, IReady } } - public async Task Translate(string source, string target, string text) + public async Task Translate(string source, string target, string text = null) { if (string.IsNullOrWhiteSpace(text)) throw new ArgumentException("Text is empty or null", nameof(text)); diff --git a/src/EllieBot/Modules/Searches/Translate/TranslatorCommands.cs b/src/EllieBot/Modules/Searches/Translate/TranslatorCommands.cs index b1cf524..348ca61 100644 --- a/src/EllieBot/Modules/Searches/Translate/TranslatorCommands.cs +++ b/src/EllieBot/Modules/Searches/Translate/TranslatorCommands.cs @@ -6,14 +6,6 @@ public partial class Searches [Group] public partial class TranslateCommands : EllieModule { - private readonly FlagTranslateService _flagSvc; - - public TranslateCommands(FlagTranslateService flagSvc) - { - _flagSvc = flagSvc; - } - - public enum AutoDeleteAutoTranslate { Del, @@ -99,18 +91,5 @@ public partial class Searches await Response().Embed(eb).SendAsync(); } - - [Cmd] - [RequireContext(ContextType.Guild)] - [UserPerm(ChannelPermission.ManageChannels)] - [BotPerm(ChannelPermission.SendMessages | ChannelPermission.EmbedLinks)] - public async Task TranslateFlags() - { - var enabled = await _flagSvc.Toggle(ctx.Guild.Id, ctx.Channel.Id); - if (enabled) - await Response().Confirm(strs.trfl_enabled).SendAsync(); - else - await Response().Confirm(strs.trfl_disabled).SendAsync(); - } } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/_common/Config/SearchesConfig.cs b/src/EllieBot/Modules/Searches/_common/Config/SearchesConfig.cs index ffcedc5..fb64849 100644 --- a/src/EllieBot/Modules/Searches/_common/Config/SearchesConfig.cs +++ b/src/EllieBot/Modules/Searches/_common/Config/SearchesConfig.cs @@ -7,7 +7,7 @@ namespace EllieBot.Modules.Searches; public partial class SearchesConfig : ICloneable { [Comment("DO NOT CHANGE")] - public int Version { get; set; } = 3; + public int Version { get; set; } = 0; [Comment(""" Which engine should .search command @@ -26,11 +26,13 @@ public partial class SearchesConfig : ICloneable [Comment(""" - Which search provider will be used for the `.youtube` and `.q` commands. + Which search provider will be used for the `.youtube` command. - - `ytDataApiv3` - uses google's official youtube data api. Requires `GoogleApiKey` set in creds and youtube data api enabled in developers console. `.q` is not supported for this setting. It will fallback to yt-dlp. + - `ytDataApiv3` - uses google's official youtube data api. Requires `GoogleApiKey` set in creds and youtube data api enabled in developers console - - `ytdlp` - default, recommended easy, uses `yt-dlp`. Requires `yt-dlp` to be installed and it's path added to env variables + - `ytdl` - default, uses youtube-dl. Requires `youtube-dl` to be installed and it's path added to env variables. Slow. + + - `ytdlp` - recommended easy, uses `yt-dlp`. Requires `yt-dlp` to be installed and it's path added to env variables - `invidious` - recommended advanced, uses invidious api. Requires at least one invidious instance specified in the `invidiousInstances` property """)] @@ -56,6 +58,7 @@ public partial class SearchesConfig : ICloneable [Comment(""" Set the invidious instance urls in case you want to use 'invidious' for `.youtube` search Ellie will use a random one for each request. + These instances may be used for music queue functionality in the future. Use a fully qualified url. Example: https://my-invidious-instance.mydomain.com Instances specified must have api available. @@ -75,9 +78,9 @@ public sealed class FollowedStreamConfig public enum YoutubeSearcher { - YtDataApiv3 = 0, - Ytdl = 1, - Ytdlp = 1, - Invid = 3, + YtDataApiv3, + Ytdl, + Ytdlp, + Invid, Invidious = 3 } \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/_common/Config/SearchesConfigService.cs b/src/EllieBot/Modules/Searches/_common/Config/SearchesConfigService.cs index 5ad305a..f656a5b 100644 --- a/src/EllieBot/Modules/Searches/_common/Config/SearchesConfigService.cs +++ b/src/EllieBot/Modules/Searches/_common/Config/SearchesConfigService.cs @@ -47,11 +47,11 @@ public class SearchesConfigService : ConfigServiceBase }); } - if (data.Version < 4) + if (data.Version < 2) { ModifyConfig(c => { - c.Version = 4; + c.Version = 2; }); } } diff --git a/src/EllieBot/Modules/Searches/_common/OsuUserData.cs b/src/EllieBot/Modules/Searches/_common/OsuUserData.cs index 86f1000..a0a1be0 100644 --- a/src/EllieBot/Modules/Searches/_common/OsuUserData.cs +++ b/src/EllieBot/Modules/Searches/_common/OsuUserData.cs @@ -67,7 +67,7 @@ public class OsuUserData [JsonProperty("pp_country_rank")] public string PpCountryRank { get; set; } - + [JsonIgnore] public int ModeNumber { get; set; } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/_common/ShortenData.cs b/src/EllieBot/Modules/Searches/_common/ShortenData.cs index 872347e..b08435c 100644 --- a/src/EllieBot/Modules/Searches/_common/ShortenData.cs +++ b/src/EllieBot/Modules/Searches/_common/ShortenData.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable using Newtonsoft.Json; namespace EllieBot.Modules.Searches.Services; diff --git a/src/EllieBot/Modules/Utility/AfkService.cs b/src/EllieBot/Modules/Utility/AfkService.cs index 7f8ede4..18c5f2c 100644 --- a/src/EllieBot/Modules/Utility/AfkService.cs +++ b/src/EllieBot/Modules/Utility/AfkService.cs @@ -61,7 +61,7 @@ public sealed class AfkService : IEService, IReadyExecutor await Task.Delay(_maxAfkDuration); _client.MessageReceived -= StopAfk; }); - + return added; } @@ -79,7 +79,7 @@ public sealed class AfkService : IEService, IReadyExecutor if (arg is not IUserMessage uMsg || uMsg.Channel is not ITextChannel tc) return Task.CompletedTask; - + if ((arg.MentionedUsers.Count is 0 or > 3) && uMsg.ReferencedMessage is null) return Task.CompletedTask; @@ -115,7 +115,7 @@ public sealed class AfkService : IEService, IReadyExecutor { return; } - + mentionedUserId = repliedUserId; } @@ -125,9 +125,9 @@ public sealed class AfkService : IEService, IReadyExecutor if (result.TryPickT0(out var msg, out _)) { var st = SmartText.CreateFrom(msg); - + st = $"The user you've pinged (<#{mentionedUserId}>) is AFK: " + st; - + var toDelete = await _mss.Response(arg.Channel) .User(arg.Author) .Message(uMsg) diff --git a/src/EllieBot/Modules/Utility/Ai/AiAssistantService.cs b/src/EllieBot/Modules/Utility/Ai/AiAssistantService.cs index 512c2db..6f6c03c 100644 --- a/src/EllieBot/Modules/Utility/Ai/AiAssistantService.cs +++ b/src/EllieBot/Modules/Utility/Ai/AiAssistantService.cs @@ -88,8 +88,8 @@ public sealed class AiAssistantService using var request = new HttpRequestMessage(); request.Method = HttpMethod.Post; - // request.RequestUri = new("https://eai.elliebot.net/get-command"); - request.RequestUri = new("https://eai.elliebot.net/get-command"); + // request.RequestUri = new("https://nai.nadeko.bot/get-command"); + request.RequestUri = new("https://nai.nadeko.bot/get-command"); request.Content = content; var creds = _credsProvider.GetCreds(); @@ -100,6 +100,10 @@ public sealed class AiAssistantService using var client = _httpFactory.CreateClient(); + // todo customize according to the bot's config + // - CurrencyName + // - + using var response = await client.SendAsync(request); if (response.StatusCode == HttpStatusCode.TooManyRequests) @@ -241,7 +245,7 @@ public sealed class AiAssistantService { if (guild is not SocketGuild sg) return false; - + var sess = _cbs.GetOrCreateSession(guild.Id); if (sess is null) return false; @@ -298,7 +302,7 @@ public sealed class AiAssistantService await _sender.Response(channel) .Error(errorMsg) .SendAsync(); - + return true; } diff --git a/src/EllieBot/Modules/Utility/Alias/AliasCommands.cs b/src/EllieBot/Modules/Utility/Alias/AliasCommands.cs index 7a4641d..fd2e52f 100644 --- a/src/EllieBot/Modules/Utility/Alias/AliasCommands.cs +++ b/src/EllieBot/Modules/Utility/Alias/AliasCommands.cs @@ -102,7 +102,6 @@ public partial class Utility await Response().Confirm(strs.alias_added(Format.Code(trigger), Format.Code(mapping))).SendAsync(); } - [Cmd] [RequireContext(ContextType.Guild)] public async Task AliasList(int page = 1) diff --git a/src/EllieBot/Modules/Utility/ConfigCommands.cs b/src/EllieBot/Modules/Utility/ConfigCommands.cs index 57b8f4c..2627d11 100644 --- a/src/EllieBot/Modules/Utility/ConfigCommands.cs +++ b/src/EllieBot/Modules/Utility/ConfigCommands.cs @@ -8,7 +8,7 @@ public partial class Utility private readonly IEnumerable _settingServices; public ConfigCommands(IEnumerable settingServices) - => _settingServices = settingServices.Where(x => x.Name != "medusa"); + => _settingServices = settingServices.Where(x => x.Name != "marmalade"); [Cmd] [OwnerOnly] diff --git a/src/EllieBot/Modules/Utility/Giveaway/GiveawayService.cs b/src/EllieBot/Modules/Utility/Giveaway/GiveawayService.cs index 0a0cf51..200c88a 100644 --- a/src/EllieBot/Modules/Utility/Giveaway/GiveawayService.cs +++ b/src/EllieBot/Modules/Utility/Giveaway/GiveawayService.cs @@ -11,7 +11,7 @@ public sealed class GiveawayService : IEService, IReadyExecutor public static string GiveawayEmoji = "🎉"; private readonly DbService _db; - private readonly IBotCreds _creds; + private readonly IBotCredentials _creds; private readonly DiscordSocketClient _client; private readonly IMessageSenderService _sender; private readonly IBotStrings _strings; @@ -20,7 +20,7 @@ public sealed class GiveawayService : IEService, IReadyExecutor private SortedSet _giveawayCache = new SortedSet(); private readonly EllieRandom _rng; - public GiveawayService(DbService db, IBotCreds creds, DiscordSocketClient client, + public GiveawayService(DbService db, IBotCredentials creds, DiscordSocketClient client, IMessageSenderService sender, IBotStrings strings, ILocalization localization, IMemoryCache cache) { _db = db; diff --git a/src/EllieBot/Modules/Utility/Quote/IQuoteService.cs b/src/EllieBot/Modules/Utility/Quote/IQuoteService.cs index 87f9675..acd6b19 100644 --- a/src/EllieBot/Modules/Utility/Quote/IQuoteService.cs +++ b/src/EllieBot/Modules/Utility/Quote/IQuoteService.cs @@ -27,8 +27,6 @@ public interface IQuoteService string? keyword, string text); - Task<(IReadOnlyCollection quotes, int totalCount)> FindQuotesAsync(ulong guildId, string query, int page); - Task> GetGuildQuotesAsync(ulong guildId); Task RemoveAllByKeyword(ulong guildId, string keyword); Task GetQuoteByIdAsync(ulong guildId, int quoteId); @@ -41,7 +39,6 @@ public interface IQuoteService string text); Task EditQuoteAsync(ulong authorId, int quoteId, string text); - Task EditQuoteAsync(ulong guildId, int quoteId, string keyword, string text); Task DeleteQuoteAsync( ulong guildId, diff --git a/src/EllieBot/Modules/Utility/Quote/QuoteService.cs b/src/EllieBot/Modules/Utility/Quote/QuoteService.cs index 429387a..a518a01 100644 --- a/src/EllieBot/Modules/Utility/Quote/QuoteService.cs +++ b/src/EllieBot/Modules/Utility/Quote/QuoteService.cs @@ -169,23 +169,6 @@ public sealed class QuoteService : IQuoteService, IEService return q; } - public async Task EditQuoteAsync( - ulong guildId, - int quoteId, - string keyword, - string text) - { - await using var uow = _db.GetDbContext(); - var result = await uow.GetTable() - .Where(x => x.Id == quoteId && x.GuildId == guildId) - .Set(x => x.Keyword, keyword) - .Set(x => x.Text, text) - .UpdateWithOutputAsync((del, ins) => ins); - - var q = result.FirstOrDefault(); - return q; - } - public async Task DeleteQuoteAsync( ulong guildId, ulong authorId, @@ -236,24 +219,4 @@ public sealed class QuoteService : IQuoteService, IEService return true; } - - public async Task<(IReadOnlyCollection quotes, int totalCount)> FindQuotesAsync( - ulong guildId, - string query, - int page) - { - await using var uow = _db.GetDbContext(); - - var baseQuery = uow.GetTable() - .Where(x => x.GuildId == guildId) - .Where(x => x.Keyword.Contains(query) || x.Text.Contains(query)); - - var quotes = await baseQuery - .OrderBy(x => x.Id) - .Skip((page - 1) * 10) - .Take(10) - .ToListAsyncLinqToDB(); - - return (quotes, await baseQuery.CountAsyncLinqToDB()); - } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Utility/Remind/RemindService.cs b/src/EllieBot/Modules/Utility/Remind/RemindService.cs index 0d91498..78981d7 100644 --- a/src/EllieBot/Modules/Utility/Remind/RemindService.cs +++ b/src/EllieBot/Modules/Utility/Remind/RemindService.cs @@ -12,19 +12,19 @@ public class RemindService : IEService, IReadyExecutor, IRemindService { private readonly Regex _regex = new( - @"^(?:(?:at|on(?:\sthe)?)?\s*(?(?:\d{2}:\d{2}\s)?\d{1,2}\.\d{1,2}(?:\.\d{2,4})?)|(?:in\s?)?\s*(?:(?\d+)(?:\s?(?:months?|mos?),?))?(?:(?:\sand\s|\s*)?(?\d+)(?:\s?(?:weeks?|w),?))?(?:(?:\sand\s|\s*)?(?\d+)(?:\s?(?:days?|d),?))?(?:(?:\sand\s|\s*)?(?\d+)(?:\s?(?:hours?|h),?))?(?:(?:\sand\s|\s*)?(?\d+)(?:\s?(?:minutes?|mins?|m),?))?)\s+(?:to:?\s+)?(?(?:\r\n|[\r\n]|.)+)", + @"^(?:(?:at|on(?:\sthe)?)?\s*(?(?:\d{2}:\d{2}\s)?\d{1,2}\.\d{1,2}(?:\.\d{2,4})?)|(?:in\s?)?\s*(?:(?\d+)(?:\s?(?:months?|mos?),?))?(?:(?:\sand\s|\s*)?(?\d+)(?:\s?(?:weeks?|w),?))?(?:(?:\sand\s|\s*)?(?\d+)(?:\s?(?:days?|d),?))?(?:(?:\sand\s|\s*)?(?\d+)(?:\s?(?:hours?|h),?))?(?:(?:\sand\s|\s*)?(?\d+)(?:\s?(?:minutes?|mins?|m),?))?)\s+(?:to:?\s+)?(?(?:\r\n|[\r\n]|.)+)", RegexOptions.Compiled | RegexOptions.Multiline); private readonly DiscordSocketClient _client; private readonly DbService _db; - private readonly IBotCreds _creds; + private readonly IBotCredentials _creds; private readonly IMessageSenderService _sender; private readonly CultureInfo _culture; public RemindService( DiscordSocketClient client, DbService db, - IBotCreds creds, + IBotCredentials creds, IMessageSenderService sender) { _client = client; @@ -197,29 +197,26 @@ public class RemindService : IEService, IReadyExecutor, IRemindService var st = SmartText.CreateFrom(r.Message); - var res = _sender.Response(ch) - .UserBasedMentions(_client.GetGuild(r.ServerId)?.GetUser(r.UserId)); - if (st is SmartEmbedText set) { - await res.Embed(set.GetEmbed()).SendAsync(); + await _sender.Response(ch).Embed(set.GetEmbed()).SendAsync(); } else if (st is SmartEmbedTextArray seta) { - await res.Embeds(seta.GetEmbedBuilders()).SendAsync(); + await _sender.Response(ch).Embeds(seta.GetEmbedBuilders()).SendAsync(); } else { - await res - .Embed(_sender.CreateEmbed() - .WithOkColor() - .WithTitle("Reminder") - .AddField("Created At", - r.DateAdded.HasValue ? r.DateAdded.Value.ToLongDateString() : "?") - .AddField("By", - (await ch.GetUserAsync(r.UserId))?.ToString() ?? r.UserId.ToString())) - .Text(r.Message) - .SendAsync(); + await _sender.Response(ch) + .Embed(_sender.CreateEmbed() + .WithOkColor() + .WithTitle("Reminder") + .AddField("Created At", + r.DateAdded.HasValue ? r.DateAdded.Value.ToLongDateString() : "?") + .AddField("By", + (await ch.GetUserAsync(r.UserId))?.ToString() ?? r.UserId.ToString())) + .Text(r.Message) + .SendAsync(); } } catch (Exception ex) diff --git a/src/EllieBot/Modules/Utility/Repeater/RepeaterService.cs b/src/EllieBot/Modules/Utility/Repeater/RepeaterService.cs index 7aa9b76..8d513cb 100644 --- a/src/EllieBot/Modules/Utility/Repeater/RepeaterService.cs +++ b/src/EllieBot/Modules/Utility/Repeater/RepeaterService.cs @@ -12,7 +12,7 @@ public sealed class RepeaterService : IReadyExecutor, IEService private readonly DbService _db; private readonly IReplacementService _repSvc; - private readonly IBotCreds _creds; + private readonly IBotCredentials _creds; private readonly DiscordSocketClient _client; private readonly LinkedList _repeaterQueue; private readonly ConcurrentHashSet _noRedundant; @@ -25,7 +25,7 @@ public sealed class RepeaterService : IReadyExecutor, IEService DiscordSocketClient client, DbService db, IReplacementService repSvc, - IBotCreds creds, + IBotCredentials creds, IMessageSenderService sender) { _db = db; diff --git a/src/EllieBot/Modules/Utility/Utility.cs b/src/EllieBot/Modules/Utility/Utility.cs index 146a97c..f84cd43 100644 --- a/src/EllieBot/Modules/Utility/Utility.cs +++ b/src/EllieBot/Modules/Utility/Utility.cs @@ -34,7 +34,7 @@ public partial class Utility : EllieModule private readonly DiscordSocketClient _client; private readonly ICoordinator _coord; private readonly IStatsService _stats; - private readonly IBotCreds _creds; + private readonly IBotCredentials _creds; private readonly DownloadTracker _tracker; private readonly IHttpClientFactory _httpFactory; private readonly VerboseErrorsService _veService; @@ -45,7 +45,7 @@ public partial class Utility : EllieModule DiscordSocketClient client, ICoordinator coord, IStatsService stats, - IBotCreds creds, + IBotCredentials creds, DownloadTracker tracker, IHttpClientFactory httpFactory, VerboseErrorsService veService, @@ -121,7 +121,7 @@ public partial class Utility : EllieModule userNames.Add(user); } } - + await Response() .Sanitize() .Paginated() @@ -222,7 +222,7 @@ public partial class Utility : EllieModule builder.AppendLine($"{p.Name} : {p.GetValue(perms, null)}"); await Response().Confirm(builder.ToString()).SendAsync(); } - + [Cmd] [RequireContext(ContextType.Guild)] public async Task UserId([Leftover] IGuildUser? target = null) @@ -331,7 +331,7 @@ public partial class Utility : EllieModule .WithOkColor() .WithAuthor($"EllieBot v{StatsService.BotVersion}", "https://cdn.elliebot.net/Ellie.png", - "https://docs.elliebot.net") + "https://docs.elliebot.net/") .AddField(GetText(strs.author), _stats.Author, true) .AddField(GetText(strs.botid), _client.CurrentUser.Id.ToString(), true) .AddField(GetText(strs.shard), @@ -783,28 +783,4 @@ public partial class Utility : EllieModule await Response().Error(ex.Message).SendAsync(); } } - - [Cmd] - public async Task Snipe() - { - if (ctx.Message.ReferencedMessage is not { } msg) - { - var msgs = await ctx.Channel.GetMessagesAsync(ctx.Message, Direction.Before, 3).FlattenAsync(); - msg = msgs.FirstOrDefault(x => !string.IsNullOrWhiteSpace(x.Content) || (x.Attachments.FirstOrDefault()?.Width is not null)) as IUserMessage; - - if (msg is null) - return; - } - - var eb = _sender.CreateEmbed() - .WithOkColor() - .WithDescription(msg.Content) - .WithAuthor(msg.Author) - .WithTimestamp(msg.Timestamp) - .WithImageUrl(msg.Attachments.FirstOrDefault()?.Url) - .WithFooter(GetText(strs.sniped_by(ctx.User.ToString())), ctx.User.GetDisplayAvatarUrl()); - - ctx.Message.DeleteAfter(1); - await Response().Embed(eb).SendAsync(); - } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Xp/Club/Club.cs b/src/EllieBot/Modules/Xp/Club/Club.cs index 4ce1c57..aff45be 100644 --- a/src/EllieBot/Modules/Xp/Club/Club.cs +++ b/src/EllieBot/Modules/Xp/Club/Club.cs @@ -112,14 +112,14 @@ public partial class Xp { var lvl = new LevelStats(club.Xp); var allUsers = club.Members.OrderByDescending(x => - { - var l = new LevelStats(x.TotalXp).Level; - if (club.OwnerId == x.Id) - return int.MaxValue; - if (x.IsClubAdmin) - return (int.MaxValue / 2) + l; - return l; - }) + { + var l = new LevelStats(x.TotalXp).Level; + if (club.OwnerId == x.Id) + return int.MaxValue; + if (x.IsClubAdmin) + return (int.MaxValue / 2) + l; + return l; + }) .ToList(); var rank = await _service.GetClubRankAsync(club.Id); diff --git a/src/EllieBot/Modules/Xp/Club/ClubService.cs b/src/EllieBot/Modules/Xp/Club/ClubService.cs index dad45ba..0c63913 100644 --- a/src/EllieBot/Modules/Xp/Club/ClubService.cs +++ b/src/EllieBot/Modules/Xp/Club/ClubService.cs @@ -173,7 +173,7 @@ public class ClubService : IEService, IClubService } - public ClubAcceptResult AcceptApplication(ulong clubOwnerUserId, string userName, out DiscordUser? discordUser ) + public ClubAcceptResult AcceptApplication(ulong clubOwnerUserId, string userName, out DiscordUser? discordUser) { discordUser = null; using var uow = _db.GetDbContext(); diff --git a/src/EllieBot/Modules/Xp/Club/IClubService.cs b/src/EllieBot/Modules/Xp/Club/IClubService.cs index ea23436..d838e91 100644 --- a/src/EllieBot/Modules/Xp/Club/IClubService.cs +++ b/src/EllieBot/Modules/Xp/Club/IClubService.cs @@ -6,7 +6,7 @@ namespace EllieBot.Modules.Xp.Services; public interface IClubService { Task CreateClubAsync(IUser user, string clubName); - OneOf TransferClub(IUser from, IUser newOwner); + OneOf TransferClub(IUser from, IUser newOwner); Task ToggleAdminAsync(IUser owner, IUser toAdmin); ClubInfo? GetClubByMember(IUser user); Task SetClubIconAsync(ulong ownerUserId, string? url); diff --git a/src/EllieBot/Modules/Xp/Xp.cs b/src/EllieBot/Modules/Xp/Xp.cs index 16e9a2f..63e59e3 100644 --- a/src/EllieBot/Modules/Xp/Xp.cs +++ b/src/EllieBot/Modules/Xp/Xp.cs @@ -107,7 +107,7 @@ public partial class Xp : EllieModule [Cmd] [UserPerm(GuildPerm.ManageChannels)] [RequireContext(ContextType.Guild)] - public async Task XpExclude(Channel _, [Leftover] IChannel? channel = null) + public async Task XpExclude(Channel _, [Leftover] IChannel channel = null) { if (channel is null) channel = ctx.Channel; @@ -182,28 +182,29 @@ public partial class Xp : EllieModule var (opts, _) = OptionsParser.ParseFrom(new LbOpts(), args); await ctx.Channel.TriggerTypingAsync(); + + var socketGuild = (SocketGuild)ctx.Guild; + var allCleanUsers = new List(); if (opts.Clean) { + await ctx.Channel.TriggerTypingAsync(); await _tracker.EnsureUsersDownloadedAsync(ctx.Guild); + + allCleanUsers = (await _service.GetTopUserXps(ctx.Guild.Id, 1000)) + .Where(user => socketGuild.GetUser(user.UserId) is not null) + .ToList(); } - async Task> GetPageItems(int curPage) - { - var socketGuild = (SocketGuild)ctx.Guild; - if (opts.Clean) - { - return await _service.GetGuildUserXps(ctx.Guild.Id, - socketGuild.Users.Select(x => x.Id).ToList(), - curPage); - } - - return await _service.GetGuildUserXps(ctx.Guild.Id, curPage); - } - - await Response() + var res = opts.Clean + ? Response() .Paginated() - .PageItems(GetPageItems) - .PageSize(10) + .Items(allCleanUsers) + : Response() + .Paginated() + .PageItems((curPage) => _service.GetUserXps(ctx.Guild.Id, curPage)); + + await res + .PageSize(9) .CurrentPage(page) .Page((users, curPage) => { @@ -225,7 +226,7 @@ public partial class Xp : EllieModule else if (userXpData.AwardedXp < 0) awardStr = $"({userXpData.AwardedXp})"; - embed.AddField($"#{i + 1 + (curPage * 10)} {user?.ToString() ?? users[i].UserId.ToString()}", + embed.AddField($"#{i + 1 + (curPage * 9)} {user?.ToString() ?? users[i].UserId.ToString()}", $"{GetText(strs.level_x(levelStats.Level))} - {levelStats.TotalXp}xp {awardStr}"); } @@ -236,33 +237,15 @@ public partial class Xp : EllieModule [Cmd] [RequireContext(ContextType.Guild)] - public async Task XpGlobalLeaderboard(int page = 1, params string[] args) + public async Task XpGlobalLeaderboard(int page = 1) { if (--page < 0 || page > 99) return; - var (opts, _) = OptionsParser.ParseFrom(new LbOpts(), args); - - await ctx.Channel.TriggerTypingAsync(); - if (opts.Clean) - { - await _tracker.EnsureUsersDownloadedAsync(ctx.Guild); - } - - async Task> GetPageItems(int curPage) - { - if (opts.Clean) - { - return await _service.GetGlobalUserXps(page, ((SocketGuild)ctx.Guild).Users.Select(x => x.Id).ToList()); - } - - return await _service.GetGlobalUserXps(curPage); - } - await Response() .Paginated() - .PageItems(GetPageItems) - .PageSize(10) + .PageItems(async curPage => await _service.GetUserXps(curPage)) + .PageSize(9) .Page((users, curPage) => { var embed = _sender.CreateEmbed() @@ -278,7 +261,7 @@ public partial class Xp : EllieModule for (var i = 0; i < users.Count; i++) { var user = users[i]; - embed.AddField($"#{i + 1 + (curPage * 10)} {user}", + embed.AddField($"#{i + 1 + (curPage * 9)} {user}", $"{GetText(strs.level_x(new LevelStats(users[i].TotalXp).Level))} - {users[i].TotalXp}xp"); } @@ -299,9 +282,7 @@ public partial class Xp : EllieModule if (role.IsManaged) return; - var count = await _service.AddXpToUsersAsync(ctx.Guild.Id, - amount, - role.Members.Select(x => x.Id).ToArray()); + var count = await _service.AddXpToUsersAsync(ctx.Guild.Id, amount, role.Members.Select(x => x.Id).ToArray()); await Response() .Confirm( strs.xpadd_users(Format.Bold(amount.ToString()), Format.Bold(count.ToString()))) @@ -357,7 +338,7 @@ public partial class Xp : EllieModule if (!await PromptUserConfirmAsync(embed)) return; - await _service.XpReset(ctx.Guild.Id, userId); + _service.XpReset(ctx.Guild.Id, userId); await Response().Confirm(strs.reset_user(userId)).SendAsync(); } @@ -464,10 +445,9 @@ public partial class Xp : EllieModule if (!string.IsNullOrWhiteSpace(item.Desc)) eb.AddField(GetText(strs.desc), item.Desc); -#if GLOBAL_ELLIE if (key == "default") eb.WithDescription(GetText(strs.xpshop_website)); -#endif + var tier = _service.GetXpShopTierRequirement(type); if (tier != PatronTier.None) diff --git a/src/EllieBot/Modules/Xp/XpService.cs b/src/EllieBot/Modules/Xp/XpService.cs index 808b79a..32ba10e 100644 --- a/src/EllieBot/Modules/Xp/XpService.cs +++ b/src/EllieBot/Modules/Xp/XpService.cs @@ -12,7 +12,6 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; using System.Threading.Channels; using LinqToDB.EntityFrameworkCore; -using LinqToDB.Tools; using EllieBot.Modules.Patronage; using Color = SixLabors.ImageSharp.Color; using Exception = System.Exception; @@ -20,38 +19,13 @@ using Image = SixLabors.ImageSharp.Image; namespace EllieBot.Modules.Xp.Services; -public interface IUserService -{ - Task GetUserAsync(ulong userId); -} - -public sealed class UserService : IUserService, IEService -{ - private readonly DbService _db; - - public UserService(DbService db) - { - _db = db; - } - - public async Task GetUserAsync(ulong userId) - { - await using var uow = _db.GetDbContext(); - var user = await uow - .GetTable() - .FirstOrDefaultAsyncLinqToDB(u => u.UserId == userId); - - return user; - } -} - public class XpService : IEService, IReadyExecutor, IExecNoCommand { private readonly DbService _db; private readonly IImageCache _images; private readonly IBotStrings _strings; private readonly FontProvider _fonts; - private readonly IBotCreds _creds; + private readonly IBotCredentials _creds; private readonly ICurrencyService _cs; private readonly IHttpClientFactory _httpFactory; private readonly XpConfigService _xpConfig; @@ -81,7 +55,7 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand IImageCache images, IBotCache c, FontProvider fonts, - IBotCreds creds, + IBotCredentials creds, ICurrencyService cs, IHttpClientFactory http, XpConfigService xpConfig, @@ -589,50 +563,23 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand uow.SaveChanges(); } - public async Task> GetGuildUserXps(ulong guildId, int page) + public async Task> GetUserXps(ulong guildId, int page) { await using var uow = _db.GetDbContext(); - return await uow - .UserXpStats - .Where(x => x.GuildId == guildId) - .OrderByDescending(x => x.Xp + x.AwardedXp) - .Skip(page * 10) - .Take(10) - .ToArrayAsyncLinqToDB(); + return await uow.Set().GetUsersFor(guildId, page); } - public async Task> GetGuildUserXps(ulong guildId, List users, int page) + public async Task> GetTopUserXps(ulong guildId, int count) { await using var uow = _db.GetDbContext(); - return await uow.Set() - .Where(x => x.GuildId == guildId && x.UserId.In(users)) - .OrderByDescending(x => x.Xp + x.AwardedXp) - .Skip(page * 10) - .Take(10) - .ToArrayAsyncLinqToDB(); + return await uow.Set().GetTopUserXps(guildId, count); } - public async Task> GetGlobalUserXps(int page) + public Task> GetUserXps(int page, int perPage = 9) { - await using var uow = _db.GetDbContext(); - - return await uow.GetTable() - .OrderByDescending(x => x.TotalXp) - .Skip(page * 10) - .Take(10) - .ToArrayAsyncLinqToDB(); - } - - public async Task> GetGlobalUserXps(int page, List users) - { - await using var uow = _db.GetDbContext(); - - return await uow.GetTable() - .Where(x => x.UserId.In(users)) - .OrderByDescending(x => x.TotalXp) - .Skip(page * 10) - .Take(10) - .ToArrayAsyncLinqToDB(); + using var uow = _db.GetDbContext(); + return uow.Set() + .GetUsersXpLeaderboardFor(page, perPage); } public async Task ChangeNotificationType(ulong userId, ulong guildId, XpNotificationLocation type) @@ -824,7 +771,7 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand { var channelId = channel.Id; - if (_excludedChannels.TryGetValue(user.Guild.Id, out var chans) + if (_excludedChannels.TryGetValue(user.Guild.Id, out var chans) && (chans.Contains(channelId) || (channel is SocketThreadChannel tc && chans.Contains(tc.ParentChannel.Id)))) return false; @@ -1462,11 +1409,11 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand } } - public async Task XpReset(ulong guildId, ulong userId) + public void XpReset(ulong guildId, ulong userId) { - await using var uow = _db.GetDbContext(); - await uow.GetTable() - .DeleteAsync(x => x.UserId == userId && x.GuildId == guildId); + using var uow = _db.GetDbContext(); + uow.Set().ResetGuildUserXp(userId, guildId); + uow.SaveChanges(); } public void XpReset(ulong guildId) @@ -1662,15 +1609,6 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand public bool IsShopEnabled() => _xpConfig.Data.Shop.IsEnabled; - - public async Task GetTotalGuildUsers(ulong requestGuildId, List? guildUsers = null) - { - await using var ctx = _db.GetDbContext(); - return await ctx.GetTable() - .Where(x => x.GuildId == requestGuildId - && (guildUsers == null || guildUsers.Contains(x.UserId))) - .CountAsyncLinqToDB(); - } } public enum BuyResult diff --git a/src/EllieBot/Program.cs b/src/EllieBot/Program.cs index 5a74a96..2c5b5a9 100644 --- a/src/EllieBot/Program.cs +++ b/src/EllieBot/Program.cs @@ -1,4 +1,6 @@ -var shardId = 0; +var pid = Environment.ProcessId; + +var shardId = 0; int? totalShards = null; // 0 to read from creds.yml if (args.Length > 0 && args[0] != "run") { @@ -20,5 +22,7 @@ if (args.Length > 0 && args[0] != "run") } } +LogSetup.SetupLogger(shardId); +Log.Information("Pid: {ProcessId}", pid); await new Bot(shardId, totalShards, Environment.GetEnvironmentVariable("EllieBot__creds")).RunAndBlockAsync(); \ No newline at end of file diff --git a/src/EllieBot/Services/GrpcApi/ExprsSvc.cs b/src/EllieBot/Services/GrpcApi/ExprsSvc.cs deleted file mode 100644 index ad34ee3..0000000 --- a/src/EllieBot/Services/GrpcApi/ExprsSvc.cs +++ /dev/null @@ -1,149 +0,0 @@ -using Google.Protobuf.WellKnownTypes; -using Grpc.Core; -using EllieBot.Db.Models; -using EllieBot.Modules.EllieExpressions; -using EllieBot.Modules.Utility; - -namespace EllieBot.GrpcApi; - -public class ExprsSvc : GrpcExprs.GrpcExprsBase, IGrpcSvc, IEService -{ - private readonly EllieExpressionsService _svc; - private readonly IQuoteService _qs; - private readonly DiscordSocketClient _client; - - public ExprsSvc(EllieExpressionsService svc, IQuoteService qs, DiscordSocketClient client) - { - _svc = svc; - _qs = qs; - _client = client; - } - - public ServerServiceDefinition Bind() - => GrpcExprs.BindService(this); - - public override async Task AddExpr(AddExprRequest request, ServerCallContext context) - { - if (string.IsNullOrWhiteSpace(request.Expr.Trigger) || string.IsNullOrWhiteSpace(request.Expr.Response)) - throw new RpcException(new Status(StatusCode.InvalidArgument, "Trigger and response are required")); - - EllieExpression expr; - if (!string.IsNullOrWhiteSpace(request.Expr.Id)) - { - expr = await _svc.EditAsync(request.GuildId, - new kwum(request.Expr.Id), - request.Expr.Response, - request.Expr.Ca, - request.Expr.Ad, - request.Expr.Dm); - } - else - { - expr = await _svc.AddAsync(request.GuildId, - request.Expr.Trigger, - request.Expr.Response, - request.Expr.Ca, - request.Expr.Ad, - request.Expr.Dm); - } - - - return new AddExprReply() - { - Id = new kwum(expr.Id).ToString(), - Success = true, - }; - } - - public override async Task GetExprs(GetExprsRequest request, ServerCallContext context) - { - var (exprs, totalCount) = await _svc.FindExpressionsAsync(request.GuildId, request.Query, request.Page); - - var reply = new GetExprsReply(); - reply.TotalCount = totalCount; - reply.Expressions.AddRange(exprs.Select(x => new ExprDto() - { - Ad = x.AutoDeleteTrigger, - At = x.AllowTarget, - Ca = x.ContainsAnywhere, - Dm = x.DmResponse, - Response = x.Response, - Id = new kwum(x.Id).ToString(), - Trigger = x.Trigger, - })); - - return reply; - } - - public override async Task DeleteExpr(DeleteExprRequest request, ServerCallContext context) - { - if (kwum.TryParse(request.Id, out var id)) - await _svc.DeleteAsync(request.GuildId, id); - - return new Empty(); - } - - public override async Task GetQuotes(GetQuotesRequest request, ServerCallContext context) - { - if (request.Page < 0) - throw new RpcException(new Status(StatusCode.InvalidArgument, "Page must be >= 0")); - - var (quotes, totalCount) = await _qs.FindQuotesAsync(request.GuildId, request.Query, request.Page); - - var reply = new GetQuotesReply(); - reply.TotalCount = totalCount; - reply.Quotes.AddRange(quotes.Select(x => new QuoteDto() - { - Id = new kwum(x.Id).ToString(), - Trigger = x.Keyword, - Response = x.Text, - AuthorId = x.AuthorId, - AuthorName = x.AuthorName - })); - - return reply; - } - - public override async Task AddQuote(AddQuoteRequest request, ServerCallContext context) - { - var userId = context.RequestHeaders.GetUserId(); - - if (string.IsNullOrWhiteSpace(request.Quote.Trigger) || string.IsNullOrWhiteSpace(request.Quote.Response)) - throw new RpcException(new Status(StatusCode.InvalidArgument, "Trigger and response are required")); - - if (string.IsNullOrWhiteSpace(request.Quote.Id)) - { - var q = await _qs.AddQuoteAsync(request.GuildId, - userId, - (await _client.GetUserAsync(userId))?.Username ?? userId.ToString(), - request.Quote.Trigger, - request.Quote.Response); - - return new() - { - Id = new kwum(q.Id).ToString() - }; - } - - if (!kwum.TryParse(request.Quote.Id, out var qid)) - throw new RpcException(new Status(StatusCode.InvalidArgument, "Invalid quote id")); - - await _qs.EditQuoteAsync( - request.GuildId, - new kwum(request.Quote.Id), - request.Quote.Trigger, - request.Quote.Response); - - return new() - { - Id = new kwum(qid).ToString() - }; - } - - - public override async Task DeleteQuote(DeleteQuoteRequest request, ServerCallContext context) - { - await _qs.DeleteQuoteAsync(request.GuildId, context.RequestHeaders.GetUserId(), true, new kwum(request.Id)); - return new Empty(); - } -} \ No newline at end of file diff --git a/src/EllieBot/Services/GrpcApi/FinSvc.cs b/src/EllieBot/Services/GrpcApi/FinSvc.cs deleted file mode 100644 index e0a92e9..0000000 --- a/src/EllieBot/Services/GrpcApi/FinSvc.cs +++ /dev/null @@ -1,89 +0,0 @@ -using Google.Protobuf.WellKnownTypes; -using Grpc.Core; -using EllieBot.Db.Models; -using EllieBot.Modules.Gambling.Bank; -using EllieBot.Modules.EllieExpressions; -using EllieBot.Modules.Utility; - -namespace EllieBot.GrpcApi; - -public class FinSvc : GrpcFin.GrpcFinBase, IGrpcSvc, IEService -{ - private readonly ICurrencyService _cs; - private readonly IBankService _bank; - - public FinSvc(ICurrencyService cs, IBankService bank) - { - _cs = cs; - _bank = bank; - } - - public ServerServiceDefinition Bind() - => GrpcFin.BindService(this); - - [GrpcNoAuthRequired] - public override async Task Deposit(DepositRequest request, ServerCallContext context) - { - if (request.Amount <= 0) - throw new RpcException(new Status(StatusCode.InvalidArgument, "Amount must be greater than 0")); - - var succ = await _bank.DepositAsync(request.UserId, request.Amount); - - return new DepositReply - { - Success = succ - }; - } - - [GrpcNoAuthRequired] - public override async Task Withdraw(WithdrawRequest request, ServerCallContext context) - { - if (request.Amount <= 0) - throw new RpcException(new Status(StatusCode.InvalidArgument, "Amount must be greater than 0")); - - var succ = await _bank.WithdrawAsync(request.UserId, request.Amount); - - return new WithdrawReply - { - Success = succ - }; - } - - [GrpcNoAuthRequired] - public override async Task GetHoldings(GetHoldingsRequest request, ServerCallContext context) - { - return new GetHoldingsReply - { - Bank = await _bank.GetBalanceAsync(request.UserId), - Cash = await _cs.GetBalanceAsync(request.UserId) - }; - } - - [GrpcNoAuthRequired] - public override async Task GetTransactions( - GetTransactionsRequest request, - ServerCallContext context) - { - if (request.Page < 1) - throw new RpcException(new Status(StatusCode.InvalidArgument, "Page must be greater than 0")); - - var trs = await _cs.GetTransactionsAsync(request.UserId, request.Page - 1); - - var reply = new GetTransactionsReply - { - Total = await _cs.GetTransactionsCountAsync(request.UserId) - }; - - reply.Transactions.AddRange(trs.Select(x => new TransactionReply() - { - Id = new kwum(x.Id).ToString(), - Timestamp = Timestamp.FromDateTime(DateTime.UtcNow), - Amount = x.Amount, - Extra = x.Extra ?? string.Empty, - Note = x.Note ?? string.Empty, - Type = x.Type ?? string.Empty, - })); - - return reply; - } -} diff --git a/src/EllieBot/Services/GrpcApi/GreetByeSvc.cs b/src/EllieBot/Services/GrpcApi/GreetByeSvc.cs deleted file mode 100644 index 1c40645..0000000 --- a/src/EllieBot/Services/GrpcApi/GreetByeSvc.cs +++ /dev/null @@ -1,121 +0,0 @@ -using Grpc.Core; -using GreetType = EllieBot.Services.GreetType; - -namespace EllieBot.GrpcApi; - -public sealed class GreetByeSvc : GrpcGreet.GrpcGreetBase, IGrpcSvc, IEService -{ - private readonly GreetService _gs; - private readonly DiscordSocketClient _client; - - public GreetByeSvc(GreetService gs, DiscordSocketClient client) - { - _gs = gs; - _client = client; - } - - public ServerServiceDefinition Bind() - => GrpcGreet.BindService(this); - - private static GrpcGreetSettings ToConf(GreetSettings? conf, GreetType type) - { - if (conf is null) - return new GrpcGreetSettings() - { - Type = (GrpcGreetType)type - }; - - return new GrpcGreetSettings() - { - Message = conf.MessageText, - Type = (GrpcGreetType)conf.GreetType, - ChannelId = conf.ChannelId?.ToString() ?? string.Empty, - IsEnabled = conf.IsEnabled, - }; - } - - public override async Task GetGreetSettings(GetGreetRequest request, ServerCallContext context) - { - var guildId = request.GuildId; - - var type = (GreetType)request.Type; - var conf = await _gs.GetGreetSettingsAsync(guildId, type); - - return ToConf(conf, type); - } - - public override async Task UpdateGreet(UpdateGreetRequest request, ServerCallContext context) - { - var gid = request.GuildId; - var s = request.Settings; - var msg = s.Message; - - var type = GetGreetType(s.Type); - - await _gs.SetMessage(gid, GetGreetType(s.Type), msg); - await _gs.SetGreet(gid, ulong.Parse(s.ChannelId), type, s.IsEnabled); - var settings = await _gs.GetGreetSettingsAsync(gid, type); - - if (settings is null) - return new() - { - Success = false - }; - - return new() - { - Success = true - }; - } - - public override Task TestGreet(TestGreetRequest request, ServerCallContext context) - => TestGreet(request.GuildId, request.ChannelId, request.UserId, request.Type); - - private async Task TestGreet( - ulong guildId, - ulong channelId, - ulong userId, - GrpcGreetType gtDto) - { - var g = _client.GetGuild(guildId) as IGuild; - if (g is null) - { - return new() - { - Error = "Guild doesn't exist", - Success = false, - }; - } - - var gu = await g.GetUserAsync(userId); - var ch = await g.GetTextChannelAsync(channelId); - - if (gu is null || ch is null) - return new TestGreetReply() - { - Error = "Guild or channel doesn't exist", - Success = false, - }; - - - var gt = GetGreetType(gtDto); - - await _gs.Test(guildId, gt, ch, gu); - return new TestGreetReply() - { - Success = true - }; - } - - private static GreetType GetGreetType(GrpcGreetType gtDto) - { - return gtDto switch - { - GrpcGreetType.Greet => GreetType.Greet, - GrpcGreetType.GreetDm => GreetType.GreetDm, - GrpcGreetType.Bye => GreetType.Bye, - GrpcGreetType.Boost => GreetType.Boost, - _ => throw new ArgumentOutOfRangeException(nameof(gtDto), gtDto, null) - }; - } -} diff --git a/src/EllieBot/Services/GrpcApi/NCanvasSvc.cs b/src/EllieBot/Services/GrpcApi/NCanvasSvc.cs deleted file mode 100644 index 8e99fb4..0000000 --- a/src/EllieBot/Services/GrpcApi/NCanvasSvc.cs +++ /dev/null @@ -1,95 +0,0 @@ -using Google.Protobuf.WellKnownTypes; -using Grpc.Core; -using EllieBot.Db.Models; -using EllieBot.Modules.Games; -using SixLabors.ImageSharp.PixelFormats; - -namespace EllieBot.GrpcApi; - -public class NCanvasSvc : GrpcNCanvas.GrpcNCanvasBase, IGrpcSvc, IEService -{ - private readonly INCanvasService _nCanvas; - private readonly DiscordSocketClient _client; - - public NCanvasSvc(INCanvasService nCanvas, DiscordSocketClient client) - { - _nCanvas = nCanvas; - _client = client; - } - - public ServerServiceDefinition Bind() - => GrpcNCanvas.BindService(this); - - [GrpcNoAuthRequired] - public override async Task GetCanvas(Empty request, ServerCallContext context) - { - var pixels = await _nCanvas.GetCanvas(); - var reply = new CanvasReply() - { - Width = _nCanvas.GetWidth(), - Height = _nCanvas.GetHeight() - }; - reply.Pixels.AddRange(pixels); - return reply; - } - - [GrpcNoAuthRequired] - public override async Task GetPixel(GetPixelRequest request, ServerCallContext context) - { - var pixel = await _nCanvas.GetPixel(request.X, request.Y); - if (pixel is null) - throw new RpcException(new Status(StatusCode.NotFound, "Pixel not found")); - - var reply = MapPixelToGrpcPixel(pixel); - return reply; - } - - private GetPixelReply MapPixelToGrpcPixel(NCPixel pixel) - { - var reply = new GetPixelReply - { - Color = "#" + new Rgba32(pixel.Color).ToHex(), - PackedColor = pixel.Color, - Position = new kwum(pixel.Position).ToString(), - PositionX = pixel.Position % _nCanvas.GetWidth(), - PositionY = pixel.Position / _nCanvas.GetWidth(), - // Owner = await ((IDiscordClient)_client).GetUserAsync(pixel.OwnerId)?.ToString() ?? string.Empty, - // OwnerId = pixel.OwnerId.ToString(), - Price = pixel.Price, - Text = pixel.Text - }; - return reply; - } - - [GrpcNoAuthRequired] - public override async Task SetPixel(SetPixelRequest request, ServerCallContext context) - { - if (!kwum.TryParse(request.Position, out var pos)) - throw new RpcException(new Status(StatusCode.InvalidArgument, "Position is invalid")); - - if (!Rgba32.TryParseHex(request.Color, out var clr)) - throw new RpcException(new Status(StatusCode.InvalidArgument, "Color is invalid")); - - var userId = context.RequestHeaders.GetUserId(); - var result = await _nCanvas.SetPixel(pos, clr.PackedValue, request.Text, userId, request.Price); - var reply = new SetPixelReply() - { - Success = result == SetPixelResult.Success, - Error = result switch - { - SetPixelResult.Success => string.Empty, - SetPixelResult.InsufficientPayment => "You have to pay equal or more than the price.", - SetPixelResult.NotEnoughMoney => "You don't have enough currency. ", - SetPixelResult.InvalidInput => - $"Invalid input. Position has to be >= 0 and < {_nCanvas.GetWidth()}x{_nCanvas.GetHeight()}", - _ => throw new ArgumentOutOfRangeException() - } - }; - - var pixel = await _nCanvas.GetPixel(pos); - if (pixel is not null) - reply.Pixel = MapPixelToGrpcPixel(pixel); - - return reply; - } -} diff --git a/src/EllieBot/Services/GrpcApi/OtherSvc.cs b/src/EllieBot/Services/GrpcApi/OtherSvc.cs deleted file mode 100644 index 8138345..0000000 --- a/src/EllieBot/Services/GrpcApi/OtherSvc.cs +++ /dev/null @@ -1,253 +0,0 @@ -using Google.Protobuf.WellKnownTypes; -using Grpc.Core; -using EllieBot.Modules.Gambling.Services; -using EllieBot.Modules.Xp.Services; - -namespace EllieBot.GrpcApi; - -public static class GrpcApiExtensions -{ - public static ulong GetUserId(this ServerCallContext context) - => ulong.Parse(context.RequestHeaders.FirstOrDefault(x => x.Key == "userid")!.Value); -} - -public sealed class OtherSvc : GrpcOther.GrpcOtherBase, IGrpcSvc, IEService -{ - private readonly DiscordSocketClient _client; - private readonly XpService _xp; - private readonly ICurrencyService _cur; - private readonly WaifuService _waifus; - private readonly IStatsService _stats; - private readonly CommandHandler _cmdHandler; - - public OtherSvc( - DiscordSocketClient client, - XpService xp, - ICurrencyService cur, - WaifuService waifus, - IStatsService stats, - CommandHandler cmdHandler) - { - _client = client; - _xp = xp; - _cur = cur; - _waifus = waifus; - _stats = stats; - _cmdHandler = cmdHandler; - } - - public ServerServiceDefinition Bind() - => GrpcOther.BindService(this); - - [GrpcNoAuthRequired] - public override Task BotOnGuild(BotOnGuildRequest request, ServerCallContext context) - { - var guild = _client.GetGuild(request.GuildId); - - var reply = new BotOnGuildReply - { - Success = guild is not null - }; - - return Task.FromResult(reply); - } - - public override Task GetRoles(GetRolesRequest request, ServerCallContext context) - { - var g = _client.GetGuild(request.GuildId); - var roles = g?.Roles; - var reply = new GetRolesReply(); - reply.Roles.AddRange(roles?.Select(x => new RoleReply() - { - Id = x.Id, - Name = x.Name, - Color = x.Color.ToString(), - IconUrl = x.GetIconUrl() ?? string.Empty, - }) - ?? new List()); - - return Task.FromResult(reply); - } - - public override async Task GetTextChannels( - GetTextChannelsRequest request, - ServerCallContext context) - { - IGuild g = _client.GetGuild(request.GuildId); - var reply = new GetTextChannelsReply(); - - var chs = await g.GetTextChannelsAsync(); - - reply.TextChannels.AddRange(chs.Select(x => new TextChannelReply() - { - Id = x.Id, - Name = x.Name, - })); - - return reply; - } - - - [GrpcNoAuthRequired] - public override async Task GetCurrencyLb(GetLbRequest request, ServerCallContext context) - { - var users = await _cur.GetTopRichest(_client.CurrentUser.Id, request.Page, request.PerPage); - - var reply = new CurrencyLbReply(); - var entries = users.Select(x => - { - var user = _client.GetUser(x.UserId); - return Task.FromResult(new CurrencyLbEntryReply() - { - Amount = x.CurrencyAmount, - User = user?.ToString() ?? x.Username, - UserId = x.UserId, - Avatar = user?.RealAvatarUrl().ToString() ?? x.RealAvatarUrl()?.ToString() - }); - }); - - reply.Entries.AddRange(await entries.WhenAll()); - - return reply; - } - - [GrpcNoAuthRequired] - public override async Task GetXpLb(GetLbRequest request, ServerCallContext context) - { - var users = await _xp.GetGlobalUserXps(request.Page); - - var reply = new XpLbReply(); - - var entries = users.Select(x => - { - var lvl = new LevelStats(x.TotalXp); - - return new XpLbEntryReply() - { - Level = lvl.Level, - TotalXp = x.TotalXp, - User = x.Username, - UserId = x.UserId - }; - }); - - reply.Entries.AddRange(entries); - - return reply; - } - - [GrpcNoAuthRequired] - public override async Task GetWaifuLb(GetLbRequest request, ServerCallContext context) - { - var waifus = await _waifus.GetTopWaifusAtPage(request.Page, request.PerPage); - - var reply = new WaifuLbReply(); - reply.Entries.AddRange(waifus.Select(x => new WaifuLbEntry() - { - ClaimedBy = x.ClaimerName ?? string.Empty, - IsMutual = x.ClaimerName == x.Affinity, - Value = x.Price, - User = x.WaifuName, - })); - return reply; - } - - [GrpcNoAuthRequired] - public override async Task GetShardStats( - Empty request, - IServerStreamWriter responseStream, - ServerCallContext context) - { - while (true) - { - var stats = new ShardStatsReply() - { - Id = _client.ShardId, - Commands = _stats.CommandsRan, - Uptime = _stats.GetUptimeString(), - Status = GetConnectionState(_client.ConnectionState), - GuildCount = _client.Guilds.Count, - }; - - await responseStream.WriteAsync(stats); - await Task.Delay(1000); - } - } - - [GrpcNoAuthRequired] - public override async Task GetCommandFeed( - Empty request, - IServerStreamWriter responseStream, - ServerCallContext context) - { - var taskCompletion = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - - Task OnCommandExecuted(IUserMessage userMessage, CommandInfo commandInfo) - { - try - { - responseStream.WriteAsync(new() - { - Command = commandInfo.Name - }); - } - catch - { - _cmdHandler.CommandExecuted -= OnCommandExecuted; - taskCompletion.TrySetResult(true); - } - - return Task.CompletedTask; - } - - _cmdHandler.CommandExecuted += OnCommandExecuted; - - await taskCompletion.Task; - } - - private string GetConnectionState(ConnectionState clientConnectionState) - { - return clientConnectionState switch - { - ConnectionState.Connected => "Connected", - ConnectionState.Connecting => "Connecting", - _ => "Disconnected" - }; - } - - public override async Task GetServerInfo(ServerInfoRequest request, ServerCallContext context) - { - var info = await _stats.GetGuildInfoAsync(request.GuildId); - - var reply = new GetServerInfoReply() - { - Id = info.Id, - Name = info.Name, - IconUrl = info.IconUrl, - OwnerId = info.OwnerId, - OwnerName = info.Owner, - TextChannels = info.TextChannels, - VoiceChannels = info.VoiceChannels, - MemberCount = info.MemberCount, - CreatedAt = info.CreatedAt.Ticks, - }; - - reply.Features.AddRange(info.Features); - reply.Emojis.AddRange(info.Emojis.Select(x => new EmojiReply() - { - Name = x.Name, - Url = x.Url, - Code = x.ToString() - })); - - reply.Roles.AddRange(info.Roles.Select(x => new RoleReply() - { - Id = x.Id, - Name = x.Name, - IconUrl = x.GetIconUrl() ?? string.Empty, - Color = x.Color.ToString() - })); - - return reply; - } -} \ No newline at end of file diff --git a/src/EllieBot/Services/GrpcApi/WarnSvc.cs b/src/EllieBot/Services/GrpcApi/WarnSvc.cs deleted file mode 100644 index b67cec7..0000000 --- a/src/EllieBot/Services/GrpcApi/WarnSvc.cs +++ /dev/null @@ -1,224 +0,0 @@ -using Grpc.Core; -using EllieBot.Db.Models; -using EllieBot.Modules.Administration.Services; -using Enum = System.Enum; - -namespace EllieBot.GrpcApi; - -public sealed class WarnSvc : GrpcWarn.GrpcWarnBase, IGrpcSvc, IEService -{ - private readonly UserPunishService _ups; - private readonly DiscordSocketClient _client; - - public WarnSvc(UserPunishService ups, DiscordSocketClient client) - { - _ups = ups; - _client = client; - } - - public ServerServiceDefinition Bind() - => GrpcWarn.BindService(this); - - public override async Task GetWarnSettings( - WarnSettingsRequest request, - ServerCallContext context) - { - var list = await _ups.WarnPunishList(request.GuildId); - - var wsr = new WarnSettingsReply(); - - (wsr.ExpiryDays, wsr.DeleteOnExpire) = await _ups.GetWarnExpire(request.GuildId); - - wsr.Punishments.AddRange(list.Select(x => new WarnPunishment() - { - Action = x.Punishment.ToString(), - Duration = x.Time, - Threshold = x.Count, - Role = x.RoleId is ulong rid - ? _client.GetGuild(request.GuildId)?.GetRole(rid)?.Name ?? x.RoleId?.ToString() ?? string.Empty - : string.Empty - })); - - return wsr; - } - - public override async Task SetWarnExpiry( - SetWarnExpiryRequest request, - ServerCallContext context) - { - if (request.ExpiryDays > 366) - { - return new SetWarnExpiryReply() - { - Success = false - }; - } - - await _ups.WarnExpireAsync(request.GuildId, request.ExpiryDays, request.DeleteOnExpire); - - return new SetWarnExpiryReply() - { - Success = true - }; - } - - public override async Task DeleteWarnp(DeleteWarnpRequest request, ServerCallContext context) - { - var succ = await _ups.WarnPunishRemove(request.GuildId, request.Threshold); - - return new DeleteWarnpReply - { - Success = succ - }; - } - - public override async Task AddWarnp(AddWarnpRequest request, ServerCallContext context) - { - if (request.Punishment.Threshold <= 0) - throw new RpcException(new Status(StatusCode.InvalidArgument, "Threshold must be greater than 0")); - - var g = _client.GetGuild(request.GuildId); - - if (g is null) - throw new RpcException(new Status(StatusCode.NotFound, "Guild not found")); - - if (!Enum.TryParse(request.Punishment.Action, out var action)) - throw new RpcException(new Status(StatusCode.InvalidArgument, "Invalid action")); - - IRole? role = null; - if (action == PunishmentAction.AddRole && ulong.TryParse(request.Punishment.Role, out var roleId)) - { - role = g.GetRole(roleId); - - if (role is null) - return new AddWarnpReply() - { - Success = false - }; - - if (!ulong.TryParse(context.RequestHeaders.GetValue("userid"), out var userId)) - return new AddWarnpReply() - { - Success = false - }; - - var user = await ((IGuild)g).GetUserAsync(userId); - - if (user is null) - throw new RpcException(new Status(StatusCode.NotFound, "User not found")); - - var userMaxRole = user.GetRoles().MaxBy(x => x.Position)?.Position ?? 0; - if (g.OwnerId != user.Id && userMaxRole <= role.Position) - { - return new AddWarnpReply() - { - Success = false - }; - } - } - - var duration = TimeSpan.FromMinutes(request.Punishment.Duration); - - var succ = await _ups.WarnPunish(request.GuildId, - request.Punishment.Threshold, - action, - duration, - role - ); - - return new AddWarnpReply() - { - Success = succ - }; - } - - public override async Task GetLatestWarnings( - GetLatestWarningsRequest request, - ServerCallContext context) - { - var (latest, count) = await _ups.GetLatestWarnings(request.GuildId, request.Page); - - var reply = new GetLatestWarningsReply() - { - TotalCount = count - }; - - reply.Warnings.AddRange(latest.Select(MapWarningToGrpcWarning)); - - return reply; - } - - public override async Task GetUserWarnings( - GetUserWarningsRequest request, - ServerCallContext context) - { - IReadOnlyCollection latest = []; - var count = 0; - if (ulong.TryParse(request.User, out var userId)) - { - (latest, count) = await _ups.GetUserWarnings(request.GuildId, userId, request.Page); - } - else if (_client.GetGuild(request.GuildId)?.Users.FirstOrDefault(x => x.Username == request.User) is { } user) - { - (latest, count) = await _ups.GetUserWarnings(request.GuildId, user.Id, request.Page); - } - else - { - } - - var reply = new GetUserWarningsReply - { - TotalCount = count - }; - - reply.Warnings.AddRange(latest.Select(MapWarningToGrpcWarning)); - - return reply; - } - - private Warning MapWarningToGrpcWarning(Db.Models.Warning x) - { - return new Warning - { - Id = new kwum(x.Id).ToString(), - Forgiven = x.Forgiven, - ForgivenBy = x.ForgivenBy ?? string.Empty, - Reason = x.Reason ?? string.Empty, - Timestamp = x.DateAdded is { } da ? Ellie.Common.Extensions.ToTimestamp(da) : 0, - Weight = x.Weight, - Moderator = x.Moderator ?? string.Empty, - User = _client.GetUser(x.UserId)?.Username ?? x.UserId.ToString(), - UserId = x.UserId - }; - } - - public override async Task ForgiveWarning( - ForgiveWarningRequest request, - ServerCallContext context) - { - if (!kwum.TryParse(request.WarnId, out var wid)) - throw new RpcException(new Status(StatusCode.InvalidArgument, "Invalid warning ID")); - - var succ = await _ups.ForgiveWarning(request.GuildId, wid, request.ModName); - - return new ForgiveWarningReply - { - Success = succ - }; - } - - public override async Task DeleteWarning( - ForgiveWarningRequest request, - ServerCallContext context) - { - if (!kwum.TryParse(request.WarnId, out var wid)) - throw new RpcException(new Status(StatusCode.InvalidArgument, "Invalid warning ID")); - - var succ = await _ups.WarnDelete(request.GuildId, wid); - - return new ForgiveWarningReply - { - Success = succ - }; - } -} \ No newline at end of file diff --git a/src/EllieBot/Services/GrpcApi/XpSvc.cs b/src/EllieBot/Services/GrpcApi/XpSvc.cs deleted file mode 100644 index 6d66fd8..0000000 --- a/src/EllieBot/Services/GrpcApi/XpSvc.cs +++ /dev/null @@ -1,282 +0,0 @@ -using Google.Protobuf.WellKnownTypes; -using Grpc.Core; -using EllieBot.Db.Models; -using EllieBot.Modules.Gambling.Bank; -using EllieBot.Modules.EllieExpressions; -using EllieBot.Modules.Utility; -using EllieBot.Modules.Xp.Services; - -namespace EllieBot.GrpcApi; - -public class XpSvc : GrpcXp.GrpcXpBase, IGrpcSvc, IEService -{ - private readonly XpService _xp; - private readonly DiscordSocketClient _client; - private readonly IUserService _duSvc; - - public XpSvc(XpService xp, DiscordSocketClient client, IUserService duSvc) - { - _xp = xp; - _client = client; - _duSvc = duSvc; - } - - public ServerServiceDefinition Bind() - => GrpcXp.BindService(this); - - public override async Task GetXpSettings( - GetXpSettingsRequest request, - ServerCallContext context) - { - await Task.Yield(); - - var guild = _client.GetGuild(request.GuildId); - - if (guild is null) - throw new RpcException(new Status(StatusCode.NotFound, "Guild not found")); - - var excludedChannels = _xp.GetExcludedChannels(request.GuildId); - var excludedRoles = _xp.GetExcludedRoles(request.GuildId); - var isServerExcluded = _xp.IsServerExcluded(request.GuildId); - - var reply = new GetXpSettingsReply(); - - reply.Exclusions.AddRange(excludedChannels - .Select(x => new ExclItemReply() - { - Id = x, - Type = "Channel", - Name = guild.GetChannel(x)?.Name ?? "????" - }) - .Concat(excludedRoles - .Select(x => new ExclItemReply() - { - Id = x, - Type = "Role", - Name = guild.GetRole(x)?.Name ?? "????" - }))); - - var curRews = _xp.GetCurrencyRewards(request.GuildId); - var roleRews = _xp.GetRoleRewards(request.GuildId); - - var rews = curRews.Select(x => new RewItemReply() - { - Level = x.Level, - Type = "Currency", - Value = x.Amount.ToString() - }); - - rews = rews.Concat(roleRews.Select(x => new RewItemReply() - { - Level = x.Level, - Type = x.Remove ? "RemoveRole" : "AddRole", - Value = guild.GetRole(x.RoleId)?.ToString() ?? x.RoleId.ToString() - })) - .OrderBy(x => x.Level); - - reply.Rewards.AddRange(rews); - - reply.ServerExcluded = isServerExcluded; - - return reply; - } - - public override async Task AddExclusion(AddExclusionRequest request, ServerCallContext context) - { - await Task.Yield(); - - var success = false; - var guild = _client.GetGuild(request.GuildId); - - if (guild is null) - throw new RpcException(new Status(StatusCode.NotFound, "Guild not found")); - - if (request.Type == "Role") - { - if (guild.GetRole(request.Id) is null) - return new() - { - Success = false - }; - - success = _xp.ToggleExcludeRole(request.GuildId, request.Id); - } - else if (request.Type == "Channel") - { - if (guild.GetTextChannel(request.Id) is null) - return new() - { - Success = false - }; - - success = _xp.ToggleExcludeChannel(request.GuildId, request.Id); - } - - return new() - { - Success = success - }; - } - - public override Task DeleteExclusion( - DeleteExclusionRequest request, - ServerCallContext context) - { - var success = false; - if (request.Type == "Role") - success = _xp.ToggleExcludeRole(request.GuildId, request.Id); - else - success = _xp.ToggleExcludeChannel(request.GuildId, request.Id); - - return Task.FromResult(new DeleteExclusionReply - { - Success = success - }); - } - - public override async Task AddReward(AddRewardRequest request, ServerCallContext context) - { - await Task.Yield(); - - var success = false; - var guild = _client.GetGuild(request.GuildId); - - if (guild is null) - throw new RpcException(new Status(StatusCode.NotFound, "Guild not found")); - - if (request.Type == "AddRole" || request.Type == "RemoveRole") - { - if (!ulong.TryParse(request.Value, out var rid)) - throw new RpcException(new Status(StatusCode.InvalidArgument, "Invalid role id")); - - var role = guild.GetRole(rid); - if (role is null) - return new() - { - Success = false - }; - - _xp.SetRoleReward(request.GuildId, request.Level, rid, request.Type == "RemoveRole"); - success = true; - } - // else if (request.Type == "Currency") - // { - // if (!int.TryParse(request.Value, out var amount)) - // throw new RpcException(new Status(StatusCode.InvalidArgument, "Invalid amount")); - // - // _xp.SetCurrencyReward(request.GuildId, request.Level, amount); - // success = true; - // } - - return new() - { - Success = success - }; - } - - public override Task DeleteReward(DeleteRewardRequest request, ServerCallContext context) - { - var success = false; - - if (request.Type == "AddRole" || request.Type == "RemoveRole") - { - _xp.ResetRoleReward(request.GuildId, request.Level); - success = true; - } - else if (request.Type == "Currency") - { - _xp.SetCurrencyReward(request.GuildId, request.Level, 0); - success = true; - } - - return Task.FromResult(new DeleteRewardReply - { - Success = success - }); - } - - public override async Task ResetUserXp(ResetUserXpRequest request, ServerCallContext context) - { - await _xp.XpReset(request.GuildId, request.UserId); - - return new ResetUserXpReply - { - Success = true - }; - } - - public override async Task GetXpLb(GetXpLbRequest request, ServerCallContext context) - { - if (request.Page < 1) - throw new RpcException(new Status(StatusCode.InvalidArgument, "Page must be greater than or equal to 1")); - - var guild = _client.GetGuild(request.GuildId); - - if (guild is null) - throw new RpcException(new Status(StatusCode.NotFound, "Guild not found")); - - var data = await _xp.GetGuildUserXps(request.GuildId, request.Page - 1); - var total = await _xp.GetTotalGuildUsers(request.GuildId); - - var reply = new GetXpLbReply - { - Total = total - }; - - var users = await data - .Select(async x => - { - var user = guild.GetUser(x.UserId); - - if (user is null) - { - var du = await _duSvc.GetUserAsync(x.UserId); - if (du is null) - return new XpLbUserReply - { - UserId = x.UserId, - Avatar = string.Empty, - Username = string.Empty, - Xp = x.Xp, - Level = new LevelStats(x.Xp).Level - }; - - return new XpLbUserReply() - { - UserId = x.UserId, - Avatar = du.RealAvatarUrl()?.ToString() ?? string.Empty, - Username = du.ToString() ?? string.Empty, - Xp = x.Xp, - Level = new LevelStats(x.Xp).Level - }; - } - - return new XpLbUserReply - { - UserId = x.UserId, - Avatar = user?.GetAvatarUrl() ?? string.Empty, - Username = user?.ToString() ?? string.Empty, - Xp = x.Xp, - Level = new LevelStats(x.Xp).Level - }; - }) - .WhenAll(); - - reply.Users.AddRange(users); - - return reply; - } - - public override async Task SetServerExclusion( - SetServerExclusionRequest request, - ServerCallContext context) - { - await Task.Yield(); - - var newValue = _xp.ToggleExcludeServer(request.GuildId); - return new() - { - Success = newValue - }; - } -} \ No newline at end of file diff --git a/src/EllieBot/Services/GrpcApiPermsInterceptor.cs b/src/EllieBot/Services/GrpcApiPermsInterceptor.cs deleted file mode 100644 index 6e4b6cf..0000000 --- a/src/EllieBot/Services/GrpcApiPermsInterceptor.cs +++ /dev/null @@ -1,119 +0,0 @@ -using Grpc.Core; -using Grpc.Core.Interceptors; - -namespace EllieBot.GrpcApi; - -public sealed partial class GrpcApiPermsInterceptor : Interceptor -{ - private const GuildPerm DEFAULT_PERMISSION = GuildPermission.Administrator; - - private readonly DiscordSocketClient _client; - - public GrpcApiPermsInterceptor(DiscordSocketClient client) - { - _client = client; - } - - public async Task RequestHandler(ServerCallContext context) - { - try - { - var method = context.Method[(context.Method.LastIndexOf('/') + 1)..]; - - // get metadata - var metadata = context - .RequestHeaders - .ToDictionary(x => x.Key, x => x.Value); - - Log.Information("grpc | g: {GuildId} | u: {UserID} | cmd: {Method}", - metadata.TryGetValue("guildid", out var gidString) ? gidString : "none", - metadata.TryGetValue("userid", out var uidString) ? uidString : "none", - method); - - - // there always has to be a user who makes the call - if (!metadata.ContainsKey("userid")) - throw new RpcException(new(StatusCode.Unauthenticated, "userid has to be specified.")); - - // get the method name without the service name - - // if the method is explicitly marked as not requiring auth - if (_noAuthRequired.Contains(method)) - return; - - // otherwise the method requires auth, and if it requires auth then the guildid has to be specified - if (string.IsNullOrWhiteSpace(gidString)) - throw new RpcException(new(StatusCode.Unauthenticated, "guildid has to be specified.")); - - var userId = ulong.Parse(metadata["userid"]); - var guildId = ulong.Parse(gidString); - - // check if the user has the required permission - if (_perms.TryGetValue(method, out var perm)) - { - await EnsureUserHasPermission(guildId, userId, perm); - } - else - { - // if not then use the default, which is Administrator permission - await EnsureUserHasPermission(guildId, userId, DEFAULT_PERMISSION); - } - } - catch (Exception ex) - { - Log.Error(ex, "Error thrown by {ContextMethod}", context.Method); - throw; - } - } - - private async Task EnsureUserHasPermission(ulong guildId, ulong userId, GuildPerm perm) - { - IGuild guild = _client.GetGuild(guildId); - var user = guild is null ? null : await guild.GetUserAsync(userId); - - if (user is null) - throw new RpcException(new Status(StatusCode.NotFound, "User not found")); - - if (!user.GuildPermissions.Has(perm)) - throw new RpcException(new Status(StatusCode.PermissionDenied, - $"You need {perm} permission to use this method")); - } - - public override async Task ClientStreamingServerHandler( - IAsyncStreamReader requestStream, - ServerCallContext context, - ClientStreamingServerMethod continuation) - { - await RequestHandler(context); - return await continuation(requestStream, context); - } - - public override async Task DuplexStreamingServerHandler( - IAsyncStreamReader requestStream, - IServerStreamWriter responseStream, - ServerCallContext context, - DuplexStreamingServerMethod continuation) - { - await RequestHandler(context); - await continuation(requestStream, responseStream, context); - } - - public override async Task ServerStreamingServerHandler( - TRequest request, - IServerStreamWriter responseStream, - ServerCallContext context, - ServerStreamingServerMethod continuation) - { - await RequestHandler(context); - await continuation(request, responseStream, context); - } - - public override async Task UnaryServerHandler( - TRequest request, - ServerCallContext context, - UnaryServerMethod continuation) - { - await RequestHandler(context); - return await continuation(request, context); - } -} \ No newline at end of file diff --git a/src/EllieBot/Services/GrpcApiService.cs b/src/EllieBot/Services/GrpcApiService.cs deleted file mode 100644 index 6703b51..0000000 --- a/src/EllieBot/Services/GrpcApiService.cs +++ /dev/null @@ -1,75 +0,0 @@ -using Grpc.Core; -using Grpc.Core.Interceptors; -using EllieBot.Common.ModuleBehaviors; - -namespace EllieBot.GrpcApi; - -public class GrpcApiService : IEService, IReadyExecutor -{ - private Server? _app; - - private readonly DiscordSocketClient _client; - private readonly IEnumerable _svcs; - private readonly IBotCredsProvider _creds; - - public GrpcApiService( - DiscordSocketClient client, - IEnumerable svcs, - IBotCredsProvider creds) - { - _client = client; - _svcs = svcs; - _creds = creds; - } - - public Task OnReadyAsync() - { - var creds = _creds.GetCreds(); - if (creds.GrpcApi is null || !creds.GrpcApi.Enabled) - return Task.CompletedTask; - - try - { - var host = creds.GrpcApi.Host; - var port = creds.GrpcApi.Port + _client.ShardId; - - var interceptor = new GrpcApiPermsInterceptor(_client); - - var serverCreds = ServerCredentials.Insecure; - - if (creds.GrpcApi is - { - CertPrivateKey: not null and not "", - CertChain: not null and not "" - } cert) - { - serverCreds = new SslServerCredentials( - new[] { new KeyCertificatePair(cert.CertChain, cert.CertPrivateKey) }); - } - - _app = new() - { - Ports = - { - new(host, port, serverCreds), - } - }; - - foreach (var svc in _svcs) - { - _app.Services.Add(svc.Bind().Intercept(interceptor)); - } - - _app.Start(); - - Log.Information("Grpc Api Server started on port {Host}:{Port}", host, port); - } - catch (Exception ex) - { - Log.Error(ex, "Error starting Grpc Api Server"); - _app?.ShutdownAsync().GetAwaiter().GetResult(); - } - - return Task.CompletedTask; - } -} \ No newline at end of file diff --git a/src/EllieBot/Services/IGrpcSvc.cs b/src/EllieBot/Services/IGrpcSvc.cs deleted file mode 100644 index ef516e4..0000000 --- a/src/EllieBot/Services/IGrpcSvc.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Grpc.Core; - -namespace EllieBot.GrpcApi; - -public interface IGrpcSvc -{ - ServerServiceDefinition Bind(); -} \ No newline at end of file diff --git a/src/EllieBot/_common/Impl/BotCredsProvider.cs b/src/EllieBot/Services/Impl/BotCredsProvider.cs similarity index 91% rename from src/EllieBot/_common/Impl/BotCredsProvider.cs rename to src/EllieBot/Services/Impl/BotCredsProvider.cs index 915e813..09cfcac 100644 --- a/src/EllieBot/_common/Impl/BotCredsProvider.cs +++ b/src/EllieBot/Services/Impl/BotCredsProvider.cs @@ -47,7 +47,6 @@ public sealed class BotCredsProvider : IBotCredsProvider // this can fail in docker containers } - try { MigrateCredentials(); @@ -119,7 +118,7 @@ public sealed class BotCredsProvider : IBotCredsProvider } } - public void ModifyCredsFile(Action func) + public void ModifyCredsFile(Action func) { var ymlData = File.ReadAllText(CREDS_FILE_NAME); var creds = Yaml.Deserializer.Deserialize(ymlData); @@ -137,18 +136,24 @@ public sealed class BotCredsProvider : IBotCredsProvider var creds = Yaml.Deserializer.Deserialize(File.ReadAllText(CREDS_FILE_NAME)); if (creds.Version <= 5) { - creds.BotCache = BotCacheImplemenation.Memory; + creds.BotCache = BotCacheImplemenation.Redis; } - if (creds.Version < 13) + if (creds.Version <= 6) { - creds.Version = 13; + creds.Version = 7; + File.WriteAllText(CREDS_FILE_NAME, Yaml.Serializer.Serialize(creds)); + } + + if (creds.Version <= 8) + { + creds.Version = 9; File.WriteAllText(CREDS_FILE_NAME, Yaml.Serializer.Serialize(creds)); } } } - public IBotCreds GetCreds() + public IBotCredentials GetCreds() { lock (_reloadLock) { diff --git a/src/EllieBot/_common/Impl/GoogleApiService.cs b/src/EllieBot/Services/Impl/GoogleApiService.cs similarity index 94% rename from src/EllieBot/_common/Impl/GoogleApiService.cs rename to src/EllieBot/Services/Impl/GoogleApiService.cs index 03dd2a6..9d4a494 100644 --- a/src/EllieBot/_common/Impl/GoogleApiService.cs +++ b/src/EllieBot/Services/Impl/GoogleApiService.cs @@ -75,7 +75,7 @@ public sealed partial class GoogleApiService : IGoogleApiService, IEService return (await query.ExecuteAsync()).Items.Select(i => "https://www.youtube.com/watch?v=" + i.Id.VideoId).Skip(1); } - public async Task> GetVideoLinksByKeywordAsync(string keywords, int count = 1) + public async Task> GetVideoLinksByKeywordAsync(string keywords, int count = 1) { if (string.IsNullOrWhiteSpace(keywords)) throw new ArgumentNullException(nameof(keywords)); @@ -87,7 +87,7 @@ public sealed partial class GoogleApiService : IGoogleApiService, IEService query.Q = keywords; query.Type = "video"; query.SafeSearch = SearchResource.ListRequest.SafeSearchEnum.Strict; - return (await query.ExecuteAsync()).Items.Select(i => "https://www.youtube.com/watch?v=" + i.Id.VideoId).ToArray(); + return (await query.ExecuteAsync()).Items.Select(i => "https://www.youtube.com/watch?v=" + i.Id.VideoId); } public async Task> GetVideoInfosByKeywordAsync( @@ -201,12 +201,9 @@ public sealed partial class GoogleApiService : IGoogleApiService, IEService { string text; - if (!Languages.ContainsKey(targetLanguage)) + if (!Languages.ContainsKey(sourceLanguage) || !Languages.ContainsKey(targetLanguage)) throw new ArgumentException(nameof(sourceLanguage) + "/" + nameof(targetLanguage)); - if (string.IsNullOrWhiteSpace(sourceLanguage) || !Languages.ContainsKey(sourceLanguage)) - sourceLanguage = "auto"; - var url = new Uri(string.Format( "https://translate.googleapis.com/translate_a/single?client=gtx&sl={0}&tl={1}&dt=t&q={2}", @@ -226,7 +223,7 @@ public sealed partial class GoogleApiService : IGoogleApiService, IEService private string ConvertToLanguageCode(string language) { Languages.TryGetValue(language, out var mode); - return string.IsNullOrWhiteSpace(mode) ? language : mode; + return mode; } } diff --git a/src/EllieBot/_common/Impl/GoogleApiService_SupportedLanguages.cs b/src/EllieBot/Services/Impl/GoogleApiService_SupportedLanguages.cs similarity index 99% rename from src/EllieBot/_common/Impl/GoogleApiService_SupportedLanguages.cs rename to src/EllieBot/Services/Impl/GoogleApiService_SupportedLanguages.cs index 300964d..b4aa70a 100644 --- a/src/EllieBot/_common/Impl/GoogleApiService_SupportedLanguages.cs +++ b/src/EllieBot/Services/Impl/GoogleApiService_SupportedLanguages.cs @@ -154,6 +154,7 @@ public sealed partial class GoogleApiService } Languages = langs; + } } \ No newline at end of file diff --git a/src/EllieBot/_common/Impl/ImageCache.cs b/src/EllieBot/Services/Impl/ImageCache.cs similarity index 100% rename from src/EllieBot/_common/Impl/ImageCache.cs rename to src/EllieBot/Services/Impl/ImageCache.cs diff --git a/src/EllieBot/_common/Impl/LocalDataCache.cs b/src/EllieBot/Services/Impl/LocalDataCache.cs similarity index 100% rename from src/EllieBot/_common/Impl/LocalDataCache.cs rename to src/EllieBot/Services/Impl/LocalDataCache.cs diff --git a/src/EllieBot/_common/Impl/Localization.cs b/src/EllieBot/Services/Impl/Localization.cs similarity index 100% rename from src/EllieBot/_common/Impl/Localization.cs rename to src/EllieBot/Services/Impl/Localization.cs diff --git a/src/EllieBot/_common/Impl/PubSub/JsonSeria.cs b/src/EllieBot/Services/Impl/PubSub/JsonSeria.cs similarity index 100% rename from src/EllieBot/_common/Impl/PubSub/JsonSeria.cs rename to src/EllieBot/Services/Impl/PubSub/JsonSeria.cs diff --git a/src/EllieBot/_common/Impl/PubSub/RedisPubSub.cs b/src/EllieBot/Services/Impl/PubSub/RedisPubSub.cs similarity index 95% rename from src/EllieBot/_common/Impl/PubSub/RedisPubSub.cs rename to src/EllieBot/Services/Impl/PubSub/RedisPubSub.cs index 6a20888..fd4a36c 100644 --- a/src/EllieBot/_common/Impl/PubSub/RedisPubSub.cs +++ b/src/EllieBot/Services/Impl/PubSub/RedisPubSub.cs @@ -4,11 +4,11 @@ namespace EllieBot.Common; public sealed class RedisPubSub : IPubSub { - private readonly IBotCreds _creds; + private readonly IBotCredentials _creds; private readonly ConnectionMultiplexer _multi; private readonly ISeria _serializer; - public RedisPubSub(ConnectionMultiplexer multi, ISeria serializer, IBotCreds creds) + public RedisPubSub(ConnectionMultiplexer multi, ISeria serializer, IBotCredentials creds) { _multi = multi; _serializer = serializer; diff --git a/src/EllieBot/_common/Impl/PubSub/YamlSeria.cs b/src/EllieBot/Services/Impl/PubSub/YamlSeria.cs similarity index 100% rename from src/EllieBot/_common/Impl/PubSub/YamlSeria.cs rename to src/EllieBot/Services/Impl/PubSub/YamlSeria.cs diff --git a/src/EllieBot/_common/Impl/RedisBotCache.cs b/src/EllieBot/Services/Impl/RedisBotCache.cs similarity index 99% rename from src/EllieBot/_common/Impl/RedisBotCache.cs rename to src/EllieBot/Services/Impl/RedisBotCache.cs index 7e37d9c..259b820 100644 --- a/src/EllieBot/_common/Impl/RedisBotCache.cs +++ b/src/EllieBot/Services/Impl/RedisBotCache.cs @@ -3,6 +3,7 @@ using OneOf.Types; using StackExchange.Redis; using System.Text.Json; using System.Text.Json.Serialization; +using YamlDotNet.Core.Tokens; namespace EllieBot.Common; diff --git a/src/EllieBot/_common/Impl/RedisBotStringsProvider.cs b/src/EllieBot/Services/Impl/RedisBotStringsProvider.cs similarity index 97% rename from src/EllieBot/_common/Impl/RedisBotStringsProvider.cs rename to src/EllieBot/Services/Impl/RedisBotStringsProvider.cs index 504fff6..c0bef49 100644 --- a/src/EllieBot/_common/Impl/RedisBotStringsProvider.cs +++ b/src/EllieBot/Services/Impl/RedisBotStringsProvider.cs @@ -15,13 +15,13 @@ public class RedisBotStringsProvider : IBotStringsProvider private readonly ConnectionMultiplexer _redis; private readonly IStringsSource _source; - private readonly IBotCreds _creds; + private readonly IBotCredentials _creds; public RedisBotStringsProvider( ConnectionMultiplexer redis, DiscordSocketClient discordClient, IStringsSource source, - IBotCreds creds) + IBotCredentials creds) { _redis = redis; _source = source; diff --git a/src/EllieBot/_common/Impl/RemoteGrpcCoordinator.cs b/src/EllieBot/Services/Impl/RemoteGrpcCoordinator.cs similarity index 94% rename from src/EllieBot/_common/Impl/RemoteGrpcCoordinator.cs rename to src/EllieBot/Services/Impl/RemoteGrpcCoordinator.cs index cd1ad8f..de56a39 100644 --- a/src/EllieBot/_common/Impl/RemoteGrpcCoordinator.cs +++ b/src/EllieBot/Services/Impl/RemoteGrpcCoordinator.cs @@ -11,7 +11,7 @@ public class RemoteGrpcCoordinator : ICoordinator, IReadyExecutor private readonly Coordinator.Coordinator.CoordinatorClient _coordClient; private readonly DiscordSocketClient _client; - public RemoteGrpcCoordinator(IBotCreds creds, DiscordSocketClient client) + public RemoteGrpcCoordinator(IBotCredentials creds, DiscordSocketClient client) { var coordUrl = string.IsNullOrWhiteSpace(creds.CoordinatorUrl) ? "http://localhost:3442" : creds.CoordinatorUrl; @@ -90,7 +90,8 @@ public class RemoteGrpcCoordinator : ICoordinator, IReadyExecutor { if (!gracefulImminent) { - Log.Warning(ex, "Hearbeat failed and graceful shutdown was not expected: {Message}", + Log.Warning(ex, + "Hearbeat failed and graceful shutdown was not expected: {Message}", ex.Message); break; } diff --git a/src/EllieBot/Services/SvcExtensions.cs b/src/EllieBot/Services/SvcExtensions.cs deleted file mode 100644 index c60b77d..0000000 --- a/src/EllieBot/Services/SvcExtensions.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Grpc.Core; - -namespace EllieBot.GrpcApi; - -public static class SvcExtensions -{ - public static ulong GetUserId(this Metadata meta) - => ulong.Parse(meta.FirstOrDefault(x => x.Key == "userid")!.Value); -} \ No newline at end of file diff --git a/src/EllieBot/_common/Abstractions/Extensions/EnumerableExtensions.cs b/src/EllieBot/_common/Abstractions/Extensions/EnumerableExtensions.cs index 1ebec24..1a20437 100644 --- a/src/EllieBot/_common/Abstractions/Extensions/EnumerableExtensions.cs +++ b/src/EllieBot/_common/Abstractions/Extensions/EnumerableExtensions.cs @@ -71,7 +71,7 @@ public static class EnumerableExtensions this IEnumerable> dict) where TKey : notnull => new(dict); - + /// /// Initializes a new instance of the class /// that contains elements copied from the specified diff --git a/src/EllieBot/_common/Abstractions/Extensions/StringExtensions.cs b/src/EllieBot/_common/Abstractions/Extensions/StringExtensions.cs index 2515e45..c96f74a 100644 --- a/src/EllieBot/_common/Abstractions/Extensions/StringExtensions.cs +++ b/src/EllieBot/_common/Abstractions/Extensions/StringExtensions.cs @@ -82,14 +82,14 @@ public static class StringExtensions // Step 3 for (var i = 1; i <= n; i++) //Step 4 - for (var j = 1; j <= m; j++) - { - // Step 5 - var cost = t[j - 1] == s[i - 1] ? 0 : 1; + for (var j = 1; j <= m; j++) + { + // Step 5 + var cost = t[j - 1] == s[i - 1] ? 0 : 1; - // Step 6 - d[i, j] = Math.Min(Math.Min(d[i - 1, j] + 1, d[i, j - 1] + 1), d[i - 1, j - 1] + cost); - } + // Step 6 + d[i, j] = Math.Min(Math.Min(d[i - 1, j] + 1, d[i, j - 1] + 1), d[i - 1, j - 1] + cost); + } // Step 7 return d[n, m]; @@ -147,5 +147,5 @@ public static class StringExtensions var newString = str.UnescapeUnicodeCodePoint(); return newString; }); - + } \ No newline at end of file diff --git a/src/EllieBot/_common/Abstractions/Helpers/LogSetup.cs b/src/EllieBot/_common/Abstractions/Helpers/LogSetup.cs index 3d4edec..8983740 100644 --- a/src/EllieBot/_common/Abstractions/Helpers/LogSetup.cs +++ b/src/EllieBot/_common/Abstractions/Helpers/LogSetup.cs @@ -6,9 +6,9 @@ namespace Ellie.Common; public static class LogSetup { - public static void SetupLogger(object source, IBotCreds creds) + public static void SetupLogger(object source) { - var config = new LoggerConfiguration().MinimumLevel.Override("Microsoft", LogEventLevel.Information) + Log.Logger = new LoggerConfiguration().MinimumLevel.Override("Microsoft", LogEventLevel.Information) .MinimumLevel.Override("System", LogEventLevel.Information) .MinimumLevel.Override("Microsoft.AspNetCore", LogEventLevel.Warning) .Enrich.FromLogContext() @@ -16,13 +16,8 @@ public static class LogSetup theme: GetTheme(), outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] | #{LogSource} | {Message:lj}{NewLine}{Exception}") - .Enrich.WithProperty("LogSource", source); - - if (!string.IsNullOrWhiteSpace(creds.Seq.Url)) - config = config.WriteTo.Seq(creds.Seq.Url, apiKey: creds.Seq.ApiKey); - - Log.Logger = config - .CreateLogger(); + .Enrich.WithProperty("LogSource", source) + .CreateLogger(); Console.OutputEncoding = Encoding.UTF8; } diff --git a/src/EllieBot/_common/Abstractions/Kwum.cs b/src/EllieBot/_common/Abstractions/Kwum.cs index ad3768e..267d38b 100644 --- a/src/EllieBot/_common/Abstractions/Kwum.cs +++ b/src/EllieBot/_common/Abstractions/Kwum.cs @@ -76,9 +76,6 @@ public readonly struct kwum : IEquatable public override string ToString() { - if (_value == 0) - return VALID_CHARACTERS[0].ToString(); - var count = VALID_CHARACTERS.Length; var localValue = _value; var arrSize = (int)Math.Log(localValue, count) + 1; diff --git a/src/EllieBot/_common/Abstractions/creds/IBotCreds.cs b/src/EllieBot/_common/Abstractions/creds/IBotCredentials.cs similarity index 94% rename from src/EllieBot/_common/Abstractions/creds/IBotCreds.cs rename to src/EllieBot/_common/Abstractions/creds/IBotCredentials.cs index 83d19b2..faeae4f 100644 --- a/src/EllieBot/_common/Abstractions/creds/IBotCreds.cs +++ b/src/EllieBot/_common/Abstractions/creds/IBotCredentials.cs @@ -1,7 +1,7 @@ #nullable disable namespace EllieBot; -public interface IBotCreds +public interface IBotCredentials { string Token { get; } string EllieAiToken { get; } @@ -29,8 +29,6 @@ public interface IBotCreds string TwitchClientSecret { get; set; } GoogleApiConfig Google { get; set; } BotCacheImplemenation BotCache { get; set; } - Creds.GrpcApiConfig GrpcApi { get; set; } - SeqConfig Seq { get; set; } } public interface IVotesSettings diff --git a/src/EllieBot/_common/Abstractions/creds/IBotCredsProvider.cs b/src/EllieBot/_common/Abstractions/creds/IBotCredsProvider.cs index bb39339..ecc90f0 100644 --- a/src/EllieBot/_common/Abstractions/creds/IBotCredsProvider.cs +++ b/src/EllieBot/_common/Abstractions/creds/IBotCredsProvider.cs @@ -3,6 +3,6 @@ public interface IBotCredsProvider { public void Reload(); - public IBotCreds GetCreds(); - public void ModifyCredsFile(Action func); + public IBotCredentials GetCreds(); + public void ModifyCredsFile(Action func); } \ No newline at end of file diff --git a/src/EllieBot/_common/Abstractions/strings/CommandStrings.cs b/src/EllieBot/_common/Abstractions/strings/CommandStrings.cs index 64efd85..77f16be 100644 --- a/src/EllieBot/_common/Abstractions/strings/CommandStrings.cs +++ b/src/EllieBot/_common/Abstractions/strings/CommandStrings.cs @@ -31,5 +31,5 @@ public sealed record class CommandStringParam // public string Type { get; set; } [YamlMember(Alias = "desc", ScalarStyle = ScalarStyle.DoubleQuoted)] - public string Desc{ get; set; } + public string Desc { get; set; } } \ No newline at end of file diff --git a/src/EllieBot/_common/Attributes/CmdAttribute.cs b/src/EllieBot/_common/Attributes/CmdAttribute.cs index b778c7d..363348c 100644 --- a/src/EllieBot/_common/Attributes/CmdAttribute.cs +++ b/src/EllieBot/_common/Attributes/CmdAttribute.cs @@ -15,4 +15,4 @@ public sealed class CmdAttribute : CommandAttribute Remarks = memberName.ToLowerInvariant(); Summary = memberName.ToLowerInvariant(); } -} +} \ No newline at end of file diff --git a/src/EllieBot/_common/Attributes/NoPublicBotAttribute.cs b/src/EllieBot/_common/Attributes/NoPublicBotAttribute.cs index 183fee5..358265e 100644 --- a/src/EllieBot/_common/Attributes/NoPublicBotAttribute.cs +++ b/src/EllieBot/_common/Attributes/NoPublicBotAttribute.cs @@ -10,7 +10,7 @@ public sealed class NoPublicBotAttribute : PreconditionAttribute IServiceProvider services) { #if GLOBAL_ELLIE - return Task.FromResult(PreconditionResult.FromError("Not available on the public bot. To learn how to selfhost a private bot, click [here](https://docs.elliebot.net).")); + return Task.FromResult(PreconditionResult.FromError("Not available on the public bot. To learn how to selfhost a private bot, click [here](https://docs.elliebot.net/ellie/).")); #else return Task.FromResult(PreconditionResult.FromSuccess()); #endif diff --git a/src/EllieBot/_common/Configs/BotConfig.cs b/src/EllieBot/_common/Configs/BotConfig.cs index 1f691ed..df416ee 100644 --- a/src/EllieBot/_common/Configs/BotConfig.cs +++ b/src/EllieBot/_common/Configs/BotConfig.cs @@ -28,7 +28,7 @@ public sealed partial class BotConfig : ICloneable public CultureInfo DefaultLocale { get; set; } [Comment(""" - Style in which executed commands will show up in the logs. + Style in which executed commands will show up in the console. Allowed values: Simple, Normal, None """)] public ConsoleOutputType ConsoleOutputType { get; set; } @@ -116,7 +116,7 @@ public sealed partial class BotConfig : ICloneable }, { "name": "List of all Commands", - "value": "https://commands.elliebot.net", + "value": "https://commands.elliebot.net/", "inline": false }, { @@ -193,4 +193,4 @@ public enum ConsoleOutputType Normal = 0, Simple = 1, None = 2 -} +} \ No newline at end of file diff --git a/src/EllieBot/_common/Creds.cs b/src/EllieBot/_common/Creds.cs index deaf3fd..295b1de 100644 --- a/src/EllieBot/_common/Creds.cs +++ b/src/EllieBot/_common/Creds.cs @@ -1,33 +1,32 @@ -#nullable disable +#nullable disable using EllieBot.Common.Yml; namespace EllieBot.Common; -public sealed class Creds : IBotCreds +public sealed class Creds : IBotCredentials { [Comment("""DO NOT CHANGE""")] - public int Version { get; set; } = 13; + public int Version { get; set; } [Comment("""Bot token. Do not share with anyone ever -> https://discordapp.com/developers/applications/""")] public string Token { get; set; } [Comment(""" - List of Ids of the users who have bot owner permissions - **DO NOT ADD PEOPLE YOU DON'T TRUST** - """)] + List of Ids of the users who have bot owner permissions + **DO NOT ADD PEOPLE YOU DON'T TRUST** + """)] public ICollection OwnerIds { get; set; } - - [Comment( - "Keep this on 'true' unless you're sure your bot shouldn't use privileged intents or you're waiting to be accepted")] + + [Comment("Keep this on 'true' unless you're sure your bot shouldn't use privileged intents or you're waiting to be accepted")] public bool UsePrivilegedIntents { get; set; } [Comment(""" - The number of shards that the bot will be running on. - Leave at 1 if you don't know what you're doing. - - note: If you are planning to have more than one shard, then you must change botCache to 'redis'. - Also, in that case you should be using EllieBot.Coordinator to start the bot, and it will correctly override this value. - """)] + The number of shards that the bot will be running on. + Leave at 1 if you don't know what you're doing. + + note: If you are planning to have more than one shard, then you must change botCache to 'redis'. + Also, in that case you should be using EllieBot.Coordinator to start the bot, and it will correctly override this value. + """)] public int TotalShards { get; set; } [Comment(""" @@ -36,37 +35,36 @@ public sealed class Creds : IBotCreds Go to the Keys page and click "Generate New Key" and copy it here You and anyone else with the permission to run `.prompt` command will be able to use natural language to run bot's commands. For example '@Bot how's the weather in Paris' will return the current weather in Paris as if you were to run `.weather Paris` command. - ⚠ This does not currently work and is a work in progress. """)] public string EllieAiToken { get; set; } - - [Comment( + + [Comment( """ - Login to https://console.cloud.google.com, create a new project, go to APIs & Services -> Library -> YouTube Data API and enable it. - Then, go to APIs and Services -> Credentials and click Create credentials -> API key. - Used only for Youtube Data Api (at the moment). - """)] + Login to https://console.cloud.google.com, create a new project, go to APIs & Services -> Library -> YouTube Data API and enable it. + Then, go to APIs and Services -> Credentials and click Create credentials -> API key. + Used only for Youtube Data Api (at the moment). + """)] public string GoogleApiKey { get; set; } - - [Comment( + + [Comment( """ - Create a new custom search here https://programmablesearchengine.google.com/cse/create/new - Enable SafeSearch - Remove all Sites to Search - Enable Search the entire web - Copy the 'Search Engine ID' to the SearchId field - - Do all steps again but enable image search for the ImageSearchId - """)] + Create a new custom search here https://programmablesearchengine.google.com/cse/create/new + Enable SafeSearch + Remove all Sites to Search + Enable Search the entire web + Copy the 'Search Engine ID' to the SearchId field + + Do all steps again but enable image search for the ImageSearchId + """)] public GoogleApiConfig Google { get; set; } [Comment("""Settings for voting system for discordbots. Meant for use on global Ellie.""")] public VotesSettings Votes { get; set; } [Comment(""" - Patreon auto reward system settings. - go to https://www.patreon.com/portal -> my clients -> create client - """)] + Patreon auto reward system settings. + go to https://www.patreon.com/portal -> my clients -> create client + """)] public PatreonSettings Patreon { get; set; } [Comment("""Api key for sending stats to DiscordBotList.""")] @@ -77,27 +75,27 @@ public sealed class Creds : IBotCreds [Comment(@"OpenAi api key.")] public string Gpt3ApiKey { get; set; } - + [Comment(""" - Which cache implementation should bot use. - 'memory' - Cache will be in memory of the bot's process itself. Only use this on bots with a single shard. When the bot is restarted the cache is reset. - 'redis' - Uses redis (which needs to be separately downloaded and installed). The cache will persist through bot restarts. You can configure connection string in creds.yml - """)] + Which cache implementation should bot use. + 'memory' - Cache will be in memory of the bot's process itself. Only use this on bots with a single shard. When the bot is restarted the cache is reset. + 'redis' - Uses redis (which needs to be separately downloaded and installed). The cache will persist through bot restarts. You can configure connection string in creds.yml + """)] public BotCacheImplemenation BotCache { get; set; } - + [Comment(""" - Redis connection string. Don't change if you don't know what you're doing. - Only used if botCache is set to 'redis' - """)] + Redis connection string. Don't change if you don't know what you're doing. + Only used if botCache is set to 'redis' + """)] public string RedisOptions { get; set; } [Comment("""Database options. Don't change if you don't know what you're doing. Leave null for default values""")] public DbOptions Db { get; set; } [Comment(""" - Address and port of the coordinator endpoint. Leave empty for default. - Change only if you've changed the coordinator address or port. - """)] + Address and port of the coordinator endpoint. Leave empty for default. + Change only if you've changed the coordinator address or port. + """)] public string CoordinatorUrl { get; set; } [Comment( @@ -105,34 +103,34 @@ public sealed class Creds : IBotCreds public string RapidApiKey { get; set; } [Comment(""" - https://locationiq.com api key (register and you will receive the token in the email). - Used only for .time command. - """)] + https://locationiq.com api key (register and you will receive the token in the email). + Used only for .time command. + """)] public string LocationIqApiKey { get; set; } [Comment(""" - https://timezonedb.com api key (register and you will receive the token in the email). - Used only for .time command - """)] + https://timezonedb.com api key (register and you will receive the token in the email). + Used only for .time command + """)] public string TimezoneDbApiKey { get; set; } [Comment(""" - https://pro.coinmarketcap.com/account/ api key. There is a free plan for personal use. - Used for cryptocurrency related commands. - """)] + https://pro.coinmarketcap.com/account/ api key. There is a free plan for personal use. + Used for cryptocurrency related commands. + """)] public string CoinmarketcapApiKey { get; set; } - - // [Comment(@"https://polygon.io/dashboard/api-keys api key. Free plan allows for 5 queries per minute. - // Used for stocks related commands.")] - // public string PolygonIoApiKey { get; set; } + +// [Comment(@"https://polygon.io/dashboard/api-keys api key. Free plan allows for 5 queries per minute. +// Used for stocks related commands.")] +// public string PolygonIoApiKey { get; set; } [Comment("""Api key used for Osu related commands. Obtain this key at https://osu.ppy.sh/p/api""")] public string OsuApiKey { get; set; } [Comment(""" - Optional Trovo client id. - You should use this if Trovo stream notifications stopped working or you're getting ratelimit errors. - """)] + Optional Trovo client id. + You should use this if Trovo stream notifications stopped working or you're getting ratelimit errors. + """)] public string TrovoClientId { get; set; } [Comment("""Obtain by creating an application at https://dev.twitch.tv/console/apps""")] @@ -142,35 +140,23 @@ public sealed class Creds : IBotCreds public string TwitchClientSecret { get; set; } [Comment(""" - Command and args which will be used to restart the bot. - Only used if bot is executed directly (NOT through the coordinator) - placeholders: - {0} -> shard id - {1} -> total shards - Linux default - cmd: dotnet - args: "EllieBot.dll -- {0}" - Windows default - cmd: EllieBot.exe - args: "{0}" - """)] + Command and args which will be used to restart the bot. + Only used if bot is executed directly (NOT through the coordinator) + placeholders: + {0} -> shard id + {1} -> total shards + Linux default + cmd: dotnet + args: "EllieBot.dll -- {0}" + Windows default + cmd: EllieBot.exe + args: "{0}" + """)] public RestartConfig RestartCommand { get; set; } - - [Comment(""" - Settings for the grpc api. - We don't provide support for this. - If you leave certPath empty, the api will run on http. - """)] - public GrpcApiConfig GrpcApi { get; set; } - - [Comment(""" - Url and api key to a seq server. If url is set, bot will try to send logs to it. - """)] - public SeqConfig Seq { get; set; } - public Creds() { + Version = 9; Token = string.Empty; UsePrivilegedIntents = true; OwnerIds = new List(); @@ -193,27 +179,24 @@ public sealed class Creds : IBotCreds RestartCommand = new RestartConfig(); Google = new GoogleApiConfig(); - - GrpcApi = new(); - Seq = new(); } - + public class DbOptions : IDbOptions { [Comment(""" - Database type. "sqlite", "mysql" and "postgresql" are supported. - Default is "sqlite" - """)] + Database type. "sqlite", "mysql" and "postgresql" are supported. + Default is "sqlite" + """)] public string Type { get; set; } [Comment(""" - Database connection string. - You MUST change this if you're not using "sqlite" type. - Default is "Data Source=data/EllieBot.db" - Example for mysql: "Server=localhost;Port=3306;Uid=root;Pwd=my_super_secret_mysql_password;Database=ellie" - Example for postgresql: "Server=localhost;Port=5432;User Id=postgres;Password=my_super_secret_postgres_password;Database=ellie;" - """)] + Database connection string. + You MUST change this if you're not using "sqlite" type. + Default is "Data Source=data/EllieBot.db" + Example for mysql: "Server=localhost;Port=3306;Uid=root;Pwd=my_super_secret_mysql_password;Database=ellie" + Example for postgresql: "Server=localhost;Port=5432;User Id=postgres;Password=my_super_secret_postgres_password;Database=ellie;" + """)] public string ConnectionString { get; set; } } @@ -248,29 +231,29 @@ public sealed class Creds : IBotCreds public sealed record VotesSettings : IVotesSettings { [Comment(""" - top.gg votes service url - This is the url of your instance of the EllieBot.Votes api - Example: https://votes.my.cool.bot.com - """)] + top.gg votes service url + This is the url of your instance of the EllieBot.Votes api + Example: https://votes.my.cool.bot.com + """)] public string TopggServiceUrl { get; set; } [Comment(""" - Authorization header value sent to the TopGG service url with each request - This should be equivalent to the TopggKey in your EllieBot.Votes api appsettings.json file - """)] + Authorization header value sent to the TopGG service url with each request + This should be equivalent to the TopggKey in your EllieBot.Votes api appsettings.json file + """)] public string TopggKey { get; set; } [Comment(""" - discords.com votes service url - This is the url of your instance of the EllieBot.Votes api - Example: https://votes.my.cool.bot.com - """)] + discords.com votes service url + This is the url of your instance of the EllieBot.Votes api + Example: https://votes.my.cool.bot.com + """)] public string DiscordsServiceUrl { get; set; } [Comment(""" - Authorization header value sent to the Discords service url with each request - This should be equivalent to the DiscordsKey in your EllieBot.Votes api appsettings.json file - """)] + Authorization header value sent to the Discords service url with each request + This should be equivalent to the DiscordsKey in your EllieBot.Votes api appsettings.json file + """)] public string DiscordsKey { get; set; } public VotesSettings() @@ -289,25 +272,13 @@ public sealed class Creds : IBotCreds DiscordsKey = discordsKey; } } - - public sealed record GrpcApiConfig - { - public bool Enabled { get; set; } = false; - public string CertChain { get; set; } = string.Empty; - public string CertPrivateKey { get; set; } = string.Empty; - public string Host { get; set; } = "localhost"; - public int Port { get; set; } = 43120; - } -} - -public sealed class SeqConfig -{ - public string Url { get; init; } - public string ApiKey { get; init; } } public class GoogleApiConfig : IGoogleApiConfig { public string SearchId { get; init; } public string ImageSearchId { get; init; } -} \ No newline at end of file +} + + + diff --git a/src/EllieBot/_common/Currency/ICurrencyService.cs b/src/EllieBot/_common/Currency/ICurrencyService.cs index 4fe8b5c..35e8273 100644 --- a/src/EllieBot/_common/Currency/ICurrencyService.cs +++ b/src/EllieBot/_common/Currency/ICurrencyService.cs @@ -40,11 +40,4 @@ public interface ICurrencyService TxData? txData); Task> GetTopRichest(ulong ignoreId, int page = 0, int perPage = 9); - - Task> GetTransactionsAsync( - ulong userId, - int page, - int perPage = 15); - - Task GetTransactionsCountAsync(ulong userId); } \ No newline at end of file diff --git a/src/EllieBot/_common/Currency/ITxTracker.cs b/src/EllieBot/_common/Currency/ITxTracker.cs index 6324901..d7cad66 100644 --- a/src/EllieBot/_common/Currency/ITxTracker.cs +++ b/src/EllieBot/_common/Currency/ITxTracker.cs @@ -4,6 +4,6 @@ namespace EllieBot.Services; public interface ITxTracker { - Task TrackAdd(ulong userId, long amount, TxData? txData); - Task TrackRemove(ulong userId, long amount, TxData? txData); + Task TrackAdd(long amount, TxData? txData); + Task TrackRemove(long amount, TxData? txData); } \ No newline at end of file diff --git a/src/EllieBot/_common/DbService.cs b/src/EllieBot/_common/DbService.cs index 089c1c2..46d2016 100644 --- a/src/EllieBot/_common/DbService.cs +++ b/src/EllieBot/_common/DbService.cs @@ -1,5 +1,4 @@ #nullable disable - using Microsoft.EntityFrameworkCore; namespace EllieBot.Services; diff --git a/src/EllieBot/_common/DownloadTracker.cs b/src/EllieBot/_common/DownloadTracker.cs index e780fb6..b886228 100644 --- a/src/EllieBot/_common/DownloadTracker.cs +++ b/src/EllieBot/_common/DownloadTracker.cs @@ -14,7 +14,6 @@ public class DownloadTracker : IEService public async Task EnsureUsersDownloadedAsync(IGuild guild) { #if GLOBAL_ELLIE - await Task.CompletedTask; return; #endif await _downloadUsersSemaphore.WaitAsync(); diff --git a/src/EllieBot/_common/EllieTypeReader.cs b/src/EllieBot/_common/EllieTypeReader.cs index f14aa1e..bab013e 100644 --- a/src/EllieBot/_common/EllieTypeReader.cs +++ b/src/EllieBot/_common/EllieTypeReader.cs @@ -1,5 +1,4 @@ #nullable disable - namespace EllieBot.Common.TypeReaders; [MeansImplicitUse(ImplicitUseTargetFlags.Default | ImplicitUseTargetFlags.WithInheritors)] diff --git a/src/EllieBot/_common/Gambling/Slot/SlotGame.cs b/src/EllieBot/_common/Gambling/Slot/SlotGame.cs index 7e4f69f..83e92eb 100644 --- a/src/EllieBot/_common/Gambling/Slot/SlotGame.cs +++ b/src/EllieBot/_common/Gambling/Slot/SlotGame.cs @@ -11,9 +11,9 @@ public class SlotGame { var rolls = new[] { - (byte)_rng.Next(0, 7), - (byte)_rng.Next(0, 7), - (byte)_rng.Next(0, 7) + (byte)_rng.Next(0, 6), + (byte)_rng.Next(0, 6), + (byte)_rng.Next(0, 6) }; ref var a = ref rolls[0]; @@ -24,24 +24,24 @@ public class SlotGame var winType = SlotWinType.None; if (a == b && b == c) { - if (a == 6) + if (a == 5) { winType = SlotWinType.TrippleJoker; - multi = 25; + multi = 30; } else { winType = SlotWinType.TrippleNormal; - multi = 15; + multi = 10; } } - else if (a == 6 && (b == 6 || c == 6) - || (b == 6 && c == 6)) + else if (a == 5 && (b == 5 || c == 5) + || (b == 5 && c == 5)) { winType = SlotWinType.DoubleJoker; - multi = 6; + multi = 4; } - else if (a == 6 || b == 6 || c == 6) + else if (a == 5 || b == 5 || c == 5) { winType = SlotWinType.SingleJoker; multi = 1; diff --git a/src/EllieBot/_common/ImageUrls.cs b/src/EllieBot/_common/ImageUrls.cs index 401803a..fa253a7 100644 --- a/src/EllieBot/_common/ImageUrls.cs +++ b/src/EllieBot/_common/ImageUrls.cs @@ -8,7 +8,7 @@ namespace EllieBot.Common; public partial class ImageUrls : ICloneable { [Comment("DO NOT CHANGE")] - public int Version { get; set; } = 6; + public int Version { get; set; } = 5; public CoinData Coins { get; set; } public Uri[] Currency { get; set; } diff --git a/src/EllieBot/_common/Interaction/EllieInteraction.cs b/src/EllieBot/_common/Interaction/EllieInteraction.cs index 0206599..3a24470 100644 --- a/src/EllieBot/_common/Interaction/EllieInteraction.cs +++ b/src/EllieBot/_common/Interaction/EllieInteraction.cs @@ -70,7 +70,7 @@ public abstract class EllieInteractionBase { if (_singleUse) _interactionCompletedSource.TrySetResult(true); - + await ExecuteOnActionAsync(smc); if (!smc.HasResponded) diff --git a/src/EllieBot/_common/Interaction/IEllieInteractionService.cs b/src/EllieBot/_common/Interaction/IEllieInteractionService.cs index 26adc74..093e4bd 100644 --- a/src/EllieBot/_common/Interaction/IEllieInteractionService.cs +++ b/src/EllieBot/_common/Interaction/IEllieInteractionService.cs @@ -29,5 +29,4 @@ public interface IEllieInteractionService ModalBuilder modal, Func onTrigger, bool singleUse = true); - } \ No newline at end of file diff --git a/src/EllieBot/_common/Interaction/Models/EllieButtonInteraction.cs b/src/EllieBot/_common/Interaction/Models/EllieButtonInteraction.cs index 676ab5d..0a80839 100644 --- a/src/EllieBot/_common/Interaction/Models/EllieButtonInteraction.cs +++ b/src/EllieBot/_common/Interaction/Models/EllieButtonInteraction.cs @@ -19,5 +19,4 @@ public sealed class EllieButtonInteractionHandler : EllieInteractionBase public override void AddTo(ComponentBuilder cb) => cb.WithButton(Button); - } \ No newline at end of file diff --git a/src/EllieBot/_common/JsonConverters/CultureInfoConverter.cs b/src/EllieBot/_common/JsonConverters/CultureInfoConverter.cs index 969a416..0c26f15 100644 --- a/src/EllieBot/_common/JsonConverters/CultureInfoConverter.cs +++ b/src/EllieBot/_common/JsonConverters/CultureInfoConverter.cs @@ -11,4 +11,4 @@ public class CultureInfoConverter : JsonConverter public override void Write(Utf8JsonWriter writer, CultureInfo value, JsonSerializerOptions options) => writer.WriteStringValue(value.Name); -} +} \ No newline at end of file diff --git a/src/EllieBot/_common/Linq2DbExpressions.cs b/src/EllieBot/_common/Linq2DbExpressions.cs index baa1f74..5a1e145 100644 --- a/src/EllieBot/_common/Linq2DbExpressions.cs +++ b/src/EllieBot/_common/Linq2DbExpressions.cs @@ -1,6 +1,6 @@ #nullable disable using LinqToDB; -using Microsoft.EntityFrameworkCore; +using LinqToDB.EntityFrameworkCore; using System.Linq.Expressions; namespace EllieBot.Common; diff --git a/src/EllieBot/_common/Marmalade/Common/MarmaladeLoaderService.cs b/src/EllieBot/_common/Marmalade/Common/MarmaladeLoaderService.cs index 06bebb5..a17e05a 100644 --- a/src/EllieBot/_common/Marmalade/Common/MarmaladeLoaderService.cs +++ b/src/EllieBot/_common/Marmalade/Common/MarmaladeLoaderService.cs @@ -250,7 +250,6 @@ public sealed class MarmaladeLoaderService : IMarmaladeLoaderService, IReadyExec } catch (Exception ex) when (ex is FileNotFoundException or BadImageFormatException) { - Log.Error(ex, "An error occurred loading a marmalade"); return MarmaladeLoadResult.NotFound; } catch (Exception ex) @@ -331,38 +330,27 @@ public sealed class MarmaladeLoaderService : IMarmaladeLoaderService, IReadyExec throw new FileNotFoundException($"Marmalade dll not found: {path}"); strings = MarmaladeStrings.CreateDefault(dir); - var ctx = new MarmaladeAssemblyLoadContext(path); + var ctx = new MarmaladeAssemblyLoadContext(Path.GetDirectoryName(path)!); var a = ctx.LoadFromAssemblyPath(Path.GetFullPath(path)); - // ctx.LoadDependencies(a); + ctx.LoadDependencies(a); - iocModule = null; // load services - try + iocModule = new MarmaladeNinjectIocModule(_cont, a, safeName); + iocModule.Load(); + + var sis = LoadCanariesFromAssembly(safeName, a); + typeReaders = LoadTypeReadersFromAssembly(a, strings); + + if (sis.Count == 0) { - iocModule = new MarmaladeNinjectIocModule(_cont, a, safeName); - iocModule.Load(); - - var sis = LoadCanariesFromAssembly(safeName, a); - typeReaders = LoadTypeReadersFromAssembly(a, strings); - - if (sis.Count == 0) - { - iocModule.Unload(); - ctx.Unload(); - return false; - } - - ctxWr = new(ctx); - canaryData = sis; - - return true; - } - catch - { - iocModule?.Unload(); - ctx.Unload(); - throw; + iocModule.Unload(); + return false; } + + ctxWr = new(ctx); + canaryData = sis; + + return true; } private static readonly Type _paramParserType = typeof(ParamParser<>); diff --git a/src/EllieBot/_common/ModuleBehaviors/IExecPostCommand.cs b/src/EllieBot/_common/ModuleBehaviors/IExecPostCommand.cs index bad88f8..b97f584 100644 --- a/src/EllieBot/_common/ModuleBehaviors/IExecPostCommand.cs +++ b/src/EllieBot/_common/ModuleBehaviors/IExecPostCommand.cs @@ -3,7 +3,7 @@ namespace EllieBot.Common.ModuleBehaviors; /// /// This interface's method is executed after the command successfully finished execution. /// ***There is no support for this method in EllieBot services.*** -/// It is only meant to be used in medusa system +/// It is only meant to be used in marmalade system /// public interface IExecPostCommand : IBehavior { diff --git a/src/EllieBot/_common/Replacements/Impl/ReplacementContext.cs b/src/EllieBot/_common/Replacements/Impl/ReplacementContext.cs index 4e87ce9..184ba4e 100644 --- a/src/EllieBot/_common/Replacements/Impl/ReplacementContext.cs +++ b/src/EllieBot/_common/Replacements/Impl/ReplacementContext.cs @@ -54,6 +54,7 @@ public sealed class ReplacementContext public ReplacementContext WithOverride(string key, Func repFactory) => WithOverride(key, () => new ValueTask(repFactory())); + public ReplacementContext WithOverride(Regex regex, Func> repFactory) { if (_regexPatterns.Add(regex.ToString())) diff --git a/src/EllieBot/_common/Replacements/Impl/ReplacementRegistrator.default.cs b/src/EllieBot/_common/Replacements/Impl/ReplacementRegistrator.default.cs index 0d8e43f..0dc42de 100644 --- a/src/EllieBot/_common/Replacements/Impl/ReplacementRegistrator.default.cs +++ b/src/EllieBot/_common/Replacements/Impl/ReplacementRegistrator.default.cs @@ -12,11 +12,7 @@ public sealed partial class ReplacementPatternStore { Register("%bot.time%", static () - => TimestampTag.FromDateTime(DateTime.UtcNow, TimestampTagStyles.ShortTime).ToString()); - - Register("%bot.date%", - static () - => TimestampTag.FromDateTime(DateTime.UtcNow, TimestampTagStyles.ShortTime).ToString()); + => DateTime.Now.ToString("HH:mm " + TimeZoneInfo.Local.StandardName.GetInitials())); } private void WithClient() @@ -69,15 +65,13 @@ public sealed partial class ReplacementPatternStore Register("%user.mention%", static (IUser user) => user.Mention); Register("%user.fullname%", static (IUser user) => user.ToString()!); Register("%user.name%", static (IUser user) => user.Username); - Register("%user.displayname%", static (IUser user) => user is IGuildUser gu ? gu.DisplayName : user.Username); Register("%user.discrim%", static (IUser user) => user.Discriminator); Register("%user.avatar%", static (IUser user) => user.RealAvatarUrl().ToString()); Register("%user.id%", static (IUser user) => user.Id.ToString()); Register("%user.created_time%", static (IUser user) => user.CreatedAt.ToString("HH:mm")); Register("%user.created_date%", static (IUser user) => user.CreatedAt.ToString("dd.MM.yyyy")); - Register("%user.joined_time%", static (IGuildUser user) => user.JoinedAt?.ToString("HH:mm") ?? "??:??"); - Register("%user.joined_date%", - static (IGuildUser user) => user.JoinedAt?.ToString("dd.MM.yyyy") ?? "??.??.????"); + Register("%user.joined_time%", static (IGuildUser user) => user.JoinedAt?.ToString("HH:mm")); + Register("%user.joined_date%", static (IGuildUser user) => user.JoinedAt?.ToString("dd.MM.yyyy")); Register("%user%", static (IUser[] users) => string.Join(" ", users.Select(user => user.Mention))); diff --git a/src/EllieBot/_common/Replacements/Impl/Replacer.cs b/src/EllieBot/_common/Replacements/Impl/Replacer.cs index adc5e4d..0bf092c 100644 --- a/src/EllieBot/_common/Replacements/Impl/Replacer.cs +++ b/src/EllieBot/_common/Replacements/Impl/Replacer.cs @@ -91,9 +91,9 @@ public sealed partial class Replacer => new() { Embeds = await embedArr.Embeds.Map(async e => await ReplaceAsync(e) with - { - Color = e.Color - }) + { + Color = e.Color + }) .WhenAll(), Content = await ReplaceAsync(embedArr.Content) }; diff --git a/src/EllieBot/_common/Sender/ResponseBuilder.cs b/src/EllieBot/_common/Sender/ResponseBuilder.cs index f209770..08d1ad3 100644 --- a/src/EllieBot/_common/Sender/ResponseBuilder.cs +++ b/src/EllieBot/_common/Sender/ResponseBuilder.cs @@ -287,9 +287,9 @@ public sealed partial class ResponseBuilder return this; } - public ResponseBuilder UserBasedMentions(IGuildUser? permUser = null) + public ResponseBuilder UserBasedMentions() { - sanitizeMentions = !((InternalResolveUser() as IGuildUser ?? permUser)?.GuildPermissions.MentionEveryone ?? false); + sanitizeMentions = !((InternalResolveUser() as IGuildUser)?.GuildPermissions.MentionEveryone ?? false); return this; } diff --git a/src/EllieBot/_common/ServiceCollectionExtensions.cs b/src/EllieBot/_common/ServiceCollectionExtensions.cs index 2326ebb..3a59226 100644 --- a/src/EllieBot/_common/ServiceCollectionExtensions.cs +++ b/src/EllieBot/_common/ServiceCollectionExtensions.cs @@ -51,9 +51,7 @@ public static class ServiceCollectionExtensions svcs.RegisterMany(Reuse.Singleton); svcs.AddSingleton(); - svcs.AddSingleton(); - svcs.AddSingleton(); - svcs.AddSingleton(); + svcs.AddSingleton(); svcs.AddSingleton(); svcs.AddSingleton(); svcs.AddSingleton(); @@ -61,7 +59,7 @@ public static class ServiceCollectionExtensions return svcs; } - public static IContainer AddCache(this IContainer cont, IBotCreds creds) + public static IContainer AddCache(this IContainer cont, IBotCredentials creds) { if (creds.BotCache == BotCacheImplemenation.Redis) { diff --git a/src/EllieBot/_common/Services/CommandHandler.cs b/src/EllieBot/_common/Services/CommandHandler.cs index a9c81a1..b9b0721 100644 --- a/src/EllieBot/_common/Services/CommandHandler.cs +++ b/src/EllieBot/_common/Services/CommandHandler.cs @@ -165,7 +165,7 @@ public class CommandHandler : IEService, IReadyExecutor, ICommandHandler Log.Information("Succ | g:{GuildId} | c: {ChannelId} | u: {UserId} | msg: {Message}", channel?.Guild.Id.ToString() ?? "-", channel?.Id.ToString() ?? "-", - usrMsg.Author.Id.ToString(), + usrMsg.Author.Id, usrMsg.Content.TrimTo(10)); } diff --git a/src/EllieBot/_common/Services/Currency/CurrencyService.cs b/src/EllieBot/_common/Services/Currency/CurrencyService.cs index 974febd..66029ff 100644 --- a/src/EllieBot/_common/Services/Currency/CurrencyService.cs +++ b/src/EllieBot/_common/Services/Currency/CurrencyService.cs @@ -55,14 +55,14 @@ public sealed class CurrencyService : ICurrencyService, IEService { await using var ctx = _db.GetDbContext(); await ctx - .GetTable() - .Where(x => userIds.Contains(x.UserId)) - .UpdateAsync(du => new() - { - CurrencyAmount = du.CurrencyAmount >= amount - ? du.CurrencyAmount - amount - : 0 - }); + .GetTable() + .Where(x => userIds.Contains(x.UserId)) + .UpdateAsync(du => new() + { + CurrencyAmount = du.CurrencyAmount >= amount + ? du.CurrencyAmount - amount + : 0 + }); await ctx.SaveChangesAsync(); return; } @@ -77,7 +77,7 @@ public sealed class CurrencyService : ICurrencyService, IEService { var wallet = await GetWalletAsync(userId); await wallet.Add(amount, txData); - await _txTracker.TrackAdd(userId, amount, txData); + await _txTracker.TrackAdd(amount, txData); } public async Task AddAsync( @@ -97,7 +97,7 @@ public sealed class CurrencyService : ICurrencyService, IEService var wallet = await GetWalletAsync(userId); var result = await wallet.Take(amount, txData); if (result) - await _txTracker.TrackRemove(userId, amount, txData); + await _txTracker.TrackRemove(amount, txData); return result; } @@ -112,29 +112,4 @@ public sealed class CurrencyService : ICurrencyService, IEService await using var uow = _db.GetDbContext(); return await uow.Set().GetTopRichest(ignoreId, page, perPage); } - - public async Task> GetTransactionsAsync( - ulong userId, - int page, - int perPage = 15) - { - await using var uow = _db.GetDbContext(); - - var trs = await uow.GetTable() - .Where(x => x.UserId == userId) - .OrderByDescending(x => x.DateAdded) - .Skip(perPage * page) - .Take(perPage) - .ToListAsyncLinqToDB(); - - return trs; - } - - public async Task GetTransactionsCountAsync(ulong userId) - { - await using var uow = _db.GetDbContext(); - return await uow.GetTable() - .Where(x => x.UserId == userId) - .CountAsyncLinqToDB(); - } } \ No newline at end of file diff --git a/src/EllieBot/_common/Services/Currency/DefaultWallet.cs b/src/EllieBot/_common/Services/Currency/DefaultWallet.cs index 1021e40..a556985 100644 --- a/src/EllieBot/_common/Services/Currency/DefaultWallet.cs +++ b/src/EllieBot/_common/Services/Currency/DefaultWallet.cs @@ -77,7 +77,8 @@ public class DefaultWallet : IWallet .InsertOrUpdateAsync(() => new() { UserId = userId, - Username = "??Unknown", + Username = "Unknown", + Discriminator = "????", CurrencyAmount = amount, }, (old) => new() diff --git a/src/EllieBot/_common/Services/Currency/GamblingTxTracker.cs b/src/EllieBot/_common/Services/Currency/GamblingTxTracker.cs index 5a40474..5751281 100644 --- a/src/EllieBot/_common/Services/Currency/GamblingTxTracker.cs +++ b/src/EllieBot/_common/Services/Currency/GamblingTxTracker.cs @@ -1,11 +1,8 @@ using LinqToDB; -using LinqToDB.Data; using LinqToDB.EntityFrameworkCore; using EllieBot.Common.ModuleBehaviors; using EllieBot.Services.Currency; using EllieBot.Db.Models; -using EllieBot.Modules.Gambling; -using System.Collections.Concurrent; namespace EllieBot.Services; @@ -13,11 +10,15 @@ public sealed class GamblingTxTracker : ITxTracker, IEService, IReadyExecutor { private static readonly IReadOnlySet _gamblingTypes = new HashSet(new[] { - "lula", "betroll", "betflip", "blackjack", "betdraw", "slot", + "lula", + "betroll", + "betflip", + "blackjack", + "betdraw", + "slot", }); - private NonBlocking.ConcurrentDictionary globalStats = new(); - private ConcurrentBag userStats = new(); + private ConcurrentDictionary _stats = new(); private readonly DbService _db; @@ -27,333 +28,83 @@ public sealed class GamblingTxTracker : ITxTracker, IEService, IReadyExecutor } public async Task OnReadyAsync() - => await Task.WhenAll(RunUserStatsCollector(), RunBetStatsCollector()); - - public async Task RunBetStatsCollector() { using var timer = new PeriodicTimer(TimeSpan.FromHours(1)); while (await timer.WaitForNextTickAsync()) { await using var ctx = _db.GetDbContext(); + await using var trans = await ctx.Database.BeginTransactionAsync(); try { - // update betstats - var keys = globalStats.Keys; + var keys = _stats.Keys; foreach (var key in keys) { - if (globalStats.TryRemove(key, out var stat)) + if (_stats.TryRemove(key, out var stat)) { await ctx.GetTable() - .InsertOrUpdateAsync(() => new() - { - Feature = key, - Bet = stat.Bet, - PaidOut = stat.PaidOut, - DateAdded = DateTime.UtcNow - }, - old => new() - { - Bet = old.Bet + stat.Bet, - PaidOut = old.PaidOut + stat.PaidOut, - }, - () => new() - { - Feature = key - }); + .InsertOrUpdateAsync(() => new() + { + Feature = key, + Bet = stat.Bet, + PaidOut = stat.PaidOut, + DateAdded = DateTime.UtcNow + }, old => new() + { + Bet = old.Bet + stat.Bet, + PaidOut = old.PaidOut + stat.PaidOut, + }, () => new() + { + Feature = key + }); } } } catch (Exception ex) { - Log.Error(ex, "An error occurred in betstats gambling tx tracker"); + Log.Error(ex, "An error occurred in gambling tx tracker"); + } + finally + { + await trans.CommitAsync(); } } } - private async Task RunUserStatsCollector() - { - var timer = new PeriodicTimer(TimeSpan.FromSeconds(5)); - while (await timer.WaitForNextTickAsync()) - { - try - { - if (userStats.Count == 0) - continue; - - var users = new List(userStats.Count + 5); - - while (userStats.TryTake(out var s)) - users.Add(s); - - if (users.Count == 0) - continue; - - // rakeback - var rakebacks = new Dictionary(); - - // update userstats - foreach (var (k, x) in users.GroupBy(x => (x.UserId, x.Game)) - .ToDictionary(x => x.Key, - x => x.Aggregate((a, b) => new() - { - WinCount = a.WinCount + b.WinCount, - LoseCount = a.LoseCount + b.LoseCount, - TotalBet = a.TotalBet + b.TotalBet, - PaidOut = a.PaidOut + b.PaidOut, - MaxBet = Math.Max(a.MaxBet, b.MaxBet), - MaxWin = Math.Max(a.MaxWin, b.MaxWin), - }))) - { - rakebacks.TryAdd(k.UserId, 0m); - rakebacks[k.UserId] += x.TotalBet * GetHouseEdge(k.Game) * BASE_RAKEBACK; - - - // bulk upsert in the future - await using var uow = _db.GetDbContext(); - await uow.GetTable() - .InsertOrUpdateAsync(() => new() - { - UserId = k.UserId, - Game = k.Game, - WinCount = x.WinCount, - LoseCount = Math.Max(0, x.LoseCount), - TotalBet = x.TotalBet, - PaidOut = x.PaidOut, - MaxBet = x.MaxBet, - MaxWin = x.MaxWin - }, - o => new() - { - WinCount = o.WinCount + x.WinCount, - LoseCount = Math.Max(0, o.LoseCount + x.LoseCount), - TotalBet = o.TotalBet + x.TotalBet, - PaidOut = o.PaidOut + x.PaidOut, - MaxBet = Math.Max(o.MaxBet, x.MaxBet), - MaxWin = Math.Max(o.MaxWin, x.MaxWin), - }, - () => new() - { - UserId = k.UserId, - Game = k.Game - }); - } - - foreach (var (k, v) in rakebacks) - { - await _db.GetDbContext() - .GetTable() - .InsertOrUpdateAsync(() => new() - { - UserId = k, - Amount = v - }, - (old) => new() - { - Amount = old.Amount + v - }, - () => new() - { - UserId = k - }); - } - } - catch (Exception ex) - { - Log.Error(ex, "An error occurred in UserBetStats gambling tx tracker"); - } - } - } - - private const decimal BASE_RAKEBACK = 0.05m; - - public Task TrackAdd(ulong userId, long amount, TxData? txData) + public Task TrackAdd(long amount, TxData? txData) { if (txData is null) return Task.CompletedTask; - + if (_gamblingTypes.Contains(txData.Type)) { - globalStats.AddOrUpdate(txData.Type, + _stats.AddOrUpdate(txData.Type, _ => (0, amount), (_, old) => (old.Bet, old.PaidOut + amount)); } - var mType = GetGameType(txData.Type); - - if (mType is not { } type) - return Task.CompletedTask; - - if (txData.Type == "lula") - { - if (txData.Extra == "lose") - { - userStats.Add(new() - { - UserId = userId, - Game = type, - WinCount = 0, - LoseCount = 0, - TotalBet = 0, - PaidOut = amount, - MaxBet = 0, - MaxWin = amount, - }); - return Task.CompletedTask; - } - } - else if (txData.Type == "animalrace") - { - if (txData.Extra == "refund") - { - userStats.Add(new() - { - UserId = userId, - Game = type, - WinCount = 0, - LoseCount = -1, - TotalBet = -amount, - PaidOut = 0, - MaxBet = 0, - MaxWin = 0, - }); - - return Task.CompletedTask; - } - } - - userStats.Add(new UserBetStats() - { - UserId = userId, - Game = type, - WinCount = 1, - LoseCount = -1, - TotalBet = 0, - PaidOut = amount, - MaxBet = 0, - MaxWin = amount, - }); - return Task.CompletedTask; } - public Task TrackRemove(ulong userId, long amount, TxData? txData) + public Task TrackRemove(long amount, TxData? txData) { if (txData is null) return Task.CompletedTask; - + if (_gamblingTypes.Contains(txData.Type)) { - globalStats.AddOrUpdate(txData.Type, + _stats.AddOrUpdate(txData.Type, _ => (amount, 0), (_, old) => (old.Bet + amount, old.PaidOut)); } - var mType = GetGameType(txData.Type); - - if (mType is not { } type) - return Task.CompletedTask; - - userStats.Add(new UserBetStats() - { - UserId = userId, - Game = type, - WinCount = 0, - LoseCount = 1, - TotalBet = amount, - PaidOut = 0, - MaxBet = amount, - MaxWin = 0 - }); - return Task.CompletedTask; } - private static GamblingGame? GetGameType(string game) - => game switch - { - "lula" => GamblingGame.Lula, - "betroll" => GamblingGame.Betroll, - "betflip" => GamblingGame.Betflip, - "blackjack" => GamblingGame.Blackjack, - "betdraw" => GamblingGame.Betdraw, - "slot" => GamblingGame.Slots, - "animalrace" => GamblingGame.Race, - _ => null - }; - public async Task> GetAllAsync() { await using var ctx = _db.GetDbContext(); return await ctx.Set() - .ToListAsyncEF(); + .ToListAsyncEF(); } - - public async Task> GetUserStatsAsync(ulong userId, GamblingGame? game = null) - { - await using var ctx = _db.GetDbContext(); - - - if (game is null) - return await ctx - .GetTable() - .Where(x => x.UserId == userId) - .ToListAsync(); - - return await ctx - .GetTable() - .Where(x => x.UserId == userId && x.Game == game) - .ToListAsync(); - } - - public decimal GetHouseEdge(GamblingGame game) - => game switch - { - GamblingGame.Betflip => 0.025m, - GamblingGame.Betroll => 0.04m, - GamblingGame.Betdraw => 0.04m, - GamblingGame.Slots => 0.034m, - GamblingGame.Blackjack => 0.02m, - GamblingGame.Lula => 0.025m, - GamblingGame.Race => 0.06m, - _ => 0 - }; - - -} - -public sealed class UserBetStats -{ - public int Id { get; set; } - public ulong UserId { get; set; } - public GamblingGame Game { get; set; } - public long WinCount { get; set; } - public long LoseCount { get; set; } - public decimal TotalBet { get; set; } - public decimal PaidOut { get; set; } - public long MaxWin { get; set; } - public long MaxBet { get; set; } -} - -public enum GamblingGame -{ - Betflip = 0, - Bf = 0, - Betroll = 1, - Br = 1, - Betdraw = 2, - Bd = 2, - Slots = 3, - Slot = 3, - Blackjack = 4, - Bj = 4, - Lula = 5, - Race = 6, - AnimalRace = 6 -} - -public sealed class Rakeback -{ - public ulong UserId { get; set; } - public decimal Amount { get; set; } } \ No newline at end of file diff --git a/src/EllieBot/_common/Services/IGoogleApiService.cs b/src/EllieBot/_common/Services/IGoogleApiService.cs index d9fa0c7..856bd51 100644 --- a/src/EllieBot/_common/Services/IGoogleApiService.cs +++ b/src/EllieBot/_common/Services/IGoogleApiService.cs @@ -5,7 +5,7 @@ public interface IGoogleApiService { IReadOnlyDictionary Languages { get; } - Task> GetVideoLinksByKeywordAsync(string keywords, int count = 1); + Task> GetVideoLinksByKeywordAsync(string keywords, int count = 1); Task> GetVideoInfosByKeywordAsync(string keywords, int count = 1); Task> GetPlaylistIdsByKeywordsAsync(string keywords, int count = 1); Task> GetRelatedVideosAsync(string id, int count = 1, string user = null); diff --git a/src/EllieBot/_common/Services/IStatsService.cs b/src/EllieBot/_common/Services/IStatsService.cs index 3f73495..3dee0a6 100644 --- a/src/EllieBot/_common/Services/IStatsService.cs +++ b/src/EllieBot/_common/Services/IStatsService.cs @@ -49,8 +49,8 @@ public interface IStatsService /// double GetPrivateMemoryMegabytes(); - GuildInfo GetGuildInfoAsync(string name); - Task GetGuildInfoAsync(ulong id); + GuildInfo GetGuildInfo(string name); + GuildInfo GetGuildInfo(ulong id); } public record struct GuildInfo diff --git a/src/EllieBot/_common/Services/Impl/BlacklistService.cs b/src/EllieBot/_common/Services/Impl/BlacklistService.cs index 6655149..ac01491 100644 --- a/src/EllieBot/_common/Services/Impl/BlacklistService.cs +++ b/src/EllieBot/_common/Services/Impl/BlacklistService.cs @@ -4,127 +4,80 @@ using LinqToDB.Data; using LinqToDB.EntityFrameworkCore; using EllieBot.Common.ModuleBehaviors; using EllieBot.Db.Models; -using System.Collections.Frozen; namespace EllieBot.Modules.Permissions.Services; -public sealed class BlacklistService : IExecOnMessage, IReadyExecutor +public sealed class BlacklistService : IExecOnMessage { public int Priority => int.MaxValue; private readonly DbService _db; private readonly IPubSub _pubSub; - private readonly IBotCreds _creds; - private readonly DiscordSocketClient _client; + private readonly IBotCredentials _creds; + private IReadOnlyList blacklist; - private FrozenSet blacklistedGuilds = new HashSet().ToFrozenSet(); - private FrozenSet blacklistedUsers = new HashSet().ToFrozenSet(); - private FrozenSet blacklistedChannels = new HashSet().ToFrozenSet(); + private readonly TypedKey _blPubKey = new("blacklist.reload"); - private readonly TypedKey _blPubKey = new("blacklist.reload"); - - public BlacklistService( - DbService db, - IPubSub pubSub, - IBotCreds creds, - DiscordSocketClient client) + public BlacklistService(DbService db, IPubSub pubSub, IBotCredentials creds) { _db = db; _pubSub = pubSub; _creds = creds; - _client = client; - _pubSub.Sub(_blPubKey, async _ => await Reload(false)); - } - - public async Task OnReadyAsync() - { - _client.JoinedGuild += async (g) => - { - if (blacklistedGuilds.Contains(g.Id)) - { - await g.LeaveAsync(); - } - }; - - await Reload(false); + Reload(false); + _pubSub.Sub(_blPubKey, OnReload); } private ValueTask OnReload(BlacklistEntry[] newBlacklist) { - if (newBlacklist is null) - return default; - - blacklistedGuilds = - new HashSet(newBlacklist.Where(x => x.Type == BlacklistType.Server).Select(x => x.ItemId)) - .ToFrozenSet(); - blacklistedChannels = - new HashSet(newBlacklist.Where(x => x.Type == BlacklistType.Channel).Select(x => x.ItemId)) - .ToFrozenSet(); - blacklistedUsers = - new HashSet(newBlacklist.Where(x => x.Type == BlacklistType.User).Select(x => x.ItemId)) - .ToFrozenSet(); - + blacklist = newBlacklist; return default; } public Task ExecOnMessageAsync(IGuild guild, IUserMessage usrMsg) { - if (blacklistedGuilds.Contains(guild.Id)) + foreach (var bl in blacklist) { - Log.Information("Blocked input from blacklisted guild: {GuildName} [{GuildId}]", - guild.Name, - guild.Id.ToString()); - return Task.FromResult(true); - } + if (guild is not null && bl.Type == BlacklistType.Server && bl.ItemId == guild.Id) + { + Log.Information("Blocked input from blacklisted guild: {GuildName} [{GuildId}]", guild.Name, guild.Id); - if (blacklistedChannels.Contains(usrMsg.Channel.Id)) - { - Log.Information("Blocked input from blacklisted channel: {ChannelName} [{ChannelId}]", - usrMsg.Channel.Name, - usrMsg.Channel.Id.ToString()); - } + return Task.FromResult(true); + } + if (bl.Type == BlacklistType.Channel && bl.ItemId == usrMsg.Channel.Id) + { + Log.Information("Blocked input from blacklisted channel: {ChannelName} [{ChannelId}]", + usrMsg.Channel.Name, + usrMsg.Channel.Id); - if (blacklistedUsers.Contains(usrMsg.Author.Id)) - { - Log.Information("Blocked input from blacklisted user: {UserName} [{UserId}]", - usrMsg.Author.ToString(), - usrMsg.Author.Id.ToString()); - return Task.FromResult(true); + return Task.FromResult(true); + } + + if (bl.Type == BlacklistType.User && bl.ItemId == usrMsg.Author.Id) + { + Log.Information("Blocked input from blacklisted user: {UserName} [{UserId}]", + usrMsg.Author.ToString(), + usrMsg.Author.Id); + + return Task.FromResult(true); + } } return Task.FromResult(false); } - public async Task> GetBlacklist(BlacklistType type) + public IReadOnlyList GetBlacklist() + => blacklist; + + public void Reload(bool publish = true) { - await using var uow = _db.GetDbContext(); - - return await uow - .GetTable() - .Where(x => x.Type == type) - .ToListAsync(); - } - - public async Task Reload(bool publish = true) - { - var totalShards = _creds.TotalShards; - await using var uow = _db.GetDbContext(); - var items = uow.GetTable() - .Where(x => x.Type != BlacklistType.Server - || (x.Type == BlacklistType.Server - && Linq2DbExpressions.GuildOnShard(x.ItemId, totalShards, _client.ShardId))) - .ToArray(); - - + using var uow = _db.GetDbContext(); + var toPublish = uow.GetTable().ToArray(); + blacklist = toPublish; if (publish) - { - await _pubSub.Pub(_blPubKey, true); - } - - await OnReload(items); + _pubSub.Pub(_blPubKey, toPublish); } public async Task Blacklist(BlacklistType type, ulong id) @@ -135,34 +88,34 @@ public sealed class BlacklistService : IExecOnMessage, IReadyExecutor await using var uow = _db.GetDbContext(); await uow - .GetTable() - .InsertAsync(() => new() - { - ItemId = id, - Type = type, - }); + .GetTable() + .InsertAsync(() => new() + { + ItemId = id, + Type = type, + }); if (type == BlacklistType.User) { await uow.GetTable() - .Where(x => x.UserId == id) - .UpdateAsync(_ => new() - { - CurrencyAmount = 0 - }); + .Where(x => x.UserId == id) + .UpdateAsync(_ => new() + { + CurrencyAmount = 0 + }); } - await Reload(); + Reload(); } public async Task UnBlacklist(BlacklistType type, ulong id) { await using var uow = _db.GetDbContext(); await uow.GetTable() - .Where(bi => bi.ItemId == id && bi.Type == type) - .DeleteAsync(); + .Where(bi => bi.ItemId == id && bi.Type == type) + .DeleteAsync(); - await Reload(); + Reload(); } public async Task BlacklistUsers(IReadOnlyCollection toBlacklist) @@ -177,12 +130,12 @@ public sealed class BlacklistService : IExecOnMessage, IReadyExecutor var blList = toBlacklist.ToList(); await uow.GetTable() - .Where(x => blList.Contains(x.UserId)) - .UpdateAsync(_ => new() - { - CurrencyAmount = 0 - }); + .Where(x => blList.Contains(x.UserId)) + .UpdateAsync(_ => new() + { + CurrencyAmount = 0 + }); - await Reload(); + Reload(); } } \ No newline at end of file diff --git a/src/EllieBot/_common/Services/Impl/ImagesConfig.cs b/src/EllieBot/_common/Services/Impl/ImagesConfig.cs index c36c20a..a730a94 100644 --- a/src/EllieBot/_common/Services/Impl/ImagesConfig.cs +++ b/src/EllieBot/_common/Services/Impl/ImagesConfig.cs @@ -27,22 +27,5 @@ public sealed class ImagesConfig : ConfigServiceBase c.Version = 5; }); } - - if (data.Version < 6) - { - ModifyConfig(c => - { - if (c.Slots.Emojis?.Length == 6) - { - c.Slots.Emojis = - [ - new("https://cdn.nadeko.bot/slots/15.png"), - ..c.Slots.Emojis - ]; - } - - c.Version = 6; - }); - } } } \ No newline at end of file diff --git a/src/EllieBot/_common/Services/Impl/SingleProcessCoordinator.cs b/src/EllieBot/_common/Services/Impl/SingleProcessCoordinator.cs index ffa5323..0784fc7 100644 --- a/src/EllieBot/_common/Services/Impl/SingleProcessCoordinator.cs +++ b/src/EllieBot/_common/Services/Impl/SingleProcessCoordinator.cs @@ -5,10 +5,10 @@ namespace EllieBot.Services; public class SingleProcessCoordinator : ICoordinator { - private readonly IBotCreds _creds; + private readonly IBotCredentials _creds; private readonly DiscordSocketClient _client; - public SingleProcessCoordinator(IBotCreds creds, DiscordSocketClient client) + public SingleProcessCoordinator(IBotCredentials creds, DiscordSocketClient client) { _creds = creds; _client = client; diff --git a/src/EllieBot/_common/Services/Impl/StatsService.cs b/src/EllieBot/_common/Services/Impl/StatsService.cs index ea80362..2c91a67 100644 --- a/src/EllieBot/_common/Services/Impl/StatsService.cs +++ b/src/EllieBot/_common/Services/Impl/StatsService.cs @@ -29,7 +29,7 @@ public sealed class StatsService : IStatsService, IReadyExecutor, IEService private readonly Process _currentProcess = Process.GetCurrentProcess(); private readonly DiscordSocketClient _client; - private readonly IBotCreds _creds; + private readonly IBotCredentials _creds; private readonly DateTime _started; private long textChannels; @@ -42,7 +42,7 @@ public sealed class StatsService : IStatsService, IReadyExecutor, IEService public StatsService( DiscordSocketClient client, CommandHandler cmdHandler, - IBotCreds creds, + IBotCredentials creds, IHttpClientFactory factory) { _client = client; @@ -161,39 +161,38 @@ public sealed class StatsService : IStatsService, IReadyExecutor, IEService public string GetUptimeString(string separator = ", ") { var time = GetUptime(); - + if (time.Days > 0) return $"{time.Days}d {time.Hours}h {time.Minutes}m"; - + if (time.Hours > 0) return $"{time.Hours}h {time.Minutes}m"; - + if (time.Minutes > 0) return $"{time.Minutes}m {time.Seconds}s"; - + return $"{time.Seconds}s"; } - + public double GetPrivateMemoryMegabytes() { _currentProcess.Refresh(); return _currentProcess.PrivateMemorySize64 / 1.Megabytes(); } - public GuildInfo GetGuildInfoAsync(string name) + public GuildInfo GetGuildInfo(string name) => throw new NotImplementedException(); - public async Task GetGuildInfoAsync(ulong id) + public GuildInfo GetGuildInfo(ulong id) { var g = _client.GetGuild(id); - var ig = (IGuild)g; - + return new GuildInfo() { Id = g.Id, IconUrl = g.IconUrl, Name = g.Name, - Owner = (await ig.GetUserAsync(g.OwnerId))?.Username ?? "??Unknown", + Owner = g.Owner.Username, OwnerId = g.OwnerId, CreatedAt = g.CreatedAt.UtcDateTime, VoiceChannels = g.VoiceChannels.Count, @@ -204,4 +203,4 @@ public sealed class StatsService : IStatsService, IReadyExecutor, IEService MemberCount = g.MemberCount, }; } -} \ No newline at end of file +} diff --git a/src/EllieBot/_common/Services/Impl/YtdlOperation.cs b/src/EllieBot/_common/Services/Impl/YtdlOperation.cs index 4100265..3813b80 100644 --- a/src/EllieBot/_common/Services/Impl/YtdlOperation.cs +++ b/src/EllieBot/_common/Services/Impl/YtdlOperation.cs @@ -8,10 +8,12 @@ namespace EllieBot.Services; public class YtdlOperation { private readonly string _baseArgString; + private readonly bool _isYtDlp; - public YtdlOperation(string baseArgString) + public YtdlOperation(string baseArgString, bool isYtDlp = false) { _baseArgString = baseArgString; + _isYtDlp = isYtDlp; } private Process CreateProcess(string[] args) @@ -21,7 +23,7 @@ public class YtdlOperation { StartInfo = new() { - FileName = "yt-dlp", + FileName = _isYtDlp ? "yt-dlp" : "youtube-dl", Arguments = string.Format(_baseArgString, newArgs), UseShellExecute = false, RedirectStandardError = true, @@ -45,18 +47,18 @@ public class YtdlOperation var str = await process.StandardOutput.ReadToEndAsync(); var err = await process.StandardError.ReadToEndAsync(); if (!string.IsNullOrEmpty(err)) - Log.Warning("yt-dlp warning: {YtdlWarning}", err); + Log.Warning("YTDL warning: {YtdlWarning}", err); return str; } catch (Win32Exception) { - Log.Error("yt-dlp is likely not installed. Please install it before running the command again"); + Log.Error("youtube-dl is likely not installed. Please install it before running the command again"); return default; } catch (Exception ex) { - Log.Error(ex, "Exception running yt-dlp: {ErrorMessage}", ex.Message); + Log.Error(ex, "Exception running youtube-dl: {ErrorMessage}", ex.Message); return default; } } diff --git a/src/EllieBot/_common/Settings/BotConfigService.cs b/src/EllieBot/_common/Settings/BotConfigService.cs index 5e98049..0deca4d 100644 --- a/src/EllieBot/_common/Settings/BotConfigService.cs +++ b/src/EllieBot/_common/Settings/BotConfigService.cs @@ -69,8 +69,8 @@ public sealed class BotConfigService : ConfigServiceBase c.Version = 7; c.IgnoreOtherBots = true; }); - - if(data.Version < 8) + + if (data.Version < 8) ModifyConfig(c => { c.Version = 8; diff --git a/src/EllieBot/_common/SmartText/SmartEmbedText.cs b/src/EllieBot/_common/SmartText/SmartEmbedText.cs index d06e72b..b52c0cb 100644 --- a/src/EllieBot/_common/SmartText/SmartEmbedText.cs +++ b/src/EllieBot/_common/SmartText/SmartEmbedText.cs @@ -69,7 +69,6 @@ public abstract record SmartEmbedTextBase : SmartText => !string.IsNullOrWhiteSpace(Title) || !string.IsNullOrWhiteSpace(Description) || !string.IsNullOrWhiteSpace(Url) - || !string.IsNullOrWhiteSpace(Author?.Name) || !string.IsNullOrWhiteSpace(Thumbnail) || !string.IsNullOrWhiteSpace(Image) || (Footer is not null diff --git a/src/EllieBot/_common/TypeReaders/Models/StoopidTime.cs b/src/EllieBot/_common/TypeReaders/Models/StoopidTime.cs index 0c5eca9..08c69b8 100644 --- a/src/EllieBot/_common/TypeReaders/Models/StoopidTime.cs +++ b/src/EllieBot/_common/TypeReaders/Models/StoopidTime.cs @@ -52,14 +52,4 @@ public class StoopidTime Time = ts }; } - - public static implicit operator TimeSpan(StoopidTime st) - => st.Time; - - public static implicit operator StoopidTime(TimeSpan ts) - => new() - { - Input = ts.ToString(), - Time = ts - }; } \ No newline at end of file diff --git a/src/EllieBot/_common/_Extensions/BotCredentialsExtensions.cs b/src/EllieBot/_common/_Extensions/BotCredentialsExtensions.cs index 0166335..890bab3 100644 --- a/src/EllieBot/_common/_Extensions/BotCredentialsExtensions.cs +++ b/src/EllieBot/_common/_Extensions/BotCredentialsExtensions.cs @@ -2,9 +2,9 @@ namespace EllieBot.Extensions; public static class BotCredentialsExtensions { - public static bool IsOwner(this IBotCreds creds, IUser user) + public static bool IsOwner(this IBotCredentials creds, IUser user) => creds.IsOwner(user.Id); - public static bool IsOwner(this IBotCreds creds, ulong userId) + public static bool IsOwner(this IBotCredentials creds, ulong userId) => creds.OwnerIds.Contains(userId); } \ No newline at end of file diff --git a/src/EllieBot/_common/_Extensions/Extensions.cs b/src/EllieBot/_common/_Extensions/Extensions.cs index 5a21861..dca195d 100644 --- a/src/EllieBot/_common/_Extensions/Extensions.cs +++ b/src/EllieBot/_common/_Extensions/Extensions.cs @@ -103,7 +103,7 @@ public static class Extensions /// /// First 10 characters of teh bot token. /// - public static string RedisKey(this IBotCreds bc) + public static string RedisKey(this IBotCredentials bc) => bc.Token[..10]; public static bool IsAuthor(this IMessage msg, IDiscordClient client) diff --git a/src/EllieBot/clean-migrations.ps1 b/src/EllieBot/clean-migrations.ps1 deleted file mode 100644 index 7db1541..0000000 --- a/src/EllieBot/clean-migrations.ps1 +++ /dev/null @@ -1,49 +0,0 @@ -# WORK IN PROGRESS - -# Define the folders to search for designer.cs files -$folders = @("Migrations/PostgreSql", "Migrations/Sqlite") - -# Loop through each folder -foreach ($folder in $folders) { - # Get all designer.cs files in the folder and subfolders - $files = Get-ChildItem -Path $folder -Filter *.designer.cs -Recurse - - $excludedPattern = "cleanup|mysql-init|squash|rero-cascade" - -$filteredFiles = $files | Where-Object { $_.Name -notmatch $excludedPattern } - # Loop through each file - foreach ($file in ($files | Where-Object { $_.Name -notmatch $excludedPattern })) { - # Read the contents of the file - $content = Get-Content -Path $file.FullName | Select-Object -First 30 - - # Find the attribute lines - $attributes = $content | Where-Object { $_ -match '\[.*\]' } | ForEach-Object { ' ' + $_.Trim() } - - # Find the namespace - $namespace = $content | Where-Object { $_ -match 'namespace' } | ForEach-Object { $_.Split(' ')[1] } - - # Find the class name - $class_name = $content | Where-Object { $_ -match 'partial class' } | ForEach-Object { $_.Trim().Split(' ')[2] } - - # Replace the contents with the new template - $new_content = @" -// -using EllieBot.Db; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace $namespace -{ -$($attributes -join "`n") - partial class $class_name - { - } -} -"@ - - # Write the new contents to the file - Set-Content -Path $file.FullName -Value $new_content - } -} \ No newline at end of file diff --git a/src/EllieBot/data/aliases.yml b/src/EllieBot/data/aliases.yml index 8589812..66b7401 100644 --- a/src/EllieBot/data/aliases.yml +++ b/src/EllieBot/data/aliases.yml @@ -365,6 +365,7 @@ quoteshow: - qushow quotesearch: - quotesearch + - qs - qse - qsearch quoteid: @@ -848,10 +849,6 @@ eventstart: - eventstart betstats: - betstats - - bs -gamblestats: - - gamblestats - - gs bettest: - bettest slot: @@ -863,11 +860,6 @@ affinity: waifuclaim: - waifuclaim - claim - - wc -waifuclaims: - - waifuclaims - - claims - - wcs waifureset: - waifureset waifutransfer: @@ -1433,43 +1425,4 @@ afk: keep: - keep leaveunkeptservers: - - leaveunkeptservers -ncanvas: - - ncanvas - - nc - - ncanv -ncsetimg: - - ncsetimg - - ncsi -ncsetpixel: - - ncsetpixel - - ncsp - - ncs -nczoom: - - nczoom - - ncz -ncpixel: - - ncpixel - - ncp - - ncgp -ncreset: - - ncreset -translateflags: - - translateflags - - trfl - - fltr - - transflags -rakeback: - - rakeback - - rb -betstatsreset: - - betstatsreset - - bsr - - bsreset -gamblestatsreset: - - gamblestatsreset - - gsr - - gsreset -snipe: - - snipe - - sn \ No newline at end of file + - leaveunkeptservers \ No newline at end of file diff --git a/src/EllieBot/data/bot.yml b/src/EllieBot/data/bot.yml index e15bbc1..22b08ed 100644 --- a/src/EllieBot/data/bot.yml +++ b/src/EllieBot/data/bot.yml @@ -15,7 +15,7 @@ color: pending: faa61a # Default bot language. It has to be in the list of supported languages (.langli) defaultLocale: en-US -# Style in which executed commands will show up in the logs. +# Style in which executed commands will show up in the console. # Allowed values: Simple, Normal, None consoleOutputType: Normal # Whether the bot will check for new releases every hour diff --git a/src/EllieBot/data/commandlist.json b/src/EllieBot/data/commandlist.json index 216bee4..5691f14 100644 --- a/src/EllieBot/data/commandlist.json +++ b/src/EllieBot/data/commandlist.json @@ -383,7 +383,7 @@ "Aliases": [ ".keep" ], - "Description": "The current server, won't be deleted from Ellie's database during the purge.", + "Description": "The current serve, won't be deleted from Ellie's database during the purge.", "Usage": [ ".keep" ], @@ -394,21 +394,6 @@ "Administrator Server Permission" ] }, - { - "Aliases": [ - ".leaveunkeptservers" - ], - "Description": "Leaves all servers whose owners didn't run .keep", - "Usage": [ - ".leaveunkeptservers" - ], - "Submodule": "CleanupCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, { "Aliases": [ ".sqlselect" @@ -601,11 +586,13 @@ }, { "Aliases": [ - ".greet" + ".greetdel", + ".grdel" ], - "Description": "Toggles announcements on the current channel when someone joins the server.", + "Description": "Sets the time it takes (in seconds) for greet messages to be auto-deleted. Set it to `0` to disable automatic deletion.", "Usage": [ - ".greet" + ".greetdel 0", + ".greetdel 30" ], "Submodule": "GreetCommands", "Module": "Administration", @@ -616,13 +603,11 @@ }, { "Aliases": [ - ".greetdel", - ".grdel" + ".greet" ], - "Description": "Sets the time it takes (in seconds) for greet messages to be auto-deleted. Set it to `0` to disable automatic deletion.", + "Description": "Toggles announcements on the current channel when someone joins the server.", "Usage": [ - ".greetdel 0", - ".greetdel 30" + ".greet" ], "Submodule": "GreetCommands", "Module": "Administration", @@ -691,6 +676,21 @@ "ManageServer Server Permission" ] }, + { + "Aliases": [ + ".byemsg" + ], + "Description": "Sets a new leave announcement message which will be shown in the current channel. \nUsing this command with no message will show the current bye message. \nSupports [placeholders](https://docs.elliebot.net/ellie/features/placeholders/) and [embeds](https://eb.elliebot.net/)", + "Usage": [ + ".byemsg %user.name% has left." + ], + "Submodule": "GreetCommands", + "Module": "Administration", + "Options": null, + "Requirements": [ + "ManageServer Server Permission" + ] + }, { "Aliases": [ ".byedel" @@ -709,11 +709,12 @@ }, { "Aliases": [ - ".byemsg" + ".byetest" ], - "Description": "Sets a new leave announcement message which will be shown in the current channel. \nUsing this command with no message will show the current bye message. \nSupports [placeholders](https://docs.elliebot.net/ellie/features/placeholders/) and [embeds](https://eb.elliebot.net/)", + "Description": "Sends the bye message in the current channel as if you just left the server. You can optionally specify a different user.", "Usage": [ - ".byemsg %user.name% has left." + ".byetest", + ".byetest @SomeoneElse" ], "Submodule": "GreetCommands", "Module": "Administration", @@ -754,22 +755,6 @@ "ManageServer Server Permission" ] }, - { - "Aliases": [ - ".byetest" - ], - "Description": "Sends the bye message in the current channel as if you just left the server. You can optionally specify a different user.", - "Usage": [ - ".byetest", - ".byetest @SomeoneElse" - ], - "Submodule": "GreetCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageServer Server Permission" - ] - }, { "Aliases": [ ".boosttest" @@ -1105,7 +1090,7 @@ "Aliases": [ ".antialt" ], - "Description": "Applies a punishment action to any user whose account is younger than the specified threshold. \nAvailable Punishments are: Ban, Kick, Softban, Mute, VoiceMute, ChatMute, RemoveRoles, AddRole, Warn, TimeOut\nYou can specify an additional time argument to do a timed punishment for actions which support it (Ban, Mute, etc) up to 24h.\nMax message count is 10.\nProvide no parameters to disable.", + "Description": "Applies a punishment action to any user whose account is younger than the specified threshold. Specify time after the punishment to have a timed punishment (not all punishments support timers).", "Usage": [ ".antialt 1h Ban", ".antialt 3d Mute 1h" @@ -1121,7 +1106,7 @@ "Aliases": [ ".antiraid" ], - "Description": "Sets an anti-raid protection on the server.\n\nFirst parameter is number of people which will trigger the protection.\n\nSecond parameter is a time interval in which that number of people needs to join in order to trigger the protection.\n\nThird parameter is punishment for those people.\nAvailable punishments: Ban, Kick, Softban, Mute, VoiceMute, ChatMute, RemoveRoles, AddRole, Warn, TimeOut\nYou can specify an additional time argument to do a timed punishment for actions which support it (Ban, Mute, etc) up to 24h.\n\nProvide no parameters to disable.", + "Description": "Sets an anti-raid protection on the server. Provide no parameters to disable. First parameter is number of people which will trigger the protection. Second parameter is a time interval in which that number of people needs to join in order to trigger the protection, and third parameter is punishment for those people. You can specify an additional time argument to do a timed punishment for actions which support it (Ban, Mute, etc) up to 24h. Available punishments: Ban, Kick, Softban, Mute, VoiceMute, ChatMute, RemoveRoles, AddRole, Warn, TimeOut", "Usage": [ ".antiraid 5 20 Kick", ".antiraid 7 9 Ban", @@ -1139,7 +1124,7 @@ "Aliases": [ ".antispam" ], - "Description": "Applies a Punishment to people who repeat the same message X times in a row.\nAvailable Punishments are: Ban, Kick, Softban, Mute, VoiceMute, ChatMute, RemoveRoles, AddRole, Warn, TimeOut\nYou can specify an additional time argument to do a timed punishment for actions which support it (Ban, Mute, etc) up to 24h.\nMax message count is 10. \nProvide no parameters to disable.", + "Description": "Stops people from repeating same message X times in a row. Provide no parameters to disable. You can specify to either mute, kick or ban the offenders. You can specify an additional time argument to do a timed punishment for actions which support it (Ban, Mute, etc) up to 24h. Max message count is 10. Available punishments: Ban, Kick, Softban, Mute, VoiceMute, ChatMute, AddRole, RemoveRoles, Warn, TimeOut", "Usage": [ ".antispam 3 Mute", ".antispam 5 Ban", @@ -1954,14 +1939,13 @@ }, { "Aliases": [ - ".setactivity", ".setgame" ], - "Description": "Sets the bots game status to a Custom, Playing, Listening, or Watching status.", + "Description": "Sets the bots game status to either Playing, Listening, or Watching.", "Usage": [ - ".setactivity Just chilling", - ".setactivity Playing with canaries", - ".setactivity Listening music" + ".setgame Playing with snakes.", + ".setgame Watching anime.", + ".setgame Listening music." ], "Submodule": "SelfCommands", "Module": "Administration", @@ -2756,6 +2740,19 @@ } ], "Gambling": [ + { + "Aliases": [ + ".betstats" + ], + "Description": "Shows the total stats of several gambling features.\nUpdates once an hour.", + "Usage": [ + ".betstats" + ], + "Submodule": "Gambling", + "Module": "Gambling", + "Options": null, + "Requirements": [] + }, { "Aliases": [ ".timely" @@ -2999,20 +2996,6 @@ "Bot Owner Only" ] }, - { - "Aliases": [ - ".rakeback", - ".rb" - ], - "Description": "Try to claim any rakeback that you have available.\nRakeback is accumulated by betting (not by winning or losing).\nDefault rakeback is 0.05 * house edge\nHouse edge is defined per game", - "Usage": [ - ".rakeback" - ], - "Submodule": "Gambling", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, { "Aliases": [ ".race" @@ -3120,70 +3103,6 @@ "Bot Owner Only" ] }, - { - "Aliases": [ - ".betstatsreset", - ".bsr", - ".bsreset" - ], - "Description": "Reset all of your Bet Stats for a fee.\nYou can alternatively reset Bet Stats for the specified game.", - "Usage": [ - ".betstatsreset", - ".betstatsreset game" - ], - "Submodule": "BetStatsCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".betstats", - ".bs" - ], - "Description": "Shows the current bet stats for yourself, or the targetted user.\nYou may optionally specify the game to show stats for.\nSupported games right now are: bf, br, bd, lula, slot, race", - "Usage": [ - ".betstats", - ".betstats @someone", - ".betstats @someone lula", - ".betstats bd" - ], - "Submodule": "BetStatsCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".gamblestats", - ".gs" - ], - "Description": "Shows the total stats of several gambling features.\nUpdates once an hour.", - "Usage": [ - ".gamblestats" - ], - "Submodule": "BetStatsCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".gamblestatsreset", - ".gsr", - ".gsreset" - ], - "Description": "Resets the gamble stats.", - "Usage": [ - ".gamblestatsreset" - ], - "Submodule": "BetStatsCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, { "Aliases": [ ".blackjack", @@ -3648,25 +3567,10 @@ "Options": null, "Requirements": [] }, - { - "Aliases": [ - ".waifuclaims", - ".claims", - ".wcs" - ], - "Description": "Shows all of your currently claimed waifus.", - "Usage": [ - ".waifuclaims" - ], - "Submodule": "WaifuClaimCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, { "Aliases": [ ".waifuclaim", - ".claim - wc" + ".claim" ], "Description": "Claim a waifu for yourself by spending currency. You must spend at least 10% more than her current value unless she set `.affinity` towards you.", "Usage": [ @@ -3770,7 +3674,7 @@ "Aliases": [ ".choose" ], - "Description": "Chooses a thing from a list of things. Separate items with a semicolon ;", + "Description": "Chooses a thing from a list of things", "Usage": [ ".choose Get up;Sleep;Sleep more" ], @@ -3868,98 +3772,6 @@ "Options": null, "Requirements": [] }, - { - "Aliases": [ - ".ncanvas", - ".nc", - ".ncanv" - ], - "Description": "Shows the current nCanvas.\nThe canvas allows users to set each pixel's color and text using currency.", - "Usage": [ - ".ncanvas" - ], - "Submodule": "NCanvasCommands", - "Module": "Games", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".nczoom", - ".ncz" - ], - "Description": "Zooms in on the nCanvas.\nBot will show the 10x10 grid with the position of each cell for use with `ncset`.\nYou can either use alphanumeric position (ex. s4u) or pixel x and y (ex. 123 123)", - "Usage": [ - ".nczoom sgu", - ".nczoom 123 123" - ], - "Submodule": "NCanvasCommands", - "Module": "Games", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".ncsetpixel", - ".ncsp", - ".ncs" - ], - "Description": "Sets a pixel's color and text on the nCanvas.\nYou must specify the position of the pixel to set in alphanumeric format.\nYou can obtain alphanumeric position of the pixel by using `nczoom` or `ncp `", - "Usage": [ - ".ncsetpixel sgu #ff0000 Some text" - ], - "Submodule": "NCanvasCommands", - "Module": "Games", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".ncpixel", - ".ncp", - ".ncgp" - ], - "Description": "Shows the pixel at the specified position.\nYou can get pixel positions by using `nczoom`", - "Usage": [ - ".ncpixel sgu", - ".ncpixel 123 123" - ], - "Submodule": "NCanvasCommands", - "Module": "Games", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".ncsetimg", - ".ncsi" - ], - "Description": "Attach the image to the message sending the command to overwrite the nCanvas with it.\nAll prices and colors will be reset.\nThe image must be equal to the size of the nCanvas (default is 500x350)\nThis command is dangerous and irreversible.", - "Usage": [ - ".ncsetimg" - ], - "Submodule": "NCanvasCommands", - "Module": "Games", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".ncreset" - ], - "Description": "Clears the nCanvas.\nAll prices and colors will be reset.\nThis command is dangerous and irreversible.", - "Usage": [ - ".ncreset" - ], - "Submodule": "NCanvasCommands", - "Module": "Games", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, { "Aliases": [ ".nunchi" @@ -5359,7 +5171,7 @@ ], "Description": "Toggles whether a module can be used on any server.", "Usage": [ - ".globalmodule Gambling" + ".globalmodule nsfw" ], "Submodule": "GlobalPermissionCommands", "Module": "Permissions", @@ -6240,24 +6052,6 @@ "Options": null, "Requirements": [] }, - { - "Aliases": [ - ".translateflags", - ".trfl", - ".fltr", - ".transflags" - ], - "Description": "Toggles translate flags on the current channel.\nReacting with a country flag will translate the message to that country's language.", - "Usage": [ - ".translateflags" - ], - "Submodule": "TranslateCommands", - "Module": "Searches", - "Options": null, - "Requirements": [ - "ManageChannels Channel Permission" - ] - }, { "Aliases": [ ".xkcd" @@ -6503,11 +6297,11 @@ }, { "Aliases": [ - ".serverlist" + ".listservers" ], "Description": "Lists servers the bot is on with some basic info. 15 per page.", "Usage": [ - ".serverlist 3" + ".listservers 3" ], "Submodule": "Utility", "Module": "Utility", @@ -6606,20 +6400,6 @@ "No Public Bot" ] }, - { - "Aliases": [ - ".snipe", - ".sn" - ], - "Description": "Snipe the message you replied to with this command.\nOtherwise, if you don't reply to a message, it will snipe the last message sent in the channel (out of the last few messages) which has text or an image.", - "Usage": [ - ".snipe" - ], - "Submodule": "Utility", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, { "Aliases": [ ".prompt" @@ -6939,15 +6719,13 @@ }, { "Aliases": [ - ".quotelist", - ".qli", - ".quli", - ".qulist" + ".listquotes", + ".liqu" ], "Description": "Lists all quotes on the server ordered alphabetically or by ID. 15 Per page.", "Usage": [ - ".quotelist 3", - ".quotelist 3 id" + ".listquotes 3", + ".listquotes 3 id" ], "Submodule": "QuoteCommands", "Module": "Utility", @@ -6957,10 +6735,7 @@ { "Aliases": [ ".quoteprint", - ".qp", - ".qup", - "...", - ".qprint" + "..." ], "Description": "Prints a random quote with a specified name.", "Usage": [ @@ -6974,9 +6749,7 @@ { "Aliases": [ ".quoteshow", - ".qsh", - ".qshow", - ".qushow" + ".qshow" ], "Description": "Shows information about a quote with the specified ID.", "Usage": [ @@ -6990,7 +6763,6 @@ { "Aliases": [ ".quotesearch", - ".qse", ".qsearch" ], "Description": "Shows a random quote given a search query. Partially matches in several ways: 1) Only content of any quote, 2) only by author, 3) keyword and content, 3) or keyword and author", @@ -7010,7 +6782,7 @@ ".quoteid", ".qid" ], - "Description": "-| Displays the quote with the specified ID number.", + "Description": "Displays the quote with the specified ID number. Quote ID numbers can be found by typing `.liqu [num]` where `[num]` is a number of a page which contains 15 quotes.", "Usage": [ ".quoteid 123456" ], @@ -7022,9 +6794,6 @@ { "Aliases": [ ".quoteadd", - ".qa", - ".qadd", - ".quadd", ".." ], "Description": "Adds a new quote with the specified name and message.", @@ -7039,8 +6808,6 @@ { "Aliases": [ ".quoteedit", - ".qe", - ".que", ".qedit" ], "Description": "Edits a quote with the specified ID.", @@ -7055,9 +6822,7 @@ { "Aliases": [ ".quotedelete", - ".qd", - ".qdel", - ".qdelete" + ".qdel" ], "Description": "Deletes a quote with the specified ID. You have to either have the Manage Messages permission or be the creator of the quote to delete it.", "Usage": [ @@ -7071,7 +6836,6 @@ { "Aliases": [ ".quotedeleteauthor", - ".qda", ".qdelauth" ], "Description": "Deletes all quotes by the specified author. If the author is not you, then ManageMessage server permission is required.", @@ -7085,13 +6849,13 @@ }, { "Aliases": [ - ".quotesdeleteall", - ".qdall", - ".qdeleteall" + ".delallquotes", + ".daq", + ".delallq" ], - "Description": "Deletes all quotes with the specified keyword.", + "Description": "Deletes all quotes on a specified keyword.", "Usage": [ - ".quotesdeleteall kek" + ".delallquotes kek" ], "Submodule": "QuoteCommands", "Module": "Utility", @@ -7103,7 +6867,6 @@ { "Aliases": [ ".quotesexport", - ".qex", ".qexport" ], "Description": "Exports quotes from the current server into a .yml file", @@ -7120,8 +6883,6 @@ { "Aliases": [ ".quotesimport", - ".qim", - ".qimp", ".qimport" ], "Description": "Upload the file or send the raw .yml data with this command to import all quotes from the specified string or file into the current server.", diff --git a/src/EllieBot/data/gambling.yml b/src/EllieBot/data/gambling.yml index 2444340..65edcc0 100644 --- a/src/EllieBot/data/gambling.yml +++ b/src/EllieBot/data/gambling.yml @@ -1,5 +1,5 @@ # DO NOT CHANGE -version: 12 +version: 8 # Currency settings currency: # What is the emoji/character which represents the currency @@ -28,7 +28,7 @@ betRoll: multiplyBy: 10 - whenAbove: 90 multiplyBy: 4 - - whenAbove: 65 + - whenAbove: 66 multiplyBy: 2 # Automatic currency generation settings. generation: @@ -56,9 +56,6 @@ timely: # How often (in hours) can users claim currency with .timely command # setting to 0 or less will disable this feature cooldown: 12 - # How will timely be protected? - # None, Button (users have to click the button) or Captcha (users have to type the captcha from an image) - protType: Button # How much will each user's owned currency decay over time. decay: # Percentage of user's current currency which will be deducted every 24h. @@ -85,7 +82,7 @@ luckyLadder: - 2.4 - 1.7 - 1.5 - - 1.1 + - 1.2 - 0.5 - 0.3 - 0.2 @@ -128,13 +125,12 @@ waifu: # Settings for periodic waifu price decay. # Waifu price decays only if the waifu has no claimer. decay: - # Unclaimed waifus will decay by this percentage (0 - 100). - # Default is 0 (disabled) + # Percentage (0 - 100) of the waifu value to reduce. + # Set 0 to disable # For example if a waifu has a price of 500$, setting this value to 10 would reduce the waifu value by 10% (50$) unclaimedDecayPercent: 0 # Claimed waifus will decay by this percentage (0 - 100). # Default is 0 (disabled) - # For example if a waifu has a price of 500$, setting this value to 10 would reduce the waifu value by 10% (50$) claimedDecayPercent: 0 # How often to decay waifu values, in hours hourInterval: 24 @@ -274,9 +270,3 @@ voteReward: 100 slots: # Hex value of the color which the numbers on the slot image will have. currencyFontColor: ff0000 -# Bonus config for server boosts -boostBonus: - # Users will receive a bonus if they boost any of these servers - guildIds: [] - # This bonus will be added before any other multiplier is applied to the .timely command - baseTimelyBonus: 50 diff --git a/src/EllieBot/data/images.yml b/src/EllieBot/data/images.yml index d3f3d77..76d8da6 100644 --- a/src/EllieBot/data/images.yml +++ b/src/EllieBot/data/images.yml @@ -1,5 +1,5 @@ # DO NOT CHANGE -version: 6 +version: 5 coins: heads: - https://cdn.nadeko.bot/coins/heads3.png @@ -22,13 +22,15 @@ dice: - https://cdn.nadeko.bot/other/dice/9.png xp: bg: https://cdn.nadeko.bot/other/xp/bg_k.png +rip: + bg: https://cdn.nadeko.bot/other/rip/rip.png + overlay: https://cdn.nadeko.bot/other/rip/overlay.png slots: emojis: - - https://cdn.nadeko.bot/slots/10.png - - https://cdn.nadeko.bot/slots/11.png - - https://cdn.nadeko.bot/slots/12.png - - https://cdn.nadeko.bot/slots/13.png - - https://cdn.nadeko.bot/slots/14.png - - https://cdn.nadeko.bot/slots/15.png - - https://cdn.nadeko.bot/slots/16.png + - https://cdn.nadeko.bot/slots/0.png + - https://cdn.nadeko.bot/slots/1.png + - https://cdn.nadeko.bot/slots/2.png + - https://cdn.nadeko.bot/slots/3.png + - https://cdn.nadeko.bot/slots/4.png + - https://cdn.nadeko.bot/slots/5.png bg: https://cdn.nadeko.bot/slots/slots_bg.png diff --git a/src/EllieBot/data/marmalades/marmalade.yml b/src/EllieBot/data/marmalades/marmalade.yml index fe3258f..34bfa71 100644 --- a/src/EllieBot/data/marmalades/marmalade.yml +++ b/src/EllieBot/data/marmalades/marmalade.yml @@ -1,4 +1,4 @@ # DO NOT CHANGE version: 1 # List of marmalades automatically loaded at startup -loaded: [] +loaded: diff --git a/src/EllieBot/data/searches.yml b/src/EllieBot/data/searches.yml index 8fb00d3..9b7ab5c 100644 --- a/src/EllieBot/data/searches.yml +++ b/src/EllieBot/data/searches.yml @@ -1,5 +1,5 @@ # DO NOT CHANGE -version: 4 +version: 2 # Which engine should .search command # 'google_scrape' - default. Scrapes the webpage for results. May break. Requires no api keys. # 'google' - official google api. Requires googleApiKey and google.searchId set in creds.yml @@ -9,32 +9,35 @@ webSearchEngine: Google_Scrape # 'google'- official google api. googleApiKey and google.imageSearchId set in creds.yml # 'searx' requires at least one searx instance specified in the 'searxInstances' property below imgSearchEngine: Google -# Which search provider will be used for the `.youtube` and `.q` commands. -# -# - `ytDataApiv3` - uses google's official youtube data api. Requires `GoogleApiKey` set in creds and youtube data api enabled in developers console. `.q` is not supported for this setting. It will fallback to yt-dlp. -# -# - `ytdlp` - default, recommended easy, uses `yt-dlp`. Requires `yt-dlp` to be installed and it's path added to env variables -# +# Which search provider will be used for the `.youtube` command. +# +# - `ytDataApiv3` - uses google's official youtube data api. Requires `GoogleApiKey` set in creds and youtube data api enabled in developers console +# +# - `ytdl` - default, uses youtube-dl. Requires `youtube-dl` to be installed and it's path added to env variables. Slow. +# +# - `ytdlp` - recommended easy, uses `yt-dlp`. Requires `yt-dlp` to be installed and it's path added to env variables +# # - `invidious` - recommended advanced, uses invidious api. Requires at least one invidious instance specified in the `invidiousInstances` property -ytProvider: Ytdl +ytProvider: Ytdlp # Set the searx instance urls in case you want to use 'searx' for either img or web search. # Ellie will use a random one for each request. # Use a fully qualified url. Example: `https://my-searx-instance.mydomain.com` # Instances specified must support 'format=json' query parameter. # - In case you're running your own searx instance, set -# +# # search: # formats: # - json -# +# # in 'searxng/settings.yml' on your server -# +# # - If you're using a public instance, make sure that the instance you're using supports it (they usually don't) searxInstances: [] # Set the invidious instance urls in case you want to use 'invidious' for `.youtube` search # Ellie will use a random one for each request. +# These instances may be used for music queue functionality in the future. # Use a fully qualified url. Example: https://my-invidious-instance.mydomain.com -# +# # Instances specified must have api available. # You check that by opening an api endpoint in your browser. For example: https://my-invidious-instance.mydomain.com/api/v1/trending invidiousInstances: [] diff --git a/src/EllieBot/data/strings/commands/commands.en-US.yml b/src/EllieBot/data/strings/commands/commands.en-US.yml index e22b0bf..a86baed 100644 --- a/src/EllieBot/data/strings/commands/commands.en-US.yml +++ b/src/EllieBot/data/strings/commands/commands.en-US.yml @@ -1517,7 +1517,7 @@ take: betroll: desc: |- Bets the specified amount of currency and rolls a dice. - Rolling over 65 yields x2 of your currency, over 90 - x4 and 100 x10. + Rolling over 66 yields x2 of your currency, over 90 - x4 and 100 x10. You can specify 'all', 'half' or 'X%' instead of the amount to bet that part of your current balance. ex: - 5 @@ -2703,7 +2703,7 @@ eventstart: desc: "The type of event being started." options: desc: "The optional option flags for the event." -gamblestats: +betstats: desc: |- Shows the total stats of several gambling features. Updates once an hour. @@ -2711,13 +2711,6 @@ gamblestats: - '' params: - { } -gamblestatsreset: - desc: |- - Resets the gamble stats. - ex: - - '' - params: - - { } slot: desc: |- Play Ellie slots by placing your bet. @@ -2745,12 +2738,6 @@ waifuclaim: desc: "The cost of claiming the waifu." target: desc: "The user to whom the claim is being made, allowing the waifu to be claimed from their collection." -waifuclaims: - desc: Shows all of your currently claimed waifus. - ex: - - '' - params: - - { } waifureset: desc: Resets your waifu stats, except current waifus. ex: @@ -4580,126 +4567,4 @@ leaveunkeptservers: - shardId: desc: "Shard id from which to start leaving unkept servers." - delay: - desc: "Delay in miliseconds between leaves" -ncanvas: - desc: |- - Shows the current nCanvas. - The canvas allows users to set each pixel's color and text using currency. - ex: - - '' - params: - - { } -nczoom: - desc: |- - Zooms in on the nCanvas. - Bot will show the 10x10 grid with the position of each cell for use with `ncset`. - You can either use alphanumeric position (ex. s4u) or pixel x and y (ex. 123 123) - ex: - - 'sgu' - - '123 123' - params: - - position: - desc: "The position of the pixel to set in alphanumeric format." - - position: - desc: "The position of the pixel to set in pixel x and y format." -ncsetpixel: - desc: |- - Sets a pixel's color and text on the nCanvas. - You must specify the position of the pixel to set in alphanumeric format. - You can obtain alphanumeric position of the pixel by using `nczoom` or `ncp ` - ex: - - 'sgu #ff0000 Some text' - params: - - position: - desc: "The position of the pixel to set in alphanumeric format." - - color: - desc: "The color of the pixel to set in HEX." - - text: - desc: "The optional text to set on the pixel." -ncsetimg: - desc: |- - Attach the image to the message sending the command to overwrite the nCanvas with it. - All prices and colors will be reset. - The image must be equal to the size of the nCanvas (default is 500x350) - This command is dangerous and irreversible. - ex: - - '' - params: - - { } -ncpixel: - desc: |- - Shows the pixel at the specified position. - You can get pixel positions by using `nczoom` - ex: - - 'sgu' - - '123 123' - params: - - position: - desc: "The position of the pixel to retrieve in alphanumeric format." - - position: - desc: "The position of the pixel to retrieve in pixel x and y format." -ncreset: - desc: |- - Clears the nCanvas. - All prices and colors will be reset. - This command is dangerous and irreversible. - ex: - - '' - params: - - { } -translateflags: - desc: |- - Toggles translate flags on the current channel. - Reacting with a country flag will translate the message to that country's language. - ex: - - '' - params: - - { } -betstatsreset: - desc: |- - Reset all of your Bet Stats for a fee. - You can alternatively reset Bet Stats for the specified game. - ex: - - '' - - 'game' - params: - - game: - desc: 'The game to reset betstats for. Omit to reset all games' -betstats: - desc: |- - Shows the current bet stats for yourself, or the targetted user. - You may optionally specify the game to show stats for. - Supported games right now are: bf, br, bd, lula, slot, race - ex: - - '' - - '@someone' - - '@someone lula' - - 'bd' - params: - - {} - - user: - desc: 'The user for who to show the betstats for.' - - user: - desc: 'The user for who to show the betstats for.' - game: - desc: 'The game to show betstats for. Omit to show betstats for all games combined' - - game: - desc: 'The game to show betstats for. Omit to show betstats for all games combined' -rakeback: - desc: |- - Try to claim any rakeback that you have available. - Rakeback is accumulated by betting (not by winning or losing). - Default rakeback is 0.05 * house edge - House edge is defined per game - ex: - - '' - params: - - {} -snipe: - desc: |- - Snipe the message you replied to with this command. - Otherwise, if you don't reply to a message, it will snipe the last message sent in the channel (out of the last few messages) which has text or an image. - ex: - - '' - params: - - { } \ No newline at end of file + desc: "Delay in miliseconds between leaves" \ No newline at end of file diff --git a/src/EllieBot/data/strings/responses/responses.en-US.json b/src/EllieBot/data/strings/responses/responses.en-US.json index 130fcbe..a1ff710 100644 --- a/src/EllieBot/data/strings/responses/responses.en-US.json +++ b/src/EllieBot/data/strings/responses/responses.en-US.json @@ -622,7 +622,6 @@ "region": "Region", "remind2": "I will remind {0} to {1} {2} ({3})", "remind_timely": "I will remind you about your timely reward {0}", - "timely_button": "Click the button to claim your timely reward.", "remind_invalid": "Not a valid remind format. Remind must have a target, timer and a reason. Check the command list.", "remind_too_long": "Remind time has exceeded maximum.", "repeater_redundant_no": "Repeater **#{0}** won't post redundant messages anymore.", @@ -1102,21 +1101,5 @@ "honeypot_on": "Honeypot enabled on this channel.", "honeypot_off": "Honeypot disabled.", "afk_set": "AFK message set. Type a message in any channel to clear.", - "rero_message_not_found": "The specified message wasn't found. Make sure you've specified the message from this channel.", - "nc_pixel_not_found": "Pixel not found", - "nc_pixel": "Pixel {0}", - "nc_position": "Position", - "nc_pixel_set": "Pixel {0} successfully set!", - "invalid_color": "Color you've specified is invalid.", - "nc_pixel_set_confirm": "Are you sure you want to set pixel {0}? It will cost you {1}", - "nc_hint": "Use `{0}nczoom x y` command to zoom in. Image is {1}x{2} pixels.", - "nc_insuff_payment": "Invalid payment.", - "invalid_img_size": "Image must to be {0}x{1} pixels.", - "no_attach_found": "No attachment found. Please send the image along with this command.", - "trfl_enabled": "Flag translation enabled on this channel. Reacting to a message with a flag will translate it to that language.", - "trfl_disabled": "Flag translation disabled.", - "rakeback_claimed": "You've claimed {0} as rakeback!", - "rakeback_none": "You don't have any rakeback to claim yet.", - "rakeback_available": "You have {0} rakeback available. Click the button to claim.", - "sniped_by": "Sniped by {0}" + "rero_message_not_found": "The specified message wasn't found. Make sure you've specified the message from this channel." } diff --git a/src/EllieBot/migrate.ps1 b/src/EllieBot/migrate.ps1 deleted file mode 100644 index 62f9b69..0000000 --- a/src/EllieBot/migrate.ps1 +++ /dev/null @@ -1,8 +0,0 @@ -if ($args.Length -eq 0) { - Write-Host "Please provide a migration name." -ForegroundColor Red -} -else { - $migrationName = $args[0] - dotnet ef migrations add $migrationName -c SqliteContext -p EllieBot.csproj - dotnet ef migrations add $migrationName -c PostgreSqlContext -p EllieBot.csproj -} \ No newline at end of file