diff --git a/.gitignore b/.gitignore index 8c045b8..e923b05 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,8 @@ src/EllieBot/data/last_known_version.txt # marmalade stuff -src/EllieBot/data/marmalades/ +!src/EllieBot/data/marmalades/marmalade.yml +src/EllieBot/data/marmalades/** # other @@ -20,8 +21,6 @@ src/EllieBot/credentials.json src/EllieBot/old_credentials.json src/EllieBot/credentials.json.bak src/EllieBot/data/EllieBot.db -ellie-menu.ps1 -package.sh # Created by https://www.gitignore.io/api/visualstudio,visualstudiocode,windows,linux,macos diff --git a/CHANGELOG.md b/CHANGELOG.md index e565936..75f3a41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,389 +1,17 @@ # Changelog -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 - -### 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...) - -### 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 -- `.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 - -### Fixed - -- Fixed `.xpcurrew` breaking xp gain if user gains 0 xp from being in a voice channel -- 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 - -### Fixed - -- Fixed some command groups incorrectly showing up as modules - -## [5.1.6] - 08.08.2024 - -### Added - -- `.serverlist` is now paginated - -### Changed - -- `.listservers` renamed to `.serverlist` - -### Fixed - -- `.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?) -- 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 -- `.mal` Removed. Useless information / semi broken - -## [5.1.5] - 01.08.2024 - -### 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 - -### Changed - -- Bot now shows a message when .prune fails due to already running error -- 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 - -### Fixed - -- .coins will no longer show double minus sign for negative changes -- You can once again disable cleverbot responses using fake 'cleverbot:response' module name in permission commands - -### Removed - -- Removed .rip command - -## [5.1.4] - 15.07.2024 - -### Added - -- Added `.coins` command which lists top 10 cryptos ordered by marketcap -- 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 -- 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 - -- Updated command strings to clarify `.say` and `.send` usages - -### Fixed - -- Fixed `.waifugift` help string - -### Removed - -- Removed selfhost button from `.donate` command, no idea why it was there in the first place - -## [5.1.3] - 08.07.2024 - -### Added - -- Added `.quran` command, which will show the provided ayah in english and arabic, including recitation by Alafasy - -### Changed - -- Replying to the bot's message in the channel where chatterbot is enabled will also trigger the ai response, as if you pinged the bot. This only works for chatterbot, but not for ellie ai command prompts - -### Fixed - -- Fixed `.stickeradd` it now properly supports 300x300 image uploads. -- Bot should now trim the invalid characters from chatterbot usernames to avoid openai errors -- Fixed prompt triggering chatterbot responses twice -- Honeypot commands now actually works - -## [5.1.2] - 29.06.2024 - -### Fixed - -- Compile issues by disabling honeypot submodule for the time being - -## [5.1.1] - 29.06.2024 - -### 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. - -### Fixed - -- Fixed `.betdraw` not respecting maxbet -- Fixed `.xpshop` pagination for real this time? - -## [5.1.0] - 28.06.2024 - -### Added - -- Added support for `gpt-4o` in `data/games.yml` -- Added EllieAiToken to `creds.yml` - -### Changed - -- Remind will now show a timestamp tag for durations -- Only `Gpt35Turbo` and `Gpt4o` are valid inputs in games.yml now -- `data/patron.yml` changed. It now has limits. The entire feature limit system has been reworked. Your previous settings will be reset -- A lot of updates to bot strings -- Improved cleanup command to delete a lot more data once cleanup is ran, not only guild configs (please don't use this command unless you have your database bakced up and you know 100% what you're doing) - -### Fixed - -- 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. -- Fixed remind not showing correct time - -### Removed - -- Removed PoE related commands -- dev: Removed patron quota data from the database, it will now be stored in redis +Mostly based on [keepachangelog](https://keepachangelog.com/en/1.0.0/) except date format. a-c-f-r-o ## [5.0.8] - 19.06.2024 ### 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 +19,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/Dockerfile b/Dockerfile index 889584a..dcdedcf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,16 @@ -# Use the .NET 8.0 SDK as the base image for the build stage -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build WORKDIR /source -# Copy the .csproj files for each project COPY src/Ellie.Marmalade/*.csproj src/Ellie.Marmalade/ COPY src/EllieBot/*.csproj src/EllieBot/ COPY src/EllieBot.Coordinator/*.csproj src/EllieBot.Coordinator/ COPY src/EllieBot.Generators/*.csproj src/EllieBot.Generators/ COPY src/EllieBot.Voice/*.csproj src/EllieBot.Voice/ - -# Restore the dependencies for the EllieBot project +COPY NuGet.Config ./ RUN dotnet restore src/EllieBot/ -# Copy the rest of the source code COPY . . - -# Set the working directory to the EllieBot project WORKDIR /source/src/EllieBot - -# Build and publish the EllieBot project, then clean up unnecessary files RUN set -xe; \ dotnet --version; \ dotnet publish -c Release -o /app --no-restore; \ @@ -27,33 +19,28 @@ RUN set -xe; \ find /app -type f -exec chmod -x {} \; ;\ chmod +x /app/EllieBot -# Use the .NET 8.0 runtime as the base image for the final stage -FROM mcr.microsoft.com/dotnet/runtime:8.0 +# final stage/image +FROM mcr.microsoft.com/dotnet/runtime:6.0 WORKDIR /app -# Create a new user, install dependencies, and set up sudoers file RUN set -xe; \ useradd -m ellie; \ apt-get update; \ apt-get install -y --no-install-recommends libopus0 libsodium23 libsqlite3-0 curl ffmpeg python3 sudo; \ + update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1; \ echo 'Defaults>ellie env_keep+="ASPNETCORE_* DOTNET_* EllieBot_* shard_id total_shards TZ"' > /etc/sudoers.d/ellie; \ curl -Lo /usr/local/bin/yt-dlp https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp; \ chmod a+rx /usr/local/bin/yt-dlp; \ apt-get autoremove -y; \ apt-get autoclean -y -# Copy the built application and the entrypoint script from the build stage COPY --from=build /app ./ COPY docker-entrypoint.sh /usr/local/sbin -# Set environment variables ENV shard_id=0 ENV total_shards=1 ENV EllieBot__creds=/app/data/creds.yml -# Define the data directory as a volume VOLUME [" /app/data "] - -# Set the entrypoint and default command ENTRYPOINT [ "/usr/local/sbin/docker-entrypoint.sh" ] CMD dotnet EllieBot.dll "$shard_id" "$total_shards" diff --git a/EllieBot.sln b/EllieBot.sln index 47179ff..4a3f164 100644 --- a/EllieBot.sln +++ b/EllieBot.sln @@ -8,10 +8,13 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6C633450-E6C2-47ED-A7AA-7367232F703A}" ProjectSection(SolutionItems) = preProject CHANGELOG.md = CHANGELOG.md - Dockerfile = Dockerfile - ellie-menu.ps1 = ellie-menu.ps1 LICENSE = LICENSE README.md = README.md + Dockerfile = Dockerfile + NuGet.Config = NuGet.Config + migrate.ps1 = migrate.ps1 + remove-migrations.ps1 = remove-migrations.ps1 + TODO.md = TODO.md EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EllieBot", "src\EllieBot\EllieBot.csproj", "{4D9001F7-B3E8-48FE-97AA-CFD36DA65A64}" @@ -28,8 +31,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 +65,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 +77,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/NuGet.Config b/NuGet.Config new file mode 100644 index 0000000..7e64704 --- /dev/null +++ b/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + diff --git a/README.md b/README.md index 28fe07b..452254f 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ -# EllieBot +# Ellie [![Please don't upload to GitHub](https://nogithub.codeberg.page/badge.svg)](https://nogithub.codeberg.page) -## Guides +## Small disclaimer -For hosting guides go https://docs.elliebot.net/ellie/ +All the code in this repo may not be production ready yet and if you want to try and run a version of this by yourself you are on your own. -## Support - -For support go to https://discord.gg/etQdZxSyEH \ No newline at end of file +## List of things +For a list of things I have to finish please go to [Todo.md](TODO.md) \ No newline at end of file diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..83ca8e7 --- /dev/null +++ b/TODO.md @@ -0,0 +1,10 @@ +# List of things to do + + - ~~Finish the Ellie.Marmalade project~~ Done + - ~~Finish the EllieBot.Tests project~~ Done + - ~~Finish the EllieBot project~~ Done + - ~~Finish the EllieBot.Coordinator project~~ Done + - ~~Finish the EllieBot.Generators project~~ Done + - ~~Finish the EllieBot.Voice project~~ Done + - ~~Finish the EllieBot.VotesApi project~~ Done + - Fix the bugs in the Db system \ No newline at end of file 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/privacy-policy.md b/privacy-policy.md deleted file mode 100644 index 25c43ce..0000000 --- a/privacy-policy.md +++ /dev/null @@ -1,11 +0,0 @@ -# Privacy Policy - -## Profile Information -Ellie stores userids, avatars, usernames, discriminators and nicknames of users who were targeted by or have used commands which require Xp, Clubs or Waifu features (not limited to these, as other features may be added over time). - -## Other -Ellie doesn't do analytics, doesn't store messages, doesn't track users, doesn't store their emails etc. -Ellie only stores user settings and states as the result of executed commands or as the effect of administration tools (for example warnings or protection commands). - -## Sensitive Information -Ellie doesn't store sensitive information, and users are strongly discouraged from adding their passwords, keys, or other important information as quotes or expressions. \ 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/Ellie.Marmalade/Attributes/svcAttribute.cs b/src/Ellie.Marmalade/Attributes/svcAttribute.cs index df9cdde..a453303 100644 --- a/src/Ellie.Marmalade/Attributes/svcAttribute.cs +++ b/src/Ellie.Marmalade/Attributes/svcAttribute.cs @@ -1,7 +1,7 @@ namespace EllieBot.Marmalade; /// -/// Marks the class as a service which can be used within the same Marmalade +/// Marks the class as a service which can be used within the same Medusa /// [AttributeUsage(AttributeTargets.Class)] public class svcAttribute : Attribute diff --git a/src/Ellie.Marmalade/Context/AnyContext.cs b/src/Ellie.Marmalade/Context/AnyContext.cs index 5af3930..4f7207c 100644 --- a/src/Ellie.Marmalade/Context/AnyContext.cs +++ b/src/Ellie.Marmalade/Context/AnyContext.cs @@ -1,4 +1,5 @@ using Discord; +using EllieBot; namespace EllieBot.Marmalade; diff --git a/src/Ellie.Marmalade/Ellie.Marmalade.csproj b/src/Ellie.Marmalade/Ellie.Marmalade.csproj index 8371f74..db33025 100644 --- a/src/Ellie.Marmalade/Ellie.Marmalade.csproj +++ b/src/Ellie.Marmalade/Ellie.Marmalade.csproj @@ -9,7 +9,7 @@ - + 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.Tests/GroupGreetTests.cs b/src/EllieBot.Tests/GroupGreetTests.cs new file mode 100644 index 0000000..ba2bf37 --- /dev/null +++ b/src/EllieBot.Tests/GroupGreetTests.cs @@ -0,0 +1,76 @@ +using System.Linq; +using System.Threading.Tasks; +using Ellie.Common; +using EllieBot.Services; +using NUnit.Framework; + +namespace EllieBot.Tests +{ + public class GroupGreetTests + { + private GreetGrouper _grouper; + + [SetUp] + public void Setup() + => _grouper = new GreetGrouper(); + + [Test] + public void CreateTest() + { + var created = _grouper.CreateOrAdd(0, 5); + + Assert.True(created); + } + + [Test] + public void CreateClearTest() + { + _grouper.CreateOrAdd(0, 5); + _grouper.ClearGroup(0, 5, out var items); + + Assert.AreEqual(0, items.Count()); + } + + [Test] + public void NotCreatedTest() + { + _grouper.CreateOrAdd(0, 5); + var created = _grouper.CreateOrAdd(0, 4); + + Assert.False(created); + } + + [Test] + public void ClearAddedTest() + { + _grouper.CreateOrAdd(0, 5); + _grouper.CreateOrAdd(0, 4); + _grouper.ClearGroup(0, 5, out var items); + + var list = items.ToList(); + + Assert.AreEqual(1, list.Count, $"Count was {list.Count}"); + Assert.AreEqual(4, list[0]); + } + + [Test] + public async Task ClearManyTest() + { + _grouper.CreateOrAdd(0, 5); + + // add 15 items + await Enumerable.Range(10, 15) + .Select(x => Task.Run(() => _grouper.CreateOrAdd(0, x))).WhenAll(); + + // get 5 at most + _grouper.ClearGroup(0, 5, out var items); + var list = items.ToList(); + Assert.AreEqual(5, list.Count, $"Count was {list.Count}"); + + // try to get 15, but there should be 10 left + _grouper.ClearGroup(0, 15, out items); + list = items.ToList(); + Assert.AreEqual(10, list.Count, $"Count was {list.Count}"); + } + } +} \ No newline at end of file diff --git a/src/EllieBot.VotesApi/Vote.cs b/src/EllieBot.VotesApi/WeatherForecast.cs similarity index 100% rename from src/EllieBot.VotesApi/Vote.cs rename to src/EllieBot.VotesApi/WeatherForecast.cs diff --git a/src/EllieBot/.editorconfig b/src/EllieBot/.editorconfig index 304861d..041e023 100644 --- a/src/EllieBot/.editorconfig +++ b/src/EllieBot/.editorconfig @@ -77,6 +77,7 @@ csharp_style_var_when_type_is_apparent = true:suggestion # Expression-bodied members csharp_style_expression_bodied_accessors = true:suggestion +csharp_style_expression_bodied_constructors = when_on_single_line:suggestion csharp_style_expression_bodied_indexers = true:suggestion csharp_style_expression_bodied_lambdas = true:suggestion csharp_style_expression_bodied_local_functions = true:suggestion @@ -180,9 +181,9 @@ dotnet_naming_rule.private_readonly_field.symbols = private_readonly_field dotnet_naming_rule.private_readonly_field.style = begins_with_underscore dotnet_naming_rule.private_readonly_field.severity = warning -# dotnet_naming_rule.private_field.symbols = private_field -# dotnet_naming_rule.private_field.style = camel_case -# dotnet_naming_rule.private_field.severity = warning +dotnet_naming_rule.private_field.symbols = private_field +dotnet_naming_rule.private_field.style = camel_case +dotnet_naming_rule.private_field.severity = warning dotnet_naming_rule.const_fields.symbols = const_fields dotnet_naming_rule.const_fields.style = all_upper diff --git a/src/EllieBot/Bot.cs b/src/EllieBot/Bot.cs index a98ebcd..1ce8774 100644 --- a/src/EllieBot/Bot.cs +++ b/src/EllieBot/Bot.cs @@ -1,6 +1,5 @@ #nullable disable using DryIoc; -using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.DependencyInjection; using EllieBot.Common.Configs; @@ -25,7 +24,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 +41,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 = @@ -92,18 +88,18 @@ public sealed class Bot : IBot public IReadOnlyList GetCurrentGuildIds() - => Client.Guilds.Select(x => x.Id).ToList().AsReadOnly(); + => Client.Guilds.Select(x => x.Id).ToList(); - private async Task AddServices() + private void AddServices() { - var startingGuildIdList = GetCurrentGuildIds().ToList(); - var startTime = Stopwatch.GetTimestamp(); + var startingGuildIdList = GetCurrentGuildIds(); + var sw = Stopwatch.StartNew(); var bot = Client.CurrentUser; - await using (var uow = _db.GetDbContext()) + using (var uow = _db.GetDbContext()) { - AllGuildConfigs = await uow.GuildConfigs.GetAllGuildConfigs(startingGuildIdList); uow.EnsureUserCreated(bot.Id, bot.Username, bot.Discriminator, bot.AvatarId); + AllGuildConfigs = uow.Set().GetAllGuildConfigs(startingGuildIdList).ToImmutableArray(); } // var svcs = new StandardKernel(new NinjectSettings() @@ -114,11 +110,11 @@ public sealed class Bot : IBot var svcs = new Container(); - // this is required in order for marmalade unloading to work + // this is required in order for medusa unloading to work // svcs.Components.Remove(); // svcs.Components.Add(); - svcs.AddSingleton(_ => _credsProvider.GetCreds()); + svcs.AddSingleton(_ => _credsProvider.GetCreds()); svcs.AddSingleton(_db); svcs.AddSingleton(_credsProvider); svcs.AddSingleton(Client); @@ -165,8 +161,8 @@ public sealed class Bot : IBot LoadTypeReaders(a); } - Log.Information("All services loaded in {ServiceLoadTime:F2}s", - Stopwatch.GetElapsedTime(startTime).TotalSeconds); + sw.Stop(); + Log.Information("All services loaded in {ServiceLoadTime:F2}s", sw.Elapsed.TotalSeconds); } private void LoadTypeReaders(Assembly assembly) @@ -263,14 +259,14 @@ public sealed class Bot : IBot if (ShardId == 0) await _db.SetupAsync(); - var startTime = Stopwatch.GetTimestamp(); + var sw = Stopwatch.StartNew(); await LoginAsync(_creds.Token); Log.Information("Shard {ShardId} loading services...", Client.ShardId); try { - await AddServices(); + AddServices(); } catch (Exception ex) { @@ -278,9 +274,8 @@ public sealed class Bot : IBot Helpers.ReadErrorAndExit(9); } - Log.Information("Shard {ShardId} connected in {Elapsed:F2}s", - Client.ShardId, - Stopwatch.GetElapsedTime(startTime).TotalSeconds); + sw.Stop(); + Log.Information("Shard {ShardId} connected in {Elapsed:F2}s", Client.ShardId, sw.Elapsed.TotalSeconds); var commandHandler = Services.GetRequiredService(); // start handling messages received in commandhandler @@ -345,26 +340,26 @@ public sealed class Bot : IBot if (arg.Exception is { InnerException: WebSocketClosedException { CloseCode: 4014 } }) { Log.Error(""" - Login failed. - - *** Please enable privileged intents *** - - Certain Ellie features require Discord's privileged gateway intents. - These include greeting and goodbye messages, as well as creating the Owner message channels for DM forwarding. - - How to enable privileged intents: - 1. Head over to the Discord Developer Portal https://discord.com/developers/applications/ - 2. Select your Application. - 3. Click on `Bot` in the left side navigation panel, and scroll down to the intents section. - 4. Enable all intents. - 5. Restart your bot. - - Read this only if your bot is in 100 or more servers: - - You'll need to apply to use the intents with Discord, but for small selfhosts, all that is required is enabling the intents in the developer portal. - Yes, this is a new thing from Discord, as of October 2020. No, there's nothing we can do about it. Yes, we're aware it worked before. - While waiting for your bot to be accepted, you can change the 'usePrivilegedIntents' inside your creds.yml to 'false', although this will break many of the ellie's features - """); + Login failed. + + *** Please enable privileged intents *** + + Certain Ellie features require Discord's privileged gateway intents. + These include greeting and goodbye messages, as well as creating the Owner message channels for DM forwarding. + + How to enable privileged intents: + 1. Head over to the Discord Developer Portal https://discord.com/developers/applications/ + 2. Select your Application. + 3. Click on `Bot` in the left side navigation panel, and scroll down to the intents section. + 4. Enable all intents. + 5. Restart your bot. + + Read this only if your bot is in 100 or more servers: + + You'll need to apply to use the intents with Discord, but for small selfhosts, all that is required is enabling the intents in the developer portal. + Yes, this is a new thing from Discord, as of October 2020. No, there's nothing we can do about it. Yes, we're aware it worked before. + While waiting for your bot to be accepted, you can change the 'usePrivilegedIntents' inside your creds.yml to 'false', although this will break many of the ellie's features + """); return Task.CompletedTask; } diff --git a/src/EllieBot/Db/EllieContext.cs b/src/EllieBot/Db/EllieContext.cs index b0bc0a8..263963b 100644 --- a/src/EllieBot/Db/EllieContext.cs +++ b/src/EllieBot/Db/EllieContext.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using EllieBot.Db.Models; @@ -10,7 +10,6 @@ namespace EllieBot.Db; public abstract class EllieContext : DbContext { public DbSet GuildConfigs { get; set; } - public DbSet GreetSettings { get; set; } public DbSet Quotes { get; set; } public DbSet Reminders { get; set; } @@ -54,15 +53,16 @@ public abstract class EllieContext : DbContext public DbSet Patrons { get; set; } + public DbSet PatronQuotas { get; set; } + public DbSet StreamOnlineMessages { get; set; } public DbSet StickyRoles { get; set; } public DbSet Todos { get; set; } 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 @@ -639,6 +597,16 @@ public abstract class EllieContext : DbContext }); // quotes are per user id + modelBuilder.Entity(pq => + { + pq.HasIndex(x => x.UserId).IsUnique(false); + pq.HasKey(x => new + { + x.UserId, + x.FeatureType, + x.Feature + }); + }); #endregion @@ -721,29 +689,6 @@ public abstract class EllieContext : DbContext .OnDelete(DeleteBehavior.Cascade); #endregion - - #region GreetSettings - - modelBuilder - .Entity(gs => gs.HasIndex(x => new - { - x.GuildId, - x.GreetType - }) - .IsUnique()); - - modelBuilder.Entity(gs => - { - gs - .Property(x => x.IsEnabled) - .HasDefaultValue(false); - - gs - .Property(x => x.AutoDeleteTimer) - .HasDefaultValue(0); - }); - - #endregion } #if DEBUG diff --git a/src/EllieBot/Db/EllieDbService.cs b/src/EllieBot/Db/EllieDbService.cs index 6106072..2a3382e 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(); } @@ -44,13 +44,15 @@ public sealed class EllieDbService : DbService case "postgres": case "pgsql": return new PostgreSqlContext(connString); + case "mysql": + return new MysqlContext(connString); case "sqlite": return new SqliteContext(connString); default: 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..7d16127 100644 --- a/src/EllieBot/Db/Extensions/GuildConfigExtensions.cs +++ b/src/EllieBot/Db/Extensions/GuildConfigExtensions.cs @@ -1,5 +1,4 @@ #nullable disable -using LinqToDB.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using EllieBot.Db.Models; @@ -33,8 +32,8 @@ public static class GuildConfigExtensions { var conf = ctx.GuildConfigsForId(guildId, set => set.Include(y => y.StreamRole) - .Include(y => y.StreamRole.Whitelist) - .Include(y => y.StreamRole.Blacklist)); + .Include(y => y.StreamRole.Whitelist) + .Include(y => y.StreamRole.Blacklist)); if (conf.StreamRole is null) conf.StreamRole = new(); @@ -43,27 +42,19 @@ public static class GuildConfigExtensions } private static IQueryable IncludeEverything(this DbSet configs) - => configs - .AsSplitQuery() - .Include(gc => gc.CommandCooldowns) - .Include(gc => gc.FollowedStreams) - .Include(gc => gc.StreamRole) - .Include(gc => gc.DelMsgOnCmdChannels) - .Include(gc => gc.XpSettings) - .ThenInclude(x => x.ExclusionList); + => configs.AsQueryable() + .AsSplitQuery() + .Include(gc => gc.CommandCooldowns) + .Include(gc => gc.FollowedStreams) + .Include(gc => gc.StreamRole) + .Include(gc => gc.XpSettings) + .ThenInclude(x => x.ExclusionList) + .Include(gc => gc.DelMsgOnCmdChannels); - public static async Task GetAllGuildConfigs( + public static IEnumerable GetAllGuildConfigs( this DbSet configs, - List availableGuilds) - { - var result = await configs - .IncludeEverything() - .Where(x => availableGuilds.Contains(x.GuildId)) - .AsNoTracking() - .ToArrayAsync(); - - return result; - } + IReadOnlyList availableGuilds) + => configs.IncludeEverything().AsNoTracking().Where(x => availableGuilds.Contains(x.GuildId)).ToList(); /// /// Gets and creates if it doesn't exist a config for a guild. @@ -89,19 +80,20 @@ public static class GuildConfigExtensions if (config is null) { - ctx.Set() - .Add(config = new() - { - GuildId = guildId, - Permissions = Permissionv2.GetDefaultPermlist, - WarningsInitialized = true, - }); + ctx.Set().Add(config = new() + { + GuildId = guildId, + Permissions = Permissionv2.GetDefaultPermlist, + WarningsInitialized = true, + WarnPunishments = DefaultWarnPunishments + }); ctx.SaveChanges(); } if (!config.WarningsInitialized) { config.WarningsInitialized = true; + config.WarnPunishments = DefaultWarnPunishments; } return config; @@ -130,18 +122,18 @@ public static class GuildConfigExtensions public static LogSetting LogSettingsFor(this DbContext ctx, ulong guildId) { var logSetting = ctx.Set() - .AsQueryable() - .Include(x => x.LogIgnores) - .Where(x => x.GuildId == guildId) - .FirstOrDefault(); + .AsQueryable() + .Include(x => x.LogIgnores) + .Where(x => x.GuildId == guildId) + .FirstOrDefault(); if (logSetting is null) { ctx.Set() - .Add(logSetting = new() - { - GuildId = guildId - }); + .Add(logSetting = new() + { + GuildId = guildId + }); ctx.SaveChanges(); } @@ -157,20 +149,18 @@ public static class GuildConfigExtensions public static GuildConfig GcWithPermissionsFor(this DbContext ctx, ulong guildId) { - var config = ctx.Set() - .AsQueryable() - .Where(gc => gc.GuildId == guildId) - .Include(gc => gc.Permissions) - .FirstOrDefault(); + var config = ctx.Set().AsQueryable() + .Where(gc => gc.GuildId == guildId) + .Include(gc => gc.Permissions) + .FirstOrDefault(); if (config is null) // if there is no guildconfig, create new one { - ctx.Set() - .Add(config = new() - { - GuildId = guildId, - Permissions = Permissionv2.GetDefaultPermlist - }); + ctx.Set().Add(config = new() + { + GuildId = guildId, + Permissions = Permissionv2.GetDefaultPermlist + }); ctx.SaveChanges(); } else if (config.Permissions is null || !config.Permissions.Any()) // if no perms, add default ones @@ -187,21 +177,30 @@ public static class GuildConfigExtensions public static IEnumerable GetFollowedStreams(this DbSet configs, List included) => configs.AsQueryable() - .Where(gc => included.Contains(gc.GuildId)) - .Include(gc => gc.FollowedStreams) - .SelectMany(gc => gc.FollowedStreams) - .ToList(); + .Where(gc => included.Contains(gc.GuildId)) + .Include(gc => gc.FollowedStreams) + .SelectMany(gc => gc.FollowedStreams) + .ToList(); + public static void SetCleverbotEnabled(this DbSet configs, ulong id, bool cleverbotEnabled) + { + var conf = configs.FirstOrDefault(gc => gc.GuildId == id); + + if (conf is null) + return; + + conf.CleverbotEnabled = cleverbotEnabled; + } public static XpSettings XpSettingsFor(this DbContext ctx, ulong guildId) { var gc = ctx.GuildConfigsForId(guildId, set => set.Include(x => x.XpSettings) - .ThenInclude(x => x.RoleRewards) - .Include(x => x.XpSettings) - .ThenInclude(x => x.CurrencyRewards) - .Include(x => x.XpSettings) - .ThenInclude(x => x.ExclusionList)); + .ThenInclude(x => x.RoleRewards) + .Include(x => x.XpSettings) + .ThenInclude(x => x.CurrencyRewards) + .Include(x => x.XpSettings) + .ThenInclude(x => x.ExclusionList)); if (gc.XpSettings is null) gc.XpSettings = new(); @@ -211,15 +210,15 @@ public static class GuildConfigExtensions public static IEnumerable GetGeneratingChannels(this DbSet configs) => configs.AsQueryable() - .Include(x => x.GenerateCurrencyChannelIds) - .Where(x => x.GenerateCurrencyChannelIds.Any()) - .SelectMany(x => x.GenerateCurrencyChannelIds) - .Select(x => new GeneratingChannel - { - ChannelId = x.ChannelId, - GuildId = x.GuildConfig.GuildId - }) - .ToArray(); + .Include(x => x.GenerateCurrencyChannelIds) + .Where(x => x.GenerateCurrencyChannelIds.Any()) + .SelectMany(x => x.GenerateCurrencyChannelIds) + .Select(x => new GeneratingChannel + { + ChannelId = x.ChannelId, + GuildId = x.GuildConfig.GuildId + }) + .ToArray(); public class GeneratingChannel { diff --git a/src/EllieBot/Db/Extensions/QuoteExtensions.cs b/src/EllieBot/Db/Extensions/QuoteExtensions.cs new file mode 100644 index 0000000..a213e6d --- /dev/null +++ b/src/EllieBot/Db/Extensions/QuoteExtensions.cs @@ -0,0 +1,53 @@ +#nullable disable +using Microsoft.EntityFrameworkCore; +using EllieBot.Db.Models; + +namespace EllieBot.Db; + +public static class QuoteExtensions +{ + public static IEnumerable GetForGuild(this DbSet quotes, ulong guildId) + => quotes.AsQueryable().Where(x => x.GuildId == guildId); + + public static IReadOnlyCollection GetGroup( + this DbSet quotes, + ulong guildId, + int page, + OrderType order) + { + var q = quotes.AsQueryable().Where(x => x.GuildId == guildId); + if (order == OrderType.Keyword) + q = q.OrderBy(x => x.Keyword); + else + q = q.OrderBy(x => x.Id); + + return q.Skip(15 * page).Take(15).ToArray(); + } + + public static async Task GetRandomQuoteByKeywordAsync( + this DbSet quotes, + ulong guildId, + string keyword) + { + return (await quotes.AsQueryable().Where(q => q.GuildId == guildId && q.Keyword == keyword).ToArrayAsync()) + .RandomOrDefault(); + } + + public static async Task SearchQuoteKeywordTextAsync( + this DbSet quotes, + ulong guildId, + string keyword, + string text) + { + return (await quotes.AsQueryable() + .Where(q => q.GuildId == guildId + && (keyword == null || q.Keyword == keyword) + && (EF.Functions.Like(q.Text.ToUpper(), $"%{text.ToUpper()}%") + || EF.Functions.Like(q.AuthorName, text))) + .ToArrayAsync()) + .RandomOrDefault(); + } + + public static void RemoveAllByKeyword(this DbSet quotes, ulong guildId, string keyword) + => quotes.RemoveRange(quotes.AsQueryable().Where(x => x.GuildId == guildId && x.Keyword.ToUpper() == keyword)); +} \ No newline at end of file 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/Models/DiscordUser.cs b/src/EllieBot/Db/Models/DiscordUser.cs index 3ac3f5c..cae2bb3 100644 --- a/src/EllieBot/Db/Models/DiscordUser.cs +++ b/src/EllieBot/Db/Models/DiscordUser.cs @@ -6,7 +6,7 @@ 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 +26,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..a88d3c0 100644 --- a/src/EllieBot/Db/Models/GuildConfig.cs +++ b/src/EllieBot/Db/Models/GuildConfig.cs @@ -13,23 +13,21 @@ public class GuildConfig : DbEntity public string AutoAssignRoleIds { get; set; } - // //greet stuff - // public int AutoDeleteGreetMessagesTimer { get; set; } = 30; - // public int AutoDeleteByeMessagesTimer { get; set; } = 30; - // - // public ulong GreetMessageChannelId { get; set; } - // public ulong ByeMessageChannelId { get; set; } - // - // public bool SendDmGreetMessage { get; set; } - // public string DmGreetMessageText { get; set; } = "Welcome to the %server% server, %user%!"; - // - // public bool SendChannelGreetMessage { get; set; } - // public string ChannelGreetMessageText { get; set; } = "Welcome to the %server% server, %user%!"; - // - // public bool SendChannelByeMessage { get; set; } - // public string ChannelByeMessageText { get; set; } = "%user% has left!"; - // public bool SendBoostMessage { get; set; } - // pulic int BoostMessageDeleteAfter { get; set; } + //greet stuff + public int AutoDeleteGreetMessagesTimer { get; set; } = 30; + public int AutoDeleteByeMessagesTimer { get; set; } = 30; + + public ulong GreetMessageChannelId { get; set; } + public ulong ByeMessageChannelId { get; set; } + + public bool SendDmGreetMessage { get; set; } + public string DmGreetMessageText { get; set; } = "Welcome to the %server% server, %user%!"; + + public bool SendChannelGreetMessage { get; set; } + public string ChannelGreetMessageText { get; set; } = "Welcome to the %server% server, %user%!"; + + public bool SendChannelByeMessage { get; set; } + public string ChannelByeMessageText { get; set; } = "%user% has left!"; //self assignable roles public bool ExclusiveSelfAssignedRoles { get; set; } @@ -77,6 +75,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; } @@ -99,6 +98,10 @@ public class GuildConfig : DbEntity #region Boost Message + public bool SendBoostMessage { get; set; } + public string BoostMessage { get; set; } = "%user% just boosted this server!"; + public ulong BoostMessageChannelId { get; set; } + public int BoostMessageDeleteAfter { get; set; } public bool StickyRoles { get; set; } #endregion diff --git a/src/EllieBot/Db/Models/HoneypotChannel.cs b/src/EllieBot/Db/Models/HoneypotChannel.cs deleted file mode 100644 index bd074c9..0000000 --- a/src/EllieBot/Db/Models/HoneypotChannel.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.ComponentModel.DataAnnotations; - -namespace EllieBot.Db.Models; - -public class HoneypotChannel -{ - [Key] - public ulong GuildId { get; set; } - - public ulong ChannelId { get; set; } -} \ No newline at end of file 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/anti/AntiRaidSetting.cs b/src/EllieBot/Db/Models/anti/AntiRaidSetting.cs index 1e219eb..b5e5f67 100644 --- a/src/EllieBot/Db/Models/anti/AntiRaidSetting.cs +++ b/src/EllieBot/Db/Models/anti/AntiRaidSetting.cs @@ -1,4 +1,6 @@ #nullable disable +using System.ComponentModel.DataAnnotations.Schema; + namespace EllieBot.Db.Models; 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..1ebd2fd 100644 --- a/src/EllieBot/Db/Models/support/PatronQuota.cs +++ b/src/EllieBot/Db/Models/support/PatronQuota.cs @@ -1,12 +1,32 @@ #nullable disable -using System.ComponentModel.DataAnnotations; - namespace EllieBot.Db.Models; +/// +/// Contains data about usage of Patron-Only commands per user +/// in order to provide support for quota limitations +/// (allow user x who is pledging amount y to use the specified command only +/// x amount of times in the specified time period) +/// +public class PatronQuota +{ + public ulong UserId { get; set; } + public FeatureType FeatureType { get; set; } + public string Feature { get; set; } + public uint HourlyCount { get; set; } + public uint DailyCount { get; set; } + public uint MonthlyCount { get; set; } +} + +public enum FeatureType +{ + Command, + Group, + Module, + Limit +} + 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/UserXpStats.cs b/src/EllieBot/Db/Models/xp/UserXpStats.cs index f34ab26..d603360 100644 --- a/src/EllieBot/Db/Models/xp/UserXpStats.cs +++ b/src/EllieBot/Db/Models/xp/UserXpStats.cs @@ -8,4 +8,6 @@ public class UserXpStats : DbEntity public long Xp { get; set; } public long AwardedXp { get; set; } public XpNotificationLocation NotifyOnLevelUp { get; set; } -} \ No newline at end of file +} + +public enum XpNotificationLocation { None, Dm, Channel } \ No newline at end of file diff --git a/src/EllieBot/Db/Models/xp/XpNotificationLocation.cs b/src/EllieBot/Db/Models/xp/XpNotificationLocation.cs deleted file mode 100644 index b410fcd..0000000 --- a/src/EllieBot/Db/Models/xp/XpNotificationLocation.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace EllieBot.Db.Models; - -public enum XpNotificationLocation -{ - None, - Dm, - Channel -} \ No newline at end of file diff --git a/src/EllieBot/Db/MysqlContext.cs b/src/EllieBot/Db/MysqlContext.cs new file mode 100644 index 0000000..7563640 --- /dev/null +++ b/src/EllieBot/Db/MysqlContext.cs @@ -0,0 +1,38 @@ +using Microsoft.EntityFrameworkCore; +using EllieBot.Db.Models; + +namespace EllieBot.Db; + +public sealed class MysqlContext : EllieContext +{ + private readonly string _connStr; + private readonly string _version; + + protected override string CurrencyTransactionOtherIdDefaultValue + => "NULL"; + + public MysqlContext(string connStr = "Server=localhost", string version = "8.0") + { + _connStr = connStr; + _version = version; + } + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + base.OnConfiguring(optionsBuilder); + optionsBuilder + .UseLowerCaseNamingConvention() + .UseMySql(_connStr, ServerVersion.Parse(_version)); + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + + // mysql is case insensitive by default + // we can set binary collation to change that + modelBuilder.Entity() + .Property(x => x.Name) + .UseCollation("utf8mb4_bin"); + } +} \ No newline at end of file diff --git a/src/EllieBot/EllieBot.csproj b/src/EllieBot/EllieBot.csproj index 0dec0f1..2c605d4 100644 --- a/src/EllieBot/EllieBot.csproj +++ b/src/EllieBot/EllieBot.csproj @@ -4,7 +4,7 @@ enable true en - 5.1.20 + 5.0.8 $(MSBuildProjectDirectory) @@ -22,87 +22,88 @@ - - - all - True - - - - - - - - - - - - - - - + + + all + True + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + - - - + + + - - + + - - - - - - - + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + + - + - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + - + - - + + + - + - - + + - - + + - + - - + @@ -113,6 +114,9 @@ + + Protos\coordinator.proto + true PreserveNewest @@ -126,13 +130,6 @@ Always - - - - _common\CoordinatorProtos\coordinator.proto - - - diff --git a/src/EllieBot/Migrations/MigrationQueries.cs b/src/EllieBot/Migrations/MigrationQueries.cs index f35dbc8..8265ebb 100644 --- a/src/EllieBot/Migrations/MigrationQueries.cs +++ b/src/EllieBot/Migrations/MigrationQueries.cs @@ -1,18 +1,23 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Migrations; +using EllieBot.Db.Models; 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()) + if (migrationBuilder.IsMySql()) + { + migrationBuilder.Sql( + @"INSERT IGNORE into reactionroles(guildid, channelid, messageid, emote, roleid, `group`, levelreq, dateadded) +select guildid, channelid, messageid, emotename, roleid, exclusive, 0, reactionrolemessage.dateadded +from reactionrole +left join reactionrolemessage on reactionrolemessage.id = reactionrole.reactionrolemessageid +left join guildconfigs on reactionrolemessage.guildconfigid = guildconfigs.id;"); + } + else if (migrationBuilder.IsSqlite()) { migrationBuilder.Sql( @"insert or ignore into reactionroles(guildid, channelid, messageid, emote, roleid, 'group', levelreq, dateadded) @@ -23,8 +28,7 @@ left join guildconfigs on reactionrolemessage.guildconfigid = guildconfigs.id;") } else if (migrationBuilder.IsNpgsql()) { - migrationBuilder.Sql( - @"insert into reactionroles(guildid, channelid, messageid, emote, roleid, ""group"", levelreq, dateadded) + migrationBuilder.Sql(@"insert into reactionroles(guildid, channelid, messageid, emote, roleid, ""group"", levelreq, dateadded) select guildid, channelid, messageid, emotename, roleid, exclusive::int, 0, reactionrolemessage.dateadded from reactionrole left join reactionrolemessage on reactionrolemessage.id = reactionrole.reactionrolemessageid @@ -40,51 +44,11 @@ left join guildconfigs on reactionrolemessage.guildconfigid = guildconfigs.id;") public static void GuildConfigCleanup(MigrationBuilder builder) { builder.Sql($""" - 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"); + """); + + builder.Sql($""" + DELETE FROM "DelMsgOnCmdChannel" WHERE "GuildConfigId" is NULL; """); } - - public static void GreetSettingsCopy(MigrationBuilder builder) - { - builder.Sql(""" - INSERT INTO GreetSettings (GuildId, GreetType, MessageText, IsEnabled, ChannelId, AutoDeleteTimer) - SELECT GuildId, 0, ChannelGreetMessageText, SendChannelGreetMessage, GreetMessageChannelId, AutoDeleteGreetMessagesTimer - FROM GuildConfigs - WHERE SendChannelGreetMessage = TRUE; - - INSERT INTO GreetSettings (GuildId, GreetType, MessageText, IsEnabled, ChannelId, AutoDeleteTimer) - SELECT GuildId, 1, DmGreetMessageText, SendDmGreetMessage, GreetMessageChannelId, 0 - FROM GuildConfigs - WHERE SendDmGreetMessage = TRUE; - - INSERT INTO GreetSettings (GuildId, GreetType, MessageText, IsEnabled, ChannelId, AutoDeleteTimer) - SELECT GuildId, 2, ChannelByeMessageText, SendChannelByeMessage, ByeMessageChannelId, AutoDeleteByeMessagesTimer - FROM GuildConfigs - WHERE SendChannelByeMessage = TRUE; - - INSERT INTO GreetSettings (GuildId, GreetType, MessageText, IsEnabled, ChannelId, AutoDeleteTimer) - SELECT GuildId, 3, BoostMessage, SendBoostMessage, BoostMessageChannelId, BoostMessageDeleteAfter - FROM GuildConfigs - 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/Mysql/20220409170652_mysql-init.Designer.cs b/src/EllieBot/Migrations/Mysql/20220409170652_mysql-init.Designer.cs new file mode 100644 index 0000000..4872ab6 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220409170652_mysql-init.Designer.cs @@ -0,0 +1,3425 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using EllieBot.Services.Database; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + [DbContext(typeof(MysqlContext))] + [Migration("20220409170652_mysql-init")] + partial class mysqlinit + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.3") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => + { + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Description") + .HasColumnType("longtext") + .HasColumnName("description"); + + b.Property("ImageUrl") + .HasColumnType("longtext") + .HasColumnName("imageurl"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("name") + .UseCollation("utf8mb4_bin"); + + b.Property("OwnerId") + .HasColumnType("int") + .HasColumnName("ownerid"); + + b.Property("Xp") + .HasColumnType("int") + .HasColumnName("xp"); + + b.HasKey("Id") + .HasName("pk_clubs"); + + b.HasAlternateKey("Name") + .HasName("ak_clubs_name"); + + b.HasIndex("OwnerId") + .IsUnique() + .HasDatabaseName("ix_clubs_ownerid"); + + b.ToTable("clubs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AvatarId") + .HasColumnType("longtext") + .HasColumnName("avatarid"); + + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("CurrencyAmount") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("currencyamount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Discriminator") + .HasColumnType("longtext") + .HasColumnName("discriminator"); + + b.Property("IsClubAdmin") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("isclubadmin"); + + b.Property("LastLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastlevelup") + .HasDefaultValueSql("(UTC_TIMESTAMP)"); + + b.Property("LastXpGain") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastxpgain") + .HasDefaultValueSql("(UTC_TIMESTAMP - INTERVAL 1 year)"); + + b.Property("NotifyOnLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("notifyonlevelup"); + + b.Property("TotalXp") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("totalxp"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .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.FollowedStream", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_followedstream"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_followedstream_guildconfigid"); + + b.ToTable("followedstream", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("ActionDurationMinutes") + .HasColumnType("int") + .HasColumnName("actiondurationminutes"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MinAge") + .HasColumnType("time(6)") + .HasColumnName("minage"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antialtsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antialtsetting_guildconfigid"); + + b.ToTable("antialtsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("PunishDuration") + .HasColumnType("int") + .HasColumnName("punishduration"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.Property("UserThreshold") + .HasColumnType("int") + .HasColumnName("userthreshold"); + + b.HasKey("Id") + .HasName("pk_antiraidsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antiraidsetting_guildconfigid"); + + b.ToTable("antiraidsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AntiSpamSettingId") + .HasColumnType("int") + .HasColumnName("antispamsettingid"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.HasKey("Id") + .HasName("pk_antispamignore"); + + b.HasIndex("AntiSpamSettingId") + .HasDatabaseName("ix_antispamignore_antispamsettingid"); + + b.ToTable("antispamignore", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MessageThreshold") + .HasColumnType("int") + .HasColumnName("messagethreshold"); + + b.Property("MuteTime") + .HasColumnType("int") + .HasColumnName("mutetime"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antispamsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antispamsetting_guildconfigid"); + + b.ToTable("antispamsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoCommand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("ChannelName") + .HasColumnType("longtext") + .HasColumnName("channelname"); + + b.Property("CommandText") + .HasColumnType("longtext") + .HasColumnName("commandtext"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("GuildName") + .HasColumnType("longtext") + .HasColumnName("guildname"); + + b.Property("Interval") + .HasColumnType("int") + .HasColumnName("interval"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.Property("VoiceChannelName") + .HasColumnType("longtext") + .HasColumnName("voicechannelname"); + + b.HasKey("Id") + .HasName("pk_autocommands"); + + b.ToTable("autocommands", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDelete") + .HasColumnType("tinyint(1)") + .HasColumnName("autodelete"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_autotranslatechannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_autotranslatechannels_channelid"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_autotranslatechannels_guildid"); + + b.ToTable("autotranslatechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("int") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Source") + .HasColumnType("longtext") + .HasColumnName("source"); + + b.Property("Target") + .HasColumnType("longtext") + .HasColumnName("target"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_autotranslateusers"); + + b.HasAlternateKey("ChannelId", "UserId") + .HasName("ak_autotranslateusers_channelid_userid"); + + b.ToTable("autotranslateusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BanTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_bantemplates"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_bantemplates_guildid"); + + b.ToTable("bantemplates", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BlacklistEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_blacklist"); + + b.ToTable("blacklist", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Mapping") + .HasColumnType("longtext") + .HasColumnName("mapping"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_commandalias"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandalias_guildconfigid"); + + b.ToTable("commandalias", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("CommandName") + .HasColumnType("longtext") + .HasColumnName("commandname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.HasKey("Id") + .HasName("pk_commandcooldown"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandcooldown_guildconfigid"); + + b.ToTable("commandcooldown", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CurrencyTransaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Extra") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("extra"); + + b.Property("Note") + .HasColumnType("longtext") + .HasColumnName("note"); + + b.Property("OtherId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("otherid") + .HasDefaultValueSql("NULL"); + + b.Property("Type") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("type"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_currencytransactions"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_currencytransactions_userid"); + + b.ToTable("currencytransactions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_delmsgoncmdchannel"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); + + b.ToTable("delmsgoncmdchannel", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DiscordPermOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Command") + .HasColumnType("varchar(255)") + .HasColumnName("command"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Perm") + .HasColumnType("bigint unsigned") + .HasColumnName("perm"); + + b.HasKey("Id") + .HasName("pk_discordpermoverrides"); + + b.HasIndex("GuildId", "Command") + .IsUnique() + .HasDatabaseName("ix_discordpermoverrides_guildid_command"); + + b.ToTable("discordpermoverrides", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_excludeditem"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_excludeditem_xpsettingsid"); + + b.ToTable("excludeditem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Url") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("url"); + + b.HasKey("Id") + .HasName("pk_feedsub"); + + b.HasAlternateKey("GuildConfigId", "Url") + .HasName("ak_feedsub_guildconfigid_url"); + + b.ToTable("feedsub", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterchannelid_guildconfigid"); + + b.ToTable("filterchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Word") + .HasColumnType("longtext") + .HasColumnName("word"); + + b.HasKey("Id") + .HasName("pk_filteredword"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filteredword_guildconfigid"); + + b.ToTable("filteredword", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterlinkschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); + + b.ToTable("filterlinkschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterwordschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); + + b.ToTable("filterwordschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_gcchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_gcchannelid_guildconfigid"); + + b.ToTable("gcchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Number") + .HasColumnType("int") + .HasColumnName("number"); + + b.HasKey("Id") + .HasName("pk_groupname"); + + b.HasIndex("GuildConfigId", "Number") + .IsUnique() + .HasDatabaseName("ix_groupname_guildconfigid_number"); + + b.ToTable("groupname", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GuildConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoAssignRoleIds") + .HasColumnType("longtext") + .HasColumnName("autoassignroleids"); + + b.Property("AutoDeleteByeMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletebyemessagestimer"); + + b.Property("AutoDeleteGreetMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletegreetmessagestimer"); + + b.Property("AutoDeleteSelfAssignedRoleMessages") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeleteselfassignedrolemessages"); + + b.Property("BoostMessage") + .HasColumnType("longtext") + .HasColumnName("boostmessage"); + + b.Property("BoostMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("boostmessagechannelid"); + + b.Property("BoostMessageDeleteAfter") + .HasColumnType("int") + .HasColumnName("boostmessagedeleteafter"); + + b.Property("ByeMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("byemessagechannelid"); + + b.Property("ChannelByeMessageText") + .HasColumnType("longtext") + .HasColumnName("channelbyemessagetext"); + + b.Property("ChannelGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("channelgreetmessagetext"); + + b.Property("CleverbotEnabled") + .HasColumnType("tinyint(1)") + .HasColumnName("cleverbotenabled"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DeleteMessageOnCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("deletemessageoncommand"); + + b.Property("DmGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("dmgreetmessagetext"); + + b.Property("ExclusiveSelfAssignedRoles") + .HasColumnType("tinyint(1)") + .HasColumnName("exclusiveselfassignedroles"); + + b.Property("FilterInvites") + .HasColumnType("tinyint(1)") + .HasColumnName("filterinvites"); + + b.Property("FilterLinks") + .HasColumnType("tinyint(1)") + .HasColumnName("filterlinks"); + + b.Property("FilterWords") + .HasColumnType("tinyint(1)") + .HasColumnName("filterwords"); + + b.Property("GameVoiceChannel") + .HasColumnType("bigint unsigned") + .HasColumnName("gamevoicechannel"); + + b.Property("GreetMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("greetmessagechannelid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Locale") + .HasColumnType("longtext") + .HasColumnName("locale"); + + b.Property("MuteRoleName") + .HasColumnType("longtext") + .HasColumnName("muterolename"); + + b.Property("NotifyStreamOffline") + .HasColumnType("tinyint(1)") + .HasColumnName("notifystreamoffline"); + + b.Property("PermissionRole") + .HasColumnType("longtext") + .HasColumnName("permissionrole"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasColumnName("prefix"); + + b.Property("SendBoostMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendboostmessage"); + + b.Property("SendChannelByeMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelbyemessage"); + + b.Property("SendChannelGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelgreetmessage"); + + b.Property("SendDmGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("senddmgreetmessage"); + + b.Property("TimeZoneId") + .HasColumnType("longtext") + .HasColumnName("timezoneid"); + + b.Property("VerboseErrors") + .HasColumnType("tinyint(1)") + .HasColumnName("verboseerrors"); + + b.Property("VerbosePermissions") + .HasColumnType("tinyint(1)") + .HasColumnName("verbosepermissions"); + + b.Property("WarnExpireAction") + .HasColumnType("int") + .HasColumnName("warnexpireaction"); + + b.Property("WarnExpireHours") + .HasColumnType("int") + .HasColumnName("warnexpirehours"); + + b.Property("WarningsInitialized") + .HasColumnType("tinyint(1)") + .HasColumnName("warningsinitialized"); + + b.HasKey("Id") + .HasName("pk_guildconfigs"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_guildconfigs_guildid"); + + b.HasIndex("WarnExpireHours") + .HasDatabaseName("ix_guildconfigs_warnexpirehours"); + + b.ToTable("guildconfigs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("LogItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("logitemid"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredlogchannels"); + + b.HasIndex("LogSettingId", "LogItemId", "ItemType") + .IsUnique() + .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype"); + + b.ToTable("ignoredlogchannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredvoicepresencechannels"); + + b.HasIndex("LogSettingId") + .HasDatabaseName("ix_ignoredvoicepresencechannels_logsettingid"); + + b.ToTable("ignoredvoicepresencechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ImageOnlyChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_imageonlychannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_imageonlychannels_channelid"); + + b.ToTable("imageonlychannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.LogSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelCreatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelcreatedid"); + + b.Property("ChannelDestroyedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channeldestroyedid"); + + b.Property("ChannelUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelupdatedid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LogOtherId") + .HasColumnType("bigint unsigned") + .HasColumnName("logotherid"); + + b.Property("LogUserPresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("loguserpresenceid"); + + b.Property("LogVoicePresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresenceid"); + + b.Property("LogVoicePresenceTTSId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresencettsid"); + + b.Property("MessageDeletedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messagedeletedid"); + + b.Property("MessageUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageupdatedid"); + + b.Property("UserBannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userbannedid"); + + b.Property("UserJoinedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userjoinedid"); + + b.Property("UserLeftId") + .HasColumnType("bigint unsigned") + .HasColumnName("userleftid"); + + b.Property("UserMutedId") + .HasColumnType("bigint unsigned") + .HasColumnName("usermutedid"); + + b.Property("UserUnbannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userunbannedid"); + + b.Property("UserUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userupdatedid"); + + b.HasKey("Id") + .HasName("pk_logsettings"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_logsettings_guildid"); + + b.ToTable("logsettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlayerSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDisconnect") + .HasColumnType("tinyint(1)") + .HasColumnName("autodisconnect"); + + b.Property("AutoPlay") + .HasColumnType("tinyint(1)") + .HasColumnName("autoplay"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MusicChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("musicchannelid"); + + b.Property("PlayerRepeat") + .HasColumnType("int") + .HasColumnName("playerrepeat"); + + b.Property("QualityPreset") + .HasColumnType("int") + .HasColumnName("qualitypreset"); + + b.Property("Volume") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .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.Services.Database.Models.MusicPlaylist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Author") + .HasColumnType("longtext") + .HasColumnName("author"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.HasKey("Id") + .HasName("pk_musicplaylists"); + + b.ToTable("musicplaylists", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_muteduserid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_muteduserid_guildconfigid"); + + b.ToTable("muteduserid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AllowTarget") + .HasColumnType("tinyint(1)") + .HasColumnName("allowtarget"); + + b.Property("AutoDeleteTrigger") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeletetrigger"); + + b.Property("ContainsAnywhere") + .HasColumnType("tinyint(1)") + .HasColumnName("containsanywhere"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DmResponse") + .HasColumnType("tinyint(1)") + .HasColumnName("dmresponse"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Reactions") + .HasColumnType("longtext") + .HasColumnName("reactions"); + + b.Property("Response") + .HasColumnType("longtext") + .HasColumnName("response"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_expressions"); + + b.ToTable("expressions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NsfwBlacklistedTag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Tag") + .HasColumnType("longtext") + .HasColumnName("tag"); + + b.HasKey("Id") + .HasName("pk_nsfwblacklistedtags"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_nsfwblacklistedtags_guildid"); + + b.ToTable("nsfwblacklistedtags", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("IsCustomCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("iscustomcommand"); + + b.Property("PrimaryTarget") + .HasColumnType("int") + .HasColumnName("primarytarget"); + + b.Property("PrimaryTargetId") + .HasColumnType("bigint unsigned") + .HasColumnName("primarytargetid"); + + b.Property("SecondaryTarget") + .HasColumnType("int") + .HasColumnName("secondarytarget"); + + b.Property("SecondaryTargetName") + .HasColumnType("longtext") + .HasColumnName("secondarytargetname"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_permissions"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_permissions_guildconfigid"); + + b.ToTable("permissions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlantedCurrency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Password") + .HasColumnType("longtext") + .HasColumnName("password"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.PlaylistSong", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MusicPlaylistId") + .HasColumnType("int") + .HasColumnName("musicplaylistid"); + + b.Property("Provider") + .HasColumnType("longtext") + .HasColumnName("provider"); + + b.Property("ProviderType") + .HasColumnType("int") + .HasColumnName("providertype"); + + b.Property("Query") + .HasColumnType("longtext") + .HasColumnName("query"); + + b.Property("Title") + .HasColumnType("longtext") + .HasColumnName("title"); + + b.Property("Uri") + .HasColumnType("longtext") + .HasColumnName("uri"); + + b.HasKey("Id") + .HasName("pk_playlistsong"); + + b.HasIndex("MusicPlaylistId") + .HasDatabaseName("ix_playlistsong_musicplaylistid"); + + b.ToTable("playlistsong", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Question") + .HasColumnType("longtext") + .HasColumnName("question"); + + b.HasKey("Id") + .HasName("pk_poll"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_poll_guildid"); + + b.ToTable("poll", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_pollanswer"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollanswer_pollid"); + + b.ToTable("pollanswer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("VoteIndex") + .HasColumnType("int") + .HasColumnName("voteindex"); + + b.HasKey("Id") + .HasName("pk_pollvote"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollvote_pollid"); + + b.ToTable("pollvote", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Quote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("AuthorName") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("authorname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Keyword") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("keyword"); + + b.Property("Text") + .IsRequired() + .HasColumnType("longtext") + .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.Services.Database.Models.ReactionRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("EmoteName") + .HasColumnType("longtext") + .HasColumnName("emotename"); + + b.Property("ReactionRoleMessageId") + .HasColumnType("int") + .HasColumnName("reactionrolemessageid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_reactionrole"); + + b.HasIndex("ReactionRoleMessageId") + .HasDatabaseName("ix_reactionrole_reactionrolemessageid"); + + b.ToTable("reactionrole", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ReactionRoleMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Exclusive") + .HasColumnType("tinyint(1)") + .HasColumnName("exclusive"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.HasKey("Id") + .HasName("pk_reactionrolemessage"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_reactionrolemessage_guildconfigid"); + + b.ToTable("reactionrolemessage", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Reminder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsPrivate") + .HasColumnType("tinyint(1)") + .HasColumnName("isprivate"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("ServerId") + .HasColumnType("bigint unsigned") + .HasColumnName("serverid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("When") + .HasColumnType("datetime(6)") + .HasColumnName("when"); + + b.HasKey("Id") + .HasName("pk_reminders"); + + b.HasIndex("When") + .HasDatabaseName("ix_reminders_when"); + + b.ToTable("reminders", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Repeater", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Interval") + .HasColumnType("time(6)") + .HasColumnName("interval"); + + b.Property("LastMessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("lastmessageid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("NoRedundant") + .HasColumnType("tinyint(1)") + .HasColumnName("noredundant"); + + b.Property("StartTimeOfDay") + .HasColumnType("time(6)") + .HasColumnName("starttimeofday"); + + b.HasKey("Id") + .HasName("pk_repeaters"); + + b.ToTable("repeaters", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RewardedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AmountRewardedThisMonth") + .HasColumnType("int") + .HasColumnName("amountrewardedthismonth"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LastReward") + .HasColumnType("datetime(6)") + .HasColumnName("lastreward"); + + b.Property("PatreonUserId") + .HasColumnType("varchar(255)") + .HasColumnName("patreonuserid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_rewardedusers"); + + b.HasIndex("PatreonUserId") + .IsUnique() + .HasDatabaseName("ix_rewardedusers_patreonuserid"); + + b.ToTable("rewardedusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RotatingPlayingStatus", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Status") + .HasColumnType("longtext") + .HasColumnName("status"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_rotatingstatus"); + + b.ToTable("rotatingstatus", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SelfAssignedRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Group") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelRequirement") + .HasColumnType("int") + .HasColumnName("levelrequirement"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.ShopEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Price") + .HasColumnType("int") + .HasColumnName("price"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("RoleName") + .HasColumnType("longtext") + .HasColumnName("rolename"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_shopentry"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_shopentry_guildconfigid"); + + b.ToTable("shopentry", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ShopEntryId") + .HasColumnType("int") + .HasColumnName("shopentryid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_shopentryitem"); + + b.HasIndex("ShopEntryId") + .HasDatabaseName("ix_shopentryitem_shopentryid"); + + b.ToTable("shopentryitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoredrole"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoredrole_guildconfigid"); + + b.ToTable("slowmodeignoredrole", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoreduser"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoreduser_guildconfigid"); + + b.ToTable("slowmodeignoreduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamroleblacklisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamroleblacklisteduser_streamrolesettingsid"); + + b.ToTable("streamroleblacklisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AddRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("addroleid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)") + .HasColumnName("enabled"); + + b.Property("FromRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("fromroleid"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Keyword") + .HasColumnType("longtext") + .HasColumnName("keyword"); + + b.HasKey("Id") + .HasName("pk_streamrolesettings"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_streamrolesettings_guildconfigid"); + + b.ToTable("streamrolesettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamrolewhitelisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamrolewhitelisteduser_streamrolesettingsid"); + + b.ToTable("streamrolewhitelisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unbantimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unbantimer_guildconfigid"); + + b.ToTable("unbantimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnmuteAt") + .HasColumnType("datetime(6)") + .HasColumnName("unmuteat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unmutetimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unmutetimer_guildconfigid"); + + b.ToTable("unmutetimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unroletimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unroletimer_guildconfigid"); + + b.ToTable("unroletimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UserXpStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AwardedXp") + .HasColumnType("int") + .HasColumnName("awardedxp"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LastLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastlevelup") + .HasDefaultValueSql("(UTC_TIMESTAMP)"); + + b.Property("NotifyOnLevelUp") + .HasColumnType("int") + .HasColumnName("notifyonlevelup"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Xp") + .HasColumnType("int") + .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.Services.Database.Models.VcRoleInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.HasKey("Id") + .HasName("pk_vcroleinfo"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_vcroleinfo_guildconfigid"); + + b.ToTable("vcroleinfo", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AffinityId") + .HasColumnType("int") + .HasColumnName("affinityid"); + + b.Property("ClaimerId") + .HasColumnType("int") + .HasColumnName("claimerid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Price") + .HasColumnType("bigint") + .HasColumnName("price"); + + b.Property("WaifuId") + .HasColumnType("int") + .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.Services.Database.Models.WaifuItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemEmoji") + .HasColumnType("longtext") + .HasColumnName("itememoji"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("WaifuInfoId") + .HasColumnType("int") + .HasColumnName("waifuinfoid"); + + b.HasKey("Id") + .HasName("pk_waifuitem"); + + b.HasIndex("WaifuInfoId") + .HasDatabaseName("ix_waifuitem_waifuinfoid"); + + b.ToTable("waifuitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("NewId") + .HasColumnType("int") + .HasColumnName("newid"); + + b.Property("OldId") + .HasColumnType("int") + .HasColumnName("oldid"); + + b.Property("UpdateType") + .HasColumnType("int") + .HasColumnName("updatetype"); + + b.Property("UserId") + .HasColumnType("int") + .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.Services.Database.Models.Warning", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Forgiven") + .HasColumnType("tinyint(1)") + .HasColumnName("forgiven"); + + b.Property("ForgivenBy") + .HasColumnType("longtext") + .HasColumnName("forgivenby"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Moderator") + .HasColumnType("longtext") + .HasColumnName("moderator"); + + b.Property("Reason") + .HasColumnType("longtext") + .HasColumnName("reason"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.WarningPunishment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Count") + .HasColumnType("int") + .HasColumnName("count"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Punishment") + .HasColumnType("int") + .HasColumnName("punishment"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("Time") + .HasColumnType("int") + .HasColumnName("time"); + + b.HasKey("Id") + .HasName("pk_warningpunishment"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_warningpunishment_guildconfigid"); + + b.ToTable("warningpunishment", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("int") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_xpcurrencyreward"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_xpcurrencyreward_xpsettingsid"); + + b.ToTable("xpcurrencyreward", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("Remove") + .HasColumnType("tinyint(1)") + .HasColumnName("remove"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .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.Services.Database.Models.XpSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("ServerExcluded") + .HasColumnType("tinyint(1)") + .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.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.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.FollowedStream", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FollowedStreams") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithOne("AntiAltSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiAltSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiRaidSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiRaidSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.HasOne("EllieBot.Services.Database.Models.AntiSpamSetting", null) + .WithMany("IgnoredChannels") + .HasForeignKey("AntiSpamSettingId") + .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiSpamSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiSpamSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.AutoTranslateChannel", "Channel") + .WithMany("Users") + .HasForeignKey("ChannelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); + + b.Navigation("Channel"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandAliases") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandCooldowns") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("DelMsgOnCmdChannels") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", null) + .WithMany("ExclusionList") + .HasForeignKey("XpSettingsId") + .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("FeedSubs") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_feedsub_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterInvitesChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilteredWords") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterLinksChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterWordsChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("GenerateCurrencyChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("SelfAssignableRoleGroupNames") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_groupname_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany("LogIgnores") + .HasForeignKey("LogSettingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ignoredlogchannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany() + .HasForeignKey("LogSettingId") + .HasConstraintName("fk_ignoredvoicepresencechannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("MutedUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("Permissions") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlaylistSong", b => + { + b.HasOne("EllieBot.Services.Database.Models.MusicPlaylist", null) + .WithMany("Songs") + .HasForeignKey("MusicPlaylistId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Answers") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollanswer_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Votes") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollvote_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ReactionRole", b => + { + b.HasOne("EllieBot.Services.Database.Models.ReactionRoleMessage", null) + .WithMany("ReactionRoles") + .HasForeignKey("ReactionRoleMessageId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_reactionrole_reactionrolemessage_reactionrolemessageid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ReactionRoleMessage", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("ReactionRoleMessages") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_reactionrolemessage_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("ShopEntries") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.ShopEntry", null) + .WithMany("Items") + .HasForeignKey("ShopEntryId") + .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredRoles") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Blacklist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("StreamRole") + .HasForeignKey("EllieBot.Services.Database.Models.StreamRoleSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Whitelist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnbanTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnmuteTimers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnroleTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.VcRoleInfo", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("VcRoleInfos") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WaifuInfo", "WaifuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); + + b.Navigation("Affinity"); + + b.Navigation("Claimer"); + + b.Navigation("Waifu"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.WaifuInfo", "WaifuInfo") + .WithMany("Items") + .HasForeignKey("WaifuInfoId") + .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); + + b.Navigation("WaifuInfo"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WarningPunishment", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("WarnPunishments") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_warningpunishment_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("CurrencyRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpcurrencyreward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("RoleRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xprolereward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("XpSettings") + .HasForeignKey("EllieBot.Services.Database.Models.XpSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => + { + b.Navigation("Applicants"); + + b.Navigation("Bans"); + + b.Navigation("Members"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Navigation("IgnoredChannels"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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("ReactionRoleMessages"); + + 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.Services.Database.Models.LogSetting", b => + { + b.Navigation("LogIgnores"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlaylist", b => + { + b.Navigation("Songs"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Navigation("Answers"); + + b.Navigation("Votes"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ReactionRoleMessage", b => + { + b.Navigation("ReactionRoles"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Navigation("Blacklist"); + + b.Navigation("Whitelist"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.Navigation("CurrencyRewards"); + + b.Navigation("ExclusionList"); + + b.Navigation("RoleRewards"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220409170652_mysql-init.cs b/src/EllieBot/Migrations/Mysql/20220409170652_mysql-init.cs new file mode 100644 index 0000000..cdf1904 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220409170652_mysql-init.cs @@ -0,0 +1,2343 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + public partial class mysqlinit : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterDatabase() + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "autocommands", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + commandtext = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + channelid = table.Column(type: "bigint unsigned", nullable: false), + channelname = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + guildid = table.Column(type: "bigint unsigned", nullable: true), + guildname = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + voicechannelid = table.Column(type: "bigint unsigned", nullable: true), + voicechannelname = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + interval = table.Column(type: "int", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_autocommands", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "autotranslatechannels", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildid = table.Column(type: "bigint unsigned", nullable: false), + channelid = table.Column(type: "bigint unsigned", nullable: false), + autodelete = table.Column(type: "tinyint(1)", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_autotranslatechannels", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "bantemplates", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildid = table.Column(type: "bigint unsigned", nullable: false), + text = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_bantemplates", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "blacklist", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + itemid = table.Column(type: "bigint unsigned", nullable: false), + type = table.Column(type: "int", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_blacklist", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "currencytransactions", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + amount = table.Column(type: "bigint", nullable: false), + note = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + userid = table.Column(type: "bigint unsigned", nullable: false), + type = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + extra = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + otherid = table.Column(type: "bigint unsigned", nullable: true, defaultValueSql: "NULL"), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_currencytransactions", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "discordpermoverrides", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + perm = table.Column(type: "bigint unsigned", nullable: false), + guildid = table.Column(type: "bigint unsigned", nullable: true), + command = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_discordpermoverrides", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "expressions", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildid = table.Column(type: "bigint unsigned", nullable: true), + response = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + trigger = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + autodeletetrigger = table.Column(type: "tinyint(1)", nullable: false), + dmresponse = table.Column(type: "tinyint(1)", nullable: false), + containsanywhere = table.Column(type: "tinyint(1)", nullable: false), + allowtarget = table.Column(type: "tinyint(1)", nullable: false), + reactions = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_expressions", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "guildconfigs", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildid = table.Column(type: "bigint unsigned", nullable: false), + prefix = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + deletemessageoncommand = table.Column(type: "tinyint(1)", nullable: false), + autoassignroleids = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + autodeletegreetmessagestimer = table.Column(type: "int", nullable: false), + autodeletebyemessagestimer = table.Column(type: "int", nullable: false), + greetmessagechannelid = table.Column(type: "bigint unsigned", nullable: false), + byemessagechannelid = table.Column(type: "bigint unsigned", nullable: false), + senddmgreetmessage = table.Column(type: "tinyint(1)", nullable: false), + dmgreetmessagetext = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + sendchannelgreetmessage = table.Column(type: "tinyint(1)", nullable: false), + channelgreetmessagetext = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + sendchannelbyemessage = table.Column(type: "tinyint(1)", nullable: false), + channelbyemessagetext = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + exclusiveselfassignedroles = table.Column(type: "tinyint(1)", nullable: false), + autodeleteselfassignedrolemessages = table.Column(type: "tinyint(1)", nullable: false), + verbosepermissions = table.Column(type: "tinyint(1)", nullable: false), + permissionrole = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + filterinvites = table.Column(type: "tinyint(1)", nullable: false), + filterlinks = table.Column(type: "tinyint(1)", nullable: false), + filterwords = table.Column(type: "tinyint(1)", nullable: false), + muterolename = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + cleverbotenabled = table.Column(type: "tinyint(1)", nullable: false), + locale = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + timezoneid = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + warningsinitialized = table.Column(type: "tinyint(1)", nullable: false), + gamevoicechannel = table.Column(type: "bigint unsigned", nullable: true), + verboseerrors = table.Column(type: "tinyint(1)", nullable: false), + notifystreamoffline = table.Column(type: "tinyint(1)", nullable: false), + warnexpirehours = table.Column(type: "int", nullable: false), + warnexpireaction = table.Column(type: "int", nullable: false), + sendboostmessage = table.Column(type: "tinyint(1)", nullable: false), + boostmessage = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + boostmessagechannelid = table.Column(type: "bigint unsigned", nullable: false), + boostmessagedeleteafter = table.Column(type: "int", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_guildconfigs", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "imageonlychannels", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildid = table.Column(type: "bigint unsigned", nullable: false), + channelid = table.Column(type: "bigint unsigned", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_imageonlychannels", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "logsettings", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildid = table.Column(type: "bigint unsigned", nullable: false), + logotherid = table.Column(type: "bigint unsigned", nullable: true), + messageupdatedid = table.Column(type: "bigint unsigned", nullable: true), + messagedeletedid = table.Column(type: "bigint unsigned", nullable: true), + userjoinedid = table.Column(type: "bigint unsigned", nullable: true), + userleftid = table.Column(type: "bigint unsigned", nullable: true), + userbannedid = table.Column(type: "bigint unsigned", nullable: true), + userunbannedid = table.Column(type: "bigint unsigned", nullable: true), + userupdatedid = table.Column(type: "bigint unsigned", nullable: true), + channelcreatedid = table.Column(type: "bigint unsigned", nullable: true), + channeldestroyedid = table.Column(type: "bigint unsigned", nullable: true), + channelupdatedid = table.Column(type: "bigint unsigned", nullable: true), + usermutedid = table.Column(type: "bigint unsigned", nullable: true), + loguserpresenceid = table.Column(type: "bigint unsigned", nullable: true), + logvoicepresenceid = table.Column(type: "bigint unsigned", nullable: true), + logvoicepresencettsid = table.Column(type: "bigint unsigned", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_logsettings", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "musicplayersettings", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildid = table.Column(type: "bigint unsigned", nullable: false), + playerrepeat = table.Column(type: "int", nullable: false), + musicchannelid = table.Column(type: "bigint unsigned", nullable: true), + volume = table.Column(type: "int", nullable: false, defaultValue: 100), + autodisconnect = table.Column(type: "tinyint(1)", nullable: false), + qualitypreset = table.Column(type: "int", nullable: false), + autoplay = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_musicplayersettings", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "musicplaylists", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + author = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + authorid = table.Column(type: "bigint unsigned", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_musicplaylists", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "nsfwblacklistedtags", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildid = table.Column(type: "bigint unsigned", nullable: false), + tag = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_nsfwblacklistedtags", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "plantedcurrency", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + amount = table.Column(type: "bigint", nullable: false), + password = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + guildid = table.Column(type: "bigint unsigned", nullable: false), + channelid = table.Column(type: "bigint unsigned", nullable: false), + userid = table.Column(type: "bigint unsigned", nullable: false), + messageid = table.Column(type: "bigint unsigned", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_plantedcurrency", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "poll", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildid = table.Column(type: "bigint unsigned", nullable: false), + channelid = table.Column(type: "bigint unsigned", nullable: false), + question = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_poll", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "quotes", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildid = table.Column(type: "bigint unsigned", nullable: false), + keyword = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + authorname = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + authorid = table.Column(type: "bigint unsigned", nullable: false), + text = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_quotes", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "reminders", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + when = table.Column(type: "datetime(6)", nullable: false), + channelid = table.Column(type: "bigint unsigned", nullable: false), + serverid = table.Column(type: "bigint unsigned", nullable: false), + userid = table.Column(type: "bigint unsigned", nullable: false), + message = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + isprivate = table.Column(type: "tinyint(1)", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_reminders", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "repeaters", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildid = table.Column(type: "bigint unsigned", nullable: false), + channelid = table.Column(type: "bigint unsigned", nullable: false), + lastmessageid = table.Column(type: "bigint unsigned", nullable: true), + message = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + interval = table.Column(type: "time(6)", nullable: false), + starttimeofday = table.Column(type: "time(6)", nullable: true), + noredundant = table.Column(type: "tinyint(1)", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_repeaters", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "rewardedusers", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + userid = table.Column(type: "bigint unsigned", nullable: false), + patreonuserid = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + amountrewardedthismonth = table.Column(type: "int", nullable: false), + lastreward = table.Column(type: "datetime(6)", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_rewardedusers", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "rotatingstatus", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + status = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + type = table.Column(type: "int", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_rotatingstatus", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "selfassignableroles", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildid = table.Column(type: "bigint unsigned", nullable: false), + roleid = table.Column(type: "bigint unsigned", nullable: false), + group = table.Column(type: "int", nullable: false, defaultValue: 0), + levelrequirement = table.Column(type: "int", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_selfassignableroles", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "userxpstats", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + userid = table.Column(type: "bigint unsigned", nullable: false), + guildid = table.Column(type: "bigint unsigned", nullable: false), + xp = table.Column(type: "int", nullable: false), + awardedxp = table.Column(type: "int", nullable: false), + notifyonlevelup = table.Column(type: "int", nullable: false), + lastlevelup = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "(UTC_TIMESTAMP)"), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_userxpstats", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "warnings", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildid = table.Column(type: "bigint unsigned", nullable: false), + userid = table.Column(type: "bigint unsigned", nullable: false), + reason = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + forgiven = table.Column(type: "tinyint(1)", nullable: false), + forgivenby = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + moderator = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + weight = table.Column(type: "bigint", nullable: false, defaultValue: 1L), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_warnings", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "autotranslateusers", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + channelid = table.Column(type: "int", nullable: false), + userid = table.Column(type: "bigint unsigned", nullable: false), + source = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + target = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_autotranslateusers", x => x.id); + table.UniqueConstraint("ak_autotranslateusers_channelid_userid", x => new { x.channelid, x.userid }); + table.ForeignKey( + name: "fk_autotranslateusers_autotranslatechannels_channelid", + column: x => x.channelid, + principalTable: "autotranslatechannels", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "antialtsetting", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildconfigid = table.Column(type: "int", nullable: false), + minage = table.Column(type: "time(6)", nullable: false), + action = table.Column(type: "int", nullable: false), + actiondurationminutes = table.Column(type: "int", nullable: false), + roleid = table.Column(type: "bigint unsigned", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_antialtsetting", x => x.id); + table.ForeignKey( + name: "fk_antialtsetting_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "antiraidsetting", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildconfigid = table.Column(type: "int", nullable: false), + userthreshold = table.Column(type: "int", nullable: false), + seconds = table.Column(type: "int", nullable: false), + action = table.Column(type: "int", nullable: false), + punishduration = table.Column(type: "int", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_antiraidsetting", x => x.id); + table.ForeignKey( + name: "fk_antiraidsetting_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "antispamsetting", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildconfigid = table.Column(type: "int", nullable: false), + action = table.Column(type: "int", nullable: false), + messagethreshold = table.Column(type: "int", nullable: false), + mutetime = table.Column(type: "int", nullable: false), + roleid = table.Column(type: "bigint unsigned", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_antispamsetting", x => x.id); + table.ForeignKey( + name: "fk_antispamsetting_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "commandalias", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + trigger = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + mapping = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + guildconfigid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_commandalias", x => x.id); + table.ForeignKey( + name: "fk_commandalias_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "commandcooldown", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + seconds = table.Column(type: "int", nullable: false), + commandname = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + guildconfigid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_commandcooldown", x => x.id); + table.ForeignKey( + name: "fk_commandcooldown_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "delmsgoncmdchannel", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + channelid = table.Column(type: "bigint unsigned", nullable: false), + state = table.Column(type: "tinyint(1)", nullable: false), + guildconfigid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_delmsgoncmdchannel", x => x.id); + table.ForeignKey( + name: "fk_delmsgoncmdchannel_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "feedsub", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildconfigid = table.Column(type: "int", nullable: false), + channelid = table.Column(type: "bigint unsigned", nullable: false), + url = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_feedsub", x => x.id); + table.UniqueConstraint("ak_feedsub_guildconfigid_url", x => new { x.guildconfigid, x.url }); + table.ForeignKey( + name: "fk_feedsub_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "filterchannelid", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + channelid = table.Column(type: "bigint unsigned", nullable: false), + guildconfigid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_filterchannelid", x => x.id); + table.ForeignKey( + name: "fk_filterchannelid_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "filteredword", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + word = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + guildconfigid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_filteredword", x => x.id); + table.ForeignKey( + name: "fk_filteredword_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "filterlinkschannelid", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + channelid = table.Column(type: "bigint unsigned", nullable: false), + guildconfigid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_filterlinkschannelid", x => x.id); + table.ForeignKey( + name: "fk_filterlinkschannelid_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "filterwordschannelid", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + channelid = table.Column(type: "bigint unsigned", nullable: false), + guildconfigid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_filterwordschannelid", x => x.id); + table.ForeignKey( + name: "fk_filterwordschannelid_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "followedstream", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildid = table.Column(type: "bigint unsigned", nullable: false), + channelid = table.Column(type: "bigint unsigned", nullable: false), + username = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + type = table.Column(type: "int", nullable: false), + message = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + guildconfigid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_followedstream", x => x.id); + table.ForeignKey( + name: "fk_followedstream_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "gcchannelid", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildconfigid = table.Column(type: "int", nullable: true), + channelid = table.Column(type: "bigint unsigned", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_gcchannelid", x => x.id); + table.ForeignKey( + name: "fk_gcchannelid_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "groupname", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildconfigid = table.Column(type: "int", nullable: false), + number = table.Column(type: "int", nullable: false), + name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_groupname", x => x.id); + table.ForeignKey( + name: "fk_groupname_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "muteduserid", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + userid = table.Column(type: "bigint unsigned", nullable: false), + guildconfigid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_muteduserid", x => x.id); + table.ForeignKey( + name: "fk_muteduserid_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "permissions", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildconfigid = table.Column(type: "int", nullable: true), + index = table.Column(type: "int", nullable: false), + primarytarget = table.Column(type: "int", nullable: false), + primarytargetid = table.Column(type: "bigint unsigned", nullable: false), + secondarytarget = table.Column(type: "int", nullable: false), + secondarytargetname = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + iscustomcommand = table.Column(type: "tinyint(1)", nullable: false), + state = table.Column(type: "tinyint(1)", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_permissions", x => x.id); + table.ForeignKey( + name: "fk_permissions_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "reactionrolemessage", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + index = table.Column(type: "int", nullable: false), + guildconfigid = table.Column(type: "int", nullable: false), + channelid = table.Column(type: "bigint unsigned", nullable: false), + messageid = table.Column(type: "bigint unsigned", nullable: false), + exclusive = table.Column(type: "tinyint(1)", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_reactionrolemessage", x => x.id); + table.ForeignKey( + name: "fk_reactionrolemessage_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "shopentry", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + index = table.Column(type: "int", nullable: false), + price = table.Column(type: "int", nullable: false), + name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + authorid = table.Column(type: "bigint unsigned", nullable: false), + type = table.Column(type: "int", nullable: false), + rolename = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + roleid = table.Column(type: "bigint unsigned", nullable: false), + guildconfigid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_shopentry", x => x.id); + table.ForeignKey( + name: "fk_shopentry_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "slowmodeignoredrole", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + roleid = table.Column(type: "bigint unsigned", nullable: false), + guildconfigid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_slowmodeignoredrole", x => x.id); + table.ForeignKey( + name: "fk_slowmodeignoredrole_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "slowmodeignoreduser", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + userid = table.Column(type: "bigint unsigned", nullable: false), + guildconfigid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_slowmodeignoreduser", x => x.id); + table.ForeignKey( + name: "fk_slowmodeignoreduser_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "streamrolesettings", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildconfigid = table.Column(type: "int", nullable: false), + enabled = table.Column(type: "tinyint(1)", nullable: false), + addroleid = table.Column(type: "bigint unsigned", nullable: false), + fromroleid = table.Column(type: "bigint unsigned", nullable: false), + keyword = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_streamrolesettings", x => x.id); + table.ForeignKey( + name: "fk_streamrolesettings_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "unbantimer", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + userid = table.Column(type: "bigint unsigned", nullable: false), + unbanat = table.Column(type: "datetime(6)", nullable: false), + guildconfigid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_unbantimer", x => x.id); + table.ForeignKey( + name: "fk_unbantimer_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "unmutetimer", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + userid = table.Column(type: "bigint unsigned", nullable: false), + unmuteat = table.Column(type: "datetime(6)", nullable: false), + guildconfigid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_unmutetimer", x => x.id); + table.ForeignKey( + name: "fk_unmutetimer_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "unroletimer", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + userid = table.Column(type: "bigint unsigned", nullable: false), + roleid = table.Column(type: "bigint unsigned", nullable: false), + unbanat = table.Column(type: "datetime(6)", nullable: false), + guildconfigid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_unroletimer", x => x.id); + table.ForeignKey( + name: "fk_unroletimer_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "vcroleinfo", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + voicechannelid = table.Column(type: "bigint unsigned", nullable: false), + roleid = table.Column(type: "bigint unsigned", nullable: false), + guildconfigid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_vcroleinfo", x => x.id); + table.ForeignKey( + name: "fk_vcroleinfo_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "warningpunishment", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + count = table.Column(type: "int", nullable: false), + punishment = table.Column(type: "int", nullable: false), + time = table.Column(type: "int", nullable: false), + roleid = table.Column(type: "bigint unsigned", nullable: true), + guildconfigid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_warningpunishment", x => x.id); + table.ForeignKey( + name: "fk_warningpunishment_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "xpsettings", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildconfigid = table.Column(type: "int", nullable: false), + serverexcluded = table.Column(type: "tinyint(1)", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_xpsettings", x => x.id); + table.ForeignKey( + name: "fk_xpsettings_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ignoredlogchannels", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + logsettingid = table.Column(type: "int", nullable: false), + logitemid = table.Column(type: "bigint unsigned", nullable: false), + itemtype = table.Column(type: "int", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_ignoredlogchannels", x => x.id); + table.ForeignKey( + name: "fk_ignoredlogchannels_logsettings_logsettingid", + column: x => x.logsettingid, + principalTable: "logsettings", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ignoredvoicepresencechannels", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + logsettingid = table.Column(type: "int", nullable: true), + channelid = table.Column(type: "bigint unsigned", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_ignoredvoicepresencechannels", x => x.id); + table.ForeignKey( + name: "fk_ignoredvoicepresencechannels_logsettings_logsettingid", + column: x => x.logsettingid, + principalTable: "logsettings", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "playlistsong", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + provider = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + providertype = table.Column(type: "int", nullable: false), + title = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + uri = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + query = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + musicplaylistid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_playlistsong", x => x.id); + table.ForeignKey( + name: "fk_playlistsong_musicplaylists_musicplaylistid", + column: x => x.musicplaylistid, + principalTable: "musicplaylists", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "pollanswer", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + index = table.Column(type: "int", nullable: false), + text = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + pollid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_pollanswer", x => x.id); + table.ForeignKey( + name: "fk_pollanswer_poll_pollid", + column: x => x.pollid, + principalTable: "poll", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "pollvote", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + userid = table.Column(type: "bigint unsigned", nullable: false), + voteindex = table.Column(type: "int", nullable: false), + pollid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_pollvote", x => x.id); + table.ForeignKey( + name: "fk_pollvote_poll_pollid", + column: x => x.pollid, + principalTable: "poll", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "antispamignore", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + channelid = table.Column(type: "bigint unsigned", nullable: false), + antispamsettingid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_antispamignore", x => x.id); + table.ForeignKey( + name: "fk_antispamignore_antispamsetting_antispamsettingid", + column: x => x.antispamsettingid, + principalTable: "antispamsetting", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "reactionrole", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + emotename = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + roleid = table.Column(type: "bigint unsigned", nullable: false), + reactionrolemessageid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_reactionrole", x => x.id); + table.ForeignKey( + name: "fk_reactionrole_reactionrolemessage_reactionrolemessageid", + column: x => x.reactionrolemessageid, + principalTable: "reactionrolemessage", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "shopentryitem", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + text = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + shopentryid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_shopentryitem", x => x.id); + table.ForeignKey( + name: "fk_shopentryitem_shopentry_shopentryid", + column: x => x.shopentryid, + principalTable: "shopentry", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "streamroleblacklisteduser", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + userid = table.Column(type: "bigint unsigned", nullable: false), + username = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + streamrolesettingsid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_streamroleblacklisteduser", x => x.id); + table.ForeignKey( + name: "fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~", + column: x => x.streamrolesettingsid, + principalTable: "streamrolesettings", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "streamrolewhitelisteduser", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + userid = table.Column(type: "bigint unsigned", nullable: false), + username = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + streamrolesettingsid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_streamrolewhitelisteduser", x => x.id); + table.ForeignKey( + name: "fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~", + column: x => x.streamrolesettingsid, + principalTable: "streamrolesettings", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "excludeditem", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + itemid = table.Column(type: "bigint unsigned", nullable: false), + itemtype = table.Column(type: "int", nullable: false), + xpsettingsid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_excludeditem", x => x.id); + table.ForeignKey( + name: "fk_excludeditem_xpsettings_xpsettingsid", + column: x => x.xpsettingsid, + principalTable: "xpsettings", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "xpcurrencyreward", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + xpsettingsid = table.Column(type: "int", nullable: false), + level = table.Column(type: "int", nullable: false), + amount = table.Column(type: "int", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_xpcurrencyreward", x => x.id); + table.ForeignKey( + name: "fk_xpcurrencyreward_xpsettings_xpsettingsid", + column: x => x.xpsettingsid, + principalTable: "xpsettings", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "xprolereward", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + xpsettingsid = table.Column(type: "int", nullable: false), + level = table.Column(type: "int", nullable: false), + roleid = table.Column(type: "bigint unsigned", nullable: false), + remove = table.Column(type: "tinyint(1)", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_xprolereward", x => x.id); + table.ForeignKey( + name: "fk_xprolereward_xpsettings_xpsettingsid", + column: x => x.xpsettingsid, + principalTable: "xpsettings", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "clubapplicants", + columns: table => new + { + clubid = table.Column(type: "int", nullable: false), + userid = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_clubapplicants", x => new { x.clubid, x.userid }); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "clubbans", + columns: table => new + { + clubid = table.Column(type: "int", nullable: false), + userid = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_clubbans", x => new { x.clubid, x.userid }); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "clubs", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + name = table.Column(type: "varchar(20)", maxLength: 20, nullable: false, collation: "utf8mb4_bin") + .Annotation("MySql:CharSet", "utf8mb4"), + description = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + imageurl = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + xp = table.Column(type: "int", nullable: false), + ownerid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_clubs", x => x.id); + table.UniqueConstraint("ak_clubs_name", x => x.name); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "discorduser", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + userid = table.Column(type: "bigint unsigned", nullable: false), + username = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + discriminator = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + avatarid = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + clubid = table.Column(type: "int", nullable: true), + isclubadmin = table.Column(type: "tinyint(1)", nullable: false, defaultValue: false), + totalxp = table.Column(type: "int", nullable: false, defaultValue: 0), + lastlevelup = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "(UTC_TIMESTAMP)"), + lastxpgain = table.Column(type: "datetime(6)", nullable: false, defaultValueSql: "(UTC_TIMESTAMP - INTERVAL 1 year)"), + notifyonlevelup = table.Column(type: "int", nullable: false, defaultValue: 0), + currencyamount = table.Column(type: "bigint", nullable: false, defaultValue: 0L), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_discorduser", x => x.id); + table.UniqueConstraint("ak_discorduser_userid", x => x.userid); + table.ForeignKey( + name: "fk_discorduser_clubs_clubid", + column: x => x.clubid, + principalTable: "clubs", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "waifuinfo", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + waifuid = table.Column(type: "int", nullable: false), + claimerid = table.Column(type: "int", nullable: true), + affinityid = table.Column(type: "int", nullable: true), + price = table.Column(type: "bigint", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_waifuinfo", x => x.id); + table.ForeignKey( + name: "fk_waifuinfo_discorduser_affinityid", + column: x => x.affinityid, + principalTable: "discorduser", + principalColumn: "id"); + table.ForeignKey( + name: "fk_waifuinfo_discorduser_claimerid", + column: x => x.claimerid, + principalTable: "discorduser", + principalColumn: "id"); + table.ForeignKey( + name: "fk_waifuinfo_discorduser_waifuid", + column: x => x.waifuid, + principalTable: "discorduser", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "waifuupdates", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + userid = table.Column(type: "int", nullable: false), + updatetype = table.Column(type: "int", nullable: false), + oldid = table.Column(type: "int", nullable: true), + newid = table.Column(type: "int", nullable: true), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_waifuupdates", x => x.id); + table.ForeignKey( + name: "fk_waifuupdates_discorduser_newid", + column: x => x.newid, + principalTable: "discorduser", + principalColumn: "id"); + table.ForeignKey( + name: "fk_waifuupdates_discorduser_oldid", + column: x => x.oldid, + principalTable: "discorduser", + principalColumn: "id"); + table.ForeignKey( + name: "fk_waifuupdates_discorduser_userid", + column: x => x.userid, + principalTable: "discorduser", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "waifuitem", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + waifuinfoid = table.Column(type: "int", nullable: true), + itememoji = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_waifuitem", x => x.id); + table.ForeignKey( + name: "fk_waifuitem_waifuinfo_waifuinfoid", + column: x => x.waifuinfoid, + principalTable: "waifuinfo", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "ix_antialtsetting_guildconfigid", + table: "antialtsetting", + column: "guildconfigid", + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_antiraidsetting_guildconfigid", + table: "antiraidsetting", + column: "guildconfigid", + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_antispamignore_antispamsettingid", + table: "antispamignore", + column: "antispamsettingid"); + + migrationBuilder.CreateIndex( + name: "ix_antispamsetting_guildconfigid", + table: "antispamsetting", + column: "guildconfigid", + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_autotranslatechannels_channelid", + table: "autotranslatechannels", + column: "channelid", + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_autotranslatechannels_guildid", + table: "autotranslatechannels", + column: "guildid"); + + migrationBuilder.CreateIndex( + name: "ix_bantemplates_guildid", + table: "bantemplates", + column: "guildid", + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_clubapplicants_userid", + table: "clubapplicants", + column: "userid"); + + migrationBuilder.CreateIndex( + name: "ix_clubbans_userid", + table: "clubbans", + column: "userid"); + + migrationBuilder.CreateIndex( + name: "ix_clubs_ownerid", + table: "clubs", + column: "ownerid", + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_commandalias_guildconfigid", + table: "commandalias", + column: "guildconfigid"); + + migrationBuilder.CreateIndex( + name: "ix_commandcooldown_guildconfigid", + table: "commandcooldown", + column: "guildconfigid"); + + migrationBuilder.CreateIndex( + name: "ix_currencytransactions_userid", + table: "currencytransactions", + column: "userid"); + + migrationBuilder.CreateIndex( + name: "ix_delmsgoncmdchannel_guildconfigid", + table: "delmsgoncmdchannel", + column: "guildconfigid"); + + migrationBuilder.CreateIndex( + name: "ix_discordpermoverrides_guildid_command", + table: "discordpermoverrides", + columns: new[] { "guildid", "command" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_discorduser_clubid", + table: "discorduser", + column: "clubid"); + + migrationBuilder.CreateIndex( + name: "ix_discorduser_currencyamount", + table: "discorduser", + column: "currencyamount"); + + migrationBuilder.CreateIndex( + name: "ix_discorduser_totalxp", + table: "discorduser", + column: "totalxp"); + + migrationBuilder.CreateIndex( + name: "ix_discorduser_userid", + table: "discorduser", + column: "userid"); + + migrationBuilder.CreateIndex( + name: "ix_excludeditem_xpsettingsid", + table: "excludeditem", + column: "xpsettingsid"); + + migrationBuilder.CreateIndex( + name: "ix_filterchannelid_guildconfigid", + table: "filterchannelid", + column: "guildconfigid"); + + migrationBuilder.CreateIndex( + name: "ix_filteredword_guildconfigid", + table: "filteredword", + column: "guildconfigid"); + + migrationBuilder.CreateIndex( + name: "ix_filterlinkschannelid_guildconfigid", + table: "filterlinkschannelid", + column: "guildconfigid"); + + migrationBuilder.CreateIndex( + name: "ix_filterwordschannelid_guildconfigid", + table: "filterwordschannelid", + column: "guildconfigid"); + + migrationBuilder.CreateIndex( + name: "ix_followedstream_guildconfigid", + table: "followedstream", + column: "guildconfigid"); + + migrationBuilder.CreateIndex( + name: "ix_gcchannelid_guildconfigid", + table: "gcchannelid", + column: "guildconfigid"); + + migrationBuilder.CreateIndex( + name: "ix_groupname_guildconfigid_number", + table: "groupname", + columns: new[] { "guildconfigid", "number" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_guildconfigs_guildid", + table: "guildconfigs", + column: "guildid", + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_guildconfigs_warnexpirehours", + table: "guildconfigs", + column: "warnexpirehours"); + + migrationBuilder.CreateIndex( + name: "ix_ignoredlogchannels_logsettingid_logitemid_itemtype", + table: "ignoredlogchannels", + columns: new[] { "logsettingid", "logitemid", "itemtype" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_ignoredvoicepresencechannels_logsettingid", + table: "ignoredvoicepresencechannels", + column: "logsettingid"); + + migrationBuilder.CreateIndex( + name: "ix_imageonlychannels_channelid", + table: "imageonlychannels", + column: "channelid", + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_logsettings_guildid", + table: "logsettings", + column: "guildid", + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_musicplayersettings_guildid", + table: "musicplayersettings", + column: "guildid", + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_muteduserid_guildconfigid", + table: "muteduserid", + column: "guildconfigid"); + + migrationBuilder.CreateIndex( + name: "ix_nsfwblacklistedtags_guildid", + table: "nsfwblacklistedtags", + column: "guildid"); + + migrationBuilder.CreateIndex( + name: "ix_permissions_guildconfigid", + table: "permissions", + column: "guildconfigid"); + + migrationBuilder.CreateIndex( + name: "ix_plantedcurrency_channelid", + table: "plantedcurrency", + column: "channelid"); + + migrationBuilder.CreateIndex( + name: "ix_plantedcurrency_messageid", + table: "plantedcurrency", + column: "messageid", + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_playlistsong_musicplaylistid", + table: "playlistsong", + column: "musicplaylistid"); + + migrationBuilder.CreateIndex( + name: "ix_poll_guildid", + table: "poll", + column: "guildid", + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_pollanswer_pollid", + table: "pollanswer", + column: "pollid"); + + migrationBuilder.CreateIndex( + name: "ix_pollvote_pollid", + table: "pollvote", + column: "pollid"); + + migrationBuilder.CreateIndex( + name: "ix_quotes_guildid", + table: "quotes", + column: "guildid"); + + migrationBuilder.CreateIndex( + name: "ix_quotes_keyword", + table: "quotes", + column: "keyword"); + + migrationBuilder.CreateIndex( + name: "ix_reactionrole_reactionrolemessageid", + table: "reactionrole", + column: "reactionrolemessageid"); + + migrationBuilder.CreateIndex( + name: "ix_reactionrolemessage_guildconfigid", + table: "reactionrolemessage", + column: "guildconfigid"); + + migrationBuilder.CreateIndex( + name: "ix_reminders_when", + table: "reminders", + column: "when"); + + migrationBuilder.CreateIndex( + name: "ix_rewardedusers_patreonuserid", + table: "rewardedusers", + column: "patreonuserid", + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_selfassignableroles_guildid_roleid", + table: "selfassignableroles", + columns: new[] { "guildid", "roleid" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_shopentry_guildconfigid", + table: "shopentry", + column: "guildconfigid"); + + migrationBuilder.CreateIndex( + name: "ix_shopentryitem_shopentryid", + table: "shopentryitem", + column: "shopentryid"); + + migrationBuilder.CreateIndex( + name: "ix_slowmodeignoredrole_guildconfigid", + table: "slowmodeignoredrole", + column: "guildconfigid"); + + migrationBuilder.CreateIndex( + name: "ix_slowmodeignoreduser_guildconfigid", + table: "slowmodeignoreduser", + column: "guildconfigid"); + + migrationBuilder.CreateIndex( + name: "ix_streamroleblacklisteduser_streamrolesettingsid", + table: "streamroleblacklisteduser", + column: "streamrolesettingsid"); + + migrationBuilder.CreateIndex( + name: "ix_streamrolesettings_guildconfigid", + table: "streamrolesettings", + column: "guildconfigid", + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_streamrolewhitelisteduser_streamrolesettingsid", + table: "streamrolewhitelisteduser", + column: "streamrolesettingsid"); + + migrationBuilder.CreateIndex( + name: "ix_unbantimer_guildconfigid", + table: "unbantimer", + column: "guildconfigid"); + + migrationBuilder.CreateIndex( + name: "ix_unmutetimer_guildconfigid", + table: "unmutetimer", + column: "guildconfigid"); + + migrationBuilder.CreateIndex( + name: "ix_unroletimer_guildconfigid", + table: "unroletimer", + column: "guildconfigid"); + + migrationBuilder.CreateIndex( + name: "ix_userxpstats_awardedxp", + table: "userxpstats", + column: "awardedxp"); + + migrationBuilder.CreateIndex( + name: "ix_userxpstats_guildid", + table: "userxpstats", + column: "guildid"); + + migrationBuilder.CreateIndex( + name: "ix_userxpstats_userid", + table: "userxpstats", + column: "userid"); + + migrationBuilder.CreateIndex( + name: "ix_userxpstats_userid_guildid", + table: "userxpstats", + columns: new[] { "userid", "guildid" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_userxpstats_xp", + table: "userxpstats", + column: "xp"); + + migrationBuilder.CreateIndex( + name: "ix_vcroleinfo_guildconfigid", + table: "vcroleinfo", + column: "guildconfigid"); + + migrationBuilder.CreateIndex( + name: "ix_waifuinfo_affinityid", + table: "waifuinfo", + column: "affinityid"); + + migrationBuilder.CreateIndex( + name: "ix_waifuinfo_claimerid", + table: "waifuinfo", + column: "claimerid"); + + migrationBuilder.CreateIndex( + name: "ix_waifuinfo_price", + table: "waifuinfo", + column: "price"); + + migrationBuilder.CreateIndex( + name: "ix_waifuinfo_waifuid", + table: "waifuinfo", + column: "waifuid", + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_waifuitem_waifuinfoid", + table: "waifuitem", + column: "waifuinfoid"); + + migrationBuilder.CreateIndex( + name: "ix_waifuupdates_newid", + table: "waifuupdates", + column: "newid"); + + migrationBuilder.CreateIndex( + name: "ix_waifuupdates_oldid", + table: "waifuupdates", + column: "oldid"); + + migrationBuilder.CreateIndex( + name: "ix_waifuupdates_userid", + table: "waifuupdates", + column: "userid"); + + migrationBuilder.CreateIndex( + name: "ix_warningpunishment_guildconfigid", + table: "warningpunishment", + column: "guildconfigid"); + + migrationBuilder.CreateIndex( + name: "ix_warnings_dateadded", + table: "warnings", + column: "dateadded"); + + migrationBuilder.CreateIndex( + name: "ix_warnings_guildid", + table: "warnings", + column: "guildid"); + + migrationBuilder.CreateIndex( + name: "ix_warnings_userid", + table: "warnings", + column: "userid"); + + migrationBuilder.CreateIndex( + name: "ix_xpcurrencyreward_xpsettingsid", + table: "xpcurrencyreward", + column: "xpsettingsid"); + + migrationBuilder.CreateIndex( + name: "ix_xprolereward_xpsettingsid_level", + table: "xprolereward", + columns: new[] { "xpsettingsid", "level" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_xpsettings_guildconfigid", + table: "xpsettings", + column: "guildconfigid", + unique: true); + + migrationBuilder.AddForeignKey( + name: "fk_clubapplicants_clubs_clubid", + table: "clubapplicants", + column: "clubid", + principalTable: "clubs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_clubapplicants_discorduser_userid", + table: "clubapplicants", + column: "userid", + principalTable: "discorduser", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_clubbans_clubs_clubid", + table: "clubbans", + column: "clubid", + principalTable: "clubs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_clubbans_discorduser_userid", + table: "clubbans", + column: "userid", + principalTable: "discorduser", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_clubs_discorduser_ownerid", + table: "clubs", + column: "ownerid", + principalTable: "discorduser", + principalColumn: "id", + onDelete: ReferentialAction.SetNull); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "fk_discorduser_clubs_clubid", + table: "discorduser"); + + migrationBuilder.DropTable( + name: "antialtsetting"); + + migrationBuilder.DropTable( + name: "antiraidsetting"); + + migrationBuilder.DropTable( + name: "antispamignore"); + + migrationBuilder.DropTable( + name: "autocommands"); + + migrationBuilder.DropTable( + name: "autotranslateusers"); + + migrationBuilder.DropTable( + name: "bantemplates"); + + migrationBuilder.DropTable( + name: "blacklist"); + + migrationBuilder.DropTable( + name: "clubapplicants"); + + migrationBuilder.DropTable( + name: "clubbans"); + + migrationBuilder.DropTable( + name: "commandalias"); + + migrationBuilder.DropTable( + name: "commandcooldown"); + + migrationBuilder.DropTable( + name: "currencytransactions"); + + migrationBuilder.DropTable( + name: "delmsgoncmdchannel"); + + migrationBuilder.DropTable( + name: "discordpermoverrides"); + + migrationBuilder.DropTable( + name: "excludeditem"); + + migrationBuilder.DropTable( + name: "expressions"); + + migrationBuilder.DropTable( + name: "feedsub"); + + migrationBuilder.DropTable( + name: "filterchannelid"); + + migrationBuilder.DropTable( + name: "filteredword"); + + migrationBuilder.DropTable( + name: "filterlinkschannelid"); + + migrationBuilder.DropTable( + name: "filterwordschannelid"); + + migrationBuilder.DropTable( + name: "followedstream"); + + migrationBuilder.DropTable( + name: "gcchannelid"); + + migrationBuilder.DropTable( + name: "groupname"); + + migrationBuilder.DropTable( + name: "ignoredlogchannels"); + + migrationBuilder.DropTable( + name: "ignoredvoicepresencechannels"); + + migrationBuilder.DropTable( + name: "imageonlychannels"); + + migrationBuilder.DropTable( + name: "musicplayersettings"); + + migrationBuilder.DropTable( + name: "muteduserid"); + + migrationBuilder.DropTable( + name: "nsfwblacklistedtags"); + + migrationBuilder.DropTable( + name: "permissions"); + + migrationBuilder.DropTable( + name: "plantedcurrency"); + + migrationBuilder.DropTable( + name: "playlistsong"); + + migrationBuilder.DropTable( + name: "pollanswer"); + + migrationBuilder.DropTable( + name: "pollvote"); + + migrationBuilder.DropTable( + name: "quotes"); + + migrationBuilder.DropTable( + name: "reactionrole"); + + migrationBuilder.DropTable( + name: "reminders"); + + migrationBuilder.DropTable( + name: "repeaters"); + + migrationBuilder.DropTable( + name: "rewardedusers"); + + migrationBuilder.DropTable( + name: "rotatingstatus"); + + migrationBuilder.DropTable( + name: "selfassignableroles"); + + migrationBuilder.DropTable( + name: "shopentryitem"); + + migrationBuilder.DropTable( + name: "slowmodeignoredrole"); + + migrationBuilder.DropTable( + name: "slowmodeignoreduser"); + + migrationBuilder.DropTable( + name: "streamroleblacklisteduser"); + + migrationBuilder.DropTable( + name: "streamrolewhitelisteduser"); + + migrationBuilder.DropTable( + name: "unbantimer"); + + migrationBuilder.DropTable( + name: "unmutetimer"); + + migrationBuilder.DropTable( + name: "unroletimer"); + + migrationBuilder.DropTable( + name: "userxpstats"); + + migrationBuilder.DropTable( + name: "vcroleinfo"); + + migrationBuilder.DropTable( + name: "waifuitem"); + + migrationBuilder.DropTable( + name: "waifuupdates"); + + migrationBuilder.DropTable( + name: "warningpunishment"); + + migrationBuilder.DropTable( + name: "warnings"); + + migrationBuilder.DropTable( + name: "xpcurrencyreward"); + + migrationBuilder.DropTable( + name: "xprolereward"); + + migrationBuilder.DropTable( + name: "antispamsetting"); + + migrationBuilder.DropTable( + name: "autotranslatechannels"); + + migrationBuilder.DropTable( + name: "logsettings"); + + migrationBuilder.DropTable( + name: "musicplaylists"); + + migrationBuilder.DropTable( + name: "poll"); + + migrationBuilder.DropTable( + name: "reactionrolemessage"); + + migrationBuilder.DropTable( + name: "shopentry"); + + migrationBuilder.DropTable( + name: "streamrolesettings"); + + migrationBuilder.DropTable( + name: "waifuinfo"); + + migrationBuilder.DropTable( + name: "xpsettings"); + + migrationBuilder.DropTable( + name: "guildconfigs"); + + migrationBuilder.DropTable( + name: "clubs"); + + migrationBuilder.DropTable( + name: "discorduser"); + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220428044612_stondel.Designer.cs b/src/EllieBot/Migrations/Mysql/20220428044612_stondel.Designer.cs new file mode 100644 index 0000000..04ca748 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220428044612_stondel.Designer.cs @@ -0,0 +1,3429 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using EllieBot.Services.Database; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + [DbContext(typeof(MysqlContext))] + [Migration("20220428044612_stondel")] + partial class stondel + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.3") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => + { + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Description") + .HasColumnType("longtext") + .HasColumnName("description"); + + b.Property("ImageUrl") + .HasColumnType("longtext") + .HasColumnName("imageurl"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("name") + .UseCollation("utf8mb4_bin"); + + b.Property("OwnerId") + .HasColumnType("int") + .HasColumnName("ownerid"); + + b.Property("Xp") + .HasColumnType("int") + .HasColumnName("xp"); + + b.HasKey("Id") + .HasName("pk_clubs"); + + b.HasAlternateKey("Name") + .HasName("ak_clubs_name"); + + b.HasIndex("OwnerId") + .IsUnique() + .HasDatabaseName("ix_clubs_ownerid"); + + b.ToTable("clubs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AvatarId") + .HasColumnType("longtext") + .HasColumnName("avatarid"); + + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("CurrencyAmount") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("currencyamount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Discriminator") + .HasColumnType("longtext") + .HasColumnName("discriminator"); + + b.Property("IsClubAdmin") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("isclubadmin"); + + b.Property("LastLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastlevelup") + .HasDefaultValueSql("(UTC_TIMESTAMP)"); + + b.Property("LastXpGain") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastxpgain") + .HasDefaultValueSql("(UTC_TIMESTAMP - INTERVAL 1 year)"); + + b.Property("NotifyOnLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("notifyonlevelup"); + + b.Property("TotalXp") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("totalxp"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .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.FollowedStream", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_followedstream"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_followedstream_guildconfigid"); + + b.ToTable("followedstream", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("ActionDurationMinutes") + .HasColumnType("int") + .HasColumnName("actiondurationminutes"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MinAge") + .HasColumnType("time(6)") + .HasColumnName("minage"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antialtsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antialtsetting_guildconfigid"); + + b.ToTable("antialtsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("PunishDuration") + .HasColumnType("int") + .HasColumnName("punishduration"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.Property("UserThreshold") + .HasColumnType("int") + .HasColumnName("userthreshold"); + + b.HasKey("Id") + .HasName("pk_antiraidsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antiraidsetting_guildconfigid"); + + b.ToTable("antiraidsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AntiSpamSettingId") + .HasColumnType("int") + .HasColumnName("antispamsettingid"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.HasKey("Id") + .HasName("pk_antispamignore"); + + b.HasIndex("AntiSpamSettingId") + .HasDatabaseName("ix_antispamignore_antispamsettingid"); + + b.ToTable("antispamignore", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MessageThreshold") + .HasColumnType("int") + .HasColumnName("messagethreshold"); + + b.Property("MuteTime") + .HasColumnType("int") + .HasColumnName("mutetime"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antispamsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antispamsetting_guildconfigid"); + + b.ToTable("antispamsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoCommand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("ChannelName") + .HasColumnType("longtext") + .HasColumnName("channelname"); + + b.Property("CommandText") + .HasColumnType("longtext") + .HasColumnName("commandtext"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("GuildName") + .HasColumnType("longtext") + .HasColumnName("guildname"); + + b.Property("Interval") + .HasColumnType("int") + .HasColumnName("interval"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.Property("VoiceChannelName") + .HasColumnType("longtext") + .HasColumnName("voicechannelname"); + + b.HasKey("Id") + .HasName("pk_autocommands"); + + b.ToTable("autocommands", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDelete") + .HasColumnType("tinyint(1)") + .HasColumnName("autodelete"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_autotranslatechannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_autotranslatechannels_channelid"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_autotranslatechannels_guildid"); + + b.ToTable("autotranslatechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("int") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Source") + .HasColumnType("longtext") + .HasColumnName("source"); + + b.Property("Target") + .HasColumnType("longtext") + .HasColumnName("target"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_autotranslateusers"); + + b.HasAlternateKey("ChannelId", "UserId") + .HasName("ak_autotranslateusers_channelid_userid"); + + b.ToTable("autotranslateusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BanTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_bantemplates"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_bantemplates_guildid"); + + b.ToTable("bantemplates", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BlacklistEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_blacklist"); + + b.ToTable("blacklist", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Mapping") + .HasColumnType("longtext") + .HasColumnName("mapping"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_commandalias"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandalias_guildconfigid"); + + b.ToTable("commandalias", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("CommandName") + .HasColumnType("longtext") + .HasColumnName("commandname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.HasKey("Id") + .HasName("pk_commandcooldown"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandcooldown_guildconfigid"); + + b.ToTable("commandcooldown", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CurrencyTransaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Extra") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("extra"); + + b.Property("Note") + .HasColumnType("longtext") + .HasColumnName("note"); + + b.Property("OtherId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("otherid") + .HasDefaultValueSql("NULL"); + + b.Property("Type") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("type"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_currencytransactions"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_currencytransactions_userid"); + + b.ToTable("currencytransactions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_delmsgoncmdchannel"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); + + b.ToTable("delmsgoncmdchannel", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DiscordPermOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Command") + .HasColumnType("varchar(255)") + .HasColumnName("command"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Perm") + .HasColumnType("bigint unsigned") + .HasColumnName("perm"); + + b.HasKey("Id") + .HasName("pk_discordpermoverrides"); + + b.HasIndex("GuildId", "Command") + .IsUnique() + .HasDatabaseName("ix_discordpermoverrides_guildid_command"); + + b.ToTable("discordpermoverrides", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_excludeditem"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_excludeditem_xpsettingsid"); + + b.ToTable("excludeditem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Url") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("url"); + + b.HasKey("Id") + .HasName("pk_feedsub"); + + b.HasAlternateKey("GuildConfigId", "Url") + .HasName("ak_feedsub_guildconfigid_url"); + + b.ToTable("feedsub", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterchannelid_guildconfigid"); + + b.ToTable("filterchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Word") + .HasColumnType("longtext") + .HasColumnName("word"); + + b.HasKey("Id") + .HasName("pk_filteredword"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filteredword_guildconfigid"); + + b.ToTable("filteredword", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterlinkschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); + + b.ToTable("filterlinkschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterwordschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); + + b.ToTable("filterwordschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_gcchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_gcchannelid_guildconfigid"); + + b.ToTable("gcchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Number") + .HasColumnType("int") + .HasColumnName("number"); + + b.HasKey("Id") + .HasName("pk_groupname"); + + b.HasIndex("GuildConfigId", "Number") + .IsUnique() + .HasDatabaseName("ix_groupname_guildconfigid_number"); + + b.ToTable("groupname", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GuildConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoAssignRoleIds") + .HasColumnType("longtext") + .HasColumnName("autoassignroleids"); + + b.Property("AutoDeleteByeMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletebyemessagestimer"); + + b.Property("AutoDeleteGreetMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletegreetmessagestimer"); + + b.Property("AutoDeleteSelfAssignedRoleMessages") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeleteselfassignedrolemessages"); + + b.Property("BoostMessage") + .HasColumnType("longtext") + .HasColumnName("boostmessage"); + + b.Property("BoostMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("boostmessagechannelid"); + + b.Property("BoostMessageDeleteAfter") + .HasColumnType("int") + .HasColumnName("boostmessagedeleteafter"); + + b.Property("ByeMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("byemessagechannelid"); + + b.Property("ChannelByeMessageText") + .HasColumnType("longtext") + .HasColumnName("channelbyemessagetext"); + + b.Property("ChannelGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("channelgreetmessagetext"); + + b.Property("CleverbotEnabled") + .HasColumnType("tinyint(1)") + .HasColumnName("cleverbotenabled"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DeleteMessageOnCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("deletemessageoncommand"); + + b.Property("DeleteStreamOnlineMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("deletestreamonlinemessage"); + + b.Property("DmGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("dmgreetmessagetext"); + + b.Property("ExclusiveSelfAssignedRoles") + .HasColumnType("tinyint(1)") + .HasColumnName("exclusiveselfassignedroles"); + + b.Property("FilterInvites") + .HasColumnType("tinyint(1)") + .HasColumnName("filterinvites"); + + b.Property("FilterLinks") + .HasColumnType("tinyint(1)") + .HasColumnName("filterlinks"); + + b.Property("FilterWords") + .HasColumnType("tinyint(1)") + .HasColumnName("filterwords"); + + b.Property("GameVoiceChannel") + .HasColumnType("bigint unsigned") + .HasColumnName("gamevoicechannel"); + + b.Property("GreetMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("greetmessagechannelid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Locale") + .HasColumnType("longtext") + .HasColumnName("locale"); + + b.Property("MuteRoleName") + .HasColumnType("longtext") + .HasColumnName("muterolename"); + + b.Property("NotifyStreamOffline") + .HasColumnType("tinyint(1)") + .HasColumnName("notifystreamoffline"); + + b.Property("PermissionRole") + .HasColumnType("longtext") + .HasColumnName("permissionrole"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasColumnName("prefix"); + + b.Property("SendBoostMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendboostmessage"); + + b.Property("SendChannelByeMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelbyemessage"); + + b.Property("SendChannelGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelgreetmessage"); + + b.Property("SendDmGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("senddmgreetmessage"); + + b.Property("TimeZoneId") + .HasColumnType("longtext") + .HasColumnName("timezoneid"); + + b.Property("VerboseErrors") + .HasColumnType("tinyint(1)") + .HasColumnName("verboseerrors"); + + b.Property("VerbosePermissions") + .HasColumnType("tinyint(1)") + .HasColumnName("verbosepermissions"); + + b.Property("WarnExpireAction") + .HasColumnType("int") + .HasColumnName("warnexpireaction"); + + b.Property("WarnExpireHours") + .HasColumnType("int") + .HasColumnName("warnexpirehours"); + + b.Property("WarningsInitialized") + .HasColumnType("tinyint(1)") + .HasColumnName("warningsinitialized"); + + b.HasKey("Id") + .HasName("pk_guildconfigs"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_guildconfigs_guildid"); + + b.HasIndex("WarnExpireHours") + .HasDatabaseName("ix_guildconfigs_warnexpirehours"); + + b.ToTable("guildconfigs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("LogItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("logitemid"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredlogchannels"); + + b.HasIndex("LogSettingId", "LogItemId", "ItemType") + .IsUnique() + .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype"); + + b.ToTable("ignoredlogchannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredvoicepresencechannels"); + + b.HasIndex("LogSettingId") + .HasDatabaseName("ix_ignoredvoicepresencechannels_logsettingid"); + + b.ToTable("ignoredvoicepresencechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ImageOnlyChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_imageonlychannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_imageonlychannels_channelid"); + + b.ToTable("imageonlychannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.LogSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelCreatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelcreatedid"); + + b.Property("ChannelDestroyedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channeldestroyedid"); + + b.Property("ChannelUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelupdatedid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LogOtherId") + .HasColumnType("bigint unsigned") + .HasColumnName("logotherid"); + + b.Property("LogUserPresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("loguserpresenceid"); + + b.Property("LogVoicePresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresenceid"); + + b.Property("LogVoicePresenceTTSId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresencettsid"); + + b.Property("MessageDeletedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messagedeletedid"); + + b.Property("MessageUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageupdatedid"); + + b.Property("UserBannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userbannedid"); + + b.Property("UserJoinedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userjoinedid"); + + b.Property("UserLeftId") + .HasColumnType("bigint unsigned") + .HasColumnName("userleftid"); + + b.Property("UserMutedId") + .HasColumnType("bigint unsigned") + .HasColumnName("usermutedid"); + + b.Property("UserUnbannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userunbannedid"); + + b.Property("UserUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userupdatedid"); + + b.HasKey("Id") + .HasName("pk_logsettings"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_logsettings_guildid"); + + b.ToTable("logsettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlayerSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDisconnect") + .HasColumnType("tinyint(1)") + .HasColumnName("autodisconnect"); + + b.Property("AutoPlay") + .HasColumnType("tinyint(1)") + .HasColumnName("autoplay"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MusicChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("musicchannelid"); + + b.Property("PlayerRepeat") + .HasColumnType("int") + .HasColumnName("playerrepeat"); + + b.Property("QualityPreset") + .HasColumnType("int") + .HasColumnName("qualitypreset"); + + b.Property("Volume") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .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.Services.Database.Models.MusicPlaylist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Author") + .HasColumnType("longtext") + .HasColumnName("author"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.HasKey("Id") + .HasName("pk_musicplaylists"); + + b.ToTable("musicplaylists", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_muteduserid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_muteduserid_guildconfigid"); + + b.ToTable("muteduserid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AllowTarget") + .HasColumnType("tinyint(1)") + .HasColumnName("allowtarget"); + + b.Property("AutoDeleteTrigger") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeletetrigger"); + + b.Property("ContainsAnywhere") + .HasColumnType("tinyint(1)") + .HasColumnName("containsanywhere"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DmResponse") + .HasColumnType("tinyint(1)") + .HasColumnName("dmresponse"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Reactions") + .HasColumnType("longtext") + .HasColumnName("reactions"); + + b.Property("Response") + .HasColumnType("longtext") + .HasColumnName("response"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_expressions"); + + b.ToTable("expressions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NsfwBlacklistedTag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Tag") + .HasColumnType("longtext") + .HasColumnName("tag"); + + b.HasKey("Id") + .HasName("pk_nsfwblacklistedtags"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_nsfwblacklistedtags_guildid"); + + b.ToTable("nsfwblacklistedtags", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("IsCustomCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("iscustomcommand"); + + b.Property("PrimaryTarget") + .HasColumnType("int") + .HasColumnName("primarytarget"); + + b.Property("PrimaryTargetId") + .HasColumnType("bigint unsigned") + .HasColumnName("primarytargetid"); + + b.Property("SecondaryTarget") + .HasColumnType("int") + .HasColumnName("secondarytarget"); + + b.Property("SecondaryTargetName") + .HasColumnType("longtext") + .HasColumnName("secondarytargetname"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_permissions"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_permissions_guildconfigid"); + + b.ToTable("permissions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlantedCurrency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Password") + .HasColumnType("longtext") + .HasColumnName("password"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.PlaylistSong", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MusicPlaylistId") + .HasColumnType("int") + .HasColumnName("musicplaylistid"); + + b.Property("Provider") + .HasColumnType("longtext") + .HasColumnName("provider"); + + b.Property("ProviderType") + .HasColumnType("int") + .HasColumnName("providertype"); + + b.Property("Query") + .HasColumnType("longtext") + .HasColumnName("query"); + + b.Property("Title") + .HasColumnType("longtext") + .HasColumnName("title"); + + b.Property("Uri") + .HasColumnType("longtext") + .HasColumnName("uri"); + + b.HasKey("Id") + .HasName("pk_playlistsong"); + + b.HasIndex("MusicPlaylistId") + .HasDatabaseName("ix_playlistsong_musicplaylistid"); + + b.ToTable("playlistsong", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Question") + .HasColumnType("longtext") + .HasColumnName("question"); + + b.HasKey("Id") + .HasName("pk_poll"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_poll_guildid"); + + b.ToTable("poll", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_pollanswer"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollanswer_pollid"); + + b.ToTable("pollanswer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("VoteIndex") + .HasColumnType("int") + .HasColumnName("voteindex"); + + b.HasKey("Id") + .HasName("pk_pollvote"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollvote_pollid"); + + b.ToTable("pollvote", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Quote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("AuthorName") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("authorname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Keyword") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("keyword"); + + b.Property("Text") + .IsRequired() + .HasColumnType("longtext") + .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.Services.Database.Models.ReactionRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("EmoteName") + .HasColumnType("longtext") + .HasColumnName("emotename"); + + b.Property("ReactionRoleMessageId") + .HasColumnType("int") + .HasColumnName("reactionrolemessageid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_reactionrole"); + + b.HasIndex("ReactionRoleMessageId") + .HasDatabaseName("ix_reactionrole_reactionrolemessageid"); + + b.ToTable("reactionrole", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ReactionRoleMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Exclusive") + .HasColumnType("tinyint(1)") + .HasColumnName("exclusive"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.HasKey("Id") + .HasName("pk_reactionrolemessage"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_reactionrolemessage_guildconfigid"); + + b.ToTable("reactionrolemessage", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Reminder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsPrivate") + .HasColumnType("tinyint(1)") + .HasColumnName("isprivate"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("ServerId") + .HasColumnType("bigint unsigned") + .HasColumnName("serverid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("When") + .HasColumnType("datetime(6)") + .HasColumnName("when"); + + b.HasKey("Id") + .HasName("pk_reminders"); + + b.HasIndex("When") + .HasDatabaseName("ix_reminders_when"); + + b.ToTable("reminders", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Repeater", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Interval") + .HasColumnType("time(6)") + .HasColumnName("interval"); + + b.Property("LastMessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("lastmessageid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("NoRedundant") + .HasColumnType("tinyint(1)") + .HasColumnName("noredundant"); + + b.Property("StartTimeOfDay") + .HasColumnType("time(6)") + .HasColumnName("starttimeofday"); + + b.HasKey("Id") + .HasName("pk_repeaters"); + + b.ToTable("repeaters", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RewardedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AmountRewardedThisMonth") + .HasColumnType("int") + .HasColumnName("amountrewardedthismonth"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LastReward") + .HasColumnType("datetime(6)") + .HasColumnName("lastreward"); + + b.Property("PatreonUserId") + .HasColumnType("varchar(255)") + .HasColumnName("patreonuserid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_rewardedusers"); + + b.HasIndex("PatreonUserId") + .IsUnique() + .HasDatabaseName("ix_rewardedusers_patreonuserid"); + + b.ToTable("rewardedusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RotatingPlayingStatus", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Status") + .HasColumnType("longtext") + .HasColumnName("status"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_rotatingstatus"); + + b.ToTable("rotatingstatus", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SelfAssignedRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Group") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelRequirement") + .HasColumnType("int") + .HasColumnName("levelrequirement"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.ShopEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Price") + .HasColumnType("int") + .HasColumnName("price"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("RoleName") + .HasColumnType("longtext") + .HasColumnName("rolename"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_shopentry"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_shopentry_guildconfigid"); + + b.ToTable("shopentry", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ShopEntryId") + .HasColumnType("int") + .HasColumnName("shopentryid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_shopentryitem"); + + b.HasIndex("ShopEntryId") + .HasDatabaseName("ix_shopentryitem_shopentryid"); + + b.ToTable("shopentryitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoredrole"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoredrole_guildconfigid"); + + b.ToTable("slowmodeignoredrole", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoreduser"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoreduser_guildconfigid"); + + b.ToTable("slowmodeignoreduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamroleblacklisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamroleblacklisteduser_streamrolesettingsid"); + + b.ToTable("streamroleblacklisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AddRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("addroleid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)") + .HasColumnName("enabled"); + + b.Property("FromRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("fromroleid"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Keyword") + .HasColumnType("longtext") + .HasColumnName("keyword"); + + b.HasKey("Id") + .HasName("pk_streamrolesettings"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_streamrolesettings_guildconfigid"); + + b.ToTable("streamrolesettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamrolewhitelisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamrolewhitelisteduser_streamrolesettingsid"); + + b.ToTable("streamrolewhitelisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unbantimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unbantimer_guildconfigid"); + + b.ToTable("unbantimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnmuteAt") + .HasColumnType("datetime(6)") + .HasColumnName("unmuteat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unmutetimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unmutetimer_guildconfigid"); + + b.ToTable("unmutetimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unroletimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unroletimer_guildconfigid"); + + b.ToTable("unroletimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UserXpStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AwardedXp") + .HasColumnType("int") + .HasColumnName("awardedxp"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LastLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastlevelup") + .HasDefaultValueSql("(UTC_TIMESTAMP)"); + + b.Property("NotifyOnLevelUp") + .HasColumnType("int") + .HasColumnName("notifyonlevelup"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Xp") + .HasColumnType("int") + .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.Services.Database.Models.VcRoleInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.HasKey("Id") + .HasName("pk_vcroleinfo"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_vcroleinfo_guildconfigid"); + + b.ToTable("vcroleinfo", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AffinityId") + .HasColumnType("int") + .HasColumnName("affinityid"); + + b.Property("ClaimerId") + .HasColumnType("int") + .HasColumnName("claimerid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Price") + .HasColumnType("bigint") + .HasColumnName("price"); + + b.Property("WaifuId") + .HasColumnType("int") + .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.Services.Database.Models.WaifuItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemEmoji") + .HasColumnType("longtext") + .HasColumnName("itememoji"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("WaifuInfoId") + .HasColumnType("int") + .HasColumnName("waifuinfoid"); + + b.HasKey("Id") + .HasName("pk_waifuitem"); + + b.HasIndex("WaifuInfoId") + .HasDatabaseName("ix_waifuitem_waifuinfoid"); + + b.ToTable("waifuitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("NewId") + .HasColumnType("int") + .HasColumnName("newid"); + + b.Property("OldId") + .HasColumnType("int") + .HasColumnName("oldid"); + + b.Property("UpdateType") + .HasColumnType("int") + .HasColumnName("updatetype"); + + b.Property("UserId") + .HasColumnType("int") + .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.Services.Database.Models.Warning", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Forgiven") + .HasColumnType("tinyint(1)") + .HasColumnName("forgiven"); + + b.Property("ForgivenBy") + .HasColumnType("longtext") + .HasColumnName("forgivenby"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Moderator") + .HasColumnType("longtext") + .HasColumnName("moderator"); + + b.Property("Reason") + .HasColumnType("longtext") + .HasColumnName("reason"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.WarningPunishment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Count") + .HasColumnType("int") + .HasColumnName("count"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Punishment") + .HasColumnType("int") + .HasColumnName("punishment"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("Time") + .HasColumnType("int") + .HasColumnName("time"); + + b.HasKey("Id") + .HasName("pk_warningpunishment"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_warningpunishment_guildconfigid"); + + b.ToTable("warningpunishment", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("int") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_xpcurrencyreward"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_xpcurrencyreward_xpsettingsid"); + + b.ToTable("xpcurrencyreward", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("Remove") + .HasColumnType("tinyint(1)") + .HasColumnName("remove"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .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.Services.Database.Models.XpSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("ServerExcluded") + .HasColumnType("tinyint(1)") + .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.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.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.FollowedStream", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FollowedStreams") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithOne("AntiAltSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiAltSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiRaidSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiRaidSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.HasOne("EllieBot.Services.Database.Models.AntiSpamSetting", null) + .WithMany("IgnoredChannels") + .HasForeignKey("AntiSpamSettingId") + .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiSpamSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiSpamSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.AutoTranslateChannel", "Channel") + .WithMany("Users") + .HasForeignKey("ChannelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); + + b.Navigation("Channel"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandAliases") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandCooldowns") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("DelMsgOnCmdChannels") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", null) + .WithMany("ExclusionList") + .HasForeignKey("XpSettingsId") + .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("FeedSubs") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_feedsub_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterInvitesChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilteredWords") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterLinksChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterWordsChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("GenerateCurrencyChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("SelfAssignableRoleGroupNames") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_groupname_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany("LogIgnores") + .HasForeignKey("LogSettingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ignoredlogchannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany() + .HasForeignKey("LogSettingId") + .HasConstraintName("fk_ignoredvoicepresencechannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("MutedUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("Permissions") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlaylistSong", b => + { + b.HasOne("EllieBot.Services.Database.Models.MusicPlaylist", null) + .WithMany("Songs") + .HasForeignKey("MusicPlaylistId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Answers") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollanswer_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Votes") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollvote_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ReactionRole", b => + { + b.HasOne("EllieBot.Services.Database.Models.ReactionRoleMessage", null) + .WithMany("ReactionRoles") + .HasForeignKey("ReactionRoleMessageId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_reactionrole_reactionrolemessage_reactionrolemessageid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ReactionRoleMessage", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("ReactionRoleMessages") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_reactionrolemessage_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("ShopEntries") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.ShopEntry", null) + .WithMany("Items") + .HasForeignKey("ShopEntryId") + .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredRoles") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Blacklist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("StreamRole") + .HasForeignKey("EllieBot.Services.Database.Models.StreamRoleSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Whitelist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnbanTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnmuteTimers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnroleTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.VcRoleInfo", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("VcRoleInfos") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WaifuInfo", "WaifuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); + + b.Navigation("Affinity"); + + b.Navigation("Claimer"); + + b.Navigation("Waifu"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.WaifuInfo", "WaifuInfo") + .WithMany("Items") + .HasForeignKey("WaifuInfoId") + .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); + + b.Navigation("WaifuInfo"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WarningPunishment", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("WarnPunishments") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_warningpunishment_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("CurrencyRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpcurrencyreward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("RoleRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xprolereward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("XpSettings") + .HasForeignKey("EllieBot.Services.Database.Models.XpSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => + { + b.Navigation("Applicants"); + + b.Navigation("Bans"); + + b.Navigation("Members"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Navigation("IgnoredChannels"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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("ReactionRoleMessages"); + + 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.Services.Database.Models.LogSetting", b => + { + b.Navigation("LogIgnores"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlaylist", b => + { + b.Navigation("Songs"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Navigation("Answers"); + + b.Navigation("Votes"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ReactionRoleMessage", b => + { + b.Navigation("ReactionRoles"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Navigation("Blacklist"); + + b.Navigation("Whitelist"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.Navigation("CurrencyRewards"); + + b.Navigation("ExclusionList"); + + b.Navigation("RoleRewards"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220428044612_stondel.cs b/src/EllieBot/Migrations/Mysql/20220428044612_stondel.cs new file mode 100644 index 0000000..2daa4c0 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220428044612_stondel.cs @@ -0,0 +1,26 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + public partial class stondel : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "deletestreamonlinemessage", + table: "guildconfigs", + type: "tinyint(1)", + nullable: false, + defaultValue: false); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "deletestreamonlinemessage", + table: "guildconfigs"); + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220429044757_bank.Designer.cs b/src/EllieBot/Migrations/Mysql/20220429044757_bank.Designer.cs new file mode 100644 index 0000000..1a8d96b --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220429044757_bank.Designer.cs @@ -0,0 +1,3458 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using EllieBot.Services.Database; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + [DbContext(typeof(MysqlContext))] + [Migration("20220429044757_bank")] + partial class bank + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.3") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Balance") + .HasColumnType("bigint") + .HasColumnName("balance"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.ClubApplicants", b => + { + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Description") + .HasColumnType("longtext") + .HasColumnName("description"); + + b.Property("ImageUrl") + .HasColumnType("longtext") + .HasColumnName("imageurl"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("name") + .UseCollation("utf8mb4_bin"); + + b.Property("OwnerId") + .HasColumnType("int") + .HasColumnName("ownerid"); + + b.Property("Xp") + .HasColumnType("int") + .HasColumnName("xp"); + + b.HasKey("Id") + .HasName("pk_clubs"); + + b.HasAlternateKey("Name") + .HasName("ak_clubs_name"); + + b.HasIndex("OwnerId") + .IsUnique() + .HasDatabaseName("ix_clubs_ownerid"); + + b.ToTable("clubs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AvatarId") + .HasColumnType("longtext") + .HasColumnName("avatarid"); + + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("CurrencyAmount") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("currencyamount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Discriminator") + .HasColumnType("longtext") + .HasColumnName("discriminator"); + + b.Property("IsClubAdmin") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("isclubadmin"); + + b.Property("LastLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastlevelup") + .HasDefaultValueSql("(UTC_TIMESTAMP)"); + + b.Property("LastXpGain") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastxpgain") + .HasDefaultValueSql("(UTC_TIMESTAMP - INTERVAL 1 year)"); + + b.Property("NotifyOnLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("notifyonlevelup"); + + b.Property("TotalXp") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("totalxp"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .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.FollowedStream", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_followedstream"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_followedstream_guildconfigid"); + + b.ToTable("followedstream", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("ActionDurationMinutes") + .HasColumnType("int") + .HasColumnName("actiondurationminutes"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MinAge") + .HasColumnType("time(6)") + .HasColumnName("minage"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antialtsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antialtsetting_guildconfigid"); + + b.ToTable("antialtsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("PunishDuration") + .HasColumnType("int") + .HasColumnName("punishduration"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.Property("UserThreshold") + .HasColumnType("int") + .HasColumnName("userthreshold"); + + b.HasKey("Id") + .HasName("pk_antiraidsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antiraidsetting_guildconfigid"); + + b.ToTable("antiraidsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AntiSpamSettingId") + .HasColumnType("int") + .HasColumnName("antispamsettingid"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.HasKey("Id") + .HasName("pk_antispamignore"); + + b.HasIndex("AntiSpamSettingId") + .HasDatabaseName("ix_antispamignore_antispamsettingid"); + + b.ToTable("antispamignore", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MessageThreshold") + .HasColumnType("int") + .HasColumnName("messagethreshold"); + + b.Property("MuteTime") + .HasColumnType("int") + .HasColumnName("mutetime"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antispamsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antispamsetting_guildconfigid"); + + b.ToTable("antispamsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoCommand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("ChannelName") + .HasColumnType("longtext") + .HasColumnName("channelname"); + + b.Property("CommandText") + .HasColumnType("longtext") + .HasColumnName("commandtext"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("GuildName") + .HasColumnType("longtext") + .HasColumnName("guildname"); + + b.Property("Interval") + .HasColumnType("int") + .HasColumnName("interval"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.Property("VoiceChannelName") + .HasColumnType("longtext") + .HasColumnName("voicechannelname"); + + b.HasKey("Id") + .HasName("pk_autocommands"); + + b.ToTable("autocommands", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDelete") + .HasColumnType("tinyint(1)") + .HasColumnName("autodelete"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_autotranslatechannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_autotranslatechannels_channelid"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_autotranslatechannels_guildid"); + + b.ToTable("autotranslatechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("int") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Source") + .HasColumnType("longtext") + .HasColumnName("source"); + + b.Property("Target") + .HasColumnType("longtext") + .HasColumnName("target"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_autotranslateusers"); + + b.HasAlternateKey("ChannelId", "UserId") + .HasName("ak_autotranslateusers_channelid_userid"); + + b.ToTable("autotranslateusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BanTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_bantemplates"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_bantemplates_guildid"); + + b.ToTable("bantemplates", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BlacklistEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_blacklist"); + + b.ToTable("blacklist", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Mapping") + .HasColumnType("longtext") + .HasColumnName("mapping"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_commandalias"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandalias_guildconfigid"); + + b.ToTable("commandalias", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("CommandName") + .HasColumnType("longtext") + .HasColumnName("commandname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.HasKey("Id") + .HasName("pk_commandcooldown"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandcooldown_guildconfigid"); + + b.ToTable("commandcooldown", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CurrencyTransaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Extra") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("extra"); + + b.Property("Note") + .HasColumnType("longtext") + .HasColumnName("note"); + + b.Property("OtherId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("otherid") + .HasDefaultValueSql("NULL"); + + b.Property("Type") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("type"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_currencytransactions"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_currencytransactions_userid"); + + b.ToTable("currencytransactions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_delmsgoncmdchannel"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); + + b.ToTable("delmsgoncmdchannel", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DiscordPermOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Command") + .HasColumnType("varchar(255)") + .HasColumnName("command"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Perm") + .HasColumnType("bigint unsigned") + .HasColumnName("perm"); + + b.HasKey("Id") + .HasName("pk_discordpermoverrides"); + + b.HasIndex("GuildId", "Command") + .IsUnique() + .HasDatabaseName("ix_discordpermoverrides_guildid_command"); + + b.ToTable("discordpermoverrides", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_excludeditem"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_excludeditem_xpsettingsid"); + + b.ToTable("excludeditem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Url") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("url"); + + b.HasKey("Id") + .HasName("pk_feedsub"); + + b.HasAlternateKey("GuildConfigId", "Url") + .HasName("ak_feedsub_guildconfigid_url"); + + b.ToTable("feedsub", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterchannelid_guildconfigid"); + + b.ToTable("filterchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Word") + .HasColumnType("longtext") + .HasColumnName("word"); + + b.HasKey("Id") + .HasName("pk_filteredword"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filteredword_guildconfigid"); + + b.ToTable("filteredword", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterlinkschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); + + b.ToTable("filterlinkschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterwordschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); + + b.ToTable("filterwordschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_gcchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_gcchannelid_guildconfigid"); + + b.ToTable("gcchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Number") + .HasColumnType("int") + .HasColumnName("number"); + + b.HasKey("Id") + .HasName("pk_groupname"); + + b.HasIndex("GuildConfigId", "Number") + .IsUnique() + .HasDatabaseName("ix_groupname_guildconfigid_number"); + + b.ToTable("groupname", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GuildConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoAssignRoleIds") + .HasColumnType("longtext") + .HasColumnName("autoassignroleids"); + + b.Property("AutoDeleteByeMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletebyemessagestimer"); + + b.Property("AutoDeleteGreetMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletegreetmessagestimer"); + + b.Property("AutoDeleteSelfAssignedRoleMessages") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeleteselfassignedrolemessages"); + + b.Property("BoostMessage") + .HasColumnType("longtext") + .HasColumnName("boostmessage"); + + b.Property("BoostMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("boostmessagechannelid"); + + b.Property("BoostMessageDeleteAfter") + .HasColumnType("int") + .HasColumnName("boostmessagedeleteafter"); + + b.Property("ByeMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("byemessagechannelid"); + + b.Property("ChannelByeMessageText") + .HasColumnType("longtext") + .HasColumnName("channelbyemessagetext"); + + b.Property("ChannelGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("channelgreetmessagetext"); + + b.Property("CleverbotEnabled") + .HasColumnType("tinyint(1)") + .HasColumnName("cleverbotenabled"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DeleteMessageOnCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("deletemessageoncommand"); + + b.Property("DeleteStreamOnlineMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("deletestreamonlinemessage"); + + b.Property("DmGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("dmgreetmessagetext"); + + b.Property("ExclusiveSelfAssignedRoles") + .HasColumnType("tinyint(1)") + .HasColumnName("exclusiveselfassignedroles"); + + b.Property("FilterInvites") + .HasColumnType("tinyint(1)") + .HasColumnName("filterinvites"); + + b.Property("FilterLinks") + .HasColumnType("tinyint(1)") + .HasColumnName("filterlinks"); + + b.Property("FilterWords") + .HasColumnType("tinyint(1)") + .HasColumnName("filterwords"); + + b.Property("GameVoiceChannel") + .HasColumnType("bigint unsigned") + .HasColumnName("gamevoicechannel"); + + b.Property("GreetMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("greetmessagechannelid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Locale") + .HasColumnType("longtext") + .HasColumnName("locale"); + + b.Property("MuteRoleName") + .HasColumnType("longtext") + .HasColumnName("muterolename"); + + b.Property("NotifyStreamOffline") + .HasColumnType("tinyint(1)") + .HasColumnName("notifystreamoffline"); + + b.Property("PermissionRole") + .HasColumnType("longtext") + .HasColumnName("permissionrole"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasColumnName("prefix"); + + b.Property("SendBoostMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendboostmessage"); + + b.Property("SendChannelByeMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelbyemessage"); + + b.Property("SendChannelGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelgreetmessage"); + + b.Property("SendDmGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("senddmgreetmessage"); + + b.Property("TimeZoneId") + .HasColumnType("longtext") + .HasColumnName("timezoneid"); + + b.Property("VerboseErrors") + .HasColumnType("tinyint(1)") + .HasColumnName("verboseerrors"); + + b.Property("VerbosePermissions") + .HasColumnType("tinyint(1)") + .HasColumnName("verbosepermissions"); + + b.Property("WarnExpireAction") + .HasColumnType("int") + .HasColumnName("warnexpireaction"); + + b.Property("WarnExpireHours") + .HasColumnType("int") + .HasColumnName("warnexpirehours"); + + b.Property("WarningsInitialized") + .HasColumnType("tinyint(1)") + .HasColumnName("warningsinitialized"); + + b.HasKey("Id") + .HasName("pk_guildconfigs"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_guildconfigs_guildid"); + + b.HasIndex("WarnExpireHours") + .HasDatabaseName("ix_guildconfigs_warnexpirehours"); + + b.ToTable("guildconfigs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("LogItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("logitemid"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredlogchannels"); + + b.HasIndex("LogSettingId", "LogItemId", "ItemType") + .IsUnique() + .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype"); + + b.ToTable("ignoredlogchannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredvoicepresencechannels"); + + b.HasIndex("LogSettingId") + .HasDatabaseName("ix_ignoredvoicepresencechannels_logsettingid"); + + b.ToTable("ignoredvoicepresencechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ImageOnlyChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_imageonlychannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_imageonlychannels_channelid"); + + b.ToTable("imageonlychannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.LogSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelCreatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelcreatedid"); + + b.Property("ChannelDestroyedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channeldestroyedid"); + + b.Property("ChannelUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelupdatedid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LogOtherId") + .HasColumnType("bigint unsigned") + .HasColumnName("logotherid"); + + b.Property("LogUserPresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("loguserpresenceid"); + + b.Property("LogVoicePresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresenceid"); + + b.Property("LogVoicePresenceTTSId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresencettsid"); + + b.Property("MessageDeletedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messagedeletedid"); + + b.Property("MessageUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageupdatedid"); + + b.Property("UserBannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userbannedid"); + + b.Property("UserJoinedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userjoinedid"); + + b.Property("UserLeftId") + .HasColumnType("bigint unsigned") + .HasColumnName("userleftid"); + + b.Property("UserMutedId") + .HasColumnType("bigint unsigned") + .HasColumnName("usermutedid"); + + b.Property("UserUnbannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userunbannedid"); + + b.Property("UserUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userupdatedid"); + + b.HasKey("Id") + .HasName("pk_logsettings"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_logsettings_guildid"); + + b.ToTable("logsettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlayerSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDisconnect") + .HasColumnType("tinyint(1)") + .HasColumnName("autodisconnect"); + + b.Property("AutoPlay") + .HasColumnType("tinyint(1)") + .HasColumnName("autoplay"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MusicChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("musicchannelid"); + + b.Property("PlayerRepeat") + .HasColumnType("int") + .HasColumnName("playerrepeat"); + + b.Property("QualityPreset") + .HasColumnType("int") + .HasColumnName("qualitypreset"); + + b.Property("Volume") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .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.Services.Database.Models.MusicPlaylist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Author") + .HasColumnType("longtext") + .HasColumnName("author"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.HasKey("Id") + .HasName("pk_musicplaylists"); + + b.ToTable("musicplaylists", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_muteduserid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_muteduserid_guildconfigid"); + + b.ToTable("muteduserid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AllowTarget") + .HasColumnType("tinyint(1)") + .HasColumnName("allowtarget"); + + b.Property("AutoDeleteTrigger") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeletetrigger"); + + b.Property("ContainsAnywhere") + .HasColumnType("tinyint(1)") + .HasColumnName("containsanywhere"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DmResponse") + .HasColumnType("tinyint(1)") + .HasColumnName("dmresponse"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Reactions") + .HasColumnType("longtext") + .HasColumnName("reactions"); + + b.Property("Response") + .HasColumnType("longtext") + .HasColumnName("response"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_expressions"); + + b.ToTable("expressions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NsfwBlacklistedTag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Tag") + .HasColumnType("longtext") + .HasColumnName("tag"); + + b.HasKey("Id") + .HasName("pk_nsfwblacklistedtags"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_nsfwblacklistedtags_guildid"); + + b.ToTable("nsfwblacklistedtags", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("IsCustomCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("iscustomcommand"); + + b.Property("PrimaryTarget") + .HasColumnType("int") + .HasColumnName("primarytarget"); + + b.Property("PrimaryTargetId") + .HasColumnType("bigint unsigned") + .HasColumnName("primarytargetid"); + + b.Property("SecondaryTarget") + .HasColumnType("int") + .HasColumnName("secondarytarget"); + + b.Property("SecondaryTargetName") + .HasColumnType("longtext") + .HasColumnName("secondarytargetname"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_permissions"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_permissions_guildconfigid"); + + b.ToTable("permissions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlantedCurrency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Password") + .HasColumnType("longtext") + .HasColumnName("password"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.PlaylistSong", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MusicPlaylistId") + .HasColumnType("int") + .HasColumnName("musicplaylistid"); + + b.Property("Provider") + .HasColumnType("longtext") + .HasColumnName("provider"); + + b.Property("ProviderType") + .HasColumnType("int") + .HasColumnName("providertype"); + + b.Property("Query") + .HasColumnType("longtext") + .HasColumnName("query"); + + b.Property("Title") + .HasColumnType("longtext") + .HasColumnName("title"); + + b.Property("Uri") + .HasColumnType("longtext") + .HasColumnName("uri"); + + b.HasKey("Id") + .HasName("pk_playlistsong"); + + b.HasIndex("MusicPlaylistId") + .HasDatabaseName("ix_playlistsong_musicplaylistid"); + + b.ToTable("playlistsong", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Question") + .HasColumnType("longtext") + .HasColumnName("question"); + + b.HasKey("Id") + .HasName("pk_poll"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_poll_guildid"); + + b.ToTable("poll", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_pollanswer"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollanswer_pollid"); + + b.ToTable("pollanswer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("VoteIndex") + .HasColumnType("int") + .HasColumnName("voteindex"); + + b.HasKey("Id") + .HasName("pk_pollvote"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollvote_pollid"); + + b.ToTable("pollvote", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Quote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("AuthorName") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("authorname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Keyword") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("keyword"); + + b.Property("Text") + .IsRequired() + .HasColumnType("longtext") + .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.Services.Database.Models.ReactionRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("EmoteName") + .HasColumnType("longtext") + .HasColumnName("emotename"); + + b.Property("ReactionRoleMessageId") + .HasColumnType("int") + .HasColumnName("reactionrolemessageid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_reactionrole"); + + b.HasIndex("ReactionRoleMessageId") + .HasDatabaseName("ix_reactionrole_reactionrolemessageid"); + + b.ToTable("reactionrole", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ReactionRoleMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Exclusive") + .HasColumnType("tinyint(1)") + .HasColumnName("exclusive"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.HasKey("Id") + .HasName("pk_reactionrolemessage"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_reactionrolemessage_guildconfigid"); + + b.ToTable("reactionrolemessage", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Reminder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsPrivate") + .HasColumnType("tinyint(1)") + .HasColumnName("isprivate"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("ServerId") + .HasColumnType("bigint unsigned") + .HasColumnName("serverid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("When") + .HasColumnType("datetime(6)") + .HasColumnName("when"); + + b.HasKey("Id") + .HasName("pk_reminders"); + + b.HasIndex("When") + .HasDatabaseName("ix_reminders_when"); + + b.ToTable("reminders", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Repeater", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Interval") + .HasColumnType("time(6)") + .HasColumnName("interval"); + + b.Property("LastMessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("lastmessageid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("NoRedundant") + .HasColumnType("tinyint(1)") + .HasColumnName("noredundant"); + + b.Property("StartTimeOfDay") + .HasColumnType("time(6)") + .HasColumnName("starttimeofday"); + + b.HasKey("Id") + .HasName("pk_repeaters"); + + b.ToTable("repeaters", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RewardedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AmountRewardedThisMonth") + .HasColumnType("int") + .HasColumnName("amountrewardedthismonth"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LastReward") + .HasColumnType("datetime(6)") + .HasColumnName("lastreward"); + + b.Property("PatreonUserId") + .HasColumnType("varchar(255)") + .HasColumnName("patreonuserid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_rewardedusers"); + + b.HasIndex("PatreonUserId") + .IsUnique() + .HasDatabaseName("ix_rewardedusers_patreonuserid"); + + b.ToTable("rewardedusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RotatingPlayingStatus", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Status") + .HasColumnType("longtext") + .HasColumnName("status"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_rotatingstatus"); + + b.ToTable("rotatingstatus", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SelfAssignedRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Group") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelRequirement") + .HasColumnType("int") + .HasColumnName("levelrequirement"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.ShopEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Price") + .HasColumnType("int") + .HasColumnName("price"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("RoleName") + .HasColumnType("longtext") + .HasColumnName("rolename"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_shopentry"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_shopentry_guildconfigid"); + + b.ToTable("shopentry", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ShopEntryId") + .HasColumnType("int") + .HasColumnName("shopentryid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_shopentryitem"); + + b.HasIndex("ShopEntryId") + .HasDatabaseName("ix_shopentryitem_shopentryid"); + + b.ToTable("shopentryitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoredrole"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoredrole_guildconfigid"); + + b.ToTable("slowmodeignoredrole", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoreduser"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoreduser_guildconfigid"); + + b.ToTable("slowmodeignoreduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamroleblacklisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamroleblacklisteduser_streamrolesettingsid"); + + b.ToTable("streamroleblacklisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AddRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("addroleid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)") + .HasColumnName("enabled"); + + b.Property("FromRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("fromroleid"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Keyword") + .HasColumnType("longtext") + .HasColumnName("keyword"); + + b.HasKey("Id") + .HasName("pk_streamrolesettings"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_streamrolesettings_guildconfigid"); + + b.ToTable("streamrolesettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamrolewhitelisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamrolewhitelisteduser_streamrolesettingsid"); + + b.ToTable("streamrolewhitelisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unbantimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unbantimer_guildconfigid"); + + b.ToTable("unbantimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnmuteAt") + .HasColumnType("datetime(6)") + .HasColumnName("unmuteat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unmutetimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unmutetimer_guildconfigid"); + + b.ToTable("unmutetimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unroletimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unroletimer_guildconfigid"); + + b.ToTable("unroletimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UserXpStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AwardedXp") + .HasColumnType("int") + .HasColumnName("awardedxp"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LastLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastlevelup") + .HasDefaultValueSql("(UTC_TIMESTAMP)"); + + b.Property("NotifyOnLevelUp") + .HasColumnType("int") + .HasColumnName("notifyonlevelup"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Xp") + .HasColumnType("int") + .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.Services.Database.Models.VcRoleInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.HasKey("Id") + .HasName("pk_vcroleinfo"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_vcroleinfo_guildconfigid"); + + b.ToTable("vcroleinfo", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AffinityId") + .HasColumnType("int") + .HasColumnName("affinityid"); + + b.Property("ClaimerId") + .HasColumnType("int") + .HasColumnName("claimerid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Price") + .HasColumnType("bigint") + .HasColumnName("price"); + + b.Property("WaifuId") + .HasColumnType("int") + .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.Services.Database.Models.WaifuItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemEmoji") + .HasColumnType("longtext") + .HasColumnName("itememoji"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("WaifuInfoId") + .HasColumnType("int") + .HasColumnName("waifuinfoid"); + + b.HasKey("Id") + .HasName("pk_waifuitem"); + + b.HasIndex("WaifuInfoId") + .HasDatabaseName("ix_waifuitem_waifuinfoid"); + + b.ToTable("waifuitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("NewId") + .HasColumnType("int") + .HasColumnName("newid"); + + b.Property("OldId") + .HasColumnType("int") + .HasColumnName("oldid"); + + b.Property("UpdateType") + .HasColumnType("int") + .HasColumnName("updatetype"); + + b.Property("UserId") + .HasColumnType("int") + .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.Services.Database.Models.Warning", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Forgiven") + .HasColumnType("tinyint(1)") + .HasColumnName("forgiven"); + + b.Property("ForgivenBy") + .HasColumnType("longtext") + .HasColumnName("forgivenby"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Moderator") + .HasColumnType("longtext") + .HasColumnName("moderator"); + + b.Property("Reason") + .HasColumnType("longtext") + .HasColumnName("reason"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.WarningPunishment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Count") + .HasColumnType("int") + .HasColumnName("count"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Punishment") + .HasColumnType("int") + .HasColumnName("punishment"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("Time") + .HasColumnType("int") + .HasColumnName("time"); + + b.HasKey("Id") + .HasName("pk_warningpunishment"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_warningpunishment_guildconfigid"); + + b.ToTable("warningpunishment", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("int") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_xpcurrencyreward"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_xpcurrencyreward_xpsettingsid"); + + b.ToTable("xpcurrencyreward", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("Remove") + .HasColumnType("tinyint(1)") + .HasColumnName("remove"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .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.Services.Database.Models.XpSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("ServerExcluded") + .HasColumnType("tinyint(1)") + .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.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.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.FollowedStream", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FollowedStreams") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithOne("AntiAltSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiAltSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiRaidSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiRaidSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.HasOne("EllieBot.Services.Database.Models.AntiSpamSetting", null) + .WithMany("IgnoredChannels") + .HasForeignKey("AntiSpamSettingId") + .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiSpamSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiSpamSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.AutoTranslateChannel", "Channel") + .WithMany("Users") + .HasForeignKey("ChannelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); + + b.Navigation("Channel"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandAliases") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandCooldowns") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("DelMsgOnCmdChannels") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", null) + .WithMany("ExclusionList") + .HasForeignKey("XpSettingsId") + .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("FeedSubs") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_feedsub_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterInvitesChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilteredWords") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterLinksChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterWordsChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("GenerateCurrencyChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("SelfAssignableRoleGroupNames") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_groupname_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany("LogIgnores") + .HasForeignKey("LogSettingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ignoredlogchannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany() + .HasForeignKey("LogSettingId") + .HasConstraintName("fk_ignoredvoicepresencechannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("MutedUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("Permissions") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlaylistSong", b => + { + b.HasOne("EllieBot.Services.Database.Models.MusicPlaylist", null) + .WithMany("Songs") + .HasForeignKey("MusicPlaylistId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Answers") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollanswer_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Votes") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollvote_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ReactionRole", b => + { + b.HasOne("EllieBot.Services.Database.Models.ReactionRoleMessage", null) + .WithMany("ReactionRoles") + .HasForeignKey("ReactionRoleMessageId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_reactionrole_reactionrolemessage_reactionrolemessageid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ReactionRoleMessage", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("ReactionRoleMessages") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_reactionrolemessage_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("ShopEntries") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.ShopEntry", null) + .WithMany("Items") + .HasForeignKey("ShopEntryId") + .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredRoles") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Blacklist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("StreamRole") + .HasForeignKey("EllieBot.Services.Database.Models.StreamRoleSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Whitelist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnbanTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnmuteTimers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnroleTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.VcRoleInfo", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("VcRoleInfos") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WaifuInfo", "WaifuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); + + b.Navigation("Affinity"); + + b.Navigation("Claimer"); + + b.Navigation("Waifu"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.WaifuInfo", "WaifuInfo") + .WithMany("Items") + .HasForeignKey("WaifuInfoId") + .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); + + b.Navigation("WaifuInfo"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WarningPunishment", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("WarnPunishments") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_warningpunishment_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("CurrencyRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpcurrencyreward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("RoleRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xprolereward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("XpSettings") + .HasForeignKey("EllieBot.Services.Database.Models.XpSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => + { + b.Navigation("Applicants"); + + b.Navigation("Bans"); + + b.Navigation("Members"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Navigation("IgnoredChannels"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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("ReactionRoleMessages"); + + 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.Services.Database.Models.LogSetting", b => + { + b.Navigation("LogIgnores"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlaylist", b => + { + b.Navigation("Songs"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Navigation("Answers"); + + b.Navigation("Votes"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ReactionRoleMessage", b => + { + b.Navigation("ReactionRoles"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Navigation("Blacklist"); + + b.Navigation("Whitelist"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.Navigation("CurrencyRewards"); + + b.Navigation("ExclusionList"); + + b.Navigation("RoleRewards"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220429044757_bank.cs b/src/EllieBot/Migrations/Mysql/20220429044757_bank.cs new file mode 100644 index 0000000..73e42f7 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220429044757_bank.cs @@ -0,0 +1,42 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + public partial class bank : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "bankusers", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + userid = table.Column(type: "bigint unsigned", nullable: false), + balance = table.Column(type: "bigint", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_bankusers", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "ix_bankusers_userid", + table: "bankusers", + column: "userid", + unique: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "bankusers"); + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220504162509_new-rero.Designer.cs b/src/EllieBot/Migrations/Mysql/20220504162509_new-rero.Designer.cs new file mode 100644 index 0000000..207ba53 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220504162509_new-rero.Designer.cs @@ -0,0 +1,3411 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using EllieBot.Services.Database; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + [DbContext(typeof(MysqlContext))] + [Migration("20220504162509_new-rero")] + partial class newrero + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Balance") + .HasColumnType("bigint") + .HasColumnName("balance"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.ClubApplicants", b => + { + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Description") + .HasColumnType("longtext") + .HasColumnName("description"); + + b.Property("ImageUrl") + .HasColumnType("longtext") + .HasColumnName("imageurl"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("name") + .UseCollation("utf8mb4_bin"); + + b.Property("OwnerId") + .HasColumnType("int") + .HasColumnName("ownerid"); + + b.Property("Xp") + .HasColumnType("int") + .HasColumnName("xp"); + + b.HasKey("Id") + .HasName("pk_clubs"); + + b.HasAlternateKey("Name") + .HasName("ak_clubs_name"); + + b.HasIndex("OwnerId") + .IsUnique() + .HasDatabaseName("ix_clubs_ownerid"); + + b.ToTable("clubs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AvatarId") + .HasColumnType("longtext") + .HasColumnName("avatarid"); + + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("CurrencyAmount") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("currencyamount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Discriminator") + .HasColumnType("longtext") + .HasColumnName("discriminator"); + + b.Property("IsClubAdmin") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("isclubadmin"); + + b.Property("LastLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastlevelup") + .HasDefaultValueSql("(UTC_TIMESTAMP)"); + + b.Property("LastXpGain") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastxpgain") + .HasDefaultValueSql("(UTC_TIMESTAMP - INTERVAL 1 year)"); + + b.Property("NotifyOnLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("notifyonlevelup"); + + b.Property("TotalXp") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("totalxp"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .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.FollowedStream", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_followedstream"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_followedstream_guildconfigid"); + + b.ToTable("followedstream", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("ActionDurationMinutes") + .HasColumnType("int") + .HasColumnName("actiondurationminutes"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MinAge") + .HasColumnType("time(6)") + .HasColumnName("minage"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antialtsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antialtsetting_guildconfigid"); + + b.ToTable("antialtsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("PunishDuration") + .HasColumnType("int") + .HasColumnName("punishduration"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.Property("UserThreshold") + .HasColumnType("int") + .HasColumnName("userthreshold"); + + b.HasKey("Id") + .HasName("pk_antiraidsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antiraidsetting_guildconfigid"); + + b.ToTable("antiraidsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AntiSpamSettingId") + .HasColumnType("int") + .HasColumnName("antispamsettingid"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.HasKey("Id") + .HasName("pk_antispamignore"); + + b.HasIndex("AntiSpamSettingId") + .HasDatabaseName("ix_antispamignore_antispamsettingid"); + + b.ToTable("antispamignore", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MessageThreshold") + .HasColumnType("int") + .HasColumnName("messagethreshold"); + + b.Property("MuteTime") + .HasColumnType("int") + .HasColumnName("mutetime"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antispamsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antispamsetting_guildconfigid"); + + b.ToTable("antispamsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoCommand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("ChannelName") + .HasColumnType("longtext") + .HasColumnName("channelname"); + + b.Property("CommandText") + .HasColumnType("longtext") + .HasColumnName("commandtext"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("GuildName") + .HasColumnType("longtext") + .HasColumnName("guildname"); + + b.Property("Interval") + .HasColumnType("int") + .HasColumnName("interval"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.Property("VoiceChannelName") + .HasColumnType("longtext") + .HasColumnName("voicechannelname"); + + b.HasKey("Id") + .HasName("pk_autocommands"); + + b.ToTable("autocommands", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDelete") + .HasColumnType("tinyint(1)") + .HasColumnName("autodelete"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_autotranslatechannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_autotranslatechannels_channelid"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_autotranslatechannels_guildid"); + + b.ToTable("autotranslatechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("int") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Source") + .HasColumnType("longtext") + .HasColumnName("source"); + + b.Property("Target") + .HasColumnType("longtext") + .HasColumnName("target"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_autotranslateusers"); + + b.HasAlternateKey("ChannelId", "UserId") + .HasName("ak_autotranslateusers_channelid_userid"); + + b.ToTable("autotranslateusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BanTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_bantemplates"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_bantemplates_guildid"); + + b.ToTable("bantemplates", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BlacklistEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_blacklist"); + + b.ToTable("blacklist", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Mapping") + .HasColumnType("longtext") + .HasColumnName("mapping"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_commandalias"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandalias_guildconfigid"); + + b.ToTable("commandalias", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("CommandName") + .HasColumnType("longtext") + .HasColumnName("commandname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.HasKey("Id") + .HasName("pk_commandcooldown"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandcooldown_guildconfigid"); + + b.ToTable("commandcooldown", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CurrencyTransaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Extra") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("extra"); + + b.Property("Note") + .HasColumnType("longtext") + .HasColumnName("note"); + + b.Property("OtherId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("otherid") + .HasDefaultValueSql("NULL"); + + b.Property("Type") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("type"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_currencytransactions"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_currencytransactions_userid"); + + b.ToTable("currencytransactions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_delmsgoncmdchannel"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); + + b.ToTable("delmsgoncmdchannel", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DiscordPermOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Command") + .HasColumnType("varchar(255)") + .HasColumnName("command"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Perm") + .HasColumnType("bigint unsigned") + .HasColumnName("perm"); + + b.HasKey("Id") + .HasName("pk_discordpermoverrides"); + + b.HasIndex("GuildId", "Command") + .IsUnique() + .HasDatabaseName("ix_discordpermoverrides_guildid_command"); + + b.ToTable("discordpermoverrides", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_excludeditem"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_excludeditem_xpsettingsid"); + + b.ToTable("excludeditem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Url") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("url"); + + b.HasKey("Id") + .HasName("pk_feedsub"); + + b.HasAlternateKey("GuildConfigId", "Url") + .HasName("ak_feedsub_guildconfigid_url"); + + b.ToTable("feedsub", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterchannelid_guildconfigid"); + + b.ToTable("filterchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Word") + .HasColumnType("longtext") + .HasColumnName("word"); + + b.HasKey("Id") + .HasName("pk_filteredword"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filteredword_guildconfigid"); + + b.ToTable("filteredword", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterlinkschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); + + b.ToTable("filterlinkschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterwordschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); + + b.ToTable("filterwordschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_gcchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_gcchannelid_guildconfigid"); + + b.ToTable("gcchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Number") + .HasColumnType("int") + .HasColumnName("number"); + + b.HasKey("Id") + .HasName("pk_groupname"); + + b.HasIndex("GuildConfigId", "Number") + .IsUnique() + .HasDatabaseName("ix_groupname_guildconfigid_number"); + + b.ToTable("groupname", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GuildConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoAssignRoleIds") + .HasColumnType("longtext") + .HasColumnName("autoassignroleids"); + + b.Property("AutoDeleteByeMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletebyemessagestimer"); + + b.Property("AutoDeleteGreetMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletegreetmessagestimer"); + + b.Property("AutoDeleteSelfAssignedRoleMessages") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeleteselfassignedrolemessages"); + + b.Property("BoostMessage") + .HasColumnType("longtext") + .HasColumnName("boostmessage"); + + b.Property("BoostMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("boostmessagechannelid"); + + b.Property("BoostMessageDeleteAfter") + .HasColumnType("int") + .HasColumnName("boostmessagedeleteafter"); + + b.Property("ByeMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("byemessagechannelid"); + + b.Property("ChannelByeMessageText") + .HasColumnType("longtext") + .HasColumnName("channelbyemessagetext"); + + b.Property("ChannelGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("channelgreetmessagetext"); + + b.Property("CleverbotEnabled") + .HasColumnType("tinyint(1)") + .HasColumnName("cleverbotenabled"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DeleteMessageOnCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("deletemessageoncommand"); + + b.Property("DeleteStreamOnlineMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("deletestreamonlinemessage"); + + b.Property("DmGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("dmgreetmessagetext"); + + b.Property("ExclusiveSelfAssignedRoles") + .HasColumnType("tinyint(1)") + .HasColumnName("exclusiveselfassignedroles"); + + b.Property("FilterInvites") + .HasColumnType("tinyint(1)") + .HasColumnName("filterinvites"); + + b.Property("FilterLinks") + .HasColumnType("tinyint(1)") + .HasColumnName("filterlinks"); + + b.Property("FilterWords") + .HasColumnType("tinyint(1)") + .HasColumnName("filterwords"); + + b.Property("GameVoiceChannel") + .HasColumnType("bigint unsigned") + .HasColumnName("gamevoicechannel"); + + b.Property("GreetMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("greetmessagechannelid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Locale") + .HasColumnType("longtext") + .HasColumnName("locale"); + + b.Property("MuteRoleName") + .HasColumnType("longtext") + .HasColumnName("muterolename"); + + b.Property("NotifyStreamOffline") + .HasColumnType("tinyint(1)") + .HasColumnName("notifystreamoffline"); + + b.Property("PermissionRole") + .HasColumnType("longtext") + .HasColumnName("permissionrole"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasColumnName("prefix"); + + b.Property("SendBoostMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendboostmessage"); + + b.Property("SendChannelByeMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelbyemessage"); + + b.Property("SendChannelGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelgreetmessage"); + + b.Property("SendDmGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("senddmgreetmessage"); + + b.Property("TimeZoneId") + .HasColumnType("longtext") + .HasColumnName("timezoneid"); + + b.Property("VerboseErrors") + .HasColumnType("tinyint(1)") + .HasColumnName("verboseerrors"); + + b.Property("VerbosePermissions") + .HasColumnType("tinyint(1)") + .HasColumnName("verbosepermissions"); + + b.Property("WarnExpireAction") + .HasColumnType("int") + .HasColumnName("warnexpireaction"); + + b.Property("WarnExpireHours") + .HasColumnType("int") + .HasColumnName("warnexpirehours"); + + b.Property("WarningsInitialized") + .HasColumnType("tinyint(1)") + .HasColumnName("warningsinitialized"); + + b.HasKey("Id") + .HasName("pk_guildconfigs"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_guildconfigs_guildid"); + + b.HasIndex("WarnExpireHours") + .HasDatabaseName("ix_guildconfigs_warnexpirehours"); + + b.ToTable("guildconfigs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("LogItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("logitemid"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredlogchannels"); + + b.HasIndex("LogSettingId", "LogItemId", "ItemType") + .IsUnique() + .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype"); + + b.ToTable("ignoredlogchannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredvoicepresencechannels"); + + b.HasIndex("LogSettingId") + .HasDatabaseName("ix_ignoredvoicepresencechannels_logsettingid"); + + b.ToTable("ignoredvoicepresencechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ImageOnlyChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_imageonlychannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_imageonlychannels_channelid"); + + b.ToTable("imageonlychannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.LogSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelCreatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelcreatedid"); + + b.Property("ChannelDestroyedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channeldestroyedid"); + + b.Property("ChannelUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelupdatedid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LogOtherId") + .HasColumnType("bigint unsigned") + .HasColumnName("logotherid"); + + b.Property("LogUserPresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("loguserpresenceid"); + + b.Property("LogVoicePresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresenceid"); + + b.Property("LogVoicePresenceTTSId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresencettsid"); + + b.Property("MessageDeletedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messagedeletedid"); + + b.Property("MessageUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageupdatedid"); + + b.Property("UserBannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userbannedid"); + + b.Property("UserJoinedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userjoinedid"); + + b.Property("UserLeftId") + .HasColumnType("bigint unsigned") + .HasColumnName("userleftid"); + + b.Property("UserMutedId") + .HasColumnType("bigint unsigned") + .HasColumnName("usermutedid"); + + b.Property("UserUnbannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userunbannedid"); + + b.Property("UserUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userupdatedid"); + + b.HasKey("Id") + .HasName("pk_logsettings"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_logsettings_guildid"); + + b.ToTable("logsettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlayerSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDisconnect") + .HasColumnType("tinyint(1)") + .HasColumnName("autodisconnect"); + + b.Property("AutoPlay") + .HasColumnType("tinyint(1)") + .HasColumnName("autoplay"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MusicChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("musicchannelid"); + + b.Property("PlayerRepeat") + .HasColumnType("int") + .HasColumnName("playerrepeat"); + + b.Property("QualityPreset") + .HasColumnType("int") + .HasColumnName("qualitypreset"); + + b.Property("Volume") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .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.Services.Database.Models.MusicPlaylist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Author") + .HasColumnType("longtext") + .HasColumnName("author"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.HasKey("Id") + .HasName("pk_musicplaylists"); + + b.ToTable("musicplaylists", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_muteduserid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_muteduserid_guildconfigid"); + + b.ToTable("muteduserid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AllowTarget") + .HasColumnType("tinyint(1)") + .HasColumnName("allowtarget"); + + b.Property("AutoDeleteTrigger") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeletetrigger"); + + b.Property("ContainsAnywhere") + .HasColumnType("tinyint(1)") + .HasColumnName("containsanywhere"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DmResponse") + .HasColumnType("tinyint(1)") + .HasColumnName("dmresponse"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Reactions") + .HasColumnType("longtext") + .HasColumnName("reactions"); + + b.Property("Response") + .HasColumnType("longtext") + .HasColumnName("response"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_expressions"); + + b.ToTable("expressions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NsfwBlacklistedTag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Tag") + .HasColumnType("longtext") + .HasColumnName("tag"); + + b.HasKey("Id") + .HasName("pk_nsfwblacklistedtags"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_nsfwblacklistedtags_guildid"); + + b.ToTable("nsfwblacklistedtags", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("IsCustomCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("iscustomcommand"); + + b.Property("PrimaryTarget") + .HasColumnType("int") + .HasColumnName("primarytarget"); + + b.Property("PrimaryTargetId") + .HasColumnType("bigint unsigned") + .HasColumnName("primarytargetid"); + + b.Property("SecondaryTarget") + .HasColumnType("int") + .HasColumnName("secondarytarget"); + + b.Property("SecondaryTargetName") + .HasColumnType("longtext") + .HasColumnName("secondarytargetname"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_permissions"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_permissions_guildconfigid"); + + b.ToTable("permissions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlantedCurrency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Password") + .HasColumnType("longtext") + .HasColumnName("password"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.PlaylistSong", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MusicPlaylistId") + .HasColumnType("int") + .HasColumnName("musicplaylistid"); + + b.Property("Provider") + .HasColumnType("longtext") + .HasColumnName("provider"); + + b.Property("ProviderType") + .HasColumnType("int") + .HasColumnName("providertype"); + + b.Property("Query") + .HasColumnType("longtext") + .HasColumnName("query"); + + b.Property("Title") + .HasColumnType("longtext") + .HasColumnName("title"); + + b.Property("Uri") + .HasColumnType("longtext") + .HasColumnName("uri"); + + b.HasKey("Id") + .HasName("pk_playlistsong"); + + b.HasIndex("MusicPlaylistId") + .HasDatabaseName("ix_playlistsong_musicplaylistid"); + + b.ToTable("playlistsong", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Question") + .HasColumnType("longtext") + .HasColumnName("question"); + + b.HasKey("Id") + .HasName("pk_poll"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_poll_guildid"); + + b.ToTable("poll", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_pollanswer"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollanswer_pollid"); + + b.ToTable("pollanswer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("VoteIndex") + .HasColumnType("int") + .HasColumnName("voteindex"); + + b.HasKey("Id") + .HasName("pk_pollvote"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollvote_pollid"); + + b.ToTable("pollvote", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Quote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("AuthorName") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("authorname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Keyword") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("keyword"); + + b.Property("Text") + .IsRequired() + .HasColumnType("longtext") + .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.Services.Database.Models.ReactionRoleV2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Emote") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("emote"); + + b.Property("Group") + .HasColumnType("int") + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelReq") + .HasColumnType("int") + .HasColumnName("levelreq"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.Reminder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsPrivate") + .HasColumnType("tinyint(1)") + .HasColumnName("isprivate"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("ServerId") + .HasColumnType("bigint unsigned") + .HasColumnName("serverid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("When") + .HasColumnType("datetime(6)") + .HasColumnName("when"); + + b.HasKey("Id") + .HasName("pk_reminders"); + + b.HasIndex("When") + .HasDatabaseName("ix_reminders_when"); + + b.ToTable("reminders", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Repeater", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Interval") + .HasColumnType("time(6)") + .HasColumnName("interval"); + + b.Property("LastMessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("lastmessageid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("NoRedundant") + .HasColumnType("tinyint(1)") + .HasColumnName("noredundant"); + + b.Property("StartTimeOfDay") + .HasColumnType("time(6)") + .HasColumnName("starttimeofday"); + + b.HasKey("Id") + .HasName("pk_repeaters"); + + b.ToTable("repeaters", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RewardedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AmountRewardedThisMonth") + .HasColumnType("int") + .HasColumnName("amountrewardedthismonth"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LastReward") + .HasColumnType("datetime(6)") + .HasColumnName("lastreward"); + + b.Property("PatreonUserId") + .HasColumnType("varchar(255)") + .HasColumnName("patreonuserid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_rewardedusers"); + + b.HasIndex("PatreonUserId") + .IsUnique() + .HasDatabaseName("ix_rewardedusers_patreonuserid"); + + b.ToTable("rewardedusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RotatingPlayingStatus", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Status") + .HasColumnType("longtext") + .HasColumnName("status"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_rotatingstatus"); + + b.ToTable("rotatingstatus", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SelfAssignedRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Group") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelRequirement") + .HasColumnType("int") + .HasColumnName("levelrequirement"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.ShopEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Price") + .HasColumnType("int") + .HasColumnName("price"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("RoleName") + .HasColumnType("longtext") + .HasColumnName("rolename"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_shopentry"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_shopentry_guildconfigid"); + + b.ToTable("shopentry", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ShopEntryId") + .HasColumnType("int") + .HasColumnName("shopentryid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_shopentryitem"); + + b.HasIndex("ShopEntryId") + .HasDatabaseName("ix_shopentryitem_shopentryid"); + + b.ToTable("shopentryitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoredrole"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoredrole_guildconfigid"); + + b.ToTable("slowmodeignoredrole", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoreduser"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoreduser_guildconfigid"); + + b.ToTable("slowmodeignoreduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamroleblacklisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamroleblacklisteduser_streamrolesettingsid"); + + b.ToTable("streamroleblacklisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AddRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("addroleid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)") + .HasColumnName("enabled"); + + b.Property("FromRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("fromroleid"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Keyword") + .HasColumnType("longtext") + .HasColumnName("keyword"); + + b.HasKey("Id") + .HasName("pk_streamrolesettings"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_streamrolesettings_guildconfigid"); + + b.ToTable("streamrolesettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamrolewhitelisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamrolewhitelisteduser_streamrolesettingsid"); + + b.ToTable("streamrolewhitelisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unbantimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unbantimer_guildconfigid"); + + b.ToTable("unbantimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnmuteAt") + .HasColumnType("datetime(6)") + .HasColumnName("unmuteat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unmutetimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unmutetimer_guildconfigid"); + + b.ToTable("unmutetimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unroletimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unroletimer_guildconfigid"); + + b.ToTable("unroletimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UserXpStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AwardedXp") + .HasColumnType("int") + .HasColumnName("awardedxp"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LastLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastlevelup") + .HasDefaultValueSql("(UTC_TIMESTAMP)"); + + b.Property("NotifyOnLevelUp") + .HasColumnType("int") + .HasColumnName("notifyonlevelup"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Xp") + .HasColumnType("int") + .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.Services.Database.Models.VcRoleInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.HasKey("Id") + .HasName("pk_vcroleinfo"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_vcroleinfo_guildconfigid"); + + b.ToTable("vcroleinfo", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AffinityId") + .HasColumnType("int") + .HasColumnName("affinityid"); + + b.Property("ClaimerId") + .HasColumnType("int") + .HasColumnName("claimerid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Price") + .HasColumnType("bigint") + .HasColumnName("price"); + + b.Property("WaifuId") + .HasColumnType("int") + .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.Services.Database.Models.WaifuItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemEmoji") + .HasColumnType("longtext") + .HasColumnName("itememoji"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("WaifuInfoId") + .HasColumnType("int") + .HasColumnName("waifuinfoid"); + + b.HasKey("Id") + .HasName("pk_waifuitem"); + + b.HasIndex("WaifuInfoId") + .HasDatabaseName("ix_waifuitem_waifuinfoid"); + + b.ToTable("waifuitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("NewId") + .HasColumnType("int") + .HasColumnName("newid"); + + b.Property("OldId") + .HasColumnType("int") + .HasColumnName("oldid"); + + b.Property("UpdateType") + .HasColumnType("int") + .HasColumnName("updatetype"); + + b.Property("UserId") + .HasColumnType("int") + .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.Services.Database.Models.Warning", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Forgiven") + .HasColumnType("tinyint(1)") + .HasColumnName("forgiven"); + + b.Property("ForgivenBy") + .HasColumnType("longtext") + .HasColumnName("forgivenby"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Moderator") + .HasColumnType("longtext") + .HasColumnName("moderator"); + + b.Property("Reason") + .HasColumnType("longtext") + .HasColumnName("reason"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.WarningPunishment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Count") + .HasColumnType("int") + .HasColumnName("count"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Punishment") + .HasColumnType("int") + .HasColumnName("punishment"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("Time") + .HasColumnType("int") + .HasColumnName("time"); + + b.HasKey("Id") + .HasName("pk_warningpunishment"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_warningpunishment_guildconfigid"); + + b.ToTable("warningpunishment", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("int") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_xpcurrencyreward"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_xpcurrencyreward_xpsettingsid"); + + b.ToTable("xpcurrencyreward", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("Remove") + .HasColumnType("tinyint(1)") + .HasColumnName("remove"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .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.Services.Database.Models.XpSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("ServerExcluded") + .HasColumnType("tinyint(1)") + .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.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.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.FollowedStream", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FollowedStreams") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithOne("AntiAltSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiAltSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiRaidSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiRaidSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.HasOne("EllieBot.Services.Database.Models.AntiSpamSetting", null) + .WithMany("IgnoredChannels") + .HasForeignKey("AntiSpamSettingId") + .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiSpamSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiSpamSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.AutoTranslateChannel", "Channel") + .WithMany("Users") + .HasForeignKey("ChannelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); + + b.Navigation("Channel"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandAliases") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandCooldowns") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("DelMsgOnCmdChannels") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", null) + .WithMany("ExclusionList") + .HasForeignKey("XpSettingsId") + .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("FeedSubs") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_feedsub_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterInvitesChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilteredWords") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterLinksChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterWordsChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("GenerateCurrencyChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("SelfAssignableRoleGroupNames") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_groupname_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany("LogIgnores") + .HasForeignKey("LogSettingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ignoredlogchannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany() + .HasForeignKey("LogSettingId") + .HasConstraintName("fk_ignoredvoicepresencechannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("MutedUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("Permissions") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlaylistSong", b => + { + b.HasOne("EllieBot.Services.Database.Models.MusicPlaylist", null) + .WithMany("Songs") + .HasForeignKey("MusicPlaylistId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Answers") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollanswer_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Votes") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollvote_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("ShopEntries") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.ShopEntry", null) + .WithMany("Items") + .HasForeignKey("ShopEntryId") + .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredRoles") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Blacklist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("StreamRole") + .HasForeignKey("EllieBot.Services.Database.Models.StreamRoleSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Whitelist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnbanTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnmuteTimers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnroleTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.VcRoleInfo", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("VcRoleInfos") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WaifuInfo", "WaifuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); + + b.Navigation("Affinity"); + + b.Navigation("Claimer"); + + b.Navigation("Waifu"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.WaifuInfo", "WaifuInfo") + .WithMany("Items") + .HasForeignKey("WaifuInfoId") + .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); + + b.Navigation("WaifuInfo"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WarningPunishment", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("WarnPunishments") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_warningpunishment_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("CurrencyRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpcurrencyreward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("RoleRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xprolereward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("XpSettings") + .HasForeignKey("EllieBot.Services.Database.Models.XpSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => + { + b.Navigation("Applicants"); + + b.Navigation("Bans"); + + b.Navigation("Members"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Navigation("IgnoredChannels"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.LogSetting", b => + { + b.Navigation("LogIgnores"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlaylist", b => + { + b.Navigation("Songs"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Navigation("Answers"); + + b.Navigation("Votes"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Navigation("Blacklist"); + + b.Navigation("Whitelist"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.Navigation("CurrencyRewards"); + + b.Navigation("ExclusionList"); + + b.Navigation("RoleRewards"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220504162509_new-rero.cs b/src/EllieBot/Migrations/Mysql/20220504162509_new-rero.cs new file mode 100644 index 0000000..e94af0b --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220504162509_new-rero.cs @@ -0,0 +1,121 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + public partial class newrero : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + + migrationBuilder.CreateTable( + name: "reactionroles", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildid = table.Column(type: "bigint unsigned", nullable: false), + channelid = table.Column(type: "bigint unsigned", nullable: false), + messageid = table.Column(type: "bigint unsigned", nullable: false), + emote = table.Column(type: "varchar(100)", maxLength: 100, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + roleid = table.Column(type: "bigint unsigned", nullable: false), + group = table.Column(type: "int", nullable: false), + levelreq = table.Column(type: "int", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_reactionroles", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "ix_reactionroles_guildid", + table: "reactionroles", + column: "guildid"); + + migrationBuilder.CreateIndex( + name: "ix_reactionroles_messageid_emote", + table: "reactionroles", + columns: new[] { "messageid", "emote" }, + unique: true); + + MigrationQueries.MigrateRero(migrationBuilder); + + migrationBuilder.DropTable( + name: "reactionrole"); + + migrationBuilder.DropTable( + name: "reactionrolemessage"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "reactionroles"); + + migrationBuilder.CreateTable( + name: "reactionrolemessage", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildconfigid = table.Column(type: "int", nullable: false), + channelid = table.Column(type: "bigint unsigned", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true), + exclusive = table.Column(type: "tinyint(1)", nullable: false), + index = table.Column(type: "int", nullable: false), + messageid = table.Column(type: "bigint unsigned", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_reactionrolemessage", x => x.id); + table.ForeignKey( + name: "fk_reactionrolemessage_guildconfigs_guildconfigid", + column: x => x.guildconfigid, + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "reactionrole", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + dateadded = table.Column(type: "datetime(6)", nullable: true), + emotename = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + reactionrolemessageid = table.Column(type: "int", nullable: true), + roleid = table.Column(type: "bigint unsigned", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_reactionrole", x => x.id); + table.ForeignKey( + name: "fk_reactionrole_reactionrolemessage_reactionrolemessageid", + column: x => x.reactionrolemessageid, + principalTable: "reactionrolemessage", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "ix_reactionrole_reactionrolemessageid", + table: "reactionrole", + column: "reactionrolemessageid"); + + migrationBuilder.CreateIndex( + name: "ix_reactionrolemessage_guildconfigid", + table: "reactionrolemessage", + column: "guildconfigid"); + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220614071410_patronage-system.Designer.cs b/src/EllieBot/Migrations/Mysql/20220614071410_patronage-system.Designer.cs new file mode 100644 index 0000000..27b18ac --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220614071410_patronage-system.Designer.cs @@ -0,0 +1,3481 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using EllieBot.Services.Database; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + [DbContext(typeof(MysqlContext))] + [Migration("20220614071410_patronage-system")] + partial class patronagesystem + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Balance") + .HasColumnType("bigint") + .HasColumnName("balance"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.ClubApplicants", b => + { + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Description") + .HasColumnType("longtext") + .HasColumnName("description"); + + b.Property("ImageUrl") + .HasColumnType("longtext") + .HasColumnName("imageurl"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("name") + .UseCollation("utf8mb4_bin"); + + b.Property("OwnerId") + .HasColumnType("int") + .HasColumnName("ownerid"); + + b.Property("Xp") + .HasColumnType("int") + .HasColumnName("xp"); + + b.HasKey("Id") + .HasName("pk_clubs"); + + b.HasAlternateKey("Name") + .HasName("ak_clubs_name"); + + b.HasIndex("OwnerId") + .IsUnique() + .HasDatabaseName("ix_clubs_ownerid"); + + b.ToTable("clubs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AvatarId") + .HasColumnType("longtext") + .HasColumnName("avatarid"); + + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("CurrencyAmount") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("currencyamount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Discriminator") + .HasColumnType("longtext") + .HasColumnName("discriminator"); + + b.Property("IsClubAdmin") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("isclubadmin"); + + b.Property("LastLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastlevelup") + .HasDefaultValueSql("(UTC_TIMESTAMP)"); + + b.Property("LastXpGain") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastxpgain") + .HasDefaultValueSql("(UTC_TIMESTAMP - INTERVAL 1 year)"); + + b.Property("NotifyOnLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("notifyonlevelup"); + + b.Property("TotalXp") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("totalxp"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .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.FollowedStream", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.Property("Username") + .HasColumnType("longtext") + .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.PatronQuota", b => + { + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("FeatureType") + .HasColumnType("int") + .HasColumnName("featuretype"); + + b.Property("Feature") + .HasColumnType("varchar(255)") + .HasColumnName("feature"); + + b.Property("DailyCount") + .HasColumnType("int unsigned") + .HasColumnName("dailycount"); + + b.Property("HourlyCount") + .HasColumnType("int unsigned") + .HasColumnName("hourlycount"); + + b.Property("MonthlyCount") + .HasColumnType("int unsigned") + .HasColumnName("monthlycount"); + + b.HasKey("UserId", "FeatureType", "Feature") + .HasName("pk_patronquotas"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_patronquotas_userid"); + + b.ToTable("patronquotas", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => + { + b.Property("UserId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("AmountCents") + .HasColumnType("int") + .HasColumnName("amountcents"); + + b.Property("LastCharge") + .HasColumnType("datetime(6)") + .HasColumnName("lastcharge"); + + b.Property("UniquePlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("uniqueplatformuserid"); + + b.Property("ValidThru") + .HasColumnType("datetime(6)") + .HasColumnName("validthru"); + + b.HasKey("UserId") + .HasName("pk_patrons"); + + b.HasIndex("UniquePlatformUserId") + .IsUnique() + .HasDatabaseName("ix_patrons_uniqueplatformuserid"); + + b.ToTable("patrons", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("ActionDurationMinutes") + .HasColumnType("int") + .HasColumnName("actiondurationminutes"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MinAge") + .HasColumnType("time(6)") + .HasColumnName("minage"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antialtsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antialtsetting_guildconfigid"); + + b.ToTable("antialtsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("PunishDuration") + .HasColumnType("int") + .HasColumnName("punishduration"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.Property("UserThreshold") + .HasColumnType("int") + .HasColumnName("userthreshold"); + + b.HasKey("Id") + .HasName("pk_antiraidsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antiraidsetting_guildconfigid"); + + b.ToTable("antiraidsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AntiSpamSettingId") + .HasColumnType("int") + .HasColumnName("antispamsettingid"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.HasKey("Id") + .HasName("pk_antispamignore"); + + b.HasIndex("AntiSpamSettingId") + .HasDatabaseName("ix_antispamignore_antispamsettingid"); + + b.ToTable("antispamignore", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MessageThreshold") + .HasColumnType("int") + .HasColumnName("messagethreshold"); + + b.Property("MuteTime") + .HasColumnType("int") + .HasColumnName("mutetime"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antispamsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antispamsetting_guildconfigid"); + + b.ToTable("antispamsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoCommand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("ChannelName") + .HasColumnType("longtext") + .HasColumnName("channelname"); + + b.Property("CommandText") + .HasColumnType("longtext") + .HasColumnName("commandtext"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("GuildName") + .HasColumnType("longtext") + .HasColumnName("guildname"); + + b.Property("Interval") + .HasColumnType("int") + .HasColumnName("interval"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.Property("VoiceChannelName") + .HasColumnType("longtext") + .HasColumnName("voicechannelname"); + + b.HasKey("Id") + .HasName("pk_autocommands"); + + b.ToTable("autocommands", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDelete") + .HasColumnType("tinyint(1)") + .HasColumnName("autodelete"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_autotranslatechannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_autotranslatechannels_channelid"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_autotranslatechannels_guildid"); + + b.ToTable("autotranslatechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("int") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Source") + .HasColumnType("longtext") + .HasColumnName("source"); + + b.Property("Target") + .HasColumnType("longtext") + .HasColumnName("target"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_autotranslateusers"); + + b.HasAlternateKey("ChannelId", "UserId") + .HasName("ak_autotranslateusers_channelid_userid"); + + b.ToTable("autotranslateusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BanTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_bantemplates"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_bantemplates_guildid"); + + b.ToTable("bantemplates", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BlacklistEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_blacklist"); + + b.ToTable("blacklist", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Mapping") + .HasColumnType("longtext") + .HasColumnName("mapping"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_commandalias"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandalias_guildconfigid"); + + b.ToTable("commandalias", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("CommandName") + .HasColumnType("longtext") + .HasColumnName("commandname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.HasKey("Id") + .HasName("pk_commandcooldown"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandcooldown_guildconfigid"); + + b.ToTable("commandcooldown", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CurrencyTransaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Extra") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("extra"); + + b.Property("Note") + .HasColumnType("longtext") + .HasColumnName("note"); + + b.Property("OtherId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("otherid") + .HasDefaultValueSql("NULL"); + + b.Property("Type") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("type"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_currencytransactions"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_currencytransactions_userid"); + + b.ToTable("currencytransactions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_delmsgoncmdchannel"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); + + b.ToTable("delmsgoncmdchannel", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DiscordPermOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Command") + .HasColumnType("varchar(255)") + .HasColumnName("command"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Perm") + .HasColumnType("bigint unsigned") + .HasColumnName("perm"); + + b.HasKey("Id") + .HasName("pk_discordpermoverrides"); + + b.HasIndex("GuildId", "Command") + .IsUnique() + .HasDatabaseName("ix_discordpermoverrides_guildid_command"); + + b.ToTable("discordpermoverrides", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_excludeditem"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_excludeditem_xpsettingsid"); + + b.ToTable("excludeditem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Url") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("url"); + + b.HasKey("Id") + .HasName("pk_feedsub"); + + b.HasAlternateKey("GuildConfigId", "Url") + .HasName("ak_feedsub_guildconfigid_url"); + + b.ToTable("feedsub", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterchannelid_guildconfigid"); + + b.ToTable("filterchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Word") + .HasColumnType("longtext") + .HasColumnName("word"); + + b.HasKey("Id") + .HasName("pk_filteredword"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filteredword_guildconfigid"); + + b.ToTable("filteredword", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterlinkschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); + + b.ToTable("filterlinkschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterwordschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); + + b.ToTable("filterwordschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_gcchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_gcchannelid_guildconfigid"); + + b.ToTable("gcchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Number") + .HasColumnType("int") + .HasColumnName("number"); + + b.HasKey("Id") + .HasName("pk_groupname"); + + b.HasIndex("GuildConfigId", "Number") + .IsUnique() + .HasDatabaseName("ix_groupname_guildconfigid_number"); + + b.ToTable("groupname", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GuildConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoAssignRoleIds") + .HasColumnType("longtext") + .HasColumnName("autoassignroleids"); + + b.Property("AutoDeleteByeMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletebyemessagestimer"); + + b.Property("AutoDeleteGreetMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletegreetmessagestimer"); + + b.Property("AutoDeleteSelfAssignedRoleMessages") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeleteselfassignedrolemessages"); + + b.Property("BoostMessage") + .HasColumnType("longtext") + .HasColumnName("boostmessage"); + + b.Property("BoostMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("boostmessagechannelid"); + + b.Property("BoostMessageDeleteAfter") + .HasColumnType("int") + .HasColumnName("boostmessagedeleteafter"); + + b.Property("ByeMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("byemessagechannelid"); + + b.Property("ChannelByeMessageText") + .HasColumnType("longtext") + .HasColumnName("channelbyemessagetext"); + + b.Property("ChannelGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("channelgreetmessagetext"); + + b.Property("CleverbotEnabled") + .HasColumnType("tinyint(1)") + .HasColumnName("cleverbotenabled"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DeleteMessageOnCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("deletemessageoncommand"); + + b.Property("DeleteStreamOnlineMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("deletestreamonlinemessage"); + + b.Property("DmGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("dmgreetmessagetext"); + + b.Property("ExclusiveSelfAssignedRoles") + .HasColumnType("tinyint(1)") + .HasColumnName("exclusiveselfassignedroles"); + + b.Property("FilterInvites") + .HasColumnType("tinyint(1)") + .HasColumnName("filterinvites"); + + b.Property("FilterLinks") + .HasColumnType("tinyint(1)") + .HasColumnName("filterlinks"); + + b.Property("FilterWords") + .HasColumnType("tinyint(1)") + .HasColumnName("filterwords"); + + b.Property("GameVoiceChannel") + .HasColumnType("bigint unsigned") + .HasColumnName("gamevoicechannel"); + + b.Property("GreetMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("greetmessagechannelid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Locale") + .HasColumnType("longtext") + .HasColumnName("locale"); + + b.Property("MuteRoleName") + .HasColumnType("longtext") + .HasColumnName("muterolename"); + + b.Property("NotifyStreamOffline") + .HasColumnType("tinyint(1)") + .HasColumnName("notifystreamoffline"); + + b.Property("PermissionRole") + .HasColumnType("longtext") + .HasColumnName("permissionrole"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasColumnName("prefix"); + + b.Property("SendBoostMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendboostmessage"); + + b.Property("SendChannelByeMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelbyemessage"); + + b.Property("SendChannelGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelgreetmessage"); + + b.Property("SendDmGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("senddmgreetmessage"); + + b.Property("TimeZoneId") + .HasColumnType("longtext") + .HasColumnName("timezoneid"); + + b.Property("VerboseErrors") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true) + .HasColumnName("verboseerrors"); + + b.Property("VerbosePermissions") + .HasColumnType("tinyint(1)") + .HasColumnName("verbosepermissions"); + + b.Property("WarnExpireAction") + .HasColumnType("int") + .HasColumnName("warnexpireaction"); + + b.Property("WarnExpireHours") + .HasColumnType("int") + .HasColumnName("warnexpirehours"); + + b.Property("WarningsInitialized") + .HasColumnType("tinyint(1)") + .HasColumnName("warningsinitialized"); + + b.HasKey("Id") + .HasName("pk_guildconfigs"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_guildconfigs_guildid"); + + b.HasIndex("WarnExpireHours") + .HasDatabaseName("ix_guildconfigs_warnexpirehours"); + + b.ToTable("guildconfigs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("LogItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("logitemid"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredlogchannels"); + + b.HasIndex("LogSettingId", "LogItemId", "ItemType") + .IsUnique() + .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype"); + + b.ToTable("ignoredlogchannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredvoicepresencechannels"); + + b.HasIndex("LogSettingId") + .HasDatabaseName("ix_ignoredvoicepresencechannels_logsettingid"); + + b.ToTable("ignoredvoicepresencechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ImageOnlyChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_imageonlychannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_imageonlychannels_channelid"); + + b.ToTable("imageonlychannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.LogSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelCreatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelcreatedid"); + + b.Property("ChannelDestroyedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channeldestroyedid"); + + b.Property("ChannelUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelupdatedid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LogOtherId") + .HasColumnType("bigint unsigned") + .HasColumnName("logotherid"); + + b.Property("LogUserPresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("loguserpresenceid"); + + b.Property("LogVoicePresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresenceid"); + + b.Property("LogVoicePresenceTTSId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresencettsid"); + + b.Property("MessageDeletedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messagedeletedid"); + + b.Property("MessageUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageupdatedid"); + + b.Property("UserBannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userbannedid"); + + b.Property("UserJoinedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userjoinedid"); + + b.Property("UserLeftId") + .HasColumnType("bigint unsigned") + .HasColumnName("userleftid"); + + b.Property("UserMutedId") + .HasColumnType("bigint unsigned") + .HasColumnName("usermutedid"); + + b.Property("UserUnbannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userunbannedid"); + + b.Property("UserUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userupdatedid"); + + b.HasKey("Id") + .HasName("pk_logsettings"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_logsettings_guildid"); + + b.ToTable("logsettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlayerSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDisconnect") + .HasColumnType("tinyint(1)") + .HasColumnName("autodisconnect"); + + b.Property("AutoPlay") + .HasColumnType("tinyint(1)") + .HasColumnName("autoplay"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MusicChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("musicchannelid"); + + b.Property("PlayerRepeat") + .HasColumnType("int") + .HasColumnName("playerrepeat"); + + b.Property("QualityPreset") + .HasColumnType("int") + .HasColumnName("qualitypreset"); + + b.Property("Volume") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .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.Services.Database.Models.MusicPlaylist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Author") + .HasColumnType("longtext") + .HasColumnName("author"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.HasKey("Id") + .HasName("pk_musicplaylists"); + + b.ToTable("musicplaylists", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_muteduserid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_muteduserid_guildconfigid"); + + b.ToTable("muteduserid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AllowTarget") + .HasColumnType("tinyint(1)") + .HasColumnName("allowtarget"); + + b.Property("AutoDeleteTrigger") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeletetrigger"); + + b.Property("ContainsAnywhere") + .HasColumnType("tinyint(1)") + .HasColumnName("containsanywhere"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DmResponse") + .HasColumnType("tinyint(1)") + .HasColumnName("dmresponse"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Reactions") + .HasColumnType("longtext") + .HasColumnName("reactions"); + + b.Property("Response") + .HasColumnType("longtext") + .HasColumnName("response"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_expressions"); + + b.ToTable("expressions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NsfwBlacklistedTag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Tag") + .HasColumnType("longtext") + .HasColumnName("tag"); + + b.HasKey("Id") + .HasName("pk_nsfwblacklistedtags"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_nsfwblacklistedtags_guildid"); + + b.ToTable("nsfwblacklistedtags", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("IsCustomCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("iscustomcommand"); + + b.Property("PrimaryTarget") + .HasColumnType("int") + .HasColumnName("primarytarget"); + + b.Property("PrimaryTargetId") + .HasColumnType("bigint unsigned") + .HasColumnName("primarytargetid"); + + b.Property("SecondaryTarget") + .HasColumnType("int") + .HasColumnName("secondarytarget"); + + b.Property("SecondaryTargetName") + .HasColumnType("longtext") + .HasColumnName("secondarytargetname"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_permissions"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_permissions_guildconfigid"); + + b.ToTable("permissions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlantedCurrency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Password") + .HasColumnType("longtext") + .HasColumnName("password"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.PlaylistSong", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MusicPlaylistId") + .HasColumnType("int") + .HasColumnName("musicplaylistid"); + + b.Property("Provider") + .HasColumnType("longtext") + .HasColumnName("provider"); + + b.Property("ProviderType") + .HasColumnType("int") + .HasColumnName("providertype"); + + b.Property("Query") + .HasColumnType("longtext") + .HasColumnName("query"); + + b.Property("Title") + .HasColumnType("longtext") + .HasColumnName("title"); + + b.Property("Uri") + .HasColumnType("longtext") + .HasColumnName("uri"); + + b.HasKey("Id") + .HasName("pk_playlistsong"); + + b.HasIndex("MusicPlaylistId") + .HasDatabaseName("ix_playlistsong_musicplaylistid"); + + b.ToTable("playlistsong", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Question") + .HasColumnType("longtext") + .HasColumnName("question"); + + b.HasKey("Id") + .HasName("pk_poll"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_poll_guildid"); + + b.ToTable("poll", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_pollanswer"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollanswer_pollid"); + + b.ToTable("pollanswer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("VoteIndex") + .HasColumnType("int") + .HasColumnName("voteindex"); + + b.HasKey("Id") + .HasName("pk_pollvote"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollvote_pollid"); + + b.ToTable("pollvote", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Quote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("AuthorName") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("authorname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Keyword") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("keyword"); + + b.Property("Text") + .IsRequired() + .HasColumnType("longtext") + .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.Services.Database.Models.ReactionRoleV2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Emote") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("emote"); + + b.Property("Group") + .HasColumnType("int") + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelReq") + .HasColumnType("int") + .HasColumnName("levelreq"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.Reminder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsPrivate") + .HasColumnType("tinyint(1)") + .HasColumnName("isprivate"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("ServerId") + .HasColumnType("bigint unsigned") + .HasColumnName("serverid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("When") + .HasColumnType("datetime(6)") + .HasColumnName("when"); + + b.HasKey("Id") + .HasName("pk_reminders"); + + b.HasIndex("When") + .HasDatabaseName("ix_reminders_when"); + + b.ToTable("reminders", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Repeater", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Interval") + .HasColumnType("time(6)") + .HasColumnName("interval"); + + b.Property("LastMessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("lastmessageid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("NoRedundant") + .HasColumnType("tinyint(1)") + .HasColumnName("noredundant"); + + b.Property("StartTimeOfDay") + .HasColumnType("time(6)") + .HasColumnName("starttimeofday"); + + b.HasKey("Id") + .HasName("pk_repeaters"); + + b.ToTable("repeaters", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RewardedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AmountRewardedThisMonth") + .HasColumnType("bigint") + .HasColumnName("amountrewardedthismonth"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LastReward") + .HasColumnType("datetime(6)") + .HasColumnName("lastreward"); + + b.Property("PlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("platformuserid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_rewardedusers"); + + b.HasIndex("PlatformUserId") + .IsUnique() + .HasDatabaseName("ix_rewardedusers_platformuserid"); + + b.ToTable("rewardedusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RotatingPlayingStatus", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Status") + .HasColumnType("longtext") + .HasColumnName("status"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_rotatingstatus"); + + b.ToTable("rotatingstatus", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SelfAssignedRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Group") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelRequirement") + .HasColumnType("int") + .HasColumnName("levelrequirement"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.ShopEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Price") + .HasColumnType("int") + .HasColumnName("price"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("RoleName") + .HasColumnType("longtext") + .HasColumnName("rolename"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_shopentry"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_shopentry_guildconfigid"); + + b.ToTable("shopentry", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ShopEntryId") + .HasColumnType("int") + .HasColumnName("shopentryid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_shopentryitem"); + + b.HasIndex("ShopEntryId") + .HasDatabaseName("ix_shopentryitem_shopentryid"); + + b.ToTable("shopentryitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoredrole"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoredrole_guildconfigid"); + + b.ToTable("slowmodeignoredrole", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoreduser"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoreduser_guildconfigid"); + + b.ToTable("slowmodeignoreduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamroleblacklisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamroleblacklisteduser_streamrolesettingsid"); + + b.ToTable("streamroleblacklisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AddRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("addroleid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)") + .HasColumnName("enabled"); + + b.Property("FromRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("fromroleid"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Keyword") + .HasColumnType("longtext") + .HasColumnName("keyword"); + + b.HasKey("Id") + .HasName("pk_streamrolesettings"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_streamrolesettings_guildconfigid"); + + b.ToTable("streamrolesettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamrolewhitelisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamrolewhitelisteduser_streamrolesettingsid"); + + b.ToTable("streamrolewhitelisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unbantimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unbantimer_guildconfigid"); + + b.ToTable("unbantimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnmuteAt") + .HasColumnType("datetime(6)") + .HasColumnName("unmuteat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unmutetimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unmutetimer_guildconfigid"); + + b.ToTable("unmutetimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unroletimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unroletimer_guildconfigid"); + + b.ToTable("unroletimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UserXpStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AwardedXp") + .HasColumnType("bigint") + .HasColumnName("awardedxp"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LastLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastlevelup") + .HasDefaultValueSql("(UTC_TIMESTAMP)"); + + b.Property("NotifyOnLevelUp") + .HasColumnType("int") + .HasColumnName("notifyonlevelup"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.VcRoleInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.HasKey("Id") + .HasName("pk_vcroleinfo"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_vcroleinfo_guildconfigid"); + + b.ToTable("vcroleinfo", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AffinityId") + .HasColumnType("int") + .HasColumnName("affinityid"); + + b.Property("ClaimerId") + .HasColumnType("int") + .HasColumnName("claimerid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Price") + .HasColumnType("bigint") + .HasColumnName("price"); + + b.Property("WaifuId") + .HasColumnType("int") + .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.Services.Database.Models.WaifuItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemEmoji") + .HasColumnType("longtext") + .HasColumnName("itememoji"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("WaifuInfoId") + .HasColumnType("int") + .HasColumnName("waifuinfoid"); + + b.HasKey("Id") + .HasName("pk_waifuitem"); + + b.HasIndex("WaifuInfoId") + .HasDatabaseName("ix_waifuitem_waifuinfoid"); + + b.ToTable("waifuitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("NewId") + .HasColumnType("int") + .HasColumnName("newid"); + + b.Property("OldId") + .HasColumnType("int") + .HasColumnName("oldid"); + + b.Property("UpdateType") + .HasColumnType("int") + .HasColumnName("updatetype"); + + b.Property("UserId") + .HasColumnType("int") + .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.Services.Database.Models.Warning", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Forgiven") + .HasColumnType("tinyint(1)") + .HasColumnName("forgiven"); + + b.Property("ForgivenBy") + .HasColumnType("longtext") + .HasColumnName("forgivenby"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Moderator") + .HasColumnType("longtext") + .HasColumnName("moderator"); + + b.Property("Reason") + .HasColumnType("longtext") + .HasColumnName("reason"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.WarningPunishment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Count") + .HasColumnType("int") + .HasColumnName("count"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Punishment") + .HasColumnType("int") + .HasColumnName("punishment"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("Time") + .HasColumnType("int") + .HasColumnName("time"); + + b.HasKey("Id") + .HasName("pk_warningpunishment"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_warningpunishment_guildconfigid"); + + b.ToTable("warningpunishment", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("int") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_xpcurrencyreward"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_xpcurrencyreward_xpsettingsid"); + + b.ToTable("xpcurrencyreward", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("Remove") + .HasColumnType("tinyint(1)") + .HasColumnName("remove"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .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.Services.Database.Models.XpSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("ServerExcluded") + .HasColumnType("tinyint(1)") + .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.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.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.FollowedStream", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FollowedStreams") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithOne("AntiAltSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiAltSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiRaidSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiRaidSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.HasOne("EllieBot.Services.Database.Models.AntiSpamSetting", null) + .WithMany("IgnoredChannels") + .HasForeignKey("AntiSpamSettingId") + .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiSpamSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiSpamSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.AutoTranslateChannel", "Channel") + .WithMany("Users") + .HasForeignKey("ChannelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); + + b.Navigation("Channel"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandAliases") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandCooldowns") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("DelMsgOnCmdChannels") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", null) + .WithMany("ExclusionList") + .HasForeignKey("XpSettingsId") + .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("FeedSubs") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_feedsub_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterInvitesChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilteredWords") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterLinksChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterWordsChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("GenerateCurrencyChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("SelfAssignableRoleGroupNames") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_groupname_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany("LogIgnores") + .HasForeignKey("LogSettingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ignoredlogchannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany() + .HasForeignKey("LogSettingId") + .HasConstraintName("fk_ignoredvoicepresencechannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("MutedUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("Permissions") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlaylistSong", b => + { + b.HasOne("EllieBot.Services.Database.Models.MusicPlaylist", null) + .WithMany("Songs") + .HasForeignKey("MusicPlaylistId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Answers") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollanswer_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Votes") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollvote_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("ShopEntries") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.ShopEntry", null) + .WithMany("Items") + .HasForeignKey("ShopEntryId") + .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredRoles") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Blacklist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("StreamRole") + .HasForeignKey("EllieBot.Services.Database.Models.StreamRoleSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Whitelist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnbanTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnmuteTimers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnroleTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.VcRoleInfo", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("VcRoleInfos") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WaifuInfo", "WaifuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); + + b.Navigation("Affinity"); + + b.Navigation("Claimer"); + + b.Navigation("Waifu"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.WaifuInfo", "WaifuInfo") + .WithMany("Items") + .HasForeignKey("WaifuInfoId") + .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); + + b.Navigation("WaifuInfo"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WarningPunishment", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("WarnPunishments") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_warningpunishment_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("CurrencyRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpcurrencyreward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("RoleRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xprolereward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("XpSettings") + .HasForeignKey("EllieBot.Services.Database.Models.XpSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => + { + b.Navigation("Applicants"); + + b.Navigation("Bans"); + + b.Navigation("Members"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Navigation("IgnoredChannels"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.LogSetting", b => + { + b.Navigation("LogIgnores"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlaylist", b => + { + b.Navigation("Songs"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Navigation("Answers"); + + b.Navigation("Votes"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Navigation("Blacklist"); + + b.Navigation("Whitelist"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.Navigation("CurrencyRewards"); + + b.Navigation("ExclusionList"); + + b.Navigation("RoleRewards"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220614071410_patronage-system.cs b/src/EllieBot/Migrations/Mysql/20220614071410_patronage-system.cs new file mode 100644 index 0000000..af53bf5 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220614071410_patronage-system.cs @@ -0,0 +1,176 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + public partial class patronagesystem : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "patreonuserid", + table: "rewardedusers", + newName: "platformuserid"); + + migrationBuilder.RenameIndex( + name: "ix_rewardedusers_patreonuserid", + table: "rewardedusers", + newName: "ix_rewardedusers_platformuserid"); + + migrationBuilder.AlterColumn( + name: "xp", + table: "userxpstats", + type: "bigint", + nullable: false, + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "awardedxp", + table: "userxpstats", + type: "bigint", + nullable: false, + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "amountrewardedthismonth", + table: "rewardedusers", + type: "bigint", + nullable: false, + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "verboseerrors", + table: "guildconfigs", + type: "tinyint(1)", + nullable: false, + defaultValue: true, + oldClrType: typeof(bool), + oldType: "tinyint(1)"); + + migrationBuilder.AlterColumn( + name: "totalxp", + table: "discorduser", + type: "bigint", + nullable: false, + defaultValue: 0L, + oldClrType: typeof(int), + oldType: "int", + oldDefaultValue: 0); + + migrationBuilder.CreateTable( + name: "patronquotas", + columns: table => new + { + userid = table.Column(type: "bigint unsigned", nullable: false), + featuretype = table.Column(type: "int", nullable: false), + feature = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + hourlycount = table.Column(type: "int unsigned", nullable: false), + dailycount = table.Column(type: "int unsigned", nullable: false), + monthlycount = table.Column(type: "int unsigned", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_patronquotas", x => new { x.userid, x.featuretype, x.feature }); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "patrons", + columns: table => new + { + userid = table.Column(type: "bigint unsigned", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + uniqueplatformuserid = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + amountcents = table.Column(type: "int", nullable: false), + lastcharge = table.Column(type: "datetime(6)", nullable: false), + validthru = table.Column(type: "datetime(6)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_patrons", x => x.userid); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "ix_patronquotas_userid", + table: "patronquotas", + column: "userid"); + + migrationBuilder.CreateIndex( + name: "ix_patrons_uniqueplatformuserid", + table: "patrons", + column: "uniqueplatformuserid", + unique: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "patronquotas"); + + migrationBuilder.DropTable( + name: "patrons"); + + migrationBuilder.RenameColumn( + name: "platformuserid", + table: "rewardedusers", + newName: "patreonuserid"); + + migrationBuilder.RenameIndex( + name: "ix_rewardedusers_platformuserid", + table: "rewardedusers", + newName: "ix_rewardedusers_patreonuserid"); + + migrationBuilder.AlterColumn( + name: "xp", + table: "userxpstats", + type: "int", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint"); + + migrationBuilder.AlterColumn( + name: "awardedxp", + table: "userxpstats", + type: "int", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint"); + + migrationBuilder.AlterColumn( + name: "amountrewardedthismonth", + table: "rewardedusers", + type: "int", + nullable: false, + oldClrType: typeof(long), + oldType: "bigint"); + + migrationBuilder.AlterColumn( + name: "verboseerrors", + table: "guildconfigs", + type: "tinyint(1)", + nullable: false, + oldClrType: typeof(bool), + oldType: "tinyint(1)", + oldDefaultValue: true); + + migrationBuilder.AlterColumn( + name: "totalxp", + table: "discorduser", + type: "int", + nullable: false, + defaultValue: 0, + oldClrType: typeof(long), + oldType: "bigint", + oldDefaultValue: 0L); + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220623090718_stondel-db-cache.Designer.cs b/src/EllieBot/Migrations/Mysql/20220623090718_stondel-db-cache.Designer.cs new file mode 100644 index 0000000..d0d2681 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220623090718_stondel-db-cache.Designer.cs @@ -0,0 +1,3514 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using EllieBot.Services.Database; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + [DbContext(typeof(MysqlContext))] + [Migration("20220623090718_stondel-db-cache")] + partial class stondeldbcache + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.6") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Balance") + .HasColumnType("bigint") + .HasColumnName("balance"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.ClubApplicants", b => + { + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Description") + .HasColumnType("longtext") + .HasColumnName("description"); + + b.Property("ImageUrl") + .HasColumnType("longtext") + .HasColumnName("imageurl"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("name") + .UseCollation("utf8mb4_bin"); + + b.Property("OwnerId") + .HasColumnType("int") + .HasColumnName("ownerid"); + + b.Property("Xp") + .HasColumnType("int") + .HasColumnName("xp"); + + b.HasKey("Id") + .HasName("pk_clubs"); + + b.HasAlternateKey("Name") + .HasName("ak_clubs_name"); + + b.HasIndex("OwnerId") + .IsUnique() + .HasDatabaseName("ix_clubs_ownerid"); + + b.ToTable("clubs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AvatarId") + .HasColumnType("longtext") + .HasColumnName("avatarid"); + + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("CurrencyAmount") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("currencyamount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Discriminator") + .HasColumnType("longtext") + .HasColumnName("discriminator"); + + b.Property("IsClubAdmin") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("isclubadmin"); + + b.Property("LastLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastlevelup") + .HasDefaultValueSql("(UTC_TIMESTAMP)"); + + b.Property("LastXpGain") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastxpgain") + .HasDefaultValueSql("(UTC_TIMESTAMP - INTERVAL 1 year)"); + + b.Property("NotifyOnLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("notifyonlevelup"); + + b.Property("TotalXp") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("totalxp"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .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.FollowedStream", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.Property("Username") + .HasColumnType("longtext") + .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.PatronQuota", b => + { + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("FeatureType") + .HasColumnType("int") + .HasColumnName("featuretype"); + + b.Property("Feature") + .HasColumnType("varchar(255)") + .HasColumnName("feature"); + + b.Property("DailyCount") + .HasColumnType("int unsigned") + .HasColumnName("dailycount"); + + b.Property("HourlyCount") + .HasColumnType("int unsigned") + .HasColumnName("hourlycount"); + + b.Property("MonthlyCount") + .HasColumnType("int unsigned") + .HasColumnName("monthlycount"); + + b.HasKey("UserId", "FeatureType", "Feature") + .HasName("pk_patronquotas"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_patronquotas_userid"); + + b.ToTable("patronquotas", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => + { + b.Property("UserId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("AmountCents") + .HasColumnType("int") + .HasColumnName("amountcents"); + + b.Property("LastCharge") + .HasColumnType("datetime(6)") + .HasColumnName("lastcharge"); + + b.Property("UniquePlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("uniqueplatformuserid"); + + b.Property("ValidThru") + .HasColumnType("datetime(6)") + .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.StreamOnlineMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_streamonlinemessages"); + + b.ToTable("streamonlinemessages", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("ActionDurationMinutes") + .HasColumnType("int") + .HasColumnName("actiondurationminutes"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MinAge") + .HasColumnType("time(6)") + .HasColumnName("minage"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antialtsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antialtsetting_guildconfigid"); + + b.ToTable("antialtsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("PunishDuration") + .HasColumnType("int") + .HasColumnName("punishduration"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.Property("UserThreshold") + .HasColumnType("int") + .HasColumnName("userthreshold"); + + b.HasKey("Id") + .HasName("pk_antiraidsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antiraidsetting_guildconfigid"); + + b.ToTable("antiraidsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AntiSpamSettingId") + .HasColumnType("int") + .HasColumnName("antispamsettingid"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.HasKey("Id") + .HasName("pk_antispamignore"); + + b.HasIndex("AntiSpamSettingId") + .HasDatabaseName("ix_antispamignore_antispamsettingid"); + + b.ToTable("antispamignore", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MessageThreshold") + .HasColumnType("int") + .HasColumnName("messagethreshold"); + + b.Property("MuteTime") + .HasColumnType("int") + .HasColumnName("mutetime"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antispamsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antispamsetting_guildconfigid"); + + b.ToTable("antispamsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoCommand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("ChannelName") + .HasColumnType("longtext") + .HasColumnName("channelname"); + + b.Property("CommandText") + .HasColumnType("longtext") + .HasColumnName("commandtext"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("GuildName") + .HasColumnType("longtext") + .HasColumnName("guildname"); + + b.Property("Interval") + .HasColumnType("int") + .HasColumnName("interval"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.Property("VoiceChannelName") + .HasColumnType("longtext") + .HasColumnName("voicechannelname"); + + b.HasKey("Id") + .HasName("pk_autocommands"); + + b.ToTable("autocommands", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDelete") + .HasColumnType("tinyint(1)") + .HasColumnName("autodelete"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_autotranslatechannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_autotranslatechannels_channelid"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_autotranslatechannels_guildid"); + + b.ToTable("autotranslatechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("int") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Source") + .HasColumnType("longtext") + .HasColumnName("source"); + + b.Property("Target") + .HasColumnType("longtext") + .HasColumnName("target"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_autotranslateusers"); + + b.HasAlternateKey("ChannelId", "UserId") + .HasName("ak_autotranslateusers_channelid_userid"); + + b.ToTable("autotranslateusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BanTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_bantemplates"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_bantemplates_guildid"); + + b.ToTable("bantemplates", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BlacklistEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_blacklist"); + + b.ToTable("blacklist", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Mapping") + .HasColumnType("longtext") + .HasColumnName("mapping"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_commandalias"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandalias_guildconfigid"); + + b.ToTable("commandalias", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("CommandName") + .HasColumnType("longtext") + .HasColumnName("commandname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.HasKey("Id") + .HasName("pk_commandcooldown"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandcooldown_guildconfigid"); + + b.ToTable("commandcooldown", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CurrencyTransaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Extra") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("extra"); + + b.Property("Note") + .HasColumnType("longtext") + .HasColumnName("note"); + + b.Property("OtherId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("otherid") + .HasDefaultValueSql("NULL"); + + b.Property("Type") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("type"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_currencytransactions"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_currencytransactions_userid"); + + b.ToTable("currencytransactions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_delmsgoncmdchannel"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); + + b.ToTable("delmsgoncmdchannel", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DiscordPermOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Command") + .HasColumnType("varchar(255)") + .HasColumnName("command"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Perm") + .HasColumnType("bigint unsigned") + .HasColumnName("perm"); + + b.HasKey("Id") + .HasName("pk_discordpermoverrides"); + + b.HasIndex("GuildId", "Command") + .IsUnique() + .HasDatabaseName("ix_discordpermoverrides_guildid_command"); + + b.ToTable("discordpermoverrides", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_excludeditem"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_excludeditem_xpsettingsid"); + + b.ToTable("excludeditem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Url") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("url"); + + b.HasKey("Id") + .HasName("pk_feedsub"); + + b.HasAlternateKey("GuildConfigId", "Url") + .HasName("ak_feedsub_guildconfigid_url"); + + b.ToTable("feedsub", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterchannelid_guildconfigid"); + + b.ToTable("filterchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Word") + .HasColumnType("longtext") + .HasColumnName("word"); + + b.HasKey("Id") + .HasName("pk_filteredword"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filteredword_guildconfigid"); + + b.ToTable("filteredword", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterlinkschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); + + b.ToTable("filterlinkschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterwordschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); + + b.ToTable("filterwordschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_gcchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_gcchannelid_guildconfigid"); + + b.ToTable("gcchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Number") + .HasColumnType("int") + .HasColumnName("number"); + + b.HasKey("Id") + .HasName("pk_groupname"); + + b.HasIndex("GuildConfigId", "Number") + .IsUnique() + .HasDatabaseName("ix_groupname_guildconfigid_number"); + + b.ToTable("groupname", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GuildConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoAssignRoleIds") + .HasColumnType("longtext") + .HasColumnName("autoassignroleids"); + + b.Property("AutoDeleteByeMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletebyemessagestimer"); + + b.Property("AutoDeleteGreetMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletegreetmessagestimer"); + + b.Property("AutoDeleteSelfAssignedRoleMessages") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeleteselfassignedrolemessages"); + + b.Property("BoostMessage") + .HasColumnType("longtext") + .HasColumnName("boostmessage"); + + b.Property("BoostMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("boostmessagechannelid"); + + b.Property("BoostMessageDeleteAfter") + .HasColumnType("int") + .HasColumnName("boostmessagedeleteafter"); + + b.Property("ByeMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("byemessagechannelid"); + + b.Property("ChannelByeMessageText") + .HasColumnType("longtext") + .HasColumnName("channelbyemessagetext"); + + b.Property("ChannelGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("channelgreetmessagetext"); + + b.Property("CleverbotEnabled") + .HasColumnType("tinyint(1)") + .HasColumnName("cleverbotenabled"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DeleteMessageOnCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("deletemessageoncommand"); + + b.Property("DeleteStreamOnlineMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("deletestreamonlinemessage"); + + b.Property("DmGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("dmgreetmessagetext"); + + b.Property("ExclusiveSelfAssignedRoles") + .HasColumnType("tinyint(1)") + .HasColumnName("exclusiveselfassignedroles"); + + b.Property("FilterInvites") + .HasColumnType("tinyint(1)") + .HasColumnName("filterinvites"); + + b.Property("FilterLinks") + .HasColumnType("tinyint(1)") + .HasColumnName("filterlinks"); + + b.Property("FilterWords") + .HasColumnType("tinyint(1)") + .HasColumnName("filterwords"); + + b.Property("GameVoiceChannel") + .HasColumnType("bigint unsigned") + .HasColumnName("gamevoicechannel"); + + b.Property("GreetMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("greetmessagechannelid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Locale") + .HasColumnType("longtext") + .HasColumnName("locale"); + + b.Property("MuteRoleName") + .HasColumnType("longtext") + .HasColumnName("muterolename"); + + b.Property("NotifyStreamOffline") + .HasColumnType("tinyint(1)") + .HasColumnName("notifystreamoffline"); + + b.Property("PermissionRole") + .HasColumnType("longtext") + .HasColumnName("permissionrole"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasColumnName("prefix"); + + b.Property("SendBoostMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendboostmessage"); + + b.Property("SendChannelByeMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelbyemessage"); + + b.Property("SendChannelGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelgreetmessage"); + + b.Property("SendDmGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("senddmgreetmessage"); + + b.Property("TimeZoneId") + .HasColumnType("longtext") + .HasColumnName("timezoneid"); + + b.Property("VerboseErrors") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true) + .HasColumnName("verboseerrors"); + + b.Property("VerbosePermissions") + .HasColumnType("tinyint(1)") + .HasColumnName("verbosepermissions"); + + b.Property("WarnExpireAction") + .HasColumnType("int") + .HasColumnName("warnexpireaction"); + + b.Property("WarnExpireHours") + .HasColumnType("int") + .HasColumnName("warnexpirehours"); + + b.Property("WarningsInitialized") + .HasColumnType("tinyint(1)") + .HasColumnName("warningsinitialized"); + + b.HasKey("Id") + .HasName("pk_guildconfigs"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_guildconfigs_guildid"); + + b.HasIndex("WarnExpireHours") + .HasDatabaseName("ix_guildconfigs_warnexpirehours"); + + b.ToTable("guildconfigs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("LogItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("logitemid"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredlogchannels"); + + b.HasIndex("LogSettingId", "LogItemId", "ItemType") + .IsUnique() + .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype"); + + b.ToTable("ignoredlogchannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredvoicepresencechannels"); + + b.HasIndex("LogSettingId") + .HasDatabaseName("ix_ignoredvoicepresencechannels_logsettingid"); + + b.ToTable("ignoredvoicepresencechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ImageOnlyChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_imageonlychannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_imageonlychannels_channelid"); + + b.ToTable("imageonlychannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.LogSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelCreatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelcreatedid"); + + b.Property("ChannelDestroyedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channeldestroyedid"); + + b.Property("ChannelUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelupdatedid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LogOtherId") + .HasColumnType("bigint unsigned") + .HasColumnName("logotherid"); + + b.Property("LogUserPresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("loguserpresenceid"); + + b.Property("LogVoicePresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresenceid"); + + b.Property("LogVoicePresenceTTSId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresencettsid"); + + b.Property("MessageDeletedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messagedeletedid"); + + b.Property("MessageUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageupdatedid"); + + b.Property("UserBannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userbannedid"); + + b.Property("UserJoinedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userjoinedid"); + + b.Property("UserLeftId") + .HasColumnType("bigint unsigned") + .HasColumnName("userleftid"); + + b.Property("UserMutedId") + .HasColumnType("bigint unsigned") + .HasColumnName("usermutedid"); + + b.Property("UserUnbannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userunbannedid"); + + b.Property("UserUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userupdatedid"); + + b.HasKey("Id") + .HasName("pk_logsettings"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_logsettings_guildid"); + + b.ToTable("logsettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlayerSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDisconnect") + .HasColumnType("tinyint(1)") + .HasColumnName("autodisconnect"); + + b.Property("AutoPlay") + .HasColumnType("tinyint(1)") + .HasColumnName("autoplay"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MusicChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("musicchannelid"); + + b.Property("PlayerRepeat") + .HasColumnType("int") + .HasColumnName("playerrepeat"); + + b.Property("QualityPreset") + .HasColumnType("int") + .HasColumnName("qualitypreset"); + + b.Property("Volume") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .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.Services.Database.Models.MusicPlaylist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Author") + .HasColumnType("longtext") + .HasColumnName("author"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.HasKey("Id") + .HasName("pk_musicplaylists"); + + b.ToTable("musicplaylists", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_muteduserid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_muteduserid_guildconfigid"); + + b.ToTable("muteduserid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AllowTarget") + .HasColumnType("tinyint(1)") + .HasColumnName("allowtarget"); + + b.Property("AutoDeleteTrigger") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeletetrigger"); + + b.Property("ContainsAnywhere") + .HasColumnType("tinyint(1)") + .HasColumnName("containsanywhere"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DmResponse") + .HasColumnType("tinyint(1)") + .HasColumnName("dmresponse"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Reactions") + .HasColumnType("longtext") + .HasColumnName("reactions"); + + b.Property("Response") + .HasColumnType("longtext") + .HasColumnName("response"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_expressions"); + + b.ToTable("expressions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NsfwBlacklistedTag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Tag") + .HasColumnType("longtext") + .HasColumnName("tag"); + + b.HasKey("Id") + .HasName("pk_nsfwblacklistedtags"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_nsfwblacklistedtags_guildid"); + + b.ToTable("nsfwblacklistedtags", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("IsCustomCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("iscustomcommand"); + + b.Property("PrimaryTarget") + .HasColumnType("int") + .HasColumnName("primarytarget"); + + b.Property("PrimaryTargetId") + .HasColumnType("bigint unsigned") + .HasColumnName("primarytargetid"); + + b.Property("SecondaryTarget") + .HasColumnType("int") + .HasColumnName("secondarytarget"); + + b.Property("SecondaryTargetName") + .HasColumnType("longtext") + .HasColumnName("secondarytargetname"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_permissions"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_permissions_guildconfigid"); + + b.ToTable("permissions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlantedCurrency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Password") + .HasColumnType("longtext") + .HasColumnName("password"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.PlaylistSong", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MusicPlaylistId") + .HasColumnType("int") + .HasColumnName("musicplaylistid"); + + b.Property("Provider") + .HasColumnType("longtext") + .HasColumnName("provider"); + + b.Property("ProviderType") + .HasColumnType("int") + .HasColumnName("providertype"); + + b.Property("Query") + .HasColumnType("longtext") + .HasColumnName("query"); + + b.Property("Title") + .HasColumnType("longtext") + .HasColumnName("title"); + + b.Property("Uri") + .HasColumnType("longtext") + .HasColumnName("uri"); + + b.HasKey("Id") + .HasName("pk_playlistsong"); + + b.HasIndex("MusicPlaylistId") + .HasDatabaseName("ix_playlistsong_musicplaylistid"); + + b.ToTable("playlistsong", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Question") + .HasColumnType("longtext") + .HasColumnName("question"); + + b.HasKey("Id") + .HasName("pk_poll"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_poll_guildid"); + + b.ToTable("poll", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_pollanswer"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollanswer_pollid"); + + b.ToTable("pollanswer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("VoteIndex") + .HasColumnType("int") + .HasColumnName("voteindex"); + + b.HasKey("Id") + .HasName("pk_pollvote"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollvote_pollid"); + + b.ToTable("pollvote", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Quote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("AuthorName") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("authorname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Keyword") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("keyword"); + + b.Property("Text") + .IsRequired() + .HasColumnType("longtext") + .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.Services.Database.Models.ReactionRoleV2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Emote") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("emote"); + + b.Property("Group") + .HasColumnType("int") + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelReq") + .HasColumnType("int") + .HasColumnName("levelreq"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.Reminder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsPrivate") + .HasColumnType("tinyint(1)") + .HasColumnName("isprivate"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("ServerId") + .HasColumnType("bigint unsigned") + .HasColumnName("serverid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("When") + .HasColumnType("datetime(6)") + .HasColumnName("when"); + + b.HasKey("Id") + .HasName("pk_reminders"); + + b.HasIndex("When") + .HasDatabaseName("ix_reminders_when"); + + b.ToTable("reminders", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Repeater", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Interval") + .HasColumnType("time(6)") + .HasColumnName("interval"); + + b.Property("LastMessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("lastmessageid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("NoRedundant") + .HasColumnType("tinyint(1)") + .HasColumnName("noredundant"); + + b.Property("StartTimeOfDay") + .HasColumnType("time(6)") + .HasColumnName("starttimeofday"); + + b.HasKey("Id") + .HasName("pk_repeaters"); + + b.ToTable("repeaters", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RewardedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AmountRewardedThisMonth") + .HasColumnType("bigint") + .HasColumnName("amountrewardedthismonth"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LastReward") + .HasColumnType("datetime(6)") + .HasColumnName("lastreward"); + + b.Property("PlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("platformuserid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_rewardedusers"); + + b.HasIndex("PlatformUserId") + .IsUnique() + .HasDatabaseName("ix_rewardedusers_platformuserid"); + + b.ToTable("rewardedusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RotatingPlayingStatus", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Status") + .HasColumnType("longtext") + .HasColumnName("status"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_rotatingstatus"); + + b.ToTable("rotatingstatus", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SelfAssignedRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Group") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelRequirement") + .HasColumnType("int") + .HasColumnName("levelrequirement"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.ShopEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Price") + .HasColumnType("int") + .HasColumnName("price"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("RoleName") + .HasColumnType("longtext") + .HasColumnName("rolename"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_shopentry"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_shopentry_guildconfigid"); + + b.ToTable("shopentry", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ShopEntryId") + .HasColumnType("int") + .HasColumnName("shopentryid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_shopentryitem"); + + b.HasIndex("ShopEntryId") + .HasDatabaseName("ix_shopentryitem_shopentryid"); + + b.ToTable("shopentryitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoredrole"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoredrole_guildconfigid"); + + b.ToTable("slowmodeignoredrole", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoreduser"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoreduser_guildconfigid"); + + b.ToTable("slowmodeignoreduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamroleblacklisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamroleblacklisteduser_streamrolesettingsid"); + + b.ToTable("streamroleblacklisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AddRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("addroleid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)") + .HasColumnName("enabled"); + + b.Property("FromRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("fromroleid"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Keyword") + .HasColumnType("longtext") + .HasColumnName("keyword"); + + b.HasKey("Id") + .HasName("pk_streamrolesettings"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_streamrolesettings_guildconfigid"); + + b.ToTable("streamrolesettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamrolewhitelisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamrolewhitelisteduser_streamrolesettingsid"); + + b.ToTable("streamrolewhitelisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unbantimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unbantimer_guildconfigid"); + + b.ToTable("unbantimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnmuteAt") + .HasColumnType("datetime(6)") + .HasColumnName("unmuteat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unmutetimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unmutetimer_guildconfigid"); + + b.ToTable("unmutetimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unroletimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unroletimer_guildconfigid"); + + b.ToTable("unroletimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UserXpStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AwardedXp") + .HasColumnType("bigint") + .HasColumnName("awardedxp"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LastLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastlevelup") + .HasDefaultValueSql("(UTC_TIMESTAMP)"); + + b.Property("NotifyOnLevelUp") + .HasColumnType("int") + .HasColumnName("notifyonlevelup"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.VcRoleInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.HasKey("Id") + .HasName("pk_vcroleinfo"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_vcroleinfo_guildconfigid"); + + b.ToTable("vcroleinfo", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AffinityId") + .HasColumnType("int") + .HasColumnName("affinityid"); + + b.Property("ClaimerId") + .HasColumnType("int") + .HasColumnName("claimerid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Price") + .HasColumnType("bigint") + .HasColumnName("price"); + + b.Property("WaifuId") + .HasColumnType("int") + .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.Services.Database.Models.WaifuItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemEmoji") + .HasColumnType("longtext") + .HasColumnName("itememoji"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("WaifuInfoId") + .HasColumnType("int") + .HasColumnName("waifuinfoid"); + + b.HasKey("Id") + .HasName("pk_waifuitem"); + + b.HasIndex("WaifuInfoId") + .HasDatabaseName("ix_waifuitem_waifuinfoid"); + + b.ToTable("waifuitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("NewId") + .HasColumnType("int") + .HasColumnName("newid"); + + b.Property("OldId") + .HasColumnType("int") + .HasColumnName("oldid"); + + b.Property("UpdateType") + .HasColumnType("int") + .HasColumnName("updatetype"); + + b.Property("UserId") + .HasColumnType("int") + .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.Services.Database.Models.Warning", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Forgiven") + .HasColumnType("tinyint(1)") + .HasColumnName("forgiven"); + + b.Property("ForgivenBy") + .HasColumnType("longtext") + .HasColumnName("forgivenby"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Moderator") + .HasColumnType("longtext") + .HasColumnName("moderator"); + + b.Property("Reason") + .HasColumnType("longtext") + .HasColumnName("reason"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.WarningPunishment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Count") + .HasColumnType("int") + .HasColumnName("count"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Punishment") + .HasColumnType("int") + .HasColumnName("punishment"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("Time") + .HasColumnType("int") + .HasColumnName("time"); + + b.HasKey("Id") + .HasName("pk_warningpunishment"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_warningpunishment_guildconfigid"); + + b.ToTable("warningpunishment", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("int") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_xpcurrencyreward"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_xpcurrencyreward_xpsettingsid"); + + b.ToTable("xpcurrencyreward", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("Remove") + .HasColumnType("tinyint(1)") + .HasColumnName("remove"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .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.Services.Database.Models.XpSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("ServerExcluded") + .HasColumnType("tinyint(1)") + .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.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.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.FollowedStream", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FollowedStreams") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithOne("AntiAltSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiAltSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiRaidSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiRaidSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.HasOne("EllieBot.Services.Database.Models.AntiSpamSetting", null) + .WithMany("IgnoredChannels") + .HasForeignKey("AntiSpamSettingId") + .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiSpamSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiSpamSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.AutoTranslateChannel", "Channel") + .WithMany("Users") + .HasForeignKey("ChannelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); + + b.Navigation("Channel"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandAliases") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandCooldowns") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("DelMsgOnCmdChannels") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", null) + .WithMany("ExclusionList") + .HasForeignKey("XpSettingsId") + .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("FeedSubs") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_feedsub_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterInvitesChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilteredWords") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterLinksChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterWordsChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("GenerateCurrencyChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("SelfAssignableRoleGroupNames") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_groupname_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany("LogIgnores") + .HasForeignKey("LogSettingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ignoredlogchannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany() + .HasForeignKey("LogSettingId") + .HasConstraintName("fk_ignoredvoicepresencechannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("MutedUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("Permissions") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlaylistSong", b => + { + b.HasOne("EllieBot.Services.Database.Models.MusicPlaylist", null) + .WithMany("Songs") + .HasForeignKey("MusicPlaylistId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Answers") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollanswer_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Votes") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollvote_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("ShopEntries") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.ShopEntry", null) + .WithMany("Items") + .HasForeignKey("ShopEntryId") + .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredRoles") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Blacklist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("StreamRole") + .HasForeignKey("EllieBot.Services.Database.Models.StreamRoleSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Whitelist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnbanTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnmuteTimers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnroleTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.VcRoleInfo", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("VcRoleInfos") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WaifuInfo", "WaifuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); + + b.Navigation("Affinity"); + + b.Navigation("Claimer"); + + b.Navigation("Waifu"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.WaifuInfo", "WaifuInfo") + .WithMany("Items") + .HasForeignKey("WaifuInfoId") + .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); + + b.Navigation("WaifuInfo"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WarningPunishment", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("WarnPunishments") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_warningpunishment_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("CurrencyRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpcurrencyreward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("RoleRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xprolereward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("XpSettings") + .HasForeignKey("EllieBot.Services.Database.Models.XpSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => + { + b.Navigation("Applicants"); + + b.Navigation("Bans"); + + b.Navigation("Members"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Navigation("IgnoredChannels"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.LogSetting", b => + { + b.Navigation("LogIgnores"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlaylist", b => + { + b.Navigation("Songs"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Navigation("Answers"); + + b.Navigation("Votes"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Navigation("Blacklist"); + + b.Navigation("Whitelist"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.Navigation("CurrencyRewards"); + + b.Navigation("ExclusionList"); + + b.Navigation("RoleRewards"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220623090718_stondel-db-cache.cs b/src/EllieBot/Migrations/Mysql/20220623090718_stondel-db-cache.cs new file mode 100644 index 0000000..1546ea1 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220623090718_stondel-db-cache.cs @@ -0,0 +1,39 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + public partial class stondeldbcache : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "streamonlinemessages", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + channelid = table.Column(type: "bigint unsigned", nullable: false), + messageid = table.Column(type: "bigint unsigned", nullable: false), + type = table.Column(type: "int", nullable: false), + name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_streamonlinemessages", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "streamonlinemessages"); + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220703194400_logwarns.Designer.cs b/src/EllieBot/Migrations/Mysql/20220703194400_logwarns.Designer.cs new file mode 100644 index 0000000..4b23faf --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220703194400_logwarns.Designer.cs @@ -0,0 +1,3518 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using EllieBot.Services.Database; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + [DbContext(typeof(MysqlContext))] + [Migration("20220703194400_logwarns")] + partial class logwarns + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.6") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Balance") + .HasColumnType("bigint") + .HasColumnName("balance"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.ClubApplicants", b => + { + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Description") + .HasColumnType("longtext") + .HasColumnName("description"); + + b.Property("ImageUrl") + .HasColumnType("longtext") + .HasColumnName("imageurl"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("name") + .UseCollation("utf8mb4_bin"); + + b.Property("OwnerId") + .HasColumnType("int") + .HasColumnName("ownerid"); + + b.Property("Xp") + .HasColumnType("int") + .HasColumnName("xp"); + + b.HasKey("Id") + .HasName("pk_clubs"); + + b.HasAlternateKey("Name") + .HasName("ak_clubs_name"); + + b.HasIndex("OwnerId") + .IsUnique() + .HasDatabaseName("ix_clubs_ownerid"); + + b.ToTable("clubs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AvatarId") + .HasColumnType("longtext") + .HasColumnName("avatarid"); + + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("CurrencyAmount") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("currencyamount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Discriminator") + .HasColumnType("longtext") + .HasColumnName("discriminator"); + + b.Property("IsClubAdmin") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("isclubadmin"); + + b.Property("LastLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastlevelup") + .HasDefaultValueSql("(UTC_TIMESTAMP)"); + + b.Property("LastXpGain") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastxpgain") + .HasDefaultValueSql("(UTC_TIMESTAMP - INTERVAL 1 year)"); + + b.Property("NotifyOnLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("notifyonlevelup"); + + b.Property("TotalXp") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("totalxp"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .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.FollowedStream", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.Property("Username") + .HasColumnType("longtext") + .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.PatronQuota", b => + { + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("FeatureType") + .HasColumnType("int") + .HasColumnName("featuretype"); + + b.Property("Feature") + .HasColumnType("varchar(255)") + .HasColumnName("feature"); + + b.Property("DailyCount") + .HasColumnType("int unsigned") + .HasColumnName("dailycount"); + + b.Property("HourlyCount") + .HasColumnType("int unsigned") + .HasColumnName("hourlycount"); + + b.Property("MonthlyCount") + .HasColumnType("int unsigned") + .HasColumnName("monthlycount"); + + b.HasKey("UserId", "FeatureType", "Feature") + .HasName("pk_patronquotas"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_patronquotas_userid"); + + b.ToTable("patronquotas", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => + { + b.Property("UserId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("AmountCents") + .HasColumnType("int") + .HasColumnName("amountcents"); + + b.Property("LastCharge") + .HasColumnType("datetime(6)") + .HasColumnName("lastcharge"); + + b.Property("UniquePlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("uniqueplatformuserid"); + + b.Property("ValidThru") + .HasColumnType("datetime(6)") + .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.StreamOnlineMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_streamonlinemessages"); + + b.ToTable("streamonlinemessages", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("ActionDurationMinutes") + .HasColumnType("int") + .HasColumnName("actiondurationminutes"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MinAge") + .HasColumnType("time(6)") + .HasColumnName("minage"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antialtsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antialtsetting_guildconfigid"); + + b.ToTable("antialtsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("PunishDuration") + .HasColumnType("int") + .HasColumnName("punishduration"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.Property("UserThreshold") + .HasColumnType("int") + .HasColumnName("userthreshold"); + + b.HasKey("Id") + .HasName("pk_antiraidsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antiraidsetting_guildconfigid"); + + b.ToTable("antiraidsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AntiSpamSettingId") + .HasColumnType("int") + .HasColumnName("antispamsettingid"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.HasKey("Id") + .HasName("pk_antispamignore"); + + b.HasIndex("AntiSpamSettingId") + .HasDatabaseName("ix_antispamignore_antispamsettingid"); + + b.ToTable("antispamignore", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MessageThreshold") + .HasColumnType("int") + .HasColumnName("messagethreshold"); + + b.Property("MuteTime") + .HasColumnType("int") + .HasColumnName("mutetime"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antispamsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antispamsetting_guildconfigid"); + + b.ToTable("antispamsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoCommand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("ChannelName") + .HasColumnType("longtext") + .HasColumnName("channelname"); + + b.Property("CommandText") + .HasColumnType("longtext") + .HasColumnName("commandtext"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("GuildName") + .HasColumnType("longtext") + .HasColumnName("guildname"); + + b.Property("Interval") + .HasColumnType("int") + .HasColumnName("interval"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.Property("VoiceChannelName") + .HasColumnType("longtext") + .HasColumnName("voicechannelname"); + + b.HasKey("Id") + .HasName("pk_autocommands"); + + b.ToTable("autocommands", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDelete") + .HasColumnType("tinyint(1)") + .HasColumnName("autodelete"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_autotranslatechannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_autotranslatechannels_channelid"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_autotranslatechannels_guildid"); + + b.ToTable("autotranslatechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("int") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Source") + .HasColumnType("longtext") + .HasColumnName("source"); + + b.Property("Target") + .HasColumnType("longtext") + .HasColumnName("target"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_autotranslateusers"); + + b.HasAlternateKey("ChannelId", "UserId") + .HasName("ak_autotranslateusers_channelid_userid"); + + b.ToTable("autotranslateusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BanTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_bantemplates"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_bantemplates_guildid"); + + b.ToTable("bantemplates", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BlacklistEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_blacklist"); + + b.ToTable("blacklist", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Mapping") + .HasColumnType("longtext") + .HasColumnName("mapping"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_commandalias"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandalias_guildconfigid"); + + b.ToTable("commandalias", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("CommandName") + .HasColumnType("longtext") + .HasColumnName("commandname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.HasKey("Id") + .HasName("pk_commandcooldown"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandcooldown_guildconfigid"); + + b.ToTable("commandcooldown", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CurrencyTransaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Extra") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("extra"); + + b.Property("Note") + .HasColumnType("longtext") + .HasColumnName("note"); + + b.Property("OtherId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("otherid") + .HasDefaultValueSql("NULL"); + + b.Property("Type") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("type"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_currencytransactions"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_currencytransactions_userid"); + + b.ToTable("currencytransactions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_delmsgoncmdchannel"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); + + b.ToTable("delmsgoncmdchannel", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DiscordPermOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Command") + .HasColumnType("varchar(255)") + .HasColumnName("command"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Perm") + .HasColumnType("bigint unsigned") + .HasColumnName("perm"); + + b.HasKey("Id") + .HasName("pk_discordpermoverrides"); + + b.HasIndex("GuildId", "Command") + .IsUnique() + .HasDatabaseName("ix_discordpermoverrides_guildid_command"); + + b.ToTable("discordpermoverrides", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_excludeditem"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_excludeditem_xpsettingsid"); + + b.ToTable("excludeditem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Url") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("url"); + + b.HasKey("Id") + .HasName("pk_feedsub"); + + b.HasAlternateKey("GuildConfigId", "Url") + .HasName("ak_feedsub_guildconfigid_url"); + + b.ToTable("feedsub", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterchannelid_guildconfigid"); + + b.ToTable("filterchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Word") + .HasColumnType("longtext") + .HasColumnName("word"); + + b.HasKey("Id") + .HasName("pk_filteredword"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filteredword_guildconfigid"); + + b.ToTable("filteredword", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterlinkschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); + + b.ToTable("filterlinkschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterwordschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); + + b.ToTable("filterwordschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_gcchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_gcchannelid_guildconfigid"); + + b.ToTable("gcchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Number") + .HasColumnType("int") + .HasColumnName("number"); + + b.HasKey("Id") + .HasName("pk_groupname"); + + b.HasIndex("GuildConfigId", "Number") + .IsUnique() + .HasDatabaseName("ix_groupname_guildconfigid_number"); + + b.ToTable("groupname", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GuildConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoAssignRoleIds") + .HasColumnType("longtext") + .HasColumnName("autoassignroleids"); + + b.Property("AutoDeleteByeMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletebyemessagestimer"); + + b.Property("AutoDeleteGreetMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletegreetmessagestimer"); + + b.Property("AutoDeleteSelfAssignedRoleMessages") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeleteselfassignedrolemessages"); + + b.Property("BoostMessage") + .HasColumnType("longtext") + .HasColumnName("boostmessage"); + + b.Property("BoostMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("boostmessagechannelid"); + + b.Property("BoostMessageDeleteAfter") + .HasColumnType("int") + .HasColumnName("boostmessagedeleteafter"); + + b.Property("ByeMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("byemessagechannelid"); + + b.Property("ChannelByeMessageText") + .HasColumnType("longtext") + .HasColumnName("channelbyemessagetext"); + + b.Property("ChannelGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("channelgreetmessagetext"); + + b.Property("CleverbotEnabled") + .HasColumnType("tinyint(1)") + .HasColumnName("cleverbotenabled"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DeleteMessageOnCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("deletemessageoncommand"); + + b.Property("DeleteStreamOnlineMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("deletestreamonlinemessage"); + + b.Property("DmGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("dmgreetmessagetext"); + + b.Property("ExclusiveSelfAssignedRoles") + .HasColumnType("tinyint(1)") + .HasColumnName("exclusiveselfassignedroles"); + + b.Property("FilterInvites") + .HasColumnType("tinyint(1)") + .HasColumnName("filterinvites"); + + b.Property("FilterLinks") + .HasColumnType("tinyint(1)") + .HasColumnName("filterlinks"); + + b.Property("FilterWords") + .HasColumnType("tinyint(1)") + .HasColumnName("filterwords"); + + b.Property("GameVoiceChannel") + .HasColumnType("bigint unsigned") + .HasColumnName("gamevoicechannel"); + + b.Property("GreetMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("greetmessagechannelid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Locale") + .HasColumnType("longtext") + .HasColumnName("locale"); + + b.Property("MuteRoleName") + .HasColumnType("longtext") + .HasColumnName("muterolename"); + + b.Property("NotifyStreamOffline") + .HasColumnType("tinyint(1)") + .HasColumnName("notifystreamoffline"); + + b.Property("PermissionRole") + .HasColumnType("longtext") + .HasColumnName("permissionrole"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasColumnName("prefix"); + + b.Property("SendBoostMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendboostmessage"); + + b.Property("SendChannelByeMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelbyemessage"); + + b.Property("SendChannelGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelgreetmessage"); + + b.Property("SendDmGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("senddmgreetmessage"); + + b.Property("TimeZoneId") + .HasColumnType("longtext") + .HasColumnName("timezoneid"); + + b.Property("VerboseErrors") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true) + .HasColumnName("verboseerrors"); + + b.Property("VerbosePermissions") + .HasColumnType("tinyint(1)") + .HasColumnName("verbosepermissions"); + + b.Property("WarnExpireAction") + .HasColumnType("int") + .HasColumnName("warnexpireaction"); + + b.Property("WarnExpireHours") + .HasColumnType("int") + .HasColumnName("warnexpirehours"); + + b.Property("WarningsInitialized") + .HasColumnType("tinyint(1)") + .HasColumnName("warningsinitialized"); + + b.HasKey("Id") + .HasName("pk_guildconfigs"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_guildconfigs_guildid"); + + b.HasIndex("WarnExpireHours") + .HasDatabaseName("ix_guildconfigs_warnexpirehours"); + + b.ToTable("guildconfigs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("LogItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("logitemid"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredlogchannels"); + + b.HasIndex("LogSettingId", "LogItemId", "ItemType") + .IsUnique() + .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype"); + + b.ToTable("ignoredlogchannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredvoicepresencechannels"); + + b.HasIndex("LogSettingId") + .HasDatabaseName("ix_ignoredvoicepresencechannels_logsettingid"); + + b.ToTable("ignoredvoicepresencechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ImageOnlyChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_imageonlychannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_imageonlychannels_channelid"); + + b.ToTable("imageonlychannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.LogSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelCreatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelcreatedid"); + + b.Property("ChannelDestroyedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channeldestroyedid"); + + b.Property("ChannelUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelupdatedid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LogOtherId") + .HasColumnType("bigint unsigned") + .HasColumnName("logotherid"); + + b.Property("LogUserPresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("loguserpresenceid"); + + b.Property("LogVoicePresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresenceid"); + + b.Property("LogVoicePresenceTTSId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresencettsid"); + + b.Property("LogWarnsId") + .HasColumnType("bigint unsigned") + .HasColumnName("logwarnsid"); + + b.Property("MessageDeletedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messagedeletedid"); + + b.Property("MessageUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageupdatedid"); + + b.Property("UserBannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userbannedid"); + + b.Property("UserJoinedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userjoinedid"); + + b.Property("UserLeftId") + .HasColumnType("bigint unsigned") + .HasColumnName("userleftid"); + + b.Property("UserMutedId") + .HasColumnType("bigint unsigned") + .HasColumnName("usermutedid"); + + b.Property("UserUnbannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userunbannedid"); + + b.Property("UserUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userupdatedid"); + + b.HasKey("Id") + .HasName("pk_logsettings"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_logsettings_guildid"); + + b.ToTable("logsettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlayerSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDisconnect") + .HasColumnType("tinyint(1)") + .HasColumnName("autodisconnect"); + + b.Property("AutoPlay") + .HasColumnType("tinyint(1)") + .HasColumnName("autoplay"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MusicChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("musicchannelid"); + + b.Property("PlayerRepeat") + .HasColumnType("int") + .HasColumnName("playerrepeat"); + + b.Property("QualityPreset") + .HasColumnType("int") + .HasColumnName("qualitypreset"); + + b.Property("Volume") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .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.Services.Database.Models.MusicPlaylist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Author") + .HasColumnType("longtext") + .HasColumnName("author"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.HasKey("Id") + .HasName("pk_musicplaylists"); + + b.ToTable("musicplaylists", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_muteduserid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_muteduserid_guildconfigid"); + + b.ToTable("muteduserid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AllowTarget") + .HasColumnType("tinyint(1)") + .HasColumnName("allowtarget"); + + b.Property("AutoDeleteTrigger") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeletetrigger"); + + b.Property("ContainsAnywhere") + .HasColumnType("tinyint(1)") + .HasColumnName("containsanywhere"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DmResponse") + .HasColumnType("tinyint(1)") + .HasColumnName("dmresponse"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Reactions") + .HasColumnType("longtext") + .HasColumnName("reactions"); + + b.Property("Response") + .HasColumnType("longtext") + .HasColumnName("response"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_expressions"); + + b.ToTable("expressions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NsfwBlacklistedTag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Tag") + .HasColumnType("longtext") + .HasColumnName("tag"); + + b.HasKey("Id") + .HasName("pk_nsfwblacklistedtags"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_nsfwblacklistedtags_guildid"); + + b.ToTable("nsfwblacklistedtags", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("IsCustomCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("iscustomcommand"); + + b.Property("PrimaryTarget") + .HasColumnType("int") + .HasColumnName("primarytarget"); + + b.Property("PrimaryTargetId") + .HasColumnType("bigint unsigned") + .HasColumnName("primarytargetid"); + + b.Property("SecondaryTarget") + .HasColumnType("int") + .HasColumnName("secondarytarget"); + + b.Property("SecondaryTargetName") + .HasColumnType("longtext") + .HasColumnName("secondarytargetname"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_permissions"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_permissions_guildconfigid"); + + b.ToTable("permissions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlantedCurrency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Password") + .HasColumnType("longtext") + .HasColumnName("password"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.PlaylistSong", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MusicPlaylistId") + .HasColumnType("int") + .HasColumnName("musicplaylistid"); + + b.Property("Provider") + .HasColumnType("longtext") + .HasColumnName("provider"); + + b.Property("ProviderType") + .HasColumnType("int") + .HasColumnName("providertype"); + + b.Property("Query") + .HasColumnType("longtext") + .HasColumnName("query"); + + b.Property("Title") + .HasColumnType("longtext") + .HasColumnName("title"); + + b.Property("Uri") + .HasColumnType("longtext") + .HasColumnName("uri"); + + b.HasKey("Id") + .HasName("pk_playlistsong"); + + b.HasIndex("MusicPlaylistId") + .HasDatabaseName("ix_playlistsong_musicplaylistid"); + + b.ToTable("playlistsong", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Question") + .HasColumnType("longtext") + .HasColumnName("question"); + + b.HasKey("Id") + .HasName("pk_poll"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_poll_guildid"); + + b.ToTable("poll", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_pollanswer"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollanswer_pollid"); + + b.ToTable("pollanswer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("VoteIndex") + .HasColumnType("int") + .HasColumnName("voteindex"); + + b.HasKey("Id") + .HasName("pk_pollvote"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollvote_pollid"); + + b.ToTable("pollvote", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Quote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("AuthorName") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("authorname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Keyword") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("keyword"); + + b.Property("Text") + .IsRequired() + .HasColumnType("longtext") + .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.Services.Database.Models.ReactionRoleV2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Emote") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("emote"); + + b.Property("Group") + .HasColumnType("int") + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelReq") + .HasColumnType("int") + .HasColumnName("levelreq"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.Reminder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsPrivate") + .HasColumnType("tinyint(1)") + .HasColumnName("isprivate"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("ServerId") + .HasColumnType("bigint unsigned") + .HasColumnName("serverid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("When") + .HasColumnType("datetime(6)") + .HasColumnName("when"); + + b.HasKey("Id") + .HasName("pk_reminders"); + + b.HasIndex("When") + .HasDatabaseName("ix_reminders_when"); + + b.ToTable("reminders", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Repeater", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Interval") + .HasColumnType("time(6)") + .HasColumnName("interval"); + + b.Property("LastMessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("lastmessageid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("NoRedundant") + .HasColumnType("tinyint(1)") + .HasColumnName("noredundant"); + + b.Property("StartTimeOfDay") + .HasColumnType("time(6)") + .HasColumnName("starttimeofday"); + + b.HasKey("Id") + .HasName("pk_repeaters"); + + b.ToTable("repeaters", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RewardedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AmountRewardedThisMonth") + .HasColumnType("bigint") + .HasColumnName("amountrewardedthismonth"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LastReward") + .HasColumnType("datetime(6)") + .HasColumnName("lastreward"); + + b.Property("PlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("platformuserid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_rewardedusers"); + + b.HasIndex("PlatformUserId") + .IsUnique() + .HasDatabaseName("ix_rewardedusers_platformuserid"); + + b.ToTable("rewardedusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RotatingPlayingStatus", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Status") + .HasColumnType("longtext") + .HasColumnName("status"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_rotatingstatus"); + + b.ToTable("rotatingstatus", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SelfAssignedRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Group") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelRequirement") + .HasColumnType("int") + .HasColumnName("levelrequirement"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.ShopEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Price") + .HasColumnType("int") + .HasColumnName("price"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("RoleName") + .HasColumnType("longtext") + .HasColumnName("rolename"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_shopentry"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_shopentry_guildconfigid"); + + b.ToTable("shopentry", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ShopEntryId") + .HasColumnType("int") + .HasColumnName("shopentryid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_shopentryitem"); + + b.HasIndex("ShopEntryId") + .HasDatabaseName("ix_shopentryitem_shopentryid"); + + b.ToTable("shopentryitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoredrole"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoredrole_guildconfigid"); + + b.ToTable("slowmodeignoredrole", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoreduser"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoreduser_guildconfigid"); + + b.ToTable("slowmodeignoreduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamroleblacklisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamroleblacklisteduser_streamrolesettingsid"); + + b.ToTable("streamroleblacklisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AddRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("addroleid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)") + .HasColumnName("enabled"); + + b.Property("FromRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("fromroleid"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Keyword") + .HasColumnType("longtext") + .HasColumnName("keyword"); + + b.HasKey("Id") + .HasName("pk_streamrolesettings"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_streamrolesettings_guildconfigid"); + + b.ToTable("streamrolesettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamrolewhitelisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamrolewhitelisteduser_streamrolesettingsid"); + + b.ToTable("streamrolewhitelisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unbantimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unbantimer_guildconfigid"); + + b.ToTable("unbantimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnmuteAt") + .HasColumnType("datetime(6)") + .HasColumnName("unmuteat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unmutetimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unmutetimer_guildconfigid"); + + b.ToTable("unmutetimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unroletimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unroletimer_guildconfigid"); + + b.ToTable("unroletimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UserXpStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AwardedXp") + .HasColumnType("bigint") + .HasColumnName("awardedxp"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LastLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastlevelup") + .HasDefaultValueSql("(UTC_TIMESTAMP)"); + + b.Property("NotifyOnLevelUp") + .HasColumnType("int") + .HasColumnName("notifyonlevelup"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.VcRoleInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.HasKey("Id") + .HasName("pk_vcroleinfo"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_vcroleinfo_guildconfigid"); + + b.ToTable("vcroleinfo", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AffinityId") + .HasColumnType("int") + .HasColumnName("affinityid"); + + b.Property("ClaimerId") + .HasColumnType("int") + .HasColumnName("claimerid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Price") + .HasColumnType("bigint") + .HasColumnName("price"); + + b.Property("WaifuId") + .HasColumnType("int") + .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.Services.Database.Models.WaifuItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemEmoji") + .HasColumnType("longtext") + .HasColumnName("itememoji"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("WaifuInfoId") + .HasColumnType("int") + .HasColumnName("waifuinfoid"); + + b.HasKey("Id") + .HasName("pk_waifuitem"); + + b.HasIndex("WaifuInfoId") + .HasDatabaseName("ix_waifuitem_waifuinfoid"); + + b.ToTable("waifuitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("NewId") + .HasColumnType("int") + .HasColumnName("newid"); + + b.Property("OldId") + .HasColumnType("int") + .HasColumnName("oldid"); + + b.Property("UpdateType") + .HasColumnType("int") + .HasColumnName("updatetype"); + + b.Property("UserId") + .HasColumnType("int") + .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.Services.Database.Models.Warning", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Forgiven") + .HasColumnType("tinyint(1)") + .HasColumnName("forgiven"); + + b.Property("ForgivenBy") + .HasColumnType("longtext") + .HasColumnName("forgivenby"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Moderator") + .HasColumnType("longtext") + .HasColumnName("moderator"); + + b.Property("Reason") + .HasColumnType("longtext") + .HasColumnName("reason"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.WarningPunishment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Count") + .HasColumnType("int") + .HasColumnName("count"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Punishment") + .HasColumnType("int") + .HasColumnName("punishment"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("Time") + .HasColumnType("int") + .HasColumnName("time"); + + b.HasKey("Id") + .HasName("pk_warningpunishment"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_warningpunishment_guildconfigid"); + + b.ToTable("warningpunishment", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("int") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_xpcurrencyreward"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_xpcurrencyreward_xpsettingsid"); + + b.ToTable("xpcurrencyreward", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("Remove") + .HasColumnType("tinyint(1)") + .HasColumnName("remove"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .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.Services.Database.Models.XpSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("ServerExcluded") + .HasColumnType("tinyint(1)") + .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.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.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.FollowedStream", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FollowedStreams") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithOne("AntiAltSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiAltSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiRaidSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiRaidSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.HasOne("EllieBot.Services.Database.Models.AntiSpamSetting", null) + .WithMany("IgnoredChannels") + .HasForeignKey("AntiSpamSettingId") + .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiSpamSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiSpamSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.AutoTranslateChannel", "Channel") + .WithMany("Users") + .HasForeignKey("ChannelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); + + b.Navigation("Channel"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandAliases") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandCooldowns") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("DelMsgOnCmdChannels") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", null) + .WithMany("ExclusionList") + .HasForeignKey("XpSettingsId") + .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("FeedSubs") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_feedsub_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterInvitesChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilteredWords") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterLinksChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterWordsChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("GenerateCurrencyChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("SelfAssignableRoleGroupNames") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_groupname_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany("LogIgnores") + .HasForeignKey("LogSettingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ignoredlogchannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany() + .HasForeignKey("LogSettingId") + .HasConstraintName("fk_ignoredvoicepresencechannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("MutedUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("Permissions") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlaylistSong", b => + { + b.HasOne("EllieBot.Services.Database.Models.MusicPlaylist", null) + .WithMany("Songs") + .HasForeignKey("MusicPlaylistId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Answers") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollanswer_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Votes") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollvote_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("ShopEntries") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.ShopEntry", null) + .WithMany("Items") + .HasForeignKey("ShopEntryId") + .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredRoles") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Blacklist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("StreamRole") + .HasForeignKey("EllieBot.Services.Database.Models.StreamRoleSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Whitelist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnbanTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnmuteTimers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnroleTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.VcRoleInfo", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("VcRoleInfos") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WaifuInfo", "WaifuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); + + b.Navigation("Affinity"); + + b.Navigation("Claimer"); + + b.Navigation("Waifu"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.WaifuInfo", "WaifuInfo") + .WithMany("Items") + .HasForeignKey("WaifuInfoId") + .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); + + b.Navigation("WaifuInfo"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WarningPunishment", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("WarnPunishments") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_warningpunishment_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("CurrencyRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpcurrencyreward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("RoleRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xprolereward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("XpSettings") + .HasForeignKey("EllieBot.Services.Database.Models.XpSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => + { + b.Navigation("Applicants"); + + b.Navigation("Bans"); + + b.Navigation("Members"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Navigation("IgnoredChannels"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.LogSetting", b => + { + b.Navigation("LogIgnores"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlaylist", b => + { + b.Navigation("Songs"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Navigation("Answers"); + + b.Navigation("Votes"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Navigation("Blacklist"); + + b.Navigation("Whitelist"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.Navigation("CurrencyRewards"); + + b.Navigation("ExclusionList"); + + b.Navigation("RoleRewards"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220703194400_logwarns.cs b/src/EllieBot/Migrations/Mysql/20220703194400_logwarns.cs new file mode 100644 index 0000000..02adc4e --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220703194400_logwarns.cs @@ -0,0 +1,25 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + public partial class logwarns : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "logwarnsid", + table: "logsettings", + type: "bigint unsigned", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "logwarnsid", + table: "logsettings"); + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220725155953_xpitemshop.Designer.cs b/src/EllieBot/Migrations/Mysql/20220725155953_xpitemshop.Designer.cs new file mode 100644 index 0000000..28e1540 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220725155953_xpitemshop.Designer.cs @@ -0,0 +1,3556 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using EllieBot.Services.Database; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + [DbContext(typeof(MysqlContext))] + [Migration("20220725155953_xpitemshop")] + partial class xpitemshop + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Balance") + .HasColumnType("bigint") + .HasColumnName("balance"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.ClubApplicants", b => + { + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Description") + .HasColumnType("longtext") + .HasColumnName("description"); + + b.Property("ImageUrl") + .HasColumnType("longtext") + .HasColumnName("imageurl"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("name") + .UseCollation("utf8mb4_bin"); + + b.Property("OwnerId") + .HasColumnType("int") + .HasColumnName("ownerid"); + + b.Property("Xp") + .HasColumnType("int") + .HasColumnName("xp"); + + b.HasKey("Id") + .HasName("pk_clubs"); + + b.HasAlternateKey("Name") + .HasName("ak_clubs_name"); + + b.HasIndex("OwnerId") + .IsUnique() + .HasDatabaseName("ix_clubs_ownerid"); + + b.ToTable("clubs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AvatarId") + .HasColumnType("longtext") + .HasColumnName("avatarid"); + + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("CurrencyAmount") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("currencyamount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Discriminator") + .HasColumnType("longtext") + .HasColumnName("discriminator"); + + b.Property("IsClubAdmin") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("isclubadmin"); + + b.Property("LastLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastlevelup") + .HasDefaultValueSql("(UTC_TIMESTAMP)"); + + b.Property("LastXpGain") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastxpgain") + .HasDefaultValueSql("(UTC_TIMESTAMP - INTERVAL 1 year)"); + + b.Property("NotifyOnLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("notifyonlevelup"); + + b.Property("TotalXp") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("totalxp"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .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.FollowedStream", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.Property("Username") + .HasColumnType("longtext") + .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.PatronQuota", b => + { + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("FeatureType") + .HasColumnType("int") + .HasColumnName("featuretype"); + + b.Property("Feature") + .HasColumnType("varchar(255)") + .HasColumnName("feature"); + + b.Property("DailyCount") + .HasColumnType("int unsigned") + .HasColumnName("dailycount"); + + b.Property("HourlyCount") + .HasColumnType("int unsigned") + .HasColumnName("hourlycount"); + + b.Property("MonthlyCount") + .HasColumnType("int unsigned") + .HasColumnName("monthlycount"); + + b.HasKey("UserId", "FeatureType", "Feature") + .HasName("pk_patronquotas"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_patronquotas_userid"); + + b.ToTable("patronquotas", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => + { + b.Property("UserId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("AmountCents") + .HasColumnType("int") + .HasColumnName("amountcents"); + + b.Property("LastCharge") + .HasColumnType("datetime(6)") + .HasColumnName("lastcharge"); + + b.Property("UniquePlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("uniqueplatformuserid"); + + b.Property("ValidThru") + .HasColumnType("datetime(6)") + .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.StreamOnlineMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_streamonlinemessages"); + + b.ToTable("streamonlinemessages", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.XpShopOwnedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsUsing") + .HasColumnType("tinyint(1)") + .HasColumnName("isusing"); + + b.Property("ItemKey") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("itemkey"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Database.Models.AntiAltSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("ActionDurationMinutes") + .HasColumnType("int") + .HasColumnName("actiondurationminutes"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MinAge") + .HasColumnType("time(6)") + .HasColumnName("minage"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antialtsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antialtsetting_guildconfigid"); + + b.ToTable("antialtsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("PunishDuration") + .HasColumnType("int") + .HasColumnName("punishduration"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.Property("UserThreshold") + .HasColumnType("int") + .HasColumnName("userthreshold"); + + b.HasKey("Id") + .HasName("pk_antiraidsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antiraidsetting_guildconfigid"); + + b.ToTable("antiraidsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AntiSpamSettingId") + .HasColumnType("int") + .HasColumnName("antispamsettingid"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.HasKey("Id") + .HasName("pk_antispamignore"); + + b.HasIndex("AntiSpamSettingId") + .HasDatabaseName("ix_antispamignore_antispamsettingid"); + + b.ToTable("antispamignore", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MessageThreshold") + .HasColumnType("int") + .HasColumnName("messagethreshold"); + + b.Property("MuteTime") + .HasColumnType("int") + .HasColumnName("mutetime"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antispamsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antispamsetting_guildconfigid"); + + b.ToTable("antispamsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoCommand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("ChannelName") + .HasColumnType("longtext") + .HasColumnName("channelname"); + + b.Property("CommandText") + .HasColumnType("longtext") + .HasColumnName("commandtext"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("GuildName") + .HasColumnType("longtext") + .HasColumnName("guildname"); + + b.Property("Interval") + .HasColumnType("int") + .HasColumnName("interval"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.Property("VoiceChannelName") + .HasColumnType("longtext") + .HasColumnName("voicechannelname"); + + b.HasKey("Id") + .HasName("pk_autocommands"); + + b.ToTable("autocommands", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDelete") + .HasColumnType("tinyint(1)") + .HasColumnName("autodelete"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_autotranslatechannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_autotranslatechannels_channelid"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_autotranslatechannels_guildid"); + + b.ToTable("autotranslatechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("int") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Source") + .HasColumnType("longtext") + .HasColumnName("source"); + + b.Property("Target") + .HasColumnType("longtext") + .HasColumnName("target"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_autotranslateusers"); + + b.HasAlternateKey("ChannelId", "UserId") + .HasName("ak_autotranslateusers_channelid_userid"); + + b.ToTable("autotranslateusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BanTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_bantemplates"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_bantemplates_guildid"); + + b.ToTable("bantemplates", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BlacklistEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_blacklist"); + + b.ToTable("blacklist", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Mapping") + .HasColumnType("longtext") + .HasColumnName("mapping"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_commandalias"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandalias_guildconfigid"); + + b.ToTable("commandalias", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("CommandName") + .HasColumnType("longtext") + .HasColumnName("commandname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.HasKey("Id") + .HasName("pk_commandcooldown"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandcooldown_guildconfigid"); + + b.ToTable("commandcooldown", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CurrencyTransaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Extra") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("extra"); + + b.Property("Note") + .HasColumnType("longtext") + .HasColumnName("note"); + + b.Property("OtherId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("otherid") + .HasDefaultValueSql("NULL"); + + b.Property("Type") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("type"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_currencytransactions"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_currencytransactions_userid"); + + b.ToTable("currencytransactions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_delmsgoncmdchannel"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); + + b.ToTable("delmsgoncmdchannel", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DiscordPermOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Command") + .HasColumnType("varchar(255)") + .HasColumnName("command"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Perm") + .HasColumnType("bigint unsigned") + .HasColumnName("perm"); + + b.HasKey("Id") + .HasName("pk_discordpermoverrides"); + + b.HasIndex("GuildId", "Command") + .IsUnique() + .HasDatabaseName("ix_discordpermoverrides_guildid_command"); + + b.ToTable("discordpermoverrides", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_excludeditem"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_excludeditem_xpsettingsid"); + + b.ToTable("excludeditem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Url") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("url"); + + b.HasKey("Id") + .HasName("pk_feedsub"); + + b.HasAlternateKey("GuildConfigId", "Url") + .HasName("ak_feedsub_guildconfigid_url"); + + b.ToTable("feedsub", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterchannelid_guildconfigid"); + + b.ToTable("filterchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Word") + .HasColumnType("longtext") + .HasColumnName("word"); + + b.HasKey("Id") + .HasName("pk_filteredword"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filteredword_guildconfigid"); + + b.ToTable("filteredword", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterlinkschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); + + b.ToTable("filterlinkschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterwordschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); + + b.ToTable("filterwordschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_gcchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_gcchannelid_guildconfigid"); + + b.ToTable("gcchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Number") + .HasColumnType("int") + .HasColumnName("number"); + + b.HasKey("Id") + .HasName("pk_groupname"); + + b.HasIndex("GuildConfigId", "Number") + .IsUnique() + .HasDatabaseName("ix_groupname_guildconfigid_number"); + + b.ToTable("groupname", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GuildConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoAssignRoleIds") + .HasColumnType("longtext") + .HasColumnName("autoassignroleids"); + + b.Property("AutoDeleteByeMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletebyemessagestimer"); + + b.Property("AutoDeleteGreetMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletegreetmessagestimer"); + + b.Property("AutoDeleteSelfAssignedRoleMessages") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeleteselfassignedrolemessages"); + + b.Property("BoostMessage") + .HasColumnType("longtext") + .HasColumnName("boostmessage"); + + b.Property("BoostMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("boostmessagechannelid"); + + b.Property("BoostMessageDeleteAfter") + .HasColumnType("int") + .HasColumnName("boostmessagedeleteafter"); + + b.Property("ByeMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("byemessagechannelid"); + + b.Property("ChannelByeMessageText") + .HasColumnType("longtext") + .HasColumnName("channelbyemessagetext"); + + b.Property("ChannelGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("channelgreetmessagetext"); + + b.Property("CleverbotEnabled") + .HasColumnType("tinyint(1)") + .HasColumnName("cleverbotenabled"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DeleteMessageOnCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("deletemessageoncommand"); + + b.Property("DeleteStreamOnlineMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("deletestreamonlinemessage"); + + b.Property("DmGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("dmgreetmessagetext"); + + b.Property("ExclusiveSelfAssignedRoles") + .HasColumnType("tinyint(1)") + .HasColumnName("exclusiveselfassignedroles"); + + b.Property("FilterInvites") + .HasColumnType("tinyint(1)") + .HasColumnName("filterinvites"); + + b.Property("FilterLinks") + .HasColumnType("tinyint(1)") + .HasColumnName("filterlinks"); + + b.Property("FilterWords") + .HasColumnType("tinyint(1)") + .HasColumnName("filterwords"); + + b.Property("GameVoiceChannel") + .HasColumnType("bigint unsigned") + .HasColumnName("gamevoicechannel"); + + b.Property("GreetMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("greetmessagechannelid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Locale") + .HasColumnType("longtext") + .HasColumnName("locale"); + + b.Property("MuteRoleName") + .HasColumnType("longtext") + .HasColumnName("muterolename"); + + b.Property("NotifyStreamOffline") + .HasColumnType("tinyint(1)") + .HasColumnName("notifystreamoffline"); + + b.Property("PermissionRole") + .HasColumnType("longtext") + .HasColumnName("permissionrole"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasColumnName("prefix"); + + b.Property("SendBoostMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendboostmessage"); + + b.Property("SendChannelByeMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelbyemessage"); + + b.Property("SendChannelGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelgreetmessage"); + + b.Property("SendDmGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("senddmgreetmessage"); + + b.Property("TimeZoneId") + .HasColumnType("longtext") + .HasColumnName("timezoneid"); + + b.Property("VerboseErrors") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true) + .HasColumnName("verboseerrors"); + + b.Property("VerbosePermissions") + .HasColumnType("tinyint(1)") + .HasColumnName("verbosepermissions"); + + b.Property("WarnExpireAction") + .HasColumnType("int") + .HasColumnName("warnexpireaction"); + + b.Property("WarnExpireHours") + .HasColumnType("int") + .HasColumnName("warnexpirehours"); + + b.Property("WarningsInitialized") + .HasColumnType("tinyint(1)") + .HasColumnName("warningsinitialized"); + + b.HasKey("Id") + .HasName("pk_guildconfigs"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_guildconfigs_guildid"); + + b.HasIndex("WarnExpireHours") + .HasDatabaseName("ix_guildconfigs_warnexpirehours"); + + b.ToTable("guildconfigs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("LogItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("logitemid"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredlogchannels"); + + b.HasIndex("LogSettingId", "LogItemId", "ItemType") + .IsUnique() + .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype"); + + b.ToTable("ignoredlogchannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredvoicepresencechannels"); + + b.HasIndex("LogSettingId") + .HasDatabaseName("ix_ignoredvoicepresencechannels_logsettingid"); + + b.ToTable("ignoredvoicepresencechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ImageOnlyChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_imageonlychannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_imageonlychannels_channelid"); + + b.ToTable("imageonlychannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.LogSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelCreatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelcreatedid"); + + b.Property("ChannelDestroyedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channeldestroyedid"); + + b.Property("ChannelUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelupdatedid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LogOtherId") + .HasColumnType("bigint unsigned") + .HasColumnName("logotherid"); + + b.Property("LogUserPresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("loguserpresenceid"); + + b.Property("LogVoicePresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresenceid"); + + b.Property("LogVoicePresenceTTSId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresencettsid"); + + b.Property("LogWarnsId") + .HasColumnType("bigint unsigned") + .HasColumnName("logwarnsid"); + + b.Property("MessageDeletedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messagedeletedid"); + + b.Property("MessageUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageupdatedid"); + + b.Property("UserBannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userbannedid"); + + b.Property("UserJoinedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userjoinedid"); + + b.Property("UserLeftId") + .HasColumnType("bigint unsigned") + .HasColumnName("userleftid"); + + b.Property("UserMutedId") + .HasColumnType("bigint unsigned") + .HasColumnName("usermutedid"); + + b.Property("UserUnbannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userunbannedid"); + + b.Property("UserUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userupdatedid"); + + b.HasKey("Id") + .HasName("pk_logsettings"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_logsettings_guildid"); + + b.ToTable("logsettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlayerSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDisconnect") + .HasColumnType("tinyint(1)") + .HasColumnName("autodisconnect"); + + b.Property("AutoPlay") + .HasColumnType("tinyint(1)") + .HasColumnName("autoplay"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MusicChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("musicchannelid"); + + b.Property("PlayerRepeat") + .HasColumnType("int") + .HasColumnName("playerrepeat"); + + b.Property("QualityPreset") + .HasColumnType("int") + .HasColumnName("qualitypreset"); + + b.Property("Volume") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .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.Services.Database.Models.MusicPlaylist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Author") + .HasColumnType("longtext") + .HasColumnName("author"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.HasKey("Id") + .HasName("pk_musicplaylists"); + + b.ToTable("musicplaylists", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_muteduserid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_muteduserid_guildconfigid"); + + b.ToTable("muteduserid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AllowTarget") + .HasColumnType("tinyint(1)") + .HasColumnName("allowtarget"); + + b.Property("AutoDeleteTrigger") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeletetrigger"); + + b.Property("ContainsAnywhere") + .HasColumnType("tinyint(1)") + .HasColumnName("containsanywhere"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DmResponse") + .HasColumnType("tinyint(1)") + .HasColumnName("dmresponse"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Reactions") + .HasColumnType("longtext") + .HasColumnName("reactions"); + + b.Property("Response") + .HasColumnType("longtext") + .HasColumnName("response"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_expressions"); + + b.ToTable("expressions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NsfwBlacklistedTag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Tag") + .HasColumnType("longtext") + .HasColumnName("tag"); + + b.HasKey("Id") + .HasName("pk_nsfwblacklistedtags"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_nsfwblacklistedtags_guildid"); + + b.ToTable("nsfwblacklistedtags", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("IsCustomCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("iscustomcommand"); + + b.Property("PrimaryTarget") + .HasColumnType("int") + .HasColumnName("primarytarget"); + + b.Property("PrimaryTargetId") + .HasColumnType("bigint unsigned") + .HasColumnName("primarytargetid"); + + b.Property("SecondaryTarget") + .HasColumnType("int") + .HasColumnName("secondarytarget"); + + b.Property("SecondaryTargetName") + .HasColumnType("longtext") + .HasColumnName("secondarytargetname"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_permissions"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_permissions_guildconfigid"); + + b.ToTable("permissions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlantedCurrency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Password") + .HasColumnType("longtext") + .HasColumnName("password"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.PlaylistSong", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MusicPlaylistId") + .HasColumnType("int") + .HasColumnName("musicplaylistid"); + + b.Property("Provider") + .HasColumnType("longtext") + .HasColumnName("provider"); + + b.Property("ProviderType") + .HasColumnType("int") + .HasColumnName("providertype"); + + b.Property("Query") + .HasColumnType("longtext") + .HasColumnName("query"); + + b.Property("Title") + .HasColumnType("longtext") + .HasColumnName("title"); + + b.Property("Uri") + .HasColumnType("longtext") + .HasColumnName("uri"); + + b.HasKey("Id") + .HasName("pk_playlistsong"); + + b.HasIndex("MusicPlaylistId") + .HasDatabaseName("ix_playlistsong_musicplaylistid"); + + b.ToTable("playlistsong", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Question") + .HasColumnType("longtext") + .HasColumnName("question"); + + b.HasKey("Id") + .HasName("pk_poll"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_poll_guildid"); + + b.ToTable("poll", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_pollanswer"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollanswer_pollid"); + + b.ToTable("pollanswer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("VoteIndex") + .HasColumnType("int") + .HasColumnName("voteindex"); + + b.HasKey("Id") + .HasName("pk_pollvote"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollvote_pollid"); + + b.ToTable("pollvote", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Quote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("AuthorName") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("authorname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Keyword") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("keyword"); + + b.Property("Text") + .IsRequired() + .HasColumnType("longtext") + .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.Services.Database.Models.ReactionRoleV2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Emote") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("emote"); + + b.Property("Group") + .HasColumnType("int") + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelReq") + .HasColumnType("int") + .HasColumnName("levelreq"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.Reminder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsPrivate") + .HasColumnType("tinyint(1)") + .HasColumnName("isprivate"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("ServerId") + .HasColumnType("bigint unsigned") + .HasColumnName("serverid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("When") + .HasColumnType("datetime(6)") + .HasColumnName("when"); + + b.HasKey("Id") + .HasName("pk_reminders"); + + b.HasIndex("When") + .HasDatabaseName("ix_reminders_when"); + + b.ToTable("reminders", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Repeater", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Interval") + .HasColumnType("time(6)") + .HasColumnName("interval"); + + b.Property("LastMessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("lastmessageid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("NoRedundant") + .HasColumnType("tinyint(1)") + .HasColumnName("noredundant"); + + b.Property("StartTimeOfDay") + .HasColumnType("time(6)") + .HasColumnName("starttimeofday"); + + b.HasKey("Id") + .HasName("pk_repeaters"); + + b.ToTable("repeaters", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RewardedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AmountRewardedThisMonth") + .HasColumnType("bigint") + .HasColumnName("amountrewardedthismonth"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LastReward") + .HasColumnType("datetime(6)") + .HasColumnName("lastreward"); + + b.Property("PlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("platformuserid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_rewardedusers"); + + b.HasIndex("PlatformUserId") + .IsUnique() + .HasDatabaseName("ix_rewardedusers_platformuserid"); + + b.ToTable("rewardedusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RotatingPlayingStatus", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Status") + .HasColumnType("longtext") + .HasColumnName("status"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_rotatingstatus"); + + b.ToTable("rotatingstatus", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SelfAssignedRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Group") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelRequirement") + .HasColumnType("int") + .HasColumnName("levelrequirement"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.ShopEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Price") + .HasColumnType("int") + .HasColumnName("price"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("RoleName") + .HasColumnType("longtext") + .HasColumnName("rolename"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_shopentry"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_shopentry_guildconfigid"); + + b.ToTable("shopentry", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ShopEntryId") + .HasColumnType("int") + .HasColumnName("shopentryid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_shopentryitem"); + + b.HasIndex("ShopEntryId") + .HasDatabaseName("ix_shopentryitem_shopentryid"); + + b.ToTable("shopentryitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoredrole"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoredrole_guildconfigid"); + + b.ToTable("slowmodeignoredrole", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoreduser"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoreduser_guildconfigid"); + + b.ToTable("slowmodeignoreduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamroleblacklisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamroleblacklisteduser_streamrolesettingsid"); + + b.ToTable("streamroleblacklisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AddRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("addroleid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)") + .HasColumnName("enabled"); + + b.Property("FromRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("fromroleid"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Keyword") + .HasColumnType("longtext") + .HasColumnName("keyword"); + + b.HasKey("Id") + .HasName("pk_streamrolesettings"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_streamrolesettings_guildconfigid"); + + b.ToTable("streamrolesettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamrolewhitelisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamrolewhitelisteduser_streamrolesettingsid"); + + b.ToTable("streamrolewhitelisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unbantimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unbantimer_guildconfigid"); + + b.ToTable("unbantimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnmuteAt") + .HasColumnType("datetime(6)") + .HasColumnName("unmuteat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unmutetimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unmutetimer_guildconfigid"); + + b.ToTable("unmutetimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unroletimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unroletimer_guildconfigid"); + + b.ToTable("unroletimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UserXpStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AwardedXp") + .HasColumnType("bigint") + .HasColumnName("awardedxp"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LastLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastlevelup") + .HasDefaultValueSql("(UTC_TIMESTAMP)"); + + b.Property("NotifyOnLevelUp") + .HasColumnType("int") + .HasColumnName("notifyonlevelup"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.VcRoleInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.HasKey("Id") + .HasName("pk_vcroleinfo"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_vcroleinfo_guildconfigid"); + + b.ToTable("vcroleinfo", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AffinityId") + .HasColumnType("int") + .HasColumnName("affinityid"); + + b.Property("ClaimerId") + .HasColumnType("int") + .HasColumnName("claimerid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Price") + .HasColumnType("bigint") + .HasColumnName("price"); + + b.Property("WaifuId") + .HasColumnType("int") + .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.Services.Database.Models.WaifuItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemEmoji") + .HasColumnType("longtext") + .HasColumnName("itememoji"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("WaifuInfoId") + .HasColumnType("int") + .HasColumnName("waifuinfoid"); + + b.HasKey("Id") + .HasName("pk_waifuitem"); + + b.HasIndex("WaifuInfoId") + .HasDatabaseName("ix_waifuitem_waifuinfoid"); + + b.ToTable("waifuitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("NewId") + .HasColumnType("int") + .HasColumnName("newid"); + + b.Property("OldId") + .HasColumnType("int") + .HasColumnName("oldid"); + + b.Property("UpdateType") + .HasColumnType("int") + .HasColumnName("updatetype"); + + b.Property("UserId") + .HasColumnType("int") + .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.Services.Database.Models.Warning", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Forgiven") + .HasColumnType("tinyint(1)") + .HasColumnName("forgiven"); + + b.Property("ForgivenBy") + .HasColumnType("longtext") + .HasColumnName("forgivenby"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Moderator") + .HasColumnType("longtext") + .HasColumnName("moderator"); + + b.Property("Reason") + .HasColumnType("longtext") + .HasColumnName("reason"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.WarningPunishment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Count") + .HasColumnType("int") + .HasColumnName("count"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Punishment") + .HasColumnType("int") + .HasColumnName("punishment"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("Time") + .HasColumnType("int") + .HasColumnName("time"); + + b.HasKey("Id") + .HasName("pk_warningpunishment"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_warningpunishment_guildconfigid"); + + b.ToTable("warningpunishment", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("int") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_xpcurrencyreward"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_xpcurrencyreward_xpsettingsid"); + + b.ToTable("xpcurrencyreward", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("Remove") + .HasColumnType("tinyint(1)") + .HasColumnName("remove"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .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.Services.Database.Models.XpSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("ServerExcluded") + .HasColumnType("tinyint(1)") + .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.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.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.FollowedStream", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FollowedStreams") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithOne("AntiAltSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiAltSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiRaidSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiRaidSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.HasOne("EllieBot.Services.Database.Models.AntiSpamSetting", null) + .WithMany("IgnoredChannels") + .HasForeignKey("AntiSpamSettingId") + .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiSpamSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiSpamSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.AutoTranslateChannel", "Channel") + .WithMany("Users") + .HasForeignKey("ChannelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); + + b.Navigation("Channel"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandAliases") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandCooldowns") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("DelMsgOnCmdChannels") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", null) + .WithMany("ExclusionList") + .HasForeignKey("XpSettingsId") + .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("FeedSubs") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_feedsub_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterInvitesChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilteredWords") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterLinksChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterWordsChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("GenerateCurrencyChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("SelfAssignableRoleGroupNames") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_groupname_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany("LogIgnores") + .HasForeignKey("LogSettingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ignoredlogchannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany() + .HasForeignKey("LogSettingId") + .HasConstraintName("fk_ignoredvoicepresencechannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("MutedUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("Permissions") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlaylistSong", b => + { + b.HasOne("EllieBot.Services.Database.Models.MusicPlaylist", null) + .WithMany("Songs") + .HasForeignKey("MusicPlaylistId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Answers") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollanswer_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Votes") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollvote_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("ShopEntries") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.ShopEntry", null) + .WithMany("Items") + .HasForeignKey("ShopEntryId") + .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredRoles") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Blacklist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("StreamRole") + .HasForeignKey("EllieBot.Services.Database.Models.StreamRoleSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Whitelist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnbanTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnmuteTimers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnroleTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.VcRoleInfo", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("VcRoleInfos") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WaifuInfo", "WaifuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); + + b.Navigation("Affinity"); + + b.Navigation("Claimer"); + + b.Navigation("Waifu"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.WaifuInfo", "WaifuInfo") + .WithMany("Items") + .HasForeignKey("WaifuInfoId") + .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); + + b.Navigation("WaifuInfo"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WarningPunishment", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("WarnPunishments") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_warningpunishment_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("CurrencyRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpcurrencyreward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("RoleRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xprolereward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("XpSettings") + .HasForeignKey("EllieBot.Services.Database.Models.XpSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => + { + b.Navigation("Applicants"); + + b.Navigation("Bans"); + + b.Navigation("Members"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Navigation("IgnoredChannels"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.LogSetting", b => + { + b.Navigation("LogIgnores"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlaylist", b => + { + b.Navigation("Songs"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Navigation("Answers"); + + b.Navigation("Votes"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Navigation("Blacklist"); + + b.Navigation("Whitelist"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.Navigation("CurrencyRewards"); + + b.Navigation("ExclusionList"); + + b.Navigation("RoleRewards"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220725155953_xpitemshop.cs b/src/EllieBot/Migrations/Mysql/20220725155953_xpitemshop.cs new file mode 100644 index 0000000..e876590 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220725155953_xpitemshop.cs @@ -0,0 +1,45 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + public partial class xpitemshop : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "xpshopowneditem", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + userid = table.Column(type: "bigint unsigned", nullable: false), + itemtype = table.Column(type: "int", nullable: false), + isusing = table.Column(type: "tinyint(1)", nullable: false), + itemkey = table.Column(type: "varchar(255)", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_xpshopowneditem", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "ix_xpshopowneditem_userid_itemtype_itemkey", + table: "xpshopowneditem", + columns: new[] { "userid", "itemtype", "itemkey" }, + unique: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "xpshopowneditem"); + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220727033931_linkonly-channels.Designer.cs b/src/EllieBot/Migrations/Mysql/20220727033931_linkonly-channels.Designer.cs new file mode 100644 index 0000000..166a899 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220727033931_linkonly-channels.Designer.cs @@ -0,0 +1,3560 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using EllieBot.Services.Database; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + [DbContext(typeof(MysqlContext))] + [Migration("20220727033931_linkonly-channels")] + partial class linkonlychannels + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Balance") + .HasColumnType("bigint") + .HasColumnName("balance"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.ClubApplicants", b => + { + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Description") + .HasColumnType("longtext") + .HasColumnName("description"); + + b.Property("ImageUrl") + .HasColumnType("longtext") + .HasColumnName("imageurl"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("name") + .UseCollation("utf8mb4_bin"); + + b.Property("OwnerId") + .HasColumnType("int") + .HasColumnName("ownerid"); + + b.Property("Xp") + .HasColumnType("int") + .HasColumnName("xp"); + + b.HasKey("Id") + .HasName("pk_clubs"); + + b.HasAlternateKey("Name") + .HasName("ak_clubs_name"); + + b.HasIndex("OwnerId") + .IsUnique() + .HasDatabaseName("ix_clubs_ownerid"); + + b.ToTable("clubs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AvatarId") + .HasColumnType("longtext") + .HasColumnName("avatarid"); + + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("CurrencyAmount") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("currencyamount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Discriminator") + .HasColumnType("longtext") + .HasColumnName("discriminator"); + + b.Property("IsClubAdmin") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("isclubadmin"); + + b.Property("LastLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastlevelup") + .HasDefaultValueSql("(UTC_TIMESTAMP)"); + + b.Property("LastXpGain") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastxpgain") + .HasDefaultValueSql("(UTC_TIMESTAMP - INTERVAL 1 year)"); + + b.Property("NotifyOnLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("notifyonlevelup"); + + b.Property("TotalXp") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("totalxp"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .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.FollowedStream", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.Property("Username") + .HasColumnType("longtext") + .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.PatronQuota", b => + { + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("FeatureType") + .HasColumnType("int") + .HasColumnName("featuretype"); + + b.Property("Feature") + .HasColumnType("varchar(255)") + .HasColumnName("feature"); + + b.Property("DailyCount") + .HasColumnType("int unsigned") + .HasColumnName("dailycount"); + + b.Property("HourlyCount") + .HasColumnType("int unsigned") + .HasColumnName("hourlycount"); + + b.Property("MonthlyCount") + .HasColumnType("int unsigned") + .HasColumnName("monthlycount"); + + b.HasKey("UserId", "FeatureType", "Feature") + .HasName("pk_patronquotas"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_patronquotas_userid"); + + b.ToTable("patronquotas", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => + { + b.Property("UserId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("AmountCents") + .HasColumnType("int") + .HasColumnName("amountcents"); + + b.Property("LastCharge") + .HasColumnType("datetime(6)") + .HasColumnName("lastcharge"); + + b.Property("UniquePlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("uniqueplatformuserid"); + + b.Property("ValidThru") + .HasColumnType("datetime(6)") + .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.StreamOnlineMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_streamonlinemessages"); + + b.ToTable("streamonlinemessages", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.XpShopOwnedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsUsing") + .HasColumnType("tinyint(1)") + .HasColumnName("isusing"); + + b.Property("ItemKey") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("itemkey"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Database.Models.AntiAltSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("ActionDurationMinutes") + .HasColumnType("int") + .HasColumnName("actiondurationminutes"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MinAge") + .HasColumnType("time(6)") + .HasColumnName("minage"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antialtsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antialtsetting_guildconfigid"); + + b.ToTable("antialtsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("PunishDuration") + .HasColumnType("int") + .HasColumnName("punishduration"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.Property("UserThreshold") + .HasColumnType("int") + .HasColumnName("userthreshold"); + + b.HasKey("Id") + .HasName("pk_antiraidsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antiraidsetting_guildconfigid"); + + b.ToTable("antiraidsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AntiSpamSettingId") + .HasColumnType("int") + .HasColumnName("antispamsettingid"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.HasKey("Id") + .HasName("pk_antispamignore"); + + b.HasIndex("AntiSpamSettingId") + .HasDatabaseName("ix_antispamignore_antispamsettingid"); + + b.ToTable("antispamignore", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MessageThreshold") + .HasColumnType("int") + .HasColumnName("messagethreshold"); + + b.Property("MuteTime") + .HasColumnType("int") + .HasColumnName("mutetime"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antispamsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antispamsetting_guildconfigid"); + + b.ToTable("antispamsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoCommand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("ChannelName") + .HasColumnType("longtext") + .HasColumnName("channelname"); + + b.Property("CommandText") + .HasColumnType("longtext") + .HasColumnName("commandtext"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("GuildName") + .HasColumnType("longtext") + .HasColumnName("guildname"); + + b.Property("Interval") + .HasColumnType("int") + .HasColumnName("interval"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.Property("VoiceChannelName") + .HasColumnType("longtext") + .HasColumnName("voicechannelname"); + + b.HasKey("Id") + .HasName("pk_autocommands"); + + b.ToTable("autocommands", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDelete") + .HasColumnType("tinyint(1)") + .HasColumnName("autodelete"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_autotranslatechannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_autotranslatechannels_channelid"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_autotranslatechannels_guildid"); + + b.ToTable("autotranslatechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("int") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Source") + .HasColumnType("longtext") + .HasColumnName("source"); + + b.Property("Target") + .HasColumnType("longtext") + .HasColumnName("target"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_autotranslateusers"); + + b.HasAlternateKey("ChannelId", "UserId") + .HasName("ak_autotranslateusers_channelid_userid"); + + b.ToTable("autotranslateusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BanTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_bantemplates"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_bantemplates_guildid"); + + b.ToTable("bantemplates", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BlacklistEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_blacklist"); + + b.ToTable("blacklist", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Mapping") + .HasColumnType("longtext") + .HasColumnName("mapping"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_commandalias"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandalias_guildconfigid"); + + b.ToTable("commandalias", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("CommandName") + .HasColumnType("longtext") + .HasColumnName("commandname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.HasKey("Id") + .HasName("pk_commandcooldown"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandcooldown_guildconfigid"); + + b.ToTable("commandcooldown", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CurrencyTransaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Extra") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("extra"); + + b.Property("Note") + .HasColumnType("longtext") + .HasColumnName("note"); + + b.Property("OtherId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("otherid") + .HasDefaultValueSql("NULL"); + + b.Property("Type") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("type"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_currencytransactions"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_currencytransactions_userid"); + + b.ToTable("currencytransactions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_delmsgoncmdchannel"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); + + b.ToTable("delmsgoncmdchannel", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DiscordPermOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Command") + .HasColumnType("varchar(255)") + .HasColumnName("command"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Perm") + .HasColumnType("bigint unsigned") + .HasColumnName("perm"); + + b.HasKey("Id") + .HasName("pk_discordpermoverrides"); + + b.HasIndex("GuildId", "Command") + .IsUnique() + .HasDatabaseName("ix_discordpermoverrides_guildid_command"); + + b.ToTable("discordpermoverrides", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_excludeditem"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_excludeditem_xpsettingsid"); + + b.ToTable("excludeditem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Url") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("url"); + + b.HasKey("Id") + .HasName("pk_feedsub"); + + b.HasAlternateKey("GuildConfigId", "Url") + .HasName("ak_feedsub_guildconfigid_url"); + + b.ToTable("feedsub", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterchannelid_guildconfigid"); + + b.ToTable("filterchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Word") + .HasColumnType("longtext") + .HasColumnName("word"); + + b.HasKey("Id") + .HasName("pk_filteredword"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filteredword_guildconfigid"); + + b.ToTable("filteredword", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterlinkschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); + + b.ToTable("filterlinkschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterwordschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); + + b.ToTable("filterwordschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_gcchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_gcchannelid_guildconfigid"); + + b.ToTable("gcchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Number") + .HasColumnType("int") + .HasColumnName("number"); + + b.HasKey("Id") + .HasName("pk_groupname"); + + b.HasIndex("GuildConfigId", "Number") + .IsUnique() + .HasDatabaseName("ix_groupname_guildconfigid_number"); + + b.ToTable("groupname", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GuildConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoAssignRoleIds") + .HasColumnType("longtext") + .HasColumnName("autoassignroleids"); + + b.Property("AutoDeleteByeMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletebyemessagestimer"); + + b.Property("AutoDeleteGreetMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletegreetmessagestimer"); + + b.Property("AutoDeleteSelfAssignedRoleMessages") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeleteselfassignedrolemessages"); + + b.Property("BoostMessage") + .HasColumnType("longtext") + .HasColumnName("boostmessage"); + + b.Property("BoostMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("boostmessagechannelid"); + + b.Property("BoostMessageDeleteAfter") + .HasColumnType("int") + .HasColumnName("boostmessagedeleteafter"); + + b.Property("ByeMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("byemessagechannelid"); + + b.Property("ChannelByeMessageText") + .HasColumnType("longtext") + .HasColumnName("channelbyemessagetext"); + + b.Property("ChannelGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("channelgreetmessagetext"); + + b.Property("CleverbotEnabled") + .HasColumnType("tinyint(1)") + .HasColumnName("cleverbotenabled"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DeleteMessageOnCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("deletemessageoncommand"); + + b.Property("DeleteStreamOnlineMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("deletestreamonlinemessage"); + + b.Property("DmGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("dmgreetmessagetext"); + + b.Property("ExclusiveSelfAssignedRoles") + .HasColumnType("tinyint(1)") + .HasColumnName("exclusiveselfassignedroles"); + + b.Property("FilterInvites") + .HasColumnType("tinyint(1)") + .HasColumnName("filterinvites"); + + b.Property("FilterLinks") + .HasColumnType("tinyint(1)") + .HasColumnName("filterlinks"); + + b.Property("FilterWords") + .HasColumnType("tinyint(1)") + .HasColumnName("filterwords"); + + b.Property("GameVoiceChannel") + .HasColumnType("bigint unsigned") + .HasColumnName("gamevoicechannel"); + + b.Property("GreetMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("greetmessagechannelid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Locale") + .HasColumnType("longtext") + .HasColumnName("locale"); + + b.Property("MuteRoleName") + .HasColumnType("longtext") + .HasColumnName("muterolename"); + + b.Property("NotifyStreamOffline") + .HasColumnType("tinyint(1)") + .HasColumnName("notifystreamoffline"); + + b.Property("PermissionRole") + .HasColumnType("longtext") + .HasColumnName("permissionrole"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasColumnName("prefix"); + + b.Property("SendBoostMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendboostmessage"); + + b.Property("SendChannelByeMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelbyemessage"); + + b.Property("SendChannelGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelgreetmessage"); + + b.Property("SendDmGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("senddmgreetmessage"); + + b.Property("TimeZoneId") + .HasColumnType("longtext") + .HasColumnName("timezoneid"); + + b.Property("VerboseErrors") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true) + .HasColumnName("verboseerrors"); + + b.Property("VerbosePermissions") + .HasColumnType("tinyint(1)") + .HasColumnName("verbosepermissions"); + + b.Property("WarnExpireAction") + .HasColumnType("int") + .HasColumnName("warnexpireaction"); + + b.Property("WarnExpireHours") + .HasColumnType("int") + .HasColumnName("warnexpirehours"); + + b.Property("WarningsInitialized") + .HasColumnType("tinyint(1)") + .HasColumnName("warningsinitialized"); + + b.HasKey("Id") + .HasName("pk_guildconfigs"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_guildconfigs_guildid"); + + b.HasIndex("WarnExpireHours") + .HasDatabaseName("ix_guildconfigs_warnexpirehours"); + + b.ToTable("guildconfigs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("LogItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("logitemid"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredlogchannels"); + + b.HasIndex("LogSettingId", "LogItemId", "ItemType") + .IsUnique() + .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype"); + + b.ToTable("ignoredlogchannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredvoicepresencechannels"); + + b.HasIndex("LogSettingId") + .HasDatabaseName("ix_ignoredvoicepresencechannels_logsettingid"); + + b.ToTable("ignoredvoicepresencechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ImageOnlyChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_imageonlychannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_imageonlychannels_channelid"); + + b.ToTable("imageonlychannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.LogSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelCreatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelcreatedid"); + + b.Property("ChannelDestroyedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channeldestroyedid"); + + b.Property("ChannelUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelupdatedid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LogOtherId") + .HasColumnType("bigint unsigned") + .HasColumnName("logotherid"); + + b.Property("LogUserPresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("loguserpresenceid"); + + b.Property("LogVoicePresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresenceid"); + + b.Property("LogVoicePresenceTTSId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresencettsid"); + + b.Property("LogWarnsId") + .HasColumnType("bigint unsigned") + .HasColumnName("logwarnsid"); + + b.Property("MessageDeletedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messagedeletedid"); + + b.Property("MessageUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageupdatedid"); + + b.Property("UserBannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userbannedid"); + + b.Property("UserJoinedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userjoinedid"); + + b.Property("UserLeftId") + .HasColumnType("bigint unsigned") + .HasColumnName("userleftid"); + + b.Property("UserMutedId") + .HasColumnType("bigint unsigned") + .HasColumnName("usermutedid"); + + b.Property("UserUnbannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userunbannedid"); + + b.Property("UserUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userupdatedid"); + + b.HasKey("Id") + .HasName("pk_logsettings"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_logsettings_guildid"); + + b.ToTable("logsettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlayerSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDisconnect") + .HasColumnType("tinyint(1)") + .HasColumnName("autodisconnect"); + + b.Property("AutoPlay") + .HasColumnType("tinyint(1)") + .HasColumnName("autoplay"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MusicChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("musicchannelid"); + + b.Property("PlayerRepeat") + .HasColumnType("int") + .HasColumnName("playerrepeat"); + + b.Property("QualityPreset") + .HasColumnType("int") + .HasColumnName("qualitypreset"); + + b.Property("Volume") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .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.Services.Database.Models.MusicPlaylist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Author") + .HasColumnType("longtext") + .HasColumnName("author"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.HasKey("Id") + .HasName("pk_musicplaylists"); + + b.ToTable("musicplaylists", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_muteduserid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_muteduserid_guildconfigid"); + + b.ToTable("muteduserid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AllowTarget") + .HasColumnType("tinyint(1)") + .HasColumnName("allowtarget"); + + b.Property("AutoDeleteTrigger") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeletetrigger"); + + b.Property("ContainsAnywhere") + .HasColumnType("tinyint(1)") + .HasColumnName("containsanywhere"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DmResponse") + .HasColumnType("tinyint(1)") + .HasColumnName("dmresponse"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Reactions") + .HasColumnType("longtext") + .HasColumnName("reactions"); + + b.Property("Response") + .HasColumnType("longtext") + .HasColumnName("response"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_expressions"); + + b.ToTable("expressions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NsfwBlacklistedTag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Tag") + .HasColumnType("longtext") + .HasColumnName("tag"); + + b.HasKey("Id") + .HasName("pk_nsfwblacklistedtags"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_nsfwblacklistedtags_guildid"); + + b.ToTable("nsfwblacklistedtags", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("IsCustomCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("iscustomcommand"); + + b.Property("PrimaryTarget") + .HasColumnType("int") + .HasColumnName("primarytarget"); + + b.Property("PrimaryTargetId") + .HasColumnType("bigint unsigned") + .HasColumnName("primarytargetid"); + + b.Property("SecondaryTarget") + .HasColumnType("int") + .HasColumnName("secondarytarget"); + + b.Property("SecondaryTargetName") + .HasColumnType("longtext") + .HasColumnName("secondarytargetname"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_permissions"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_permissions_guildconfigid"); + + b.ToTable("permissions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlantedCurrency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Password") + .HasColumnType("longtext") + .HasColumnName("password"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.PlaylistSong", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MusicPlaylistId") + .HasColumnType("int") + .HasColumnName("musicplaylistid"); + + b.Property("Provider") + .HasColumnType("longtext") + .HasColumnName("provider"); + + b.Property("ProviderType") + .HasColumnType("int") + .HasColumnName("providertype"); + + b.Property("Query") + .HasColumnType("longtext") + .HasColumnName("query"); + + b.Property("Title") + .HasColumnType("longtext") + .HasColumnName("title"); + + b.Property("Uri") + .HasColumnType("longtext") + .HasColumnName("uri"); + + b.HasKey("Id") + .HasName("pk_playlistsong"); + + b.HasIndex("MusicPlaylistId") + .HasDatabaseName("ix_playlistsong_musicplaylistid"); + + b.ToTable("playlistsong", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Question") + .HasColumnType("longtext") + .HasColumnName("question"); + + b.HasKey("Id") + .HasName("pk_poll"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_poll_guildid"); + + b.ToTable("poll", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_pollanswer"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollanswer_pollid"); + + b.ToTable("pollanswer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("VoteIndex") + .HasColumnType("int") + .HasColumnName("voteindex"); + + b.HasKey("Id") + .HasName("pk_pollvote"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollvote_pollid"); + + b.ToTable("pollvote", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Quote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("AuthorName") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("authorname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Keyword") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("keyword"); + + b.Property("Text") + .IsRequired() + .HasColumnType("longtext") + .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.Services.Database.Models.ReactionRoleV2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Emote") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("emote"); + + b.Property("Group") + .HasColumnType("int") + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelReq") + .HasColumnType("int") + .HasColumnName("levelreq"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.Reminder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsPrivate") + .HasColumnType("tinyint(1)") + .HasColumnName("isprivate"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("ServerId") + .HasColumnType("bigint unsigned") + .HasColumnName("serverid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("When") + .HasColumnType("datetime(6)") + .HasColumnName("when"); + + b.HasKey("Id") + .HasName("pk_reminders"); + + b.HasIndex("When") + .HasDatabaseName("ix_reminders_when"); + + b.ToTable("reminders", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Repeater", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Interval") + .HasColumnType("time(6)") + .HasColumnName("interval"); + + b.Property("LastMessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("lastmessageid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("NoRedundant") + .HasColumnType("tinyint(1)") + .HasColumnName("noredundant"); + + b.Property("StartTimeOfDay") + .HasColumnType("time(6)") + .HasColumnName("starttimeofday"); + + b.HasKey("Id") + .HasName("pk_repeaters"); + + b.ToTable("repeaters", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RewardedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AmountRewardedThisMonth") + .HasColumnType("bigint") + .HasColumnName("amountrewardedthismonth"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LastReward") + .HasColumnType("datetime(6)") + .HasColumnName("lastreward"); + + b.Property("PlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("platformuserid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_rewardedusers"); + + b.HasIndex("PlatformUserId") + .IsUnique() + .HasDatabaseName("ix_rewardedusers_platformuserid"); + + b.ToTable("rewardedusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RotatingPlayingStatus", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Status") + .HasColumnType("longtext") + .HasColumnName("status"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_rotatingstatus"); + + b.ToTable("rotatingstatus", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SelfAssignedRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Group") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelRequirement") + .HasColumnType("int") + .HasColumnName("levelrequirement"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.ShopEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Price") + .HasColumnType("int") + .HasColumnName("price"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("RoleName") + .HasColumnType("longtext") + .HasColumnName("rolename"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_shopentry"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_shopentry_guildconfigid"); + + b.ToTable("shopentry", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ShopEntryId") + .HasColumnType("int") + .HasColumnName("shopentryid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_shopentryitem"); + + b.HasIndex("ShopEntryId") + .HasDatabaseName("ix_shopentryitem_shopentryid"); + + b.ToTable("shopentryitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoredrole"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoredrole_guildconfigid"); + + b.ToTable("slowmodeignoredrole", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoreduser"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoreduser_guildconfigid"); + + b.ToTable("slowmodeignoreduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamroleblacklisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamroleblacklisteduser_streamrolesettingsid"); + + b.ToTable("streamroleblacklisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AddRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("addroleid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)") + .HasColumnName("enabled"); + + b.Property("FromRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("fromroleid"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Keyword") + .HasColumnType("longtext") + .HasColumnName("keyword"); + + b.HasKey("Id") + .HasName("pk_streamrolesettings"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_streamrolesettings_guildconfigid"); + + b.ToTable("streamrolesettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamrolewhitelisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamrolewhitelisteduser_streamrolesettingsid"); + + b.ToTable("streamrolewhitelisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unbantimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unbantimer_guildconfigid"); + + b.ToTable("unbantimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnmuteAt") + .HasColumnType("datetime(6)") + .HasColumnName("unmuteat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unmutetimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unmutetimer_guildconfigid"); + + b.ToTable("unmutetimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unroletimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unroletimer_guildconfigid"); + + b.ToTable("unroletimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UserXpStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AwardedXp") + .HasColumnType("bigint") + .HasColumnName("awardedxp"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LastLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("datetime(6)") + .HasColumnName("lastlevelup") + .HasDefaultValueSql("(UTC_TIMESTAMP)"); + + b.Property("NotifyOnLevelUp") + .HasColumnType("int") + .HasColumnName("notifyonlevelup"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.VcRoleInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.HasKey("Id") + .HasName("pk_vcroleinfo"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_vcroleinfo_guildconfigid"); + + b.ToTable("vcroleinfo", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AffinityId") + .HasColumnType("int") + .HasColumnName("affinityid"); + + b.Property("ClaimerId") + .HasColumnType("int") + .HasColumnName("claimerid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Price") + .HasColumnType("bigint") + .HasColumnName("price"); + + b.Property("WaifuId") + .HasColumnType("int") + .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.Services.Database.Models.WaifuItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemEmoji") + .HasColumnType("longtext") + .HasColumnName("itememoji"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("WaifuInfoId") + .HasColumnType("int") + .HasColumnName("waifuinfoid"); + + b.HasKey("Id") + .HasName("pk_waifuitem"); + + b.HasIndex("WaifuInfoId") + .HasDatabaseName("ix_waifuitem_waifuinfoid"); + + b.ToTable("waifuitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("NewId") + .HasColumnType("int") + .HasColumnName("newid"); + + b.Property("OldId") + .HasColumnType("int") + .HasColumnName("oldid"); + + b.Property("UpdateType") + .HasColumnType("int") + .HasColumnName("updatetype"); + + b.Property("UserId") + .HasColumnType("int") + .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.Services.Database.Models.Warning", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Forgiven") + .HasColumnType("tinyint(1)") + .HasColumnName("forgiven"); + + b.Property("ForgivenBy") + .HasColumnType("longtext") + .HasColumnName("forgivenby"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Moderator") + .HasColumnType("longtext") + .HasColumnName("moderator"); + + b.Property("Reason") + .HasColumnType("longtext") + .HasColumnName("reason"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.WarningPunishment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Count") + .HasColumnType("int") + .HasColumnName("count"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Punishment") + .HasColumnType("int") + .HasColumnName("punishment"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("Time") + .HasColumnType("int") + .HasColumnName("time"); + + b.HasKey("Id") + .HasName("pk_warningpunishment"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_warningpunishment_guildconfigid"); + + b.ToTable("warningpunishment", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("int") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_xpcurrencyreward"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_xpcurrencyreward_xpsettingsid"); + + b.ToTable("xpcurrencyreward", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("Remove") + .HasColumnType("tinyint(1)") + .HasColumnName("remove"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .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.Services.Database.Models.XpSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("ServerExcluded") + .HasColumnType("tinyint(1)") + .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.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.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.FollowedStream", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FollowedStreams") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithOne("AntiAltSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiAltSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiRaidSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiRaidSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.HasOne("EllieBot.Services.Database.Models.AntiSpamSetting", null) + .WithMany("IgnoredChannels") + .HasForeignKey("AntiSpamSettingId") + .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiSpamSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiSpamSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.AutoTranslateChannel", "Channel") + .WithMany("Users") + .HasForeignKey("ChannelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); + + b.Navigation("Channel"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandAliases") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandCooldowns") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("DelMsgOnCmdChannels") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", null) + .WithMany("ExclusionList") + .HasForeignKey("XpSettingsId") + .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("FeedSubs") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_feedsub_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterInvitesChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilteredWords") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterLinksChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterWordsChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("GenerateCurrencyChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("SelfAssignableRoleGroupNames") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_groupname_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany("LogIgnores") + .HasForeignKey("LogSettingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ignoredlogchannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany() + .HasForeignKey("LogSettingId") + .HasConstraintName("fk_ignoredvoicepresencechannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("MutedUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("Permissions") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlaylistSong", b => + { + b.HasOne("EllieBot.Services.Database.Models.MusicPlaylist", null) + .WithMany("Songs") + .HasForeignKey("MusicPlaylistId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Answers") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollanswer_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Votes") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollvote_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("ShopEntries") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.ShopEntry", null) + .WithMany("Items") + .HasForeignKey("ShopEntryId") + .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredRoles") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Blacklist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("StreamRole") + .HasForeignKey("EllieBot.Services.Database.Models.StreamRoleSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Whitelist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnbanTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnmuteTimers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnroleTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.VcRoleInfo", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("VcRoleInfos") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WaifuInfo", "WaifuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); + + b.Navigation("Affinity"); + + b.Navigation("Claimer"); + + b.Navigation("Waifu"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.WaifuInfo", "WaifuInfo") + .WithMany("Items") + .HasForeignKey("WaifuInfoId") + .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); + + b.Navigation("WaifuInfo"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WarningPunishment", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("WarnPunishments") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_warningpunishment_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("CurrencyRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpcurrencyreward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("RoleRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xprolereward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("XpSettings") + .HasForeignKey("EllieBot.Services.Database.Models.XpSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => + { + b.Navigation("Applicants"); + + b.Navigation("Bans"); + + b.Navigation("Members"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Navigation("IgnoredChannels"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.LogSetting", b => + { + b.Navigation("LogIgnores"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlaylist", b => + { + b.Navigation("Songs"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Navigation("Answers"); + + b.Navigation("Votes"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Navigation("Blacklist"); + + b.Navigation("Whitelist"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.Navigation("CurrencyRewards"); + + b.Navigation("ExclusionList"); + + b.Navigation("RoleRewards"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220727033931_linkonly-channels.cs b/src/EllieBot/Migrations/Mysql/20220727033931_linkonly-channels.cs new file mode 100644 index 0000000..95a31e3 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220727033931_linkonly-channels.cs @@ -0,0 +1,26 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + public partial class linkonlychannels : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "type", + table: "imageonlychannels", + type: "int", + nullable: false, + defaultValue: 0); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "type", + table: "imageonlychannels"); + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220808141855_remove-obsolete-xp-columns.Designer.cs b/src/EllieBot/Migrations/Mysql/20220808141855_remove-obsolete-xp-columns.Designer.cs new file mode 100644 index 0000000..407b1b1 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220808141855_remove-obsolete-xp-columns.Designer.cs @@ -0,0 +1,3542 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using EllieBot.Services.Database; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + [DbContext(typeof(MysqlContext))] + [Migration("20220808141855_remove-obsolete-xp-columns")] + partial class removeobsoletexpcolumns + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Balance") + .HasColumnType("bigint") + .HasColumnName("balance"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.ClubApplicants", b => + { + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Description") + .HasColumnType("longtext") + .HasColumnName("description"); + + b.Property("ImageUrl") + .HasColumnType("longtext") + .HasColumnName("imageurl"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("name") + .UseCollation("utf8mb4_bin"); + + b.Property("OwnerId") + .HasColumnType("int") + .HasColumnName("ownerid"); + + b.Property("Xp") + .HasColumnType("int") + .HasColumnName("xp"); + + b.HasKey("Id") + .HasName("pk_clubs"); + + b.HasAlternateKey("Name") + .HasName("ak_clubs_name"); + + b.HasIndex("OwnerId") + .IsUnique() + .HasDatabaseName("ix_clubs_ownerid"); + + b.ToTable("clubs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AvatarId") + .HasColumnType("longtext") + .HasColumnName("avatarid"); + + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("CurrencyAmount") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("currencyamount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Discriminator") + .HasColumnType("longtext") + .HasColumnName("discriminator"); + + b.Property("IsClubAdmin") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("isclubadmin"); + + b.Property("NotifyOnLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("notifyonlevelup"); + + b.Property("TotalXp") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("totalxp"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .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.FollowedStream", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.Property("Username") + .HasColumnType("longtext") + .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.PatronQuota", b => + { + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("FeatureType") + .HasColumnType("int") + .HasColumnName("featuretype"); + + b.Property("Feature") + .HasColumnType("varchar(255)") + .HasColumnName("feature"); + + b.Property("DailyCount") + .HasColumnType("int unsigned") + .HasColumnName("dailycount"); + + b.Property("HourlyCount") + .HasColumnType("int unsigned") + .HasColumnName("hourlycount"); + + b.Property("MonthlyCount") + .HasColumnType("int unsigned") + .HasColumnName("monthlycount"); + + b.HasKey("UserId", "FeatureType", "Feature") + .HasName("pk_patronquotas"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_patronquotas_userid"); + + b.ToTable("patronquotas", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => + { + b.Property("UserId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("AmountCents") + .HasColumnType("int") + .HasColumnName("amountcents"); + + b.Property("LastCharge") + .HasColumnType("datetime(6)") + .HasColumnName("lastcharge"); + + b.Property("UniquePlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("uniqueplatformuserid"); + + b.Property("ValidThru") + .HasColumnType("datetime(6)") + .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.StreamOnlineMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_streamonlinemessages"); + + b.ToTable("streamonlinemessages", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.XpShopOwnedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsUsing") + .HasColumnType("tinyint(1)") + .HasColumnName("isusing"); + + b.Property("ItemKey") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("itemkey"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Database.Models.AntiAltSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("ActionDurationMinutes") + .HasColumnType("int") + .HasColumnName("actiondurationminutes"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MinAge") + .HasColumnType("time(6)") + .HasColumnName("minage"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antialtsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antialtsetting_guildconfigid"); + + b.ToTable("antialtsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("PunishDuration") + .HasColumnType("int") + .HasColumnName("punishduration"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.Property("UserThreshold") + .HasColumnType("int") + .HasColumnName("userthreshold"); + + b.HasKey("Id") + .HasName("pk_antiraidsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antiraidsetting_guildconfigid"); + + b.ToTable("antiraidsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AntiSpamSettingId") + .HasColumnType("int") + .HasColumnName("antispamsettingid"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.HasKey("Id") + .HasName("pk_antispamignore"); + + b.HasIndex("AntiSpamSettingId") + .HasDatabaseName("ix_antispamignore_antispamsettingid"); + + b.ToTable("antispamignore", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MessageThreshold") + .HasColumnType("int") + .HasColumnName("messagethreshold"); + + b.Property("MuteTime") + .HasColumnType("int") + .HasColumnName("mutetime"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antispamsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antispamsetting_guildconfigid"); + + b.ToTable("antispamsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoCommand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("ChannelName") + .HasColumnType("longtext") + .HasColumnName("channelname"); + + b.Property("CommandText") + .HasColumnType("longtext") + .HasColumnName("commandtext"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("GuildName") + .HasColumnType("longtext") + .HasColumnName("guildname"); + + b.Property("Interval") + .HasColumnType("int") + .HasColumnName("interval"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.Property("VoiceChannelName") + .HasColumnType("longtext") + .HasColumnName("voicechannelname"); + + b.HasKey("Id") + .HasName("pk_autocommands"); + + b.ToTable("autocommands", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDelete") + .HasColumnType("tinyint(1)") + .HasColumnName("autodelete"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_autotranslatechannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_autotranslatechannels_channelid"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_autotranslatechannels_guildid"); + + b.ToTable("autotranslatechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("int") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Source") + .HasColumnType("longtext") + .HasColumnName("source"); + + b.Property("Target") + .HasColumnType("longtext") + .HasColumnName("target"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_autotranslateusers"); + + b.HasAlternateKey("ChannelId", "UserId") + .HasName("ak_autotranslateusers_channelid_userid"); + + b.ToTable("autotranslateusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BanTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_bantemplates"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_bantemplates_guildid"); + + b.ToTable("bantemplates", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BlacklistEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_blacklist"); + + b.ToTable("blacklist", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Mapping") + .HasColumnType("longtext") + .HasColumnName("mapping"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_commandalias"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandalias_guildconfigid"); + + b.ToTable("commandalias", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("CommandName") + .HasColumnType("longtext") + .HasColumnName("commandname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.HasKey("Id") + .HasName("pk_commandcooldown"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandcooldown_guildconfigid"); + + b.ToTable("commandcooldown", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CurrencyTransaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Extra") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("extra"); + + b.Property("Note") + .HasColumnType("longtext") + .HasColumnName("note"); + + b.Property("OtherId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("otherid") + .HasDefaultValueSql("NULL"); + + b.Property("Type") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("type"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_currencytransactions"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_currencytransactions_userid"); + + b.ToTable("currencytransactions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_delmsgoncmdchannel"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); + + b.ToTable("delmsgoncmdchannel", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DiscordPermOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Command") + .HasColumnType("varchar(255)") + .HasColumnName("command"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Perm") + .HasColumnType("bigint unsigned") + .HasColumnName("perm"); + + b.HasKey("Id") + .HasName("pk_discordpermoverrides"); + + b.HasIndex("GuildId", "Command") + .IsUnique() + .HasDatabaseName("ix_discordpermoverrides_guildid_command"); + + b.ToTable("discordpermoverrides", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_excludeditem"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_excludeditem_xpsettingsid"); + + b.ToTable("excludeditem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Url") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("url"); + + b.HasKey("Id") + .HasName("pk_feedsub"); + + b.HasAlternateKey("GuildConfigId", "Url") + .HasName("ak_feedsub_guildconfigid_url"); + + b.ToTable("feedsub", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterchannelid_guildconfigid"); + + b.ToTable("filterchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Word") + .HasColumnType("longtext") + .HasColumnName("word"); + + b.HasKey("Id") + .HasName("pk_filteredword"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filteredword_guildconfigid"); + + b.ToTable("filteredword", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterlinkschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); + + b.ToTable("filterlinkschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterwordschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); + + b.ToTable("filterwordschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_gcchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_gcchannelid_guildconfigid"); + + b.ToTable("gcchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Number") + .HasColumnType("int") + .HasColumnName("number"); + + b.HasKey("Id") + .HasName("pk_groupname"); + + b.HasIndex("GuildConfigId", "Number") + .IsUnique() + .HasDatabaseName("ix_groupname_guildconfigid_number"); + + b.ToTable("groupname", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GuildConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoAssignRoleIds") + .HasColumnType("longtext") + .HasColumnName("autoassignroleids"); + + b.Property("AutoDeleteByeMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletebyemessagestimer"); + + b.Property("AutoDeleteGreetMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletegreetmessagestimer"); + + b.Property("AutoDeleteSelfAssignedRoleMessages") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeleteselfassignedrolemessages"); + + b.Property("BoostMessage") + .HasColumnType("longtext") + .HasColumnName("boostmessage"); + + b.Property("BoostMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("boostmessagechannelid"); + + b.Property("BoostMessageDeleteAfter") + .HasColumnType("int") + .HasColumnName("boostmessagedeleteafter"); + + b.Property("ByeMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("byemessagechannelid"); + + b.Property("ChannelByeMessageText") + .HasColumnType("longtext") + .HasColumnName("channelbyemessagetext"); + + b.Property("ChannelGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("channelgreetmessagetext"); + + b.Property("CleverbotEnabled") + .HasColumnType("tinyint(1)") + .HasColumnName("cleverbotenabled"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DeleteMessageOnCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("deletemessageoncommand"); + + b.Property("DeleteStreamOnlineMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("deletestreamonlinemessage"); + + b.Property("DmGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("dmgreetmessagetext"); + + b.Property("ExclusiveSelfAssignedRoles") + .HasColumnType("tinyint(1)") + .HasColumnName("exclusiveselfassignedroles"); + + b.Property("FilterInvites") + .HasColumnType("tinyint(1)") + .HasColumnName("filterinvites"); + + b.Property("FilterLinks") + .HasColumnType("tinyint(1)") + .HasColumnName("filterlinks"); + + b.Property("FilterWords") + .HasColumnType("tinyint(1)") + .HasColumnName("filterwords"); + + b.Property("GameVoiceChannel") + .HasColumnType("bigint unsigned") + .HasColumnName("gamevoicechannel"); + + b.Property("GreetMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("greetmessagechannelid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Locale") + .HasColumnType("longtext") + .HasColumnName("locale"); + + b.Property("MuteRoleName") + .HasColumnType("longtext") + .HasColumnName("muterolename"); + + b.Property("NotifyStreamOffline") + .HasColumnType("tinyint(1)") + .HasColumnName("notifystreamoffline"); + + b.Property("PermissionRole") + .HasColumnType("longtext") + .HasColumnName("permissionrole"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasColumnName("prefix"); + + b.Property("SendBoostMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendboostmessage"); + + b.Property("SendChannelByeMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelbyemessage"); + + b.Property("SendChannelGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelgreetmessage"); + + b.Property("SendDmGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("senddmgreetmessage"); + + b.Property("TimeZoneId") + .HasColumnType("longtext") + .HasColumnName("timezoneid"); + + b.Property("VerboseErrors") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true) + .HasColumnName("verboseerrors"); + + b.Property("VerbosePermissions") + .HasColumnType("tinyint(1)") + .HasColumnName("verbosepermissions"); + + b.Property("WarnExpireAction") + .HasColumnType("int") + .HasColumnName("warnexpireaction"); + + b.Property("WarnExpireHours") + .HasColumnType("int") + .HasColumnName("warnexpirehours"); + + b.Property("WarningsInitialized") + .HasColumnType("tinyint(1)") + .HasColumnName("warningsinitialized"); + + b.HasKey("Id") + .HasName("pk_guildconfigs"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_guildconfigs_guildid"); + + b.HasIndex("WarnExpireHours") + .HasDatabaseName("ix_guildconfigs_warnexpirehours"); + + b.ToTable("guildconfigs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("LogItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("logitemid"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredlogchannels"); + + b.HasIndex("LogSettingId", "LogItemId", "ItemType") + .IsUnique() + .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype"); + + b.ToTable("ignoredlogchannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredvoicepresencechannels"); + + b.HasIndex("LogSettingId") + .HasDatabaseName("ix_ignoredvoicepresencechannels_logsettingid"); + + b.ToTable("ignoredvoicepresencechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ImageOnlyChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_imageonlychannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_imageonlychannels_channelid"); + + b.ToTable("imageonlychannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.LogSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelCreatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelcreatedid"); + + b.Property("ChannelDestroyedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channeldestroyedid"); + + b.Property("ChannelUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelupdatedid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LogOtherId") + .HasColumnType("bigint unsigned") + .HasColumnName("logotherid"); + + b.Property("LogUserPresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("loguserpresenceid"); + + b.Property("LogVoicePresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresenceid"); + + b.Property("LogVoicePresenceTTSId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresencettsid"); + + b.Property("LogWarnsId") + .HasColumnType("bigint unsigned") + .HasColumnName("logwarnsid"); + + b.Property("MessageDeletedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messagedeletedid"); + + b.Property("MessageUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageupdatedid"); + + b.Property("UserBannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userbannedid"); + + b.Property("UserJoinedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userjoinedid"); + + b.Property("UserLeftId") + .HasColumnType("bigint unsigned") + .HasColumnName("userleftid"); + + b.Property("UserMutedId") + .HasColumnType("bigint unsigned") + .HasColumnName("usermutedid"); + + b.Property("UserUnbannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userunbannedid"); + + b.Property("UserUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userupdatedid"); + + b.HasKey("Id") + .HasName("pk_logsettings"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_logsettings_guildid"); + + b.ToTable("logsettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlayerSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDisconnect") + .HasColumnType("tinyint(1)") + .HasColumnName("autodisconnect"); + + b.Property("AutoPlay") + .HasColumnType("tinyint(1)") + .HasColumnName("autoplay"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MusicChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("musicchannelid"); + + b.Property("PlayerRepeat") + .HasColumnType("int") + .HasColumnName("playerrepeat"); + + b.Property("QualityPreset") + .HasColumnType("int") + .HasColumnName("qualitypreset"); + + b.Property("Volume") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .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.Services.Database.Models.MusicPlaylist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Author") + .HasColumnType("longtext") + .HasColumnName("author"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.HasKey("Id") + .HasName("pk_musicplaylists"); + + b.ToTable("musicplaylists", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_muteduserid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_muteduserid_guildconfigid"); + + b.ToTable("muteduserid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AllowTarget") + .HasColumnType("tinyint(1)") + .HasColumnName("allowtarget"); + + b.Property("AutoDeleteTrigger") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeletetrigger"); + + b.Property("ContainsAnywhere") + .HasColumnType("tinyint(1)") + .HasColumnName("containsanywhere"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DmResponse") + .HasColumnType("tinyint(1)") + .HasColumnName("dmresponse"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Reactions") + .HasColumnType("longtext") + .HasColumnName("reactions"); + + b.Property("Response") + .HasColumnType("longtext") + .HasColumnName("response"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_expressions"); + + b.ToTable("expressions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NsfwBlacklistedTag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Tag") + .HasColumnType("longtext") + .HasColumnName("tag"); + + b.HasKey("Id") + .HasName("pk_nsfwblacklistedtags"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_nsfwblacklistedtags_guildid"); + + b.ToTable("nsfwblacklistedtags", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("IsCustomCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("iscustomcommand"); + + b.Property("PrimaryTarget") + .HasColumnType("int") + .HasColumnName("primarytarget"); + + b.Property("PrimaryTargetId") + .HasColumnType("bigint unsigned") + .HasColumnName("primarytargetid"); + + b.Property("SecondaryTarget") + .HasColumnType("int") + .HasColumnName("secondarytarget"); + + b.Property("SecondaryTargetName") + .HasColumnType("longtext") + .HasColumnName("secondarytargetname"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_permissions"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_permissions_guildconfigid"); + + b.ToTable("permissions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlantedCurrency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Password") + .HasColumnType("longtext") + .HasColumnName("password"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.PlaylistSong", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MusicPlaylistId") + .HasColumnType("int") + .HasColumnName("musicplaylistid"); + + b.Property("Provider") + .HasColumnType("longtext") + .HasColumnName("provider"); + + b.Property("ProviderType") + .HasColumnType("int") + .HasColumnName("providertype"); + + b.Property("Query") + .HasColumnType("longtext") + .HasColumnName("query"); + + b.Property("Title") + .HasColumnType("longtext") + .HasColumnName("title"); + + b.Property("Uri") + .HasColumnType("longtext") + .HasColumnName("uri"); + + b.HasKey("Id") + .HasName("pk_playlistsong"); + + b.HasIndex("MusicPlaylistId") + .HasDatabaseName("ix_playlistsong_musicplaylistid"); + + b.ToTable("playlistsong", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Question") + .HasColumnType("longtext") + .HasColumnName("question"); + + b.HasKey("Id") + .HasName("pk_poll"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_poll_guildid"); + + b.ToTable("poll", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_pollanswer"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollanswer_pollid"); + + b.ToTable("pollanswer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("VoteIndex") + .HasColumnType("int") + .HasColumnName("voteindex"); + + b.HasKey("Id") + .HasName("pk_pollvote"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollvote_pollid"); + + b.ToTable("pollvote", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Quote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("AuthorName") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("authorname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Keyword") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("keyword"); + + b.Property("Text") + .IsRequired() + .HasColumnType("longtext") + .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.Services.Database.Models.ReactionRoleV2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Emote") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("emote"); + + b.Property("Group") + .HasColumnType("int") + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelReq") + .HasColumnType("int") + .HasColumnName("levelreq"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.Reminder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsPrivate") + .HasColumnType("tinyint(1)") + .HasColumnName("isprivate"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("ServerId") + .HasColumnType("bigint unsigned") + .HasColumnName("serverid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("When") + .HasColumnType("datetime(6)") + .HasColumnName("when"); + + b.HasKey("Id") + .HasName("pk_reminders"); + + b.HasIndex("When") + .HasDatabaseName("ix_reminders_when"); + + b.ToTable("reminders", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Repeater", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Interval") + .HasColumnType("time(6)") + .HasColumnName("interval"); + + b.Property("LastMessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("lastmessageid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("NoRedundant") + .HasColumnType("tinyint(1)") + .HasColumnName("noredundant"); + + b.Property("StartTimeOfDay") + .HasColumnType("time(6)") + .HasColumnName("starttimeofday"); + + b.HasKey("Id") + .HasName("pk_repeaters"); + + b.ToTable("repeaters", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RewardedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AmountRewardedThisMonth") + .HasColumnType("bigint") + .HasColumnName("amountrewardedthismonth"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LastReward") + .HasColumnType("datetime(6)") + .HasColumnName("lastreward"); + + b.Property("PlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("platformuserid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_rewardedusers"); + + b.HasIndex("PlatformUserId") + .IsUnique() + .HasDatabaseName("ix_rewardedusers_platformuserid"); + + b.ToTable("rewardedusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RotatingPlayingStatus", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Status") + .HasColumnType("longtext") + .HasColumnName("status"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_rotatingstatus"); + + b.ToTable("rotatingstatus", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SelfAssignedRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Group") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelRequirement") + .HasColumnType("int") + .HasColumnName("levelrequirement"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.ShopEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Price") + .HasColumnType("int") + .HasColumnName("price"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("RoleName") + .HasColumnType("longtext") + .HasColumnName("rolename"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_shopentry"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_shopentry_guildconfigid"); + + b.ToTable("shopentry", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ShopEntryId") + .HasColumnType("int") + .HasColumnName("shopentryid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_shopentryitem"); + + b.HasIndex("ShopEntryId") + .HasDatabaseName("ix_shopentryitem_shopentryid"); + + b.ToTable("shopentryitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoredrole"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoredrole_guildconfigid"); + + b.ToTable("slowmodeignoredrole", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoreduser"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoreduser_guildconfigid"); + + b.ToTable("slowmodeignoreduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamroleblacklisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamroleblacklisteduser_streamrolesettingsid"); + + b.ToTable("streamroleblacklisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AddRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("addroleid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)") + .HasColumnName("enabled"); + + b.Property("FromRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("fromroleid"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Keyword") + .HasColumnType("longtext") + .HasColumnName("keyword"); + + b.HasKey("Id") + .HasName("pk_streamrolesettings"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_streamrolesettings_guildconfigid"); + + b.ToTable("streamrolesettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamrolewhitelisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamrolewhitelisteduser_streamrolesettingsid"); + + b.ToTable("streamrolewhitelisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unbantimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unbantimer_guildconfigid"); + + b.ToTable("unbantimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnmuteAt") + .HasColumnType("datetime(6)") + .HasColumnName("unmuteat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unmutetimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unmutetimer_guildconfigid"); + + b.ToTable("unmutetimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unroletimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unroletimer_guildconfigid"); + + b.ToTable("unroletimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UserXpStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AwardedXp") + .HasColumnType("bigint") + .HasColumnName("awardedxp"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("NotifyOnLevelUp") + .HasColumnType("int") + .HasColumnName("notifyonlevelup"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.VcRoleInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.HasKey("Id") + .HasName("pk_vcroleinfo"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_vcroleinfo_guildconfigid"); + + b.ToTable("vcroleinfo", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AffinityId") + .HasColumnType("int") + .HasColumnName("affinityid"); + + b.Property("ClaimerId") + .HasColumnType("int") + .HasColumnName("claimerid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Price") + .HasColumnType("bigint") + .HasColumnName("price"); + + b.Property("WaifuId") + .HasColumnType("int") + .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.Services.Database.Models.WaifuItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemEmoji") + .HasColumnType("longtext") + .HasColumnName("itememoji"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("WaifuInfoId") + .HasColumnType("int") + .HasColumnName("waifuinfoid"); + + b.HasKey("Id") + .HasName("pk_waifuitem"); + + b.HasIndex("WaifuInfoId") + .HasDatabaseName("ix_waifuitem_waifuinfoid"); + + b.ToTable("waifuitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("NewId") + .HasColumnType("int") + .HasColumnName("newid"); + + b.Property("OldId") + .HasColumnType("int") + .HasColumnName("oldid"); + + b.Property("UpdateType") + .HasColumnType("int") + .HasColumnName("updatetype"); + + b.Property("UserId") + .HasColumnType("int") + .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.Services.Database.Models.Warning", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Forgiven") + .HasColumnType("tinyint(1)") + .HasColumnName("forgiven"); + + b.Property("ForgivenBy") + .HasColumnType("longtext") + .HasColumnName("forgivenby"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Moderator") + .HasColumnType("longtext") + .HasColumnName("moderator"); + + b.Property("Reason") + .HasColumnType("longtext") + .HasColumnName("reason"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.WarningPunishment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Count") + .HasColumnType("int") + .HasColumnName("count"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Punishment") + .HasColumnType("int") + .HasColumnName("punishment"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("Time") + .HasColumnType("int") + .HasColumnName("time"); + + b.HasKey("Id") + .HasName("pk_warningpunishment"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_warningpunishment_guildconfigid"); + + b.ToTable("warningpunishment", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("int") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_xpcurrencyreward"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_xpcurrencyreward_xpsettingsid"); + + b.ToTable("xpcurrencyreward", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("Remove") + .HasColumnType("tinyint(1)") + .HasColumnName("remove"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .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.Services.Database.Models.XpSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("ServerExcluded") + .HasColumnType("tinyint(1)") + .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.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.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.FollowedStream", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FollowedStreams") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithOne("AntiAltSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiAltSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiRaidSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiRaidSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.HasOne("EllieBot.Services.Database.Models.AntiSpamSetting", null) + .WithMany("IgnoredChannels") + .HasForeignKey("AntiSpamSettingId") + .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiSpamSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiSpamSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.AutoTranslateChannel", "Channel") + .WithMany("Users") + .HasForeignKey("ChannelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); + + b.Navigation("Channel"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandAliases") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandCooldowns") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("DelMsgOnCmdChannels") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", null) + .WithMany("ExclusionList") + .HasForeignKey("XpSettingsId") + .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("FeedSubs") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_feedsub_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterInvitesChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilteredWords") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterLinksChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterWordsChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("GenerateCurrencyChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("SelfAssignableRoleGroupNames") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_groupname_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany("LogIgnores") + .HasForeignKey("LogSettingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ignoredlogchannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany() + .HasForeignKey("LogSettingId") + .HasConstraintName("fk_ignoredvoicepresencechannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("MutedUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("Permissions") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlaylistSong", b => + { + b.HasOne("EllieBot.Services.Database.Models.MusicPlaylist", null) + .WithMany("Songs") + .HasForeignKey("MusicPlaylistId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Answers") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollanswer_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Votes") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollvote_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("ShopEntries") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.ShopEntry", null) + .WithMany("Items") + .HasForeignKey("ShopEntryId") + .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredRoles") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Blacklist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("StreamRole") + .HasForeignKey("EllieBot.Services.Database.Models.StreamRoleSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Whitelist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnbanTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnmuteTimers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnroleTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.VcRoleInfo", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("VcRoleInfos") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WaifuInfo", "WaifuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); + + b.Navigation("Affinity"); + + b.Navigation("Claimer"); + + b.Navigation("Waifu"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.WaifuInfo", "WaifuInfo") + .WithMany("Items") + .HasForeignKey("WaifuInfoId") + .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); + + b.Navigation("WaifuInfo"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WarningPunishment", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("WarnPunishments") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_warningpunishment_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("CurrencyRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpcurrencyreward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("RoleRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xprolereward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("XpSettings") + .HasForeignKey("EllieBot.Services.Database.Models.XpSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => + { + b.Navigation("Applicants"); + + b.Navigation("Bans"); + + b.Navigation("Members"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Navigation("IgnoredChannels"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.LogSetting", b => + { + b.Navigation("LogIgnores"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlaylist", b => + { + b.Navigation("Songs"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Navigation("Answers"); + + b.Navigation("Votes"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Navigation("Blacklist"); + + b.Navigation("Whitelist"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.Navigation("CurrencyRewards"); + + b.Navigation("ExclusionList"); + + b.Navigation("RoleRewards"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220808141855_remove-obsolete-xp-columns.cs b/src/EllieBot/Migrations/Mysql/20220808141855_remove-obsolete-xp-columns.cs new file mode 100644 index 0000000..dedceb3 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220808141855_remove-obsolete-xp-columns.cs @@ -0,0 +1,49 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + public partial class removeobsoletexpcolumns : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "lastlevelup", + table: "userxpstats"); + + migrationBuilder.DropColumn( + name: "lastlevelup", + table: "discorduser"); + + migrationBuilder.DropColumn( + name: "lastxpgain", + table: "discorduser"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "lastlevelup", + table: "userxpstats", + type: "datetime(6)", + nullable: false, + defaultValueSql: "(UTC_TIMESTAMP)"); + + migrationBuilder.AddColumn( + name: "lastlevelup", + table: "discorduser", + type: "datetime(6)", + nullable: false, + defaultValueSql: "(UTC_TIMESTAMP)"); + + migrationBuilder.AddColumn( + name: "lastxpgain", + table: "discorduser", + type: "datetime(6)", + nullable: false, + defaultValueSql: "(UTC_TIMESTAMP - INTERVAL 1 year)"); + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220831142722_banprune.Designer.cs b/src/EllieBot/Migrations/Mysql/20220831142722_banprune.Designer.cs new file mode 100644 index 0000000..1afccb9 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220831142722_banprune.Designer.cs @@ -0,0 +1,3546 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using EllieBot.Services.Database; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + [DbContext(typeof(MysqlContext))] + [Migration("20220831142722_banprune")] + partial class banprune + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Balance") + .HasColumnType("bigint") + .HasColumnName("balance"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.ClubApplicants", b => + { + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Description") + .HasColumnType("longtext") + .HasColumnName("description"); + + b.Property("ImageUrl") + .HasColumnType("longtext") + .HasColumnName("imageurl"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("name") + .UseCollation("utf8mb4_bin"); + + b.Property("OwnerId") + .HasColumnType("int") + .HasColumnName("ownerid"); + + b.Property("Xp") + .HasColumnType("int") + .HasColumnName("xp"); + + b.HasKey("Id") + .HasName("pk_clubs"); + + b.HasAlternateKey("Name") + .HasName("ak_clubs_name"); + + b.HasIndex("OwnerId") + .IsUnique() + .HasDatabaseName("ix_clubs_ownerid"); + + b.ToTable("clubs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AvatarId") + .HasColumnType("longtext") + .HasColumnName("avatarid"); + + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("CurrencyAmount") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("currencyamount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Discriminator") + .HasColumnType("longtext") + .HasColumnName("discriminator"); + + b.Property("IsClubAdmin") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("isclubadmin"); + + b.Property("NotifyOnLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("notifyonlevelup"); + + b.Property("TotalXp") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("totalxp"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .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.FollowedStream", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.Property("Username") + .HasColumnType("longtext") + .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.PatronQuota", b => + { + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("FeatureType") + .HasColumnType("int") + .HasColumnName("featuretype"); + + b.Property("Feature") + .HasColumnType("varchar(255)") + .HasColumnName("feature"); + + b.Property("DailyCount") + .HasColumnType("int unsigned") + .HasColumnName("dailycount"); + + b.Property("HourlyCount") + .HasColumnType("int unsigned") + .HasColumnName("hourlycount"); + + b.Property("MonthlyCount") + .HasColumnType("int unsigned") + .HasColumnName("monthlycount"); + + b.HasKey("UserId", "FeatureType", "Feature") + .HasName("pk_patronquotas"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_patronquotas_userid"); + + b.ToTable("patronquotas", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => + { + b.Property("UserId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("AmountCents") + .HasColumnType("int") + .HasColumnName("amountcents"); + + b.Property("LastCharge") + .HasColumnType("datetime(6)") + .HasColumnName("lastcharge"); + + b.Property("UniquePlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("uniqueplatformuserid"); + + b.Property("ValidThru") + .HasColumnType("datetime(6)") + .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.StreamOnlineMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_streamonlinemessages"); + + b.ToTable("streamonlinemessages", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.XpShopOwnedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsUsing") + .HasColumnType("tinyint(1)") + .HasColumnName("isusing"); + + b.Property("ItemKey") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("itemkey"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Database.Models.AntiAltSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("ActionDurationMinutes") + .HasColumnType("int") + .HasColumnName("actiondurationminutes"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MinAge") + .HasColumnType("time(6)") + .HasColumnName("minage"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antialtsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antialtsetting_guildconfigid"); + + b.ToTable("antialtsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("PunishDuration") + .HasColumnType("int") + .HasColumnName("punishduration"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.Property("UserThreshold") + .HasColumnType("int") + .HasColumnName("userthreshold"); + + b.HasKey("Id") + .HasName("pk_antiraidsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antiraidsetting_guildconfigid"); + + b.ToTable("antiraidsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AntiSpamSettingId") + .HasColumnType("int") + .HasColumnName("antispamsettingid"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.HasKey("Id") + .HasName("pk_antispamignore"); + + b.HasIndex("AntiSpamSettingId") + .HasDatabaseName("ix_antispamignore_antispamsettingid"); + + b.ToTable("antispamignore", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MessageThreshold") + .HasColumnType("int") + .HasColumnName("messagethreshold"); + + b.Property("MuteTime") + .HasColumnType("int") + .HasColumnName("mutetime"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antispamsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antispamsetting_guildconfigid"); + + b.ToTable("antispamsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoCommand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("ChannelName") + .HasColumnType("longtext") + .HasColumnName("channelname"); + + b.Property("CommandText") + .HasColumnType("longtext") + .HasColumnName("commandtext"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("GuildName") + .HasColumnType("longtext") + .HasColumnName("guildname"); + + b.Property("Interval") + .HasColumnType("int") + .HasColumnName("interval"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.Property("VoiceChannelName") + .HasColumnType("longtext") + .HasColumnName("voicechannelname"); + + b.HasKey("Id") + .HasName("pk_autocommands"); + + b.ToTable("autocommands", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDelete") + .HasColumnType("tinyint(1)") + .HasColumnName("autodelete"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_autotranslatechannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_autotranslatechannels_channelid"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_autotranslatechannels_guildid"); + + b.ToTable("autotranslatechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("int") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Source") + .HasColumnType("longtext") + .HasColumnName("source"); + + b.Property("Target") + .HasColumnType("longtext") + .HasColumnName("target"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_autotranslateusers"); + + b.HasAlternateKey("ChannelId", "UserId") + .HasName("ak_autotranslateusers_channelid_userid"); + + b.ToTable("autotranslateusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BanTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("PruneDays") + .HasColumnType("int") + .HasColumnName("prunedays"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_bantemplates"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_bantemplates_guildid"); + + b.ToTable("bantemplates", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BlacklistEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_blacklist"); + + b.ToTable("blacklist", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Mapping") + .HasColumnType("longtext") + .HasColumnName("mapping"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_commandalias"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandalias_guildconfigid"); + + b.ToTable("commandalias", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("CommandName") + .HasColumnType("longtext") + .HasColumnName("commandname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.HasKey("Id") + .HasName("pk_commandcooldown"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandcooldown_guildconfigid"); + + b.ToTable("commandcooldown", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CurrencyTransaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Extra") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("extra"); + + b.Property("Note") + .HasColumnType("longtext") + .HasColumnName("note"); + + b.Property("OtherId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("otherid") + .HasDefaultValueSql("NULL"); + + b.Property("Type") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("type"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_currencytransactions"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_currencytransactions_userid"); + + b.ToTable("currencytransactions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_delmsgoncmdchannel"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); + + b.ToTable("delmsgoncmdchannel", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DiscordPermOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Command") + .HasColumnType("varchar(255)") + .HasColumnName("command"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Perm") + .HasColumnType("bigint unsigned") + .HasColumnName("perm"); + + b.HasKey("Id") + .HasName("pk_discordpermoverrides"); + + b.HasIndex("GuildId", "Command") + .IsUnique() + .HasDatabaseName("ix_discordpermoverrides_guildid_command"); + + b.ToTable("discordpermoverrides", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_excludeditem"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_excludeditem_xpsettingsid"); + + b.ToTable("excludeditem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Url") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("url"); + + b.HasKey("Id") + .HasName("pk_feedsub"); + + b.HasAlternateKey("GuildConfigId", "Url") + .HasName("ak_feedsub_guildconfigid_url"); + + b.ToTable("feedsub", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterchannelid_guildconfigid"); + + b.ToTable("filterchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Word") + .HasColumnType("longtext") + .HasColumnName("word"); + + b.HasKey("Id") + .HasName("pk_filteredword"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filteredword_guildconfigid"); + + b.ToTable("filteredword", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterlinkschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); + + b.ToTable("filterlinkschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterwordschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); + + b.ToTable("filterwordschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_gcchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_gcchannelid_guildconfigid"); + + b.ToTable("gcchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Number") + .HasColumnType("int") + .HasColumnName("number"); + + b.HasKey("Id") + .HasName("pk_groupname"); + + b.HasIndex("GuildConfigId", "Number") + .IsUnique() + .HasDatabaseName("ix_groupname_guildconfigid_number"); + + b.ToTable("groupname", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GuildConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoAssignRoleIds") + .HasColumnType("longtext") + .HasColumnName("autoassignroleids"); + + b.Property("AutoDeleteByeMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletebyemessagestimer"); + + b.Property("AutoDeleteGreetMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletegreetmessagestimer"); + + b.Property("AutoDeleteSelfAssignedRoleMessages") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeleteselfassignedrolemessages"); + + b.Property("BoostMessage") + .HasColumnType("longtext") + .HasColumnName("boostmessage"); + + b.Property("BoostMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("boostmessagechannelid"); + + b.Property("BoostMessageDeleteAfter") + .HasColumnType("int") + .HasColumnName("boostmessagedeleteafter"); + + b.Property("ByeMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("byemessagechannelid"); + + b.Property("ChannelByeMessageText") + .HasColumnType("longtext") + .HasColumnName("channelbyemessagetext"); + + b.Property("ChannelGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("channelgreetmessagetext"); + + b.Property("CleverbotEnabled") + .HasColumnType("tinyint(1)") + .HasColumnName("cleverbotenabled"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DeleteMessageOnCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("deletemessageoncommand"); + + b.Property("DeleteStreamOnlineMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("deletestreamonlinemessage"); + + b.Property("DmGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("dmgreetmessagetext"); + + b.Property("ExclusiveSelfAssignedRoles") + .HasColumnType("tinyint(1)") + .HasColumnName("exclusiveselfassignedroles"); + + b.Property("FilterInvites") + .HasColumnType("tinyint(1)") + .HasColumnName("filterinvites"); + + b.Property("FilterLinks") + .HasColumnType("tinyint(1)") + .HasColumnName("filterlinks"); + + b.Property("FilterWords") + .HasColumnType("tinyint(1)") + .HasColumnName("filterwords"); + + b.Property("GameVoiceChannel") + .HasColumnType("bigint unsigned") + .HasColumnName("gamevoicechannel"); + + b.Property("GreetMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("greetmessagechannelid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Locale") + .HasColumnType("longtext") + .HasColumnName("locale"); + + b.Property("MuteRoleName") + .HasColumnType("longtext") + .HasColumnName("muterolename"); + + b.Property("NotifyStreamOffline") + .HasColumnType("tinyint(1)") + .HasColumnName("notifystreamoffline"); + + b.Property("PermissionRole") + .HasColumnType("longtext") + .HasColumnName("permissionrole"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasColumnName("prefix"); + + b.Property("SendBoostMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendboostmessage"); + + b.Property("SendChannelByeMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelbyemessage"); + + b.Property("SendChannelGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelgreetmessage"); + + b.Property("SendDmGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("senddmgreetmessage"); + + b.Property("TimeZoneId") + .HasColumnType("longtext") + .HasColumnName("timezoneid"); + + b.Property("VerboseErrors") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true) + .HasColumnName("verboseerrors"); + + b.Property("VerbosePermissions") + .HasColumnType("tinyint(1)") + .HasColumnName("verbosepermissions"); + + b.Property("WarnExpireAction") + .HasColumnType("int") + .HasColumnName("warnexpireaction"); + + b.Property("WarnExpireHours") + .HasColumnType("int") + .HasColumnName("warnexpirehours"); + + b.Property("WarningsInitialized") + .HasColumnType("tinyint(1)") + .HasColumnName("warningsinitialized"); + + b.HasKey("Id") + .HasName("pk_guildconfigs"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_guildconfigs_guildid"); + + b.HasIndex("WarnExpireHours") + .HasDatabaseName("ix_guildconfigs_warnexpirehours"); + + b.ToTable("guildconfigs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("LogItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("logitemid"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredlogchannels"); + + b.HasIndex("LogSettingId", "LogItemId", "ItemType") + .IsUnique() + .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype"); + + b.ToTable("ignoredlogchannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredvoicepresencechannels"); + + b.HasIndex("LogSettingId") + .HasDatabaseName("ix_ignoredvoicepresencechannels_logsettingid"); + + b.ToTable("ignoredvoicepresencechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ImageOnlyChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_imageonlychannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_imageonlychannels_channelid"); + + b.ToTable("imageonlychannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.LogSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelCreatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelcreatedid"); + + b.Property("ChannelDestroyedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channeldestroyedid"); + + b.Property("ChannelUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelupdatedid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LogOtherId") + .HasColumnType("bigint unsigned") + .HasColumnName("logotherid"); + + b.Property("LogUserPresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("loguserpresenceid"); + + b.Property("LogVoicePresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresenceid"); + + b.Property("LogVoicePresenceTTSId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresencettsid"); + + b.Property("LogWarnsId") + .HasColumnType("bigint unsigned") + .HasColumnName("logwarnsid"); + + b.Property("MessageDeletedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messagedeletedid"); + + b.Property("MessageUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageupdatedid"); + + b.Property("UserBannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userbannedid"); + + b.Property("UserJoinedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userjoinedid"); + + b.Property("UserLeftId") + .HasColumnType("bigint unsigned") + .HasColumnName("userleftid"); + + b.Property("UserMutedId") + .HasColumnType("bigint unsigned") + .HasColumnName("usermutedid"); + + b.Property("UserUnbannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userunbannedid"); + + b.Property("UserUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userupdatedid"); + + b.HasKey("Id") + .HasName("pk_logsettings"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_logsettings_guildid"); + + b.ToTable("logsettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlayerSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDisconnect") + .HasColumnType("tinyint(1)") + .HasColumnName("autodisconnect"); + + b.Property("AutoPlay") + .HasColumnType("tinyint(1)") + .HasColumnName("autoplay"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MusicChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("musicchannelid"); + + b.Property("PlayerRepeat") + .HasColumnType("int") + .HasColumnName("playerrepeat"); + + b.Property("QualityPreset") + .HasColumnType("int") + .HasColumnName("qualitypreset"); + + b.Property("Volume") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .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.Services.Database.Models.MusicPlaylist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Author") + .HasColumnType("longtext") + .HasColumnName("author"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.HasKey("Id") + .HasName("pk_musicplaylists"); + + b.ToTable("musicplaylists", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_muteduserid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_muteduserid_guildconfigid"); + + b.ToTable("muteduserid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AllowTarget") + .HasColumnType("tinyint(1)") + .HasColumnName("allowtarget"); + + b.Property("AutoDeleteTrigger") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeletetrigger"); + + b.Property("ContainsAnywhere") + .HasColumnType("tinyint(1)") + .HasColumnName("containsanywhere"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DmResponse") + .HasColumnType("tinyint(1)") + .HasColumnName("dmresponse"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Reactions") + .HasColumnType("longtext") + .HasColumnName("reactions"); + + b.Property("Response") + .HasColumnType("longtext") + .HasColumnName("response"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_expressions"); + + b.ToTable("expressions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NsfwBlacklistedTag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Tag") + .HasColumnType("longtext") + .HasColumnName("tag"); + + b.HasKey("Id") + .HasName("pk_nsfwblacklistedtags"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_nsfwblacklistedtags_guildid"); + + b.ToTable("nsfwblacklistedtags", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("IsCustomCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("iscustomcommand"); + + b.Property("PrimaryTarget") + .HasColumnType("int") + .HasColumnName("primarytarget"); + + b.Property("PrimaryTargetId") + .HasColumnType("bigint unsigned") + .HasColumnName("primarytargetid"); + + b.Property("SecondaryTarget") + .HasColumnType("int") + .HasColumnName("secondarytarget"); + + b.Property("SecondaryTargetName") + .HasColumnType("longtext") + .HasColumnName("secondarytargetname"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_permissions"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_permissions_guildconfigid"); + + b.ToTable("permissions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlantedCurrency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Password") + .HasColumnType("longtext") + .HasColumnName("password"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.PlaylistSong", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MusicPlaylistId") + .HasColumnType("int") + .HasColumnName("musicplaylistid"); + + b.Property("Provider") + .HasColumnType("longtext") + .HasColumnName("provider"); + + b.Property("ProviderType") + .HasColumnType("int") + .HasColumnName("providertype"); + + b.Property("Query") + .HasColumnType("longtext") + .HasColumnName("query"); + + b.Property("Title") + .HasColumnType("longtext") + .HasColumnName("title"); + + b.Property("Uri") + .HasColumnType("longtext") + .HasColumnName("uri"); + + b.HasKey("Id") + .HasName("pk_playlistsong"); + + b.HasIndex("MusicPlaylistId") + .HasDatabaseName("ix_playlistsong_musicplaylistid"); + + b.ToTable("playlistsong", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Question") + .HasColumnType("longtext") + .HasColumnName("question"); + + b.HasKey("Id") + .HasName("pk_poll"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_poll_guildid"); + + b.ToTable("poll", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_pollanswer"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollanswer_pollid"); + + b.ToTable("pollanswer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("VoteIndex") + .HasColumnType("int") + .HasColumnName("voteindex"); + + b.HasKey("Id") + .HasName("pk_pollvote"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollvote_pollid"); + + b.ToTable("pollvote", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Quote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("AuthorName") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("authorname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Keyword") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("keyword"); + + b.Property("Text") + .IsRequired() + .HasColumnType("longtext") + .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.Services.Database.Models.ReactionRoleV2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Emote") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("emote"); + + b.Property("Group") + .HasColumnType("int") + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelReq") + .HasColumnType("int") + .HasColumnName("levelreq"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.Reminder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsPrivate") + .HasColumnType("tinyint(1)") + .HasColumnName("isprivate"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("ServerId") + .HasColumnType("bigint unsigned") + .HasColumnName("serverid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("When") + .HasColumnType("datetime(6)") + .HasColumnName("when"); + + b.HasKey("Id") + .HasName("pk_reminders"); + + b.HasIndex("When") + .HasDatabaseName("ix_reminders_when"); + + b.ToTable("reminders", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Repeater", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Interval") + .HasColumnType("time(6)") + .HasColumnName("interval"); + + b.Property("LastMessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("lastmessageid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("NoRedundant") + .HasColumnType("tinyint(1)") + .HasColumnName("noredundant"); + + b.Property("StartTimeOfDay") + .HasColumnType("time(6)") + .HasColumnName("starttimeofday"); + + b.HasKey("Id") + .HasName("pk_repeaters"); + + b.ToTable("repeaters", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RewardedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AmountRewardedThisMonth") + .HasColumnType("bigint") + .HasColumnName("amountrewardedthismonth"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LastReward") + .HasColumnType("datetime(6)") + .HasColumnName("lastreward"); + + b.Property("PlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("platformuserid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_rewardedusers"); + + b.HasIndex("PlatformUserId") + .IsUnique() + .HasDatabaseName("ix_rewardedusers_platformuserid"); + + b.ToTable("rewardedusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RotatingPlayingStatus", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Status") + .HasColumnType("longtext") + .HasColumnName("status"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_rotatingstatus"); + + b.ToTable("rotatingstatus", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SelfAssignedRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Group") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelRequirement") + .HasColumnType("int") + .HasColumnName("levelrequirement"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.ShopEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Price") + .HasColumnType("int") + .HasColumnName("price"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("RoleName") + .HasColumnType("longtext") + .HasColumnName("rolename"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_shopentry"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_shopentry_guildconfigid"); + + b.ToTable("shopentry", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ShopEntryId") + .HasColumnType("int") + .HasColumnName("shopentryid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_shopentryitem"); + + b.HasIndex("ShopEntryId") + .HasDatabaseName("ix_shopentryitem_shopentryid"); + + b.ToTable("shopentryitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoredrole"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoredrole_guildconfigid"); + + b.ToTable("slowmodeignoredrole", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoreduser"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoreduser_guildconfigid"); + + b.ToTable("slowmodeignoreduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamroleblacklisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamroleblacklisteduser_streamrolesettingsid"); + + b.ToTable("streamroleblacklisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AddRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("addroleid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)") + .HasColumnName("enabled"); + + b.Property("FromRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("fromroleid"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Keyword") + .HasColumnType("longtext") + .HasColumnName("keyword"); + + b.HasKey("Id") + .HasName("pk_streamrolesettings"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_streamrolesettings_guildconfigid"); + + b.ToTable("streamrolesettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamrolewhitelisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamrolewhitelisteduser_streamrolesettingsid"); + + b.ToTable("streamrolewhitelisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unbantimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unbantimer_guildconfigid"); + + b.ToTable("unbantimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnmuteAt") + .HasColumnType("datetime(6)") + .HasColumnName("unmuteat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unmutetimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unmutetimer_guildconfigid"); + + b.ToTable("unmutetimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unroletimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unroletimer_guildconfigid"); + + b.ToTable("unroletimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UserXpStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AwardedXp") + .HasColumnType("bigint") + .HasColumnName("awardedxp"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("NotifyOnLevelUp") + .HasColumnType("int") + .HasColumnName("notifyonlevelup"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.VcRoleInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.HasKey("Id") + .HasName("pk_vcroleinfo"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_vcroleinfo_guildconfigid"); + + b.ToTable("vcroleinfo", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AffinityId") + .HasColumnType("int") + .HasColumnName("affinityid"); + + b.Property("ClaimerId") + .HasColumnType("int") + .HasColumnName("claimerid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Price") + .HasColumnType("bigint") + .HasColumnName("price"); + + b.Property("WaifuId") + .HasColumnType("int") + .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.Services.Database.Models.WaifuItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemEmoji") + .HasColumnType("longtext") + .HasColumnName("itememoji"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("WaifuInfoId") + .HasColumnType("int") + .HasColumnName("waifuinfoid"); + + b.HasKey("Id") + .HasName("pk_waifuitem"); + + b.HasIndex("WaifuInfoId") + .HasDatabaseName("ix_waifuitem_waifuinfoid"); + + b.ToTable("waifuitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("NewId") + .HasColumnType("int") + .HasColumnName("newid"); + + b.Property("OldId") + .HasColumnType("int") + .HasColumnName("oldid"); + + b.Property("UpdateType") + .HasColumnType("int") + .HasColumnName("updatetype"); + + b.Property("UserId") + .HasColumnType("int") + .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.Services.Database.Models.Warning", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Forgiven") + .HasColumnType("tinyint(1)") + .HasColumnName("forgiven"); + + b.Property("ForgivenBy") + .HasColumnType("longtext") + .HasColumnName("forgivenby"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Moderator") + .HasColumnType("longtext") + .HasColumnName("moderator"); + + b.Property("Reason") + .HasColumnType("longtext") + .HasColumnName("reason"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.WarningPunishment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Count") + .HasColumnType("int") + .HasColumnName("count"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Punishment") + .HasColumnType("int") + .HasColumnName("punishment"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("Time") + .HasColumnType("int") + .HasColumnName("time"); + + b.HasKey("Id") + .HasName("pk_warningpunishment"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_warningpunishment_guildconfigid"); + + b.ToTable("warningpunishment", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("int") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_xpcurrencyreward"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_xpcurrencyreward_xpsettingsid"); + + b.ToTable("xpcurrencyreward", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("Remove") + .HasColumnType("tinyint(1)") + .HasColumnName("remove"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .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.Services.Database.Models.XpSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("ServerExcluded") + .HasColumnType("tinyint(1)") + .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.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.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.FollowedStream", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FollowedStreams") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithOne("AntiAltSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiAltSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiRaidSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiRaidSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.HasOne("EllieBot.Services.Database.Models.AntiSpamSetting", null) + .WithMany("IgnoredChannels") + .HasForeignKey("AntiSpamSettingId") + .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiSpamSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiSpamSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.AutoTranslateChannel", "Channel") + .WithMany("Users") + .HasForeignKey("ChannelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); + + b.Navigation("Channel"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandAliases") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandCooldowns") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("DelMsgOnCmdChannels") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", null) + .WithMany("ExclusionList") + .HasForeignKey("XpSettingsId") + .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("FeedSubs") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_feedsub_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterInvitesChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilteredWords") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterLinksChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterWordsChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("GenerateCurrencyChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("SelfAssignableRoleGroupNames") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_groupname_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany("LogIgnores") + .HasForeignKey("LogSettingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ignoredlogchannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany() + .HasForeignKey("LogSettingId") + .HasConstraintName("fk_ignoredvoicepresencechannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("MutedUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("Permissions") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlaylistSong", b => + { + b.HasOne("EllieBot.Services.Database.Models.MusicPlaylist", null) + .WithMany("Songs") + .HasForeignKey("MusicPlaylistId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Answers") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollanswer_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Votes") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollvote_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("ShopEntries") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.ShopEntry", null) + .WithMany("Items") + .HasForeignKey("ShopEntryId") + .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredRoles") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Blacklist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("StreamRole") + .HasForeignKey("EllieBot.Services.Database.Models.StreamRoleSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Whitelist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnbanTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnmuteTimers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnroleTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.VcRoleInfo", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("VcRoleInfos") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WaifuInfo", "WaifuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); + + b.Navigation("Affinity"); + + b.Navigation("Claimer"); + + b.Navigation("Waifu"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.WaifuInfo", "WaifuInfo") + .WithMany("Items") + .HasForeignKey("WaifuInfoId") + .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); + + b.Navigation("WaifuInfo"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WarningPunishment", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("WarnPunishments") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_warningpunishment_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("CurrencyRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpcurrencyreward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("RoleRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xprolereward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("XpSettings") + .HasForeignKey("EllieBot.Services.Database.Models.XpSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => + { + b.Navigation("Applicants"); + + b.Navigation("Bans"); + + b.Navigation("Members"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Navigation("IgnoredChannels"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.LogSetting", b => + { + b.Navigation("LogIgnores"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlaylist", b => + { + b.Navigation("Songs"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Navigation("Answers"); + + b.Navigation("Votes"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Navigation("Blacklist"); + + b.Navigation("Whitelist"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.Navigation("CurrencyRewards"); + + b.Navigation("ExclusionList"); + + b.Navigation("RoleRewards"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220831142722_banprune.cs b/src/EllieBot/Migrations/Mysql/20220831142722_banprune.cs new file mode 100644 index 0000000..5a1c7b7 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220831142722_banprune.cs @@ -0,0 +1,25 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + public partial class banprune : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "prunedays", + table: "bantemplates", + type: "int", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "prunedays", + table: "bantemplates"); + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220913192520_shop-role-req.Designer.cs b/src/EllieBot/Migrations/Mysql/20220913192520_shop-role-req.Designer.cs new file mode 100644 index 0000000..bbf5c0f --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220913192520_shop-role-req.Designer.cs @@ -0,0 +1,3550 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using EllieBot.Services.Database; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + [DbContext(typeof(MysqlContext))] + [Migration("20220913192520_shop-role-req")] + partial class shoprolereq + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Balance") + .HasColumnType("bigint") + .HasColumnName("balance"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.ClubApplicants", b => + { + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Description") + .HasColumnType("longtext") + .HasColumnName("description"); + + b.Property("ImageUrl") + .HasColumnType("longtext") + .HasColumnName("imageurl"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("name") + .UseCollation("utf8mb4_bin"); + + b.Property("OwnerId") + .HasColumnType("int") + .HasColumnName("ownerid"); + + b.Property("Xp") + .HasColumnType("int") + .HasColumnName("xp"); + + b.HasKey("Id") + .HasName("pk_clubs"); + + b.HasAlternateKey("Name") + .HasName("ak_clubs_name"); + + b.HasIndex("OwnerId") + .IsUnique() + .HasDatabaseName("ix_clubs_ownerid"); + + b.ToTable("clubs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AvatarId") + .HasColumnType("longtext") + .HasColumnName("avatarid"); + + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("CurrencyAmount") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("currencyamount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Discriminator") + .HasColumnType("longtext") + .HasColumnName("discriminator"); + + b.Property("IsClubAdmin") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("isclubadmin"); + + b.Property("NotifyOnLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("notifyonlevelup"); + + b.Property("TotalXp") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("totalxp"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .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.FollowedStream", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.Property("Username") + .HasColumnType("longtext") + .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.PatronQuota", b => + { + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("FeatureType") + .HasColumnType("int") + .HasColumnName("featuretype"); + + b.Property("Feature") + .HasColumnType("varchar(255)") + .HasColumnName("feature"); + + b.Property("DailyCount") + .HasColumnType("int unsigned") + .HasColumnName("dailycount"); + + b.Property("HourlyCount") + .HasColumnType("int unsigned") + .HasColumnName("hourlycount"); + + b.Property("MonthlyCount") + .HasColumnType("int unsigned") + .HasColumnName("monthlycount"); + + b.HasKey("UserId", "FeatureType", "Feature") + .HasName("pk_patronquotas"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_patronquotas_userid"); + + b.ToTable("patronquotas", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => + { + b.Property("UserId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("AmountCents") + .HasColumnType("int") + .HasColumnName("amountcents"); + + b.Property("LastCharge") + .HasColumnType("datetime(6)") + .HasColumnName("lastcharge"); + + b.Property("UniquePlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("uniqueplatformuserid"); + + b.Property("ValidThru") + .HasColumnType("datetime(6)") + .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.StreamOnlineMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_streamonlinemessages"); + + b.ToTable("streamonlinemessages", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.XpShopOwnedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsUsing") + .HasColumnType("tinyint(1)") + .HasColumnName("isusing"); + + b.Property("ItemKey") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("itemkey"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Database.Models.AntiAltSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("ActionDurationMinutes") + .HasColumnType("int") + .HasColumnName("actiondurationminutes"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MinAge") + .HasColumnType("time(6)") + .HasColumnName("minage"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antialtsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antialtsetting_guildconfigid"); + + b.ToTable("antialtsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("PunishDuration") + .HasColumnType("int") + .HasColumnName("punishduration"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.Property("UserThreshold") + .HasColumnType("int") + .HasColumnName("userthreshold"); + + b.HasKey("Id") + .HasName("pk_antiraidsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antiraidsetting_guildconfigid"); + + b.ToTable("antiraidsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AntiSpamSettingId") + .HasColumnType("int") + .HasColumnName("antispamsettingid"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.HasKey("Id") + .HasName("pk_antispamignore"); + + b.HasIndex("AntiSpamSettingId") + .HasDatabaseName("ix_antispamignore_antispamsettingid"); + + b.ToTable("antispamignore", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MessageThreshold") + .HasColumnType("int") + .HasColumnName("messagethreshold"); + + b.Property("MuteTime") + .HasColumnType("int") + .HasColumnName("mutetime"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antispamsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antispamsetting_guildconfigid"); + + b.ToTable("antispamsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoCommand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("ChannelName") + .HasColumnType("longtext") + .HasColumnName("channelname"); + + b.Property("CommandText") + .HasColumnType("longtext") + .HasColumnName("commandtext"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("GuildName") + .HasColumnType("longtext") + .HasColumnName("guildname"); + + b.Property("Interval") + .HasColumnType("int") + .HasColumnName("interval"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.Property("VoiceChannelName") + .HasColumnType("longtext") + .HasColumnName("voicechannelname"); + + b.HasKey("Id") + .HasName("pk_autocommands"); + + b.ToTable("autocommands", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDelete") + .HasColumnType("tinyint(1)") + .HasColumnName("autodelete"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_autotranslatechannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_autotranslatechannels_channelid"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_autotranslatechannels_guildid"); + + b.ToTable("autotranslatechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("int") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Source") + .HasColumnType("longtext") + .HasColumnName("source"); + + b.Property("Target") + .HasColumnType("longtext") + .HasColumnName("target"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_autotranslateusers"); + + b.HasAlternateKey("ChannelId", "UserId") + .HasName("ak_autotranslateusers_channelid_userid"); + + b.ToTable("autotranslateusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BanTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("PruneDays") + .HasColumnType("int") + .HasColumnName("prunedays"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_bantemplates"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_bantemplates_guildid"); + + b.ToTable("bantemplates", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BlacklistEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_blacklist"); + + b.ToTable("blacklist", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Mapping") + .HasColumnType("longtext") + .HasColumnName("mapping"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_commandalias"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandalias_guildconfigid"); + + b.ToTable("commandalias", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("CommandName") + .HasColumnType("longtext") + .HasColumnName("commandname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.HasKey("Id") + .HasName("pk_commandcooldown"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandcooldown_guildconfigid"); + + b.ToTable("commandcooldown", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CurrencyTransaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Extra") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("extra"); + + b.Property("Note") + .HasColumnType("longtext") + .HasColumnName("note"); + + b.Property("OtherId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("otherid") + .HasDefaultValueSql("NULL"); + + b.Property("Type") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("type"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_currencytransactions"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_currencytransactions_userid"); + + b.ToTable("currencytransactions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_delmsgoncmdchannel"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); + + b.ToTable("delmsgoncmdchannel", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DiscordPermOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Command") + .HasColumnType("varchar(255)") + .HasColumnName("command"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Perm") + .HasColumnType("bigint unsigned") + .HasColumnName("perm"); + + b.HasKey("Id") + .HasName("pk_discordpermoverrides"); + + b.HasIndex("GuildId", "Command") + .IsUnique() + .HasDatabaseName("ix_discordpermoverrides_guildid_command"); + + b.ToTable("discordpermoverrides", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_excludeditem"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_excludeditem_xpsettingsid"); + + b.ToTable("excludeditem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Url") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("url"); + + b.HasKey("Id") + .HasName("pk_feedsub"); + + b.HasAlternateKey("GuildConfigId", "Url") + .HasName("ak_feedsub_guildconfigid_url"); + + b.ToTable("feedsub", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterchannelid_guildconfigid"); + + b.ToTable("filterchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Word") + .HasColumnType("longtext") + .HasColumnName("word"); + + b.HasKey("Id") + .HasName("pk_filteredword"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filteredword_guildconfigid"); + + b.ToTable("filteredword", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterlinkschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); + + b.ToTable("filterlinkschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterwordschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); + + b.ToTable("filterwordschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_gcchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_gcchannelid_guildconfigid"); + + b.ToTable("gcchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Number") + .HasColumnType("int") + .HasColumnName("number"); + + b.HasKey("Id") + .HasName("pk_groupname"); + + b.HasIndex("GuildConfigId", "Number") + .IsUnique() + .HasDatabaseName("ix_groupname_guildconfigid_number"); + + b.ToTable("groupname", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GuildConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoAssignRoleIds") + .HasColumnType("longtext") + .HasColumnName("autoassignroleids"); + + b.Property("AutoDeleteByeMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletebyemessagestimer"); + + b.Property("AutoDeleteGreetMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletegreetmessagestimer"); + + b.Property("AutoDeleteSelfAssignedRoleMessages") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeleteselfassignedrolemessages"); + + b.Property("BoostMessage") + .HasColumnType("longtext") + .HasColumnName("boostmessage"); + + b.Property("BoostMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("boostmessagechannelid"); + + b.Property("BoostMessageDeleteAfter") + .HasColumnType("int") + .HasColumnName("boostmessagedeleteafter"); + + b.Property("ByeMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("byemessagechannelid"); + + b.Property("ChannelByeMessageText") + .HasColumnType("longtext") + .HasColumnName("channelbyemessagetext"); + + b.Property("ChannelGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("channelgreetmessagetext"); + + b.Property("CleverbotEnabled") + .HasColumnType("tinyint(1)") + .HasColumnName("cleverbotenabled"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DeleteMessageOnCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("deletemessageoncommand"); + + b.Property("DeleteStreamOnlineMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("deletestreamonlinemessage"); + + b.Property("DmGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("dmgreetmessagetext"); + + b.Property("ExclusiveSelfAssignedRoles") + .HasColumnType("tinyint(1)") + .HasColumnName("exclusiveselfassignedroles"); + + b.Property("FilterInvites") + .HasColumnType("tinyint(1)") + .HasColumnName("filterinvites"); + + b.Property("FilterLinks") + .HasColumnType("tinyint(1)") + .HasColumnName("filterlinks"); + + b.Property("FilterWords") + .HasColumnType("tinyint(1)") + .HasColumnName("filterwords"); + + b.Property("GameVoiceChannel") + .HasColumnType("bigint unsigned") + .HasColumnName("gamevoicechannel"); + + b.Property("GreetMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("greetmessagechannelid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Locale") + .HasColumnType("longtext") + .HasColumnName("locale"); + + b.Property("MuteRoleName") + .HasColumnType("longtext") + .HasColumnName("muterolename"); + + b.Property("NotifyStreamOffline") + .HasColumnType("tinyint(1)") + .HasColumnName("notifystreamoffline"); + + b.Property("PermissionRole") + .HasColumnType("longtext") + .HasColumnName("permissionrole"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasColumnName("prefix"); + + b.Property("SendBoostMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendboostmessage"); + + b.Property("SendChannelByeMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelbyemessage"); + + b.Property("SendChannelGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelgreetmessage"); + + b.Property("SendDmGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("senddmgreetmessage"); + + b.Property("TimeZoneId") + .HasColumnType("longtext") + .HasColumnName("timezoneid"); + + b.Property("VerboseErrors") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true) + .HasColumnName("verboseerrors"); + + b.Property("VerbosePermissions") + .HasColumnType("tinyint(1)") + .HasColumnName("verbosepermissions"); + + b.Property("WarnExpireAction") + .HasColumnType("int") + .HasColumnName("warnexpireaction"); + + b.Property("WarnExpireHours") + .HasColumnType("int") + .HasColumnName("warnexpirehours"); + + b.Property("WarningsInitialized") + .HasColumnType("tinyint(1)") + .HasColumnName("warningsinitialized"); + + b.HasKey("Id") + .HasName("pk_guildconfigs"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_guildconfigs_guildid"); + + b.HasIndex("WarnExpireHours") + .HasDatabaseName("ix_guildconfigs_warnexpirehours"); + + b.ToTable("guildconfigs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("LogItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("logitemid"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredlogchannels"); + + b.HasIndex("LogSettingId", "LogItemId", "ItemType") + .IsUnique() + .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype"); + + b.ToTable("ignoredlogchannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredvoicepresencechannels"); + + b.HasIndex("LogSettingId") + .HasDatabaseName("ix_ignoredvoicepresencechannels_logsettingid"); + + b.ToTable("ignoredvoicepresencechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ImageOnlyChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_imageonlychannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_imageonlychannels_channelid"); + + b.ToTable("imageonlychannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.LogSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelCreatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelcreatedid"); + + b.Property("ChannelDestroyedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channeldestroyedid"); + + b.Property("ChannelUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelupdatedid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LogOtherId") + .HasColumnType("bigint unsigned") + .HasColumnName("logotherid"); + + b.Property("LogUserPresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("loguserpresenceid"); + + b.Property("LogVoicePresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresenceid"); + + b.Property("LogVoicePresenceTTSId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresencettsid"); + + b.Property("LogWarnsId") + .HasColumnType("bigint unsigned") + .HasColumnName("logwarnsid"); + + b.Property("MessageDeletedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messagedeletedid"); + + b.Property("MessageUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageupdatedid"); + + b.Property("UserBannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userbannedid"); + + b.Property("UserJoinedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userjoinedid"); + + b.Property("UserLeftId") + .HasColumnType("bigint unsigned") + .HasColumnName("userleftid"); + + b.Property("UserMutedId") + .HasColumnType("bigint unsigned") + .HasColumnName("usermutedid"); + + b.Property("UserUnbannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userunbannedid"); + + b.Property("UserUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userupdatedid"); + + b.HasKey("Id") + .HasName("pk_logsettings"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_logsettings_guildid"); + + b.ToTable("logsettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlayerSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDisconnect") + .HasColumnType("tinyint(1)") + .HasColumnName("autodisconnect"); + + b.Property("AutoPlay") + .HasColumnType("tinyint(1)") + .HasColumnName("autoplay"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MusicChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("musicchannelid"); + + b.Property("PlayerRepeat") + .HasColumnType("int") + .HasColumnName("playerrepeat"); + + b.Property("QualityPreset") + .HasColumnType("int") + .HasColumnName("qualitypreset"); + + b.Property("Volume") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .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.Services.Database.Models.MusicPlaylist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Author") + .HasColumnType("longtext") + .HasColumnName("author"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.HasKey("Id") + .HasName("pk_musicplaylists"); + + b.ToTable("musicplaylists", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_muteduserid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_muteduserid_guildconfigid"); + + b.ToTable("muteduserid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AllowTarget") + .HasColumnType("tinyint(1)") + .HasColumnName("allowtarget"); + + b.Property("AutoDeleteTrigger") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeletetrigger"); + + b.Property("ContainsAnywhere") + .HasColumnType("tinyint(1)") + .HasColumnName("containsanywhere"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DmResponse") + .HasColumnType("tinyint(1)") + .HasColumnName("dmresponse"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Reactions") + .HasColumnType("longtext") + .HasColumnName("reactions"); + + b.Property("Response") + .HasColumnType("longtext") + .HasColumnName("response"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_expressions"); + + b.ToTable("expressions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NsfwBlacklistedTag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Tag") + .HasColumnType("longtext") + .HasColumnName("tag"); + + b.HasKey("Id") + .HasName("pk_nsfwblacklistedtags"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_nsfwblacklistedtags_guildid"); + + b.ToTable("nsfwblacklistedtags", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("IsCustomCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("iscustomcommand"); + + b.Property("PrimaryTarget") + .HasColumnType("int") + .HasColumnName("primarytarget"); + + b.Property("PrimaryTargetId") + .HasColumnType("bigint unsigned") + .HasColumnName("primarytargetid"); + + b.Property("SecondaryTarget") + .HasColumnType("int") + .HasColumnName("secondarytarget"); + + b.Property("SecondaryTargetName") + .HasColumnType("longtext") + .HasColumnName("secondarytargetname"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_permissions"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_permissions_guildconfigid"); + + b.ToTable("permissions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlantedCurrency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Password") + .HasColumnType("longtext") + .HasColumnName("password"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.PlaylistSong", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MusicPlaylistId") + .HasColumnType("int") + .HasColumnName("musicplaylistid"); + + b.Property("Provider") + .HasColumnType("longtext") + .HasColumnName("provider"); + + b.Property("ProviderType") + .HasColumnType("int") + .HasColumnName("providertype"); + + b.Property("Query") + .HasColumnType("longtext") + .HasColumnName("query"); + + b.Property("Title") + .HasColumnType("longtext") + .HasColumnName("title"); + + b.Property("Uri") + .HasColumnType("longtext") + .HasColumnName("uri"); + + b.HasKey("Id") + .HasName("pk_playlistsong"); + + b.HasIndex("MusicPlaylistId") + .HasDatabaseName("ix_playlistsong_musicplaylistid"); + + b.ToTable("playlistsong", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Question") + .HasColumnType("longtext") + .HasColumnName("question"); + + b.HasKey("Id") + .HasName("pk_poll"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_poll_guildid"); + + b.ToTable("poll", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_pollanswer"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollanswer_pollid"); + + b.ToTable("pollanswer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("VoteIndex") + .HasColumnType("int") + .HasColumnName("voteindex"); + + b.HasKey("Id") + .HasName("pk_pollvote"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollvote_pollid"); + + b.ToTable("pollvote", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Quote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("AuthorName") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("authorname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Keyword") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("keyword"); + + b.Property("Text") + .IsRequired() + .HasColumnType("longtext") + .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.Services.Database.Models.ReactionRoleV2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Emote") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("emote"); + + b.Property("Group") + .HasColumnType("int") + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelReq") + .HasColumnType("int") + .HasColumnName("levelreq"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.Reminder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsPrivate") + .HasColumnType("tinyint(1)") + .HasColumnName("isprivate"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("ServerId") + .HasColumnType("bigint unsigned") + .HasColumnName("serverid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("When") + .HasColumnType("datetime(6)") + .HasColumnName("when"); + + b.HasKey("Id") + .HasName("pk_reminders"); + + b.HasIndex("When") + .HasDatabaseName("ix_reminders_when"); + + b.ToTable("reminders", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Repeater", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Interval") + .HasColumnType("time(6)") + .HasColumnName("interval"); + + b.Property("LastMessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("lastmessageid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("NoRedundant") + .HasColumnType("tinyint(1)") + .HasColumnName("noredundant"); + + b.Property("StartTimeOfDay") + .HasColumnType("time(6)") + .HasColumnName("starttimeofday"); + + b.HasKey("Id") + .HasName("pk_repeaters"); + + b.ToTable("repeaters", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RewardedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AmountRewardedThisMonth") + .HasColumnType("bigint") + .HasColumnName("amountrewardedthismonth"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LastReward") + .HasColumnType("datetime(6)") + .HasColumnName("lastreward"); + + b.Property("PlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("platformuserid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_rewardedusers"); + + b.HasIndex("PlatformUserId") + .IsUnique() + .HasDatabaseName("ix_rewardedusers_platformuserid"); + + b.ToTable("rewardedusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RotatingPlayingStatus", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Status") + .HasColumnType("longtext") + .HasColumnName("status"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_rotatingstatus"); + + b.ToTable("rotatingstatus", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SelfAssignedRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Group") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelRequirement") + .HasColumnType("int") + .HasColumnName("levelrequirement"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.ShopEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Price") + .HasColumnType("int") + .HasColumnName("price"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("RoleName") + .HasColumnType("longtext") + .HasColumnName("rolename"); + + b.Property("RoleRequirement") + .HasColumnType("bigint unsigned") + .HasColumnName("rolerequirement"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_shopentry"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_shopentry_guildconfigid"); + + b.ToTable("shopentry", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ShopEntryId") + .HasColumnType("int") + .HasColumnName("shopentryid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_shopentryitem"); + + b.HasIndex("ShopEntryId") + .HasDatabaseName("ix_shopentryitem_shopentryid"); + + b.ToTable("shopentryitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoredrole"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoredrole_guildconfigid"); + + b.ToTable("slowmodeignoredrole", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoreduser"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoreduser_guildconfigid"); + + b.ToTable("slowmodeignoreduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamroleblacklisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamroleblacklisteduser_streamrolesettingsid"); + + b.ToTable("streamroleblacklisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AddRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("addroleid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)") + .HasColumnName("enabled"); + + b.Property("FromRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("fromroleid"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Keyword") + .HasColumnType("longtext") + .HasColumnName("keyword"); + + b.HasKey("Id") + .HasName("pk_streamrolesettings"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_streamrolesettings_guildconfigid"); + + b.ToTable("streamrolesettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamrolewhitelisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamrolewhitelisteduser_streamrolesettingsid"); + + b.ToTable("streamrolewhitelisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unbantimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unbantimer_guildconfigid"); + + b.ToTable("unbantimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnmuteAt") + .HasColumnType("datetime(6)") + .HasColumnName("unmuteat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unmutetimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unmutetimer_guildconfigid"); + + b.ToTable("unmutetimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unroletimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unroletimer_guildconfigid"); + + b.ToTable("unroletimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UserXpStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AwardedXp") + .HasColumnType("bigint") + .HasColumnName("awardedxp"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("NotifyOnLevelUp") + .HasColumnType("int") + .HasColumnName("notifyonlevelup"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.VcRoleInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.HasKey("Id") + .HasName("pk_vcroleinfo"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_vcroleinfo_guildconfigid"); + + b.ToTable("vcroleinfo", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AffinityId") + .HasColumnType("int") + .HasColumnName("affinityid"); + + b.Property("ClaimerId") + .HasColumnType("int") + .HasColumnName("claimerid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Price") + .HasColumnType("bigint") + .HasColumnName("price"); + + b.Property("WaifuId") + .HasColumnType("int") + .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.Services.Database.Models.WaifuItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemEmoji") + .HasColumnType("longtext") + .HasColumnName("itememoji"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("WaifuInfoId") + .HasColumnType("int") + .HasColumnName("waifuinfoid"); + + b.HasKey("Id") + .HasName("pk_waifuitem"); + + b.HasIndex("WaifuInfoId") + .HasDatabaseName("ix_waifuitem_waifuinfoid"); + + b.ToTable("waifuitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("NewId") + .HasColumnType("int") + .HasColumnName("newid"); + + b.Property("OldId") + .HasColumnType("int") + .HasColumnName("oldid"); + + b.Property("UpdateType") + .HasColumnType("int") + .HasColumnName("updatetype"); + + b.Property("UserId") + .HasColumnType("int") + .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.Services.Database.Models.Warning", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Forgiven") + .HasColumnType("tinyint(1)") + .HasColumnName("forgiven"); + + b.Property("ForgivenBy") + .HasColumnType("longtext") + .HasColumnName("forgivenby"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Moderator") + .HasColumnType("longtext") + .HasColumnName("moderator"); + + b.Property("Reason") + .HasColumnType("longtext") + .HasColumnName("reason"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.WarningPunishment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Count") + .HasColumnType("int") + .HasColumnName("count"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Punishment") + .HasColumnType("int") + .HasColumnName("punishment"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("Time") + .HasColumnType("int") + .HasColumnName("time"); + + b.HasKey("Id") + .HasName("pk_warningpunishment"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_warningpunishment_guildconfigid"); + + b.ToTable("warningpunishment", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("int") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_xpcurrencyreward"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_xpcurrencyreward_xpsettingsid"); + + b.ToTable("xpcurrencyreward", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("Remove") + .HasColumnType("tinyint(1)") + .HasColumnName("remove"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .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.Services.Database.Models.XpSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("ServerExcluded") + .HasColumnType("tinyint(1)") + .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.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.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.FollowedStream", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FollowedStreams") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithOne("AntiAltSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiAltSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiRaidSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiRaidSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.HasOne("EllieBot.Services.Database.Models.AntiSpamSetting", null) + .WithMany("IgnoredChannels") + .HasForeignKey("AntiSpamSettingId") + .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiSpamSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiSpamSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.AutoTranslateChannel", "Channel") + .WithMany("Users") + .HasForeignKey("ChannelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); + + b.Navigation("Channel"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandAliases") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandCooldowns") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("DelMsgOnCmdChannels") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", null) + .WithMany("ExclusionList") + .HasForeignKey("XpSettingsId") + .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("FeedSubs") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_feedsub_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterInvitesChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilteredWords") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterLinksChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterWordsChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("GenerateCurrencyChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("SelfAssignableRoleGroupNames") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_groupname_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany("LogIgnores") + .HasForeignKey("LogSettingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ignoredlogchannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany() + .HasForeignKey("LogSettingId") + .HasConstraintName("fk_ignoredvoicepresencechannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("MutedUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("Permissions") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlaylistSong", b => + { + b.HasOne("EllieBot.Services.Database.Models.MusicPlaylist", null) + .WithMany("Songs") + .HasForeignKey("MusicPlaylistId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Answers") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollanswer_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Votes") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollvote_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("ShopEntries") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.ShopEntry", null) + .WithMany("Items") + .HasForeignKey("ShopEntryId") + .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredRoles") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Blacklist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("StreamRole") + .HasForeignKey("EllieBot.Services.Database.Models.StreamRoleSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Whitelist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnbanTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnmuteTimers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnroleTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.VcRoleInfo", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("VcRoleInfos") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WaifuInfo", "WaifuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); + + b.Navigation("Affinity"); + + b.Navigation("Claimer"); + + b.Navigation("Waifu"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.WaifuInfo", "WaifuInfo") + .WithMany("Items") + .HasForeignKey("WaifuInfoId") + .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); + + b.Navigation("WaifuInfo"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WarningPunishment", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("WarnPunishments") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_warningpunishment_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("CurrencyRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpcurrencyreward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("RoleRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xprolereward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("XpSettings") + .HasForeignKey("EllieBot.Services.Database.Models.XpSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => + { + b.Navigation("Applicants"); + + b.Navigation("Bans"); + + b.Navigation("Members"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Navigation("IgnoredChannels"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.LogSetting", b => + { + b.Navigation("LogIgnores"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlaylist", b => + { + b.Navigation("Songs"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Navigation("Answers"); + + b.Navigation("Votes"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Navigation("Blacklist"); + + b.Navigation("Whitelist"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.Navigation("CurrencyRewards"); + + b.Navigation("ExclusionList"); + + b.Navigation("RoleRewards"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220913192520_shop-role-req.cs b/src/EllieBot/Migrations/Mysql/20220913192520_shop-role-req.cs new file mode 100644 index 0000000..6d52a2c --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220913192520_shop-role-req.cs @@ -0,0 +1,25 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + public partial class shoprolereq : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "rolerequirement", + table: "shopentry", + type: "bigint unsigned", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "rolerequirement", + table: "shopentry"); + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220916194514_autopub.Designer.cs b/src/EllieBot/Migrations/Mysql/20220916194514_autopub.Designer.cs new file mode 100644 index 0000000..f5dc4a0 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220916194514_autopub.Designer.cs @@ -0,0 +1,3579 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using EllieBot.Services.Database; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + [DbContext(typeof(MysqlContext))] + [Migration("20220916194514_autopub")] + partial class autopub + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("EllieBot.Db.Models.AutoPublishChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_autopublishchannel"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_autopublishchannel_guildid"); + + b.ToTable("autopublishchannel", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Balance") + .HasColumnType("bigint") + .HasColumnName("balance"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.ClubApplicants", b => + { + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Description") + .HasColumnType("longtext") + .HasColumnName("description"); + + b.Property("ImageUrl") + .HasColumnType("longtext") + .HasColumnName("imageurl"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("name") + .UseCollation("utf8mb4_bin"); + + b.Property("OwnerId") + .HasColumnType("int") + .HasColumnName("ownerid"); + + b.Property("Xp") + .HasColumnType("int") + .HasColumnName("xp"); + + b.HasKey("Id") + .HasName("pk_clubs"); + + b.HasAlternateKey("Name") + .HasName("ak_clubs_name"); + + b.HasIndex("OwnerId") + .IsUnique() + .HasDatabaseName("ix_clubs_ownerid"); + + b.ToTable("clubs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AvatarId") + .HasColumnType("longtext") + .HasColumnName("avatarid"); + + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("CurrencyAmount") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("currencyamount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Discriminator") + .HasColumnType("longtext") + .HasColumnName("discriminator"); + + b.Property("IsClubAdmin") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("isclubadmin"); + + b.Property("NotifyOnLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("notifyonlevelup"); + + b.Property("TotalXp") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("totalxp"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .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.FollowedStream", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.Property("Username") + .HasColumnType("longtext") + .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.PatronQuota", b => + { + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("FeatureType") + .HasColumnType("int") + .HasColumnName("featuretype"); + + b.Property("Feature") + .HasColumnType("varchar(255)") + .HasColumnName("feature"); + + b.Property("DailyCount") + .HasColumnType("int unsigned") + .HasColumnName("dailycount"); + + b.Property("HourlyCount") + .HasColumnType("int unsigned") + .HasColumnName("hourlycount"); + + b.Property("MonthlyCount") + .HasColumnType("int unsigned") + .HasColumnName("monthlycount"); + + b.HasKey("UserId", "FeatureType", "Feature") + .HasName("pk_patronquotas"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_patronquotas_userid"); + + b.ToTable("patronquotas", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => + { + b.Property("UserId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("AmountCents") + .HasColumnType("int") + .HasColumnName("amountcents"); + + b.Property("LastCharge") + .HasColumnType("datetime(6)") + .HasColumnName("lastcharge"); + + b.Property("UniquePlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("uniqueplatformuserid"); + + b.Property("ValidThru") + .HasColumnType("datetime(6)") + .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.StreamOnlineMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_streamonlinemessages"); + + b.ToTable("streamonlinemessages", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.XpShopOwnedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsUsing") + .HasColumnType("tinyint(1)") + .HasColumnName("isusing"); + + b.Property("ItemKey") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("itemkey"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Database.Models.AntiAltSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("ActionDurationMinutes") + .HasColumnType("int") + .HasColumnName("actiondurationminutes"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MinAge") + .HasColumnType("time(6)") + .HasColumnName("minage"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antialtsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antialtsetting_guildconfigid"); + + b.ToTable("antialtsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("PunishDuration") + .HasColumnType("int") + .HasColumnName("punishduration"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.Property("UserThreshold") + .HasColumnType("int") + .HasColumnName("userthreshold"); + + b.HasKey("Id") + .HasName("pk_antiraidsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antiraidsetting_guildconfigid"); + + b.ToTable("antiraidsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AntiSpamSettingId") + .HasColumnType("int") + .HasColumnName("antispamsettingid"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.HasKey("Id") + .HasName("pk_antispamignore"); + + b.HasIndex("AntiSpamSettingId") + .HasDatabaseName("ix_antispamignore_antispamsettingid"); + + b.ToTable("antispamignore", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MessageThreshold") + .HasColumnType("int") + .HasColumnName("messagethreshold"); + + b.Property("MuteTime") + .HasColumnType("int") + .HasColumnName("mutetime"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antispamsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antispamsetting_guildconfigid"); + + b.ToTable("antispamsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoCommand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("ChannelName") + .HasColumnType("longtext") + .HasColumnName("channelname"); + + b.Property("CommandText") + .HasColumnType("longtext") + .HasColumnName("commandtext"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("GuildName") + .HasColumnType("longtext") + .HasColumnName("guildname"); + + b.Property("Interval") + .HasColumnType("int") + .HasColumnName("interval"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.Property("VoiceChannelName") + .HasColumnType("longtext") + .HasColumnName("voicechannelname"); + + b.HasKey("Id") + .HasName("pk_autocommands"); + + b.ToTable("autocommands", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDelete") + .HasColumnType("tinyint(1)") + .HasColumnName("autodelete"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_autotranslatechannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_autotranslatechannels_channelid"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_autotranslatechannels_guildid"); + + b.ToTable("autotranslatechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("int") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Source") + .HasColumnType("longtext") + .HasColumnName("source"); + + b.Property("Target") + .HasColumnType("longtext") + .HasColumnName("target"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_autotranslateusers"); + + b.HasAlternateKey("ChannelId", "UserId") + .HasName("ak_autotranslateusers_channelid_userid"); + + b.ToTable("autotranslateusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BanTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("PruneDays") + .HasColumnType("int") + .HasColumnName("prunedays"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_bantemplates"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_bantemplates_guildid"); + + b.ToTable("bantemplates", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BlacklistEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_blacklist"); + + b.ToTable("blacklist", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Mapping") + .HasColumnType("longtext") + .HasColumnName("mapping"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_commandalias"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandalias_guildconfigid"); + + b.ToTable("commandalias", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("CommandName") + .HasColumnType("longtext") + .HasColumnName("commandname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.HasKey("Id") + .HasName("pk_commandcooldown"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandcooldown_guildconfigid"); + + b.ToTable("commandcooldown", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CurrencyTransaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Extra") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("extra"); + + b.Property("Note") + .HasColumnType("longtext") + .HasColumnName("note"); + + b.Property("OtherId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("otherid") + .HasDefaultValueSql("NULL"); + + b.Property("Type") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("type"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_currencytransactions"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_currencytransactions_userid"); + + b.ToTable("currencytransactions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_delmsgoncmdchannel"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); + + b.ToTable("delmsgoncmdchannel", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DiscordPermOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Command") + .HasColumnType("varchar(255)") + .HasColumnName("command"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Perm") + .HasColumnType("bigint unsigned") + .HasColumnName("perm"); + + b.HasKey("Id") + .HasName("pk_discordpermoverrides"); + + b.HasIndex("GuildId", "Command") + .IsUnique() + .HasDatabaseName("ix_discordpermoverrides_guildid_command"); + + b.ToTable("discordpermoverrides", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_excludeditem"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_excludeditem_xpsettingsid"); + + b.ToTable("excludeditem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Url") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("url"); + + b.HasKey("Id") + .HasName("pk_feedsub"); + + b.HasAlternateKey("GuildConfigId", "Url") + .HasName("ak_feedsub_guildconfigid_url"); + + b.ToTable("feedsub", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterchannelid_guildconfigid"); + + b.ToTable("filterchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Word") + .HasColumnType("longtext") + .HasColumnName("word"); + + b.HasKey("Id") + .HasName("pk_filteredword"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filteredword_guildconfigid"); + + b.ToTable("filteredword", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterlinkschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); + + b.ToTable("filterlinkschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterwordschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); + + b.ToTable("filterwordschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_gcchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_gcchannelid_guildconfigid"); + + b.ToTable("gcchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Number") + .HasColumnType("int") + .HasColumnName("number"); + + b.HasKey("Id") + .HasName("pk_groupname"); + + b.HasIndex("GuildConfigId", "Number") + .IsUnique() + .HasDatabaseName("ix_groupname_guildconfigid_number"); + + b.ToTable("groupname", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GuildConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoAssignRoleIds") + .HasColumnType("longtext") + .HasColumnName("autoassignroleids"); + + b.Property("AutoDeleteByeMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletebyemessagestimer"); + + b.Property("AutoDeleteGreetMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletegreetmessagestimer"); + + b.Property("AutoDeleteSelfAssignedRoleMessages") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeleteselfassignedrolemessages"); + + b.Property("BoostMessage") + .HasColumnType("longtext") + .HasColumnName("boostmessage"); + + b.Property("BoostMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("boostmessagechannelid"); + + b.Property("BoostMessageDeleteAfter") + .HasColumnType("int") + .HasColumnName("boostmessagedeleteafter"); + + b.Property("ByeMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("byemessagechannelid"); + + b.Property("ChannelByeMessageText") + .HasColumnType("longtext") + .HasColumnName("channelbyemessagetext"); + + b.Property("ChannelGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("channelgreetmessagetext"); + + b.Property("CleverbotEnabled") + .HasColumnType("tinyint(1)") + .HasColumnName("cleverbotenabled"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DeleteMessageOnCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("deletemessageoncommand"); + + b.Property("DeleteStreamOnlineMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("deletestreamonlinemessage"); + + b.Property("DmGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("dmgreetmessagetext"); + + b.Property("ExclusiveSelfAssignedRoles") + .HasColumnType("tinyint(1)") + .HasColumnName("exclusiveselfassignedroles"); + + b.Property("FilterInvites") + .HasColumnType("tinyint(1)") + .HasColumnName("filterinvites"); + + b.Property("FilterLinks") + .HasColumnType("tinyint(1)") + .HasColumnName("filterlinks"); + + b.Property("FilterWords") + .HasColumnType("tinyint(1)") + .HasColumnName("filterwords"); + + b.Property("GameVoiceChannel") + .HasColumnType("bigint unsigned") + .HasColumnName("gamevoicechannel"); + + b.Property("GreetMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("greetmessagechannelid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Locale") + .HasColumnType("longtext") + .HasColumnName("locale"); + + b.Property("MuteRoleName") + .HasColumnType("longtext") + .HasColumnName("muterolename"); + + b.Property("NotifyStreamOffline") + .HasColumnType("tinyint(1)") + .HasColumnName("notifystreamoffline"); + + b.Property("PermissionRole") + .HasColumnType("longtext") + .HasColumnName("permissionrole"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasColumnName("prefix"); + + b.Property("SendBoostMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendboostmessage"); + + b.Property("SendChannelByeMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelbyemessage"); + + b.Property("SendChannelGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelgreetmessage"); + + b.Property("SendDmGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("senddmgreetmessage"); + + b.Property("TimeZoneId") + .HasColumnType("longtext") + .HasColumnName("timezoneid"); + + b.Property("VerboseErrors") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true) + .HasColumnName("verboseerrors"); + + b.Property("VerbosePermissions") + .HasColumnType("tinyint(1)") + .HasColumnName("verbosepermissions"); + + b.Property("WarnExpireAction") + .HasColumnType("int") + .HasColumnName("warnexpireaction"); + + b.Property("WarnExpireHours") + .HasColumnType("int") + .HasColumnName("warnexpirehours"); + + b.Property("WarningsInitialized") + .HasColumnType("tinyint(1)") + .HasColumnName("warningsinitialized"); + + b.HasKey("Id") + .HasName("pk_guildconfigs"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_guildconfigs_guildid"); + + b.HasIndex("WarnExpireHours") + .HasDatabaseName("ix_guildconfigs_warnexpirehours"); + + b.ToTable("guildconfigs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("LogItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("logitemid"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredlogchannels"); + + b.HasIndex("LogSettingId", "LogItemId", "ItemType") + .IsUnique() + .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype"); + + b.ToTable("ignoredlogchannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredvoicepresencechannels"); + + b.HasIndex("LogSettingId") + .HasDatabaseName("ix_ignoredvoicepresencechannels_logsettingid"); + + b.ToTable("ignoredvoicepresencechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ImageOnlyChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_imageonlychannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_imageonlychannels_channelid"); + + b.ToTable("imageonlychannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.LogSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelCreatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelcreatedid"); + + b.Property("ChannelDestroyedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channeldestroyedid"); + + b.Property("ChannelUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelupdatedid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LogOtherId") + .HasColumnType("bigint unsigned") + .HasColumnName("logotherid"); + + b.Property("LogUserPresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("loguserpresenceid"); + + b.Property("LogVoicePresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresenceid"); + + b.Property("LogVoicePresenceTTSId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresencettsid"); + + b.Property("LogWarnsId") + .HasColumnType("bigint unsigned") + .HasColumnName("logwarnsid"); + + b.Property("MessageDeletedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messagedeletedid"); + + b.Property("MessageUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageupdatedid"); + + b.Property("UserBannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userbannedid"); + + b.Property("UserJoinedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userjoinedid"); + + b.Property("UserLeftId") + .HasColumnType("bigint unsigned") + .HasColumnName("userleftid"); + + b.Property("UserMutedId") + .HasColumnType("bigint unsigned") + .HasColumnName("usermutedid"); + + b.Property("UserUnbannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userunbannedid"); + + b.Property("UserUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userupdatedid"); + + b.HasKey("Id") + .HasName("pk_logsettings"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_logsettings_guildid"); + + b.ToTable("logsettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlayerSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDisconnect") + .HasColumnType("tinyint(1)") + .HasColumnName("autodisconnect"); + + b.Property("AutoPlay") + .HasColumnType("tinyint(1)") + .HasColumnName("autoplay"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MusicChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("musicchannelid"); + + b.Property("PlayerRepeat") + .HasColumnType("int") + .HasColumnName("playerrepeat"); + + b.Property("QualityPreset") + .HasColumnType("int") + .HasColumnName("qualitypreset"); + + b.Property("Volume") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .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.Services.Database.Models.MusicPlaylist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Author") + .HasColumnType("longtext") + .HasColumnName("author"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.HasKey("Id") + .HasName("pk_musicplaylists"); + + b.ToTable("musicplaylists", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_muteduserid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_muteduserid_guildconfigid"); + + b.ToTable("muteduserid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AllowTarget") + .HasColumnType("tinyint(1)") + .HasColumnName("allowtarget"); + + b.Property("AutoDeleteTrigger") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeletetrigger"); + + b.Property("ContainsAnywhere") + .HasColumnType("tinyint(1)") + .HasColumnName("containsanywhere"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DmResponse") + .HasColumnType("tinyint(1)") + .HasColumnName("dmresponse"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Reactions") + .HasColumnType("longtext") + .HasColumnName("reactions"); + + b.Property("Response") + .HasColumnType("longtext") + .HasColumnName("response"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_expressions"); + + b.ToTable("expressions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NsfwBlacklistedTag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Tag") + .HasColumnType("longtext") + .HasColumnName("tag"); + + b.HasKey("Id") + .HasName("pk_nsfwblacklistedtags"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_nsfwblacklistedtags_guildid"); + + b.ToTable("nsfwblacklistedtags", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("IsCustomCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("iscustomcommand"); + + b.Property("PrimaryTarget") + .HasColumnType("int") + .HasColumnName("primarytarget"); + + b.Property("PrimaryTargetId") + .HasColumnType("bigint unsigned") + .HasColumnName("primarytargetid"); + + b.Property("SecondaryTarget") + .HasColumnType("int") + .HasColumnName("secondarytarget"); + + b.Property("SecondaryTargetName") + .HasColumnType("longtext") + .HasColumnName("secondarytargetname"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_permissions"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_permissions_guildconfigid"); + + b.ToTable("permissions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlantedCurrency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Password") + .HasColumnType("longtext") + .HasColumnName("password"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.PlaylistSong", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MusicPlaylistId") + .HasColumnType("int") + .HasColumnName("musicplaylistid"); + + b.Property("Provider") + .HasColumnType("longtext") + .HasColumnName("provider"); + + b.Property("ProviderType") + .HasColumnType("int") + .HasColumnName("providertype"); + + b.Property("Query") + .HasColumnType("longtext") + .HasColumnName("query"); + + b.Property("Title") + .HasColumnType("longtext") + .HasColumnName("title"); + + b.Property("Uri") + .HasColumnType("longtext") + .HasColumnName("uri"); + + b.HasKey("Id") + .HasName("pk_playlistsong"); + + b.HasIndex("MusicPlaylistId") + .HasDatabaseName("ix_playlistsong_musicplaylistid"); + + b.ToTable("playlistsong", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Question") + .HasColumnType("longtext") + .HasColumnName("question"); + + b.HasKey("Id") + .HasName("pk_poll"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_poll_guildid"); + + b.ToTable("poll", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_pollanswer"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollanswer_pollid"); + + b.ToTable("pollanswer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("VoteIndex") + .HasColumnType("int") + .HasColumnName("voteindex"); + + b.HasKey("Id") + .HasName("pk_pollvote"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollvote_pollid"); + + b.ToTable("pollvote", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Quote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("AuthorName") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("authorname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Keyword") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("keyword"); + + b.Property("Text") + .IsRequired() + .HasColumnType("longtext") + .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.Services.Database.Models.ReactionRoleV2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Emote") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("emote"); + + b.Property("Group") + .HasColumnType("int") + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelReq") + .HasColumnType("int") + .HasColumnName("levelreq"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.Reminder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsPrivate") + .HasColumnType("tinyint(1)") + .HasColumnName("isprivate"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("ServerId") + .HasColumnType("bigint unsigned") + .HasColumnName("serverid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("When") + .HasColumnType("datetime(6)") + .HasColumnName("when"); + + b.HasKey("Id") + .HasName("pk_reminders"); + + b.HasIndex("When") + .HasDatabaseName("ix_reminders_when"); + + b.ToTable("reminders", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Repeater", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Interval") + .HasColumnType("time(6)") + .HasColumnName("interval"); + + b.Property("LastMessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("lastmessageid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("NoRedundant") + .HasColumnType("tinyint(1)") + .HasColumnName("noredundant"); + + b.Property("StartTimeOfDay") + .HasColumnType("time(6)") + .HasColumnName("starttimeofday"); + + b.HasKey("Id") + .HasName("pk_repeaters"); + + b.ToTable("repeaters", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RewardedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AmountRewardedThisMonth") + .HasColumnType("bigint") + .HasColumnName("amountrewardedthismonth"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LastReward") + .HasColumnType("datetime(6)") + .HasColumnName("lastreward"); + + b.Property("PlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("platformuserid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_rewardedusers"); + + b.HasIndex("PlatformUserId") + .IsUnique() + .HasDatabaseName("ix_rewardedusers_platformuserid"); + + b.ToTable("rewardedusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RotatingPlayingStatus", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Status") + .HasColumnType("longtext") + .HasColumnName("status"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_rotatingstatus"); + + b.ToTable("rotatingstatus", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SelfAssignedRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Group") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelRequirement") + .HasColumnType("int") + .HasColumnName("levelrequirement"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.ShopEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Price") + .HasColumnType("int") + .HasColumnName("price"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("RoleName") + .HasColumnType("longtext") + .HasColumnName("rolename"); + + b.Property("RoleRequirement") + .HasColumnType("bigint unsigned") + .HasColumnName("rolerequirement"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_shopentry"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_shopentry_guildconfigid"); + + b.ToTable("shopentry", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ShopEntryId") + .HasColumnType("int") + .HasColumnName("shopentryid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_shopentryitem"); + + b.HasIndex("ShopEntryId") + .HasDatabaseName("ix_shopentryitem_shopentryid"); + + b.ToTable("shopentryitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoredrole"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoredrole_guildconfigid"); + + b.ToTable("slowmodeignoredrole", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoreduser"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoreduser_guildconfigid"); + + b.ToTable("slowmodeignoreduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamroleblacklisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamroleblacklisteduser_streamrolesettingsid"); + + b.ToTable("streamroleblacklisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AddRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("addroleid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)") + .HasColumnName("enabled"); + + b.Property("FromRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("fromroleid"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Keyword") + .HasColumnType("longtext") + .HasColumnName("keyword"); + + b.HasKey("Id") + .HasName("pk_streamrolesettings"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_streamrolesettings_guildconfigid"); + + b.ToTable("streamrolesettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamrolewhitelisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamrolewhitelisteduser_streamrolesettingsid"); + + b.ToTable("streamrolewhitelisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unbantimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unbantimer_guildconfigid"); + + b.ToTable("unbantimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnmuteAt") + .HasColumnType("datetime(6)") + .HasColumnName("unmuteat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unmutetimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unmutetimer_guildconfigid"); + + b.ToTable("unmutetimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unroletimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unroletimer_guildconfigid"); + + b.ToTable("unroletimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UserXpStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AwardedXp") + .HasColumnType("bigint") + .HasColumnName("awardedxp"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("NotifyOnLevelUp") + .HasColumnType("int") + .HasColumnName("notifyonlevelup"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.VcRoleInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.HasKey("Id") + .HasName("pk_vcroleinfo"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_vcroleinfo_guildconfigid"); + + b.ToTable("vcroleinfo", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AffinityId") + .HasColumnType("int") + .HasColumnName("affinityid"); + + b.Property("ClaimerId") + .HasColumnType("int") + .HasColumnName("claimerid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Price") + .HasColumnType("bigint") + .HasColumnName("price"); + + b.Property("WaifuId") + .HasColumnType("int") + .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.Services.Database.Models.WaifuItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemEmoji") + .HasColumnType("longtext") + .HasColumnName("itememoji"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("WaifuInfoId") + .HasColumnType("int") + .HasColumnName("waifuinfoid"); + + b.HasKey("Id") + .HasName("pk_waifuitem"); + + b.HasIndex("WaifuInfoId") + .HasDatabaseName("ix_waifuitem_waifuinfoid"); + + b.ToTable("waifuitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("NewId") + .HasColumnType("int") + .HasColumnName("newid"); + + b.Property("OldId") + .HasColumnType("int") + .HasColumnName("oldid"); + + b.Property("UpdateType") + .HasColumnType("int") + .HasColumnName("updatetype"); + + b.Property("UserId") + .HasColumnType("int") + .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.Services.Database.Models.Warning", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Forgiven") + .HasColumnType("tinyint(1)") + .HasColumnName("forgiven"); + + b.Property("ForgivenBy") + .HasColumnType("longtext") + .HasColumnName("forgivenby"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Moderator") + .HasColumnType("longtext") + .HasColumnName("moderator"); + + b.Property("Reason") + .HasColumnType("longtext") + .HasColumnName("reason"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.WarningPunishment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Count") + .HasColumnType("int") + .HasColumnName("count"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Punishment") + .HasColumnType("int") + .HasColumnName("punishment"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("Time") + .HasColumnType("int") + .HasColumnName("time"); + + b.HasKey("Id") + .HasName("pk_warningpunishment"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_warningpunishment_guildconfigid"); + + b.ToTable("warningpunishment", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("int") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_xpcurrencyreward"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_xpcurrencyreward_xpsettingsid"); + + b.ToTable("xpcurrencyreward", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("Remove") + .HasColumnType("tinyint(1)") + .HasColumnName("remove"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .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.Services.Database.Models.XpSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("ServerExcluded") + .HasColumnType("tinyint(1)") + .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.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.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.FollowedStream", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FollowedStreams") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithOne("AntiAltSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiAltSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiRaidSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiRaidSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.HasOne("EllieBot.Services.Database.Models.AntiSpamSetting", null) + .WithMany("IgnoredChannels") + .HasForeignKey("AntiSpamSettingId") + .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiSpamSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiSpamSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.AutoTranslateChannel", "Channel") + .WithMany("Users") + .HasForeignKey("ChannelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); + + b.Navigation("Channel"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandAliases") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandCooldowns") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("DelMsgOnCmdChannels") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", null) + .WithMany("ExclusionList") + .HasForeignKey("XpSettingsId") + .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("FeedSubs") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_feedsub_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterInvitesChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilteredWords") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterLinksChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterWordsChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("GenerateCurrencyChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("SelfAssignableRoleGroupNames") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_groupname_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany("LogIgnores") + .HasForeignKey("LogSettingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ignoredlogchannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany() + .HasForeignKey("LogSettingId") + .HasConstraintName("fk_ignoredvoicepresencechannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("MutedUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("Permissions") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlaylistSong", b => + { + b.HasOne("EllieBot.Services.Database.Models.MusicPlaylist", null) + .WithMany("Songs") + .HasForeignKey("MusicPlaylistId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Answers") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollanswer_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Votes") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollvote_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("ShopEntries") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.ShopEntry", null) + .WithMany("Items") + .HasForeignKey("ShopEntryId") + .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredRoles") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Blacklist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("StreamRole") + .HasForeignKey("EllieBot.Services.Database.Models.StreamRoleSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Whitelist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnbanTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnmuteTimers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnroleTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.VcRoleInfo", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("VcRoleInfos") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WaifuInfo", "WaifuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); + + b.Navigation("Affinity"); + + b.Navigation("Claimer"); + + b.Navigation("Waifu"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.WaifuInfo", "WaifuInfo") + .WithMany("Items") + .HasForeignKey("WaifuInfoId") + .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); + + b.Navigation("WaifuInfo"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WarningPunishment", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("WarnPunishments") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_warningpunishment_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("CurrencyRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpcurrencyreward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("RoleRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xprolereward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("XpSettings") + .HasForeignKey("EllieBot.Services.Database.Models.XpSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => + { + b.Navigation("Applicants"); + + b.Navigation("Bans"); + + b.Navigation("Members"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Navigation("IgnoredChannels"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.LogSetting", b => + { + b.Navigation("LogIgnores"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlaylist", b => + { + b.Navigation("Songs"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Navigation("Answers"); + + b.Navigation("Votes"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Navigation("Blacklist"); + + b.Navigation("Whitelist"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.Navigation("CurrencyRewards"); + + b.Navigation("ExclusionList"); + + b.Navigation("RoleRewards"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20220916194514_autopub.cs b/src/EllieBot/Migrations/Mysql/20220916194514_autopub.cs new file mode 100644 index 0000000..16a0ed2 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20220916194514_autopub.cs @@ -0,0 +1,42 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + public partial class autopub : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "autopublishchannel", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildid = table.Column(type: "bigint unsigned", nullable: false), + channelid = table.Column(type: "bigint unsigned", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_autopublishchannel", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "ix_autopublishchannel_guildid", + table: "autopublishchannel", + column: "guildid", + unique: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "autopublishchannel"); + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20221003175743_gambling-stats.Designer.cs b/src/EllieBot/Migrations/Mysql/20221003175743_gambling-stats.Designer.cs new file mode 100644 index 0000000..eeb172f --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20221003175743_gambling-stats.Designer.cs @@ -0,0 +1,3612 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using EllieBot.Services.Database; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + [DbContext(typeof(MysqlContext))] + [Migration("20221003175743_gambling-stats")] + partial class gamblingstats + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("EllieBot.Db.Models.AutoPublishChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_autopublishchannel"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_autopublishchannel_guildid"); + + b.ToTable("autopublishchannel", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Balance") + .HasColumnType("bigint") + .HasColumnName("balance"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.ClubApplicants", b => + { + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Description") + .HasColumnType("longtext") + .HasColumnName("description"); + + b.Property("ImageUrl") + .HasColumnType("longtext") + .HasColumnName("imageurl"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("name") + .UseCollation("utf8mb4_bin"); + + b.Property("OwnerId") + .HasColumnType("int") + .HasColumnName("ownerid"); + + b.Property("Xp") + .HasColumnType("int") + .HasColumnName("xp"); + + b.HasKey("Id") + .HasName("pk_clubs"); + + b.HasAlternateKey("Name") + .HasName("ak_clubs_name"); + + b.HasIndex("OwnerId") + .IsUnique() + .HasDatabaseName("ix_clubs_ownerid"); + + b.ToTable("clubs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AvatarId") + .HasColumnType("longtext") + .HasColumnName("avatarid"); + + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("CurrencyAmount") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("currencyamount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Discriminator") + .HasColumnType("longtext") + .HasColumnName("discriminator"); + + b.Property("IsClubAdmin") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("isclubadmin"); + + b.Property("NotifyOnLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("notifyonlevelup"); + + b.Property("TotalXp") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("totalxp"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .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.FollowedStream", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.Property("Username") + .HasColumnType("longtext") + .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.PatronQuota", b => + { + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("FeatureType") + .HasColumnType("int") + .HasColumnName("featuretype"); + + b.Property("Feature") + .HasColumnType("varchar(255)") + .HasColumnName("feature"); + + b.Property("DailyCount") + .HasColumnType("int unsigned") + .HasColumnName("dailycount"); + + b.Property("HourlyCount") + .HasColumnType("int unsigned") + .HasColumnName("hourlycount"); + + b.Property("MonthlyCount") + .HasColumnType("int unsigned") + .HasColumnName("monthlycount"); + + b.HasKey("UserId", "FeatureType", "Feature") + .HasName("pk_patronquotas"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_patronquotas_userid"); + + b.ToTable("patronquotas", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => + { + b.Property("UserId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("AmountCents") + .HasColumnType("int") + .HasColumnName("amountcents"); + + b.Property("LastCharge") + .HasColumnType("datetime(6)") + .HasColumnName("lastcharge"); + + b.Property("UniquePlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("uniqueplatformuserid"); + + b.Property("ValidThru") + .HasColumnType("datetime(6)") + .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.StreamOnlineMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_streamonlinemessages"); + + b.ToTable("streamonlinemessages", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.XpShopOwnedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsUsing") + .HasColumnType("tinyint(1)") + .HasColumnName("isusing"); + + b.Property("ItemKey") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("itemkey"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Database.Models.AntiAltSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("ActionDurationMinutes") + .HasColumnType("int") + .HasColumnName("actiondurationminutes"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MinAge") + .HasColumnType("time(6)") + .HasColumnName("minage"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antialtsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antialtsetting_guildconfigid"); + + b.ToTable("antialtsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("PunishDuration") + .HasColumnType("int") + .HasColumnName("punishduration"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.Property("UserThreshold") + .HasColumnType("int") + .HasColumnName("userthreshold"); + + b.HasKey("Id") + .HasName("pk_antiraidsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antiraidsetting_guildconfigid"); + + b.ToTable("antiraidsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AntiSpamSettingId") + .HasColumnType("int") + .HasColumnName("antispamsettingid"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.HasKey("Id") + .HasName("pk_antispamignore"); + + b.HasIndex("AntiSpamSettingId") + .HasDatabaseName("ix_antispamignore_antispamsettingid"); + + b.ToTable("antispamignore", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MessageThreshold") + .HasColumnType("int") + .HasColumnName("messagethreshold"); + + b.Property("MuteTime") + .HasColumnType("int") + .HasColumnName("mutetime"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antispamsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antispamsetting_guildconfigid"); + + b.ToTable("antispamsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoCommand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("ChannelName") + .HasColumnType("longtext") + .HasColumnName("channelname"); + + b.Property("CommandText") + .HasColumnType("longtext") + .HasColumnName("commandtext"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("GuildName") + .HasColumnType("longtext") + .HasColumnName("guildname"); + + b.Property("Interval") + .HasColumnType("int") + .HasColumnName("interval"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.Property("VoiceChannelName") + .HasColumnType("longtext") + .HasColumnName("voicechannelname"); + + b.HasKey("Id") + .HasName("pk_autocommands"); + + b.ToTable("autocommands", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDelete") + .HasColumnType("tinyint(1)") + .HasColumnName("autodelete"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_autotranslatechannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_autotranslatechannels_channelid"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_autotranslatechannels_guildid"); + + b.ToTable("autotranslatechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("int") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Source") + .HasColumnType("longtext") + .HasColumnName("source"); + + b.Property("Target") + .HasColumnType("longtext") + .HasColumnName("target"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_autotranslateusers"); + + b.HasAlternateKey("ChannelId", "UserId") + .HasName("ak_autotranslateusers_channelid_userid"); + + b.ToTable("autotranslateusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BanTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("PruneDays") + .HasColumnType("int") + .HasColumnName("prunedays"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_bantemplates"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_bantemplates_guildid"); + + b.ToTable("bantemplates", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BlacklistEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_blacklist"); + + b.ToTable("blacklist", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Mapping") + .HasColumnType("longtext") + .HasColumnName("mapping"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_commandalias"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandalias_guildconfigid"); + + b.ToTable("commandalias", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("CommandName") + .HasColumnType("longtext") + .HasColumnName("commandname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.HasKey("Id") + .HasName("pk_commandcooldown"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandcooldown_guildconfigid"); + + b.ToTable("commandcooldown", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CurrencyTransaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Extra") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("extra"); + + b.Property("Note") + .HasColumnType("longtext") + .HasColumnName("note"); + + b.Property("OtherId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("otherid") + .HasDefaultValueSql("NULL"); + + b.Property("Type") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("type"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_currencytransactions"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_currencytransactions_userid"); + + b.ToTable("currencytransactions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_delmsgoncmdchannel"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); + + b.ToTable("delmsgoncmdchannel", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DiscordPermOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Command") + .HasColumnType("varchar(255)") + .HasColumnName("command"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Perm") + .HasColumnType("bigint unsigned") + .HasColumnName("perm"); + + b.HasKey("Id") + .HasName("pk_discordpermoverrides"); + + b.HasIndex("GuildId", "Command") + .IsUnique() + .HasDatabaseName("ix_discordpermoverrides_guildid_command"); + + b.ToTable("discordpermoverrides", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_excludeditem"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_excludeditem_xpsettingsid"); + + b.ToTable("excludeditem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Url") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("url"); + + b.HasKey("Id") + .HasName("pk_feedsub"); + + b.HasAlternateKey("GuildConfigId", "Url") + .HasName("ak_feedsub_guildconfigid_url"); + + b.ToTable("feedsub", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterchannelid_guildconfigid"); + + b.ToTable("filterchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Word") + .HasColumnType("longtext") + .HasColumnName("word"); + + b.HasKey("Id") + .HasName("pk_filteredword"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filteredword_guildconfigid"); + + b.ToTable("filteredword", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterlinkschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); + + b.ToTable("filterlinkschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterwordschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); + + b.ToTable("filterwordschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GamblingStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Bet") + .HasColumnType("decimal(65,30)") + .HasColumnName("bet"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Feature") + .HasColumnType("varchar(255)") + .HasColumnName("feature"); + + b.Property("PaidOut") + .HasColumnType("decimal(65,30)") + .HasColumnName("paidout"); + + b.HasKey("Id") + .HasName("pk_gamblingstats"); + + b.HasIndex("Feature") + .IsUnique() + .HasDatabaseName("ix_gamblingstats_feature"); + + b.ToTable("gamblingstats", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_gcchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_gcchannelid_guildconfigid"); + + b.ToTable("gcchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Number") + .HasColumnType("int") + .HasColumnName("number"); + + b.HasKey("Id") + .HasName("pk_groupname"); + + b.HasIndex("GuildConfigId", "Number") + .IsUnique() + .HasDatabaseName("ix_groupname_guildconfigid_number"); + + b.ToTable("groupname", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GuildConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoAssignRoleIds") + .HasColumnType("longtext") + .HasColumnName("autoassignroleids"); + + b.Property("AutoDeleteByeMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletebyemessagestimer"); + + b.Property("AutoDeleteGreetMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletegreetmessagestimer"); + + b.Property("AutoDeleteSelfAssignedRoleMessages") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeleteselfassignedrolemessages"); + + b.Property("BoostMessage") + .HasColumnType("longtext") + .HasColumnName("boostmessage"); + + b.Property("BoostMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("boostmessagechannelid"); + + b.Property("BoostMessageDeleteAfter") + .HasColumnType("int") + .HasColumnName("boostmessagedeleteafter"); + + b.Property("ByeMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("byemessagechannelid"); + + b.Property("ChannelByeMessageText") + .HasColumnType("longtext") + .HasColumnName("channelbyemessagetext"); + + b.Property("ChannelGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("channelgreetmessagetext"); + + b.Property("CleverbotEnabled") + .HasColumnType("tinyint(1)") + .HasColumnName("cleverbotenabled"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DeleteMessageOnCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("deletemessageoncommand"); + + b.Property("DeleteStreamOnlineMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("deletestreamonlinemessage"); + + b.Property("DmGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("dmgreetmessagetext"); + + b.Property("ExclusiveSelfAssignedRoles") + .HasColumnType("tinyint(1)") + .HasColumnName("exclusiveselfassignedroles"); + + b.Property("FilterInvites") + .HasColumnType("tinyint(1)") + .HasColumnName("filterinvites"); + + b.Property("FilterLinks") + .HasColumnType("tinyint(1)") + .HasColumnName("filterlinks"); + + b.Property("FilterWords") + .HasColumnType("tinyint(1)") + .HasColumnName("filterwords"); + + b.Property("GameVoiceChannel") + .HasColumnType("bigint unsigned") + .HasColumnName("gamevoicechannel"); + + b.Property("GreetMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("greetmessagechannelid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Locale") + .HasColumnType("longtext") + .HasColumnName("locale"); + + b.Property("MuteRoleName") + .HasColumnType("longtext") + .HasColumnName("muterolename"); + + b.Property("NotifyStreamOffline") + .HasColumnType("tinyint(1)") + .HasColumnName("notifystreamoffline"); + + b.Property("PermissionRole") + .HasColumnType("longtext") + .HasColumnName("permissionrole"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasColumnName("prefix"); + + b.Property("SendBoostMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendboostmessage"); + + b.Property("SendChannelByeMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelbyemessage"); + + b.Property("SendChannelGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelgreetmessage"); + + b.Property("SendDmGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("senddmgreetmessage"); + + b.Property("TimeZoneId") + .HasColumnType("longtext") + .HasColumnName("timezoneid"); + + b.Property("VerboseErrors") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true) + .HasColumnName("verboseerrors"); + + b.Property("VerbosePermissions") + .HasColumnType("tinyint(1)") + .HasColumnName("verbosepermissions"); + + b.Property("WarnExpireAction") + .HasColumnType("int") + .HasColumnName("warnexpireaction"); + + b.Property("WarnExpireHours") + .HasColumnType("int") + .HasColumnName("warnexpirehours"); + + b.Property("WarningsInitialized") + .HasColumnType("tinyint(1)") + .HasColumnName("warningsinitialized"); + + b.HasKey("Id") + .HasName("pk_guildconfigs"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_guildconfigs_guildid"); + + b.HasIndex("WarnExpireHours") + .HasDatabaseName("ix_guildconfigs_warnexpirehours"); + + b.ToTable("guildconfigs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("LogItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("logitemid"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredlogchannels"); + + b.HasIndex("LogSettingId", "LogItemId", "ItemType") + .IsUnique() + .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype"); + + b.ToTable("ignoredlogchannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredvoicepresencechannels"); + + b.HasIndex("LogSettingId") + .HasDatabaseName("ix_ignoredvoicepresencechannels_logsettingid"); + + b.ToTable("ignoredvoicepresencechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ImageOnlyChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_imageonlychannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_imageonlychannels_channelid"); + + b.ToTable("imageonlychannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.LogSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelCreatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelcreatedid"); + + b.Property("ChannelDestroyedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channeldestroyedid"); + + b.Property("ChannelUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelupdatedid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LogOtherId") + .HasColumnType("bigint unsigned") + .HasColumnName("logotherid"); + + b.Property("LogUserPresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("loguserpresenceid"); + + b.Property("LogVoicePresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresenceid"); + + b.Property("LogVoicePresenceTTSId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresencettsid"); + + b.Property("LogWarnsId") + .HasColumnType("bigint unsigned") + .HasColumnName("logwarnsid"); + + b.Property("MessageDeletedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messagedeletedid"); + + b.Property("MessageUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageupdatedid"); + + b.Property("UserBannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userbannedid"); + + b.Property("UserJoinedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userjoinedid"); + + b.Property("UserLeftId") + .HasColumnType("bigint unsigned") + .HasColumnName("userleftid"); + + b.Property("UserMutedId") + .HasColumnType("bigint unsigned") + .HasColumnName("usermutedid"); + + b.Property("UserUnbannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userunbannedid"); + + b.Property("UserUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userupdatedid"); + + b.HasKey("Id") + .HasName("pk_logsettings"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_logsettings_guildid"); + + b.ToTable("logsettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlayerSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDisconnect") + .HasColumnType("tinyint(1)") + .HasColumnName("autodisconnect"); + + b.Property("AutoPlay") + .HasColumnType("tinyint(1)") + .HasColumnName("autoplay"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MusicChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("musicchannelid"); + + b.Property("PlayerRepeat") + .HasColumnType("int") + .HasColumnName("playerrepeat"); + + b.Property("QualityPreset") + .HasColumnType("int") + .HasColumnName("qualitypreset"); + + b.Property("Volume") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .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.Services.Database.Models.MusicPlaylist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Author") + .HasColumnType("longtext") + .HasColumnName("author"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.HasKey("Id") + .HasName("pk_musicplaylists"); + + b.ToTable("musicplaylists", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_muteduserid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_muteduserid_guildconfigid"); + + b.ToTable("muteduserid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AllowTarget") + .HasColumnType("tinyint(1)") + .HasColumnName("allowtarget"); + + b.Property("AutoDeleteTrigger") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeletetrigger"); + + b.Property("ContainsAnywhere") + .HasColumnType("tinyint(1)") + .HasColumnName("containsanywhere"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DmResponse") + .HasColumnType("tinyint(1)") + .HasColumnName("dmresponse"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Reactions") + .HasColumnType("longtext") + .HasColumnName("reactions"); + + b.Property("Response") + .HasColumnType("longtext") + .HasColumnName("response"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_expressions"); + + b.ToTable("expressions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NsfwBlacklistedTag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Tag") + .HasColumnType("longtext") + .HasColumnName("tag"); + + b.HasKey("Id") + .HasName("pk_nsfwblacklistedtags"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_nsfwblacklistedtags_guildid"); + + b.ToTable("nsfwblacklistedtags", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("IsCustomCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("iscustomcommand"); + + b.Property("PrimaryTarget") + .HasColumnType("int") + .HasColumnName("primarytarget"); + + b.Property("PrimaryTargetId") + .HasColumnType("bigint unsigned") + .HasColumnName("primarytargetid"); + + b.Property("SecondaryTarget") + .HasColumnType("int") + .HasColumnName("secondarytarget"); + + b.Property("SecondaryTargetName") + .HasColumnType("longtext") + .HasColumnName("secondarytargetname"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_permissions"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_permissions_guildconfigid"); + + b.ToTable("permissions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlantedCurrency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Password") + .HasColumnType("longtext") + .HasColumnName("password"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.PlaylistSong", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MusicPlaylistId") + .HasColumnType("int") + .HasColumnName("musicplaylistid"); + + b.Property("Provider") + .HasColumnType("longtext") + .HasColumnName("provider"); + + b.Property("ProviderType") + .HasColumnType("int") + .HasColumnName("providertype"); + + b.Property("Query") + .HasColumnType("longtext") + .HasColumnName("query"); + + b.Property("Title") + .HasColumnType("longtext") + .HasColumnName("title"); + + b.Property("Uri") + .HasColumnType("longtext") + .HasColumnName("uri"); + + b.HasKey("Id") + .HasName("pk_playlistsong"); + + b.HasIndex("MusicPlaylistId") + .HasDatabaseName("ix_playlistsong_musicplaylistid"); + + b.ToTable("playlistsong", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Question") + .HasColumnType("longtext") + .HasColumnName("question"); + + b.HasKey("Id") + .HasName("pk_poll"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_poll_guildid"); + + b.ToTable("poll", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_pollanswer"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollanswer_pollid"); + + b.ToTable("pollanswer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("VoteIndex") + .HasColumnType("int") + .HasColumnName("voteindex"); + + b.HasKey("Id") + .HasName("pk_pollvote"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollvote_pollid"); + + b.ToTable("pollvote", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Quote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("AuthorName") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("authorname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Keyword") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("keyword"); + + b.Property("Text") + .IsRequired() + .HasColumnType("longtext") + .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.Services.Database.Models.ReactionRoleV2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Emote") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("emote"); + + b.Property("Group") + .HasColumnType("int") + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelReq") + .HasColumnType("int") + .HasColumnName("levelreq"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.Reminder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsPrivate") + .HasColumnType("tinyint(1)") + .HasColumnName("isprivate"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("ServerId") + .HasColumnType("bigint unsigned") + .HasColumnName("serverid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("When") + .HasColumnType("datetime(6)") + .HasColumnName("when"); + + b.HasKey("Id") + .HasName("pk_reminders"); + + b.HasIndex("When") + .HasDatabaseName("ix_reminders_when"); + + b.ToTable("reminders", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Repeater", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Interval") + .HasColumnType("time(6)") + .HasColumnName("interval"); + + b.Property("LastMessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("lastmessageid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("NoRedundant") + .HasColumnType("tinyint(1)") + .HasColumnName("noredundant"); + + b.Property("StartTimeOfDay") + .HasColumnType("time(6)") + .HasColumnName("starttimeofday"); + + b.HasKey("Id") + .HasName("pk_repeaters"); + + b.ToTable("repeaters", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RewardedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AmountRewardedThisMonth") + .HasColumnType("bigint") + .HasColumnName("amountrewardedthismonth"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LastReward") + .HasColumnType("datetime(6)") + .HasColumnName("lastreward"); + + b.Property("PlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("platformuserid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_rewardedusers"); + + b.HasIndex("PlatformUserId") + .IsUnique() + .HasDatabaseName("ix_rewardedusers_platformuserid"); + + b.ToTable("rewardedusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RotatingPlayingStatus", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Status") + .HasColumnType("longtext") + .HasColumnName("status"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_rotatingstatus"); + + b.ToTable("rotatingstatus", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SelfAssignedRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Group") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelRequirement") + .HasColumnType("int") + .HasColumnName("levelrequirement"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.ShopEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Price") + .HasColumnType("int") + .HasColumnName("price"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("RoleName") + .HasColumnType("longtext") + .HasColumnName("rolename"); + + b.Property("RoleRequirement") + .HasColumnType("bigint unsigned") + .HasColumnName("rolerequirement"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_shopentry"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_shopentry_guildconfigid"); + + b.ToTable("shopentry", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ShopEntryId") + .HasColumnType("int") + .HasColumnName("shopentryid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_shopentryitem"); + + b.HasIndex("ShopEntryId") + .HasDatabaseName("ix_shopentryitem_shopentryid"); + + b.ToTable("shopentryitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoredrole"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoredrole_guildconfigid"); + + b.ToTable("slowmodeignoredrole", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoreduser"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoreduser_guildconfigid"); + + b.ToTable("slowmodeignoreduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamroleblacklisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamroleblacklisteduser_streamrolesettingsid"); + + b.ToTable("streamroleblacklisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AddRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("addroleid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)") + .HasColumnName("enabled"); + + b.Property("FromRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("fromroleid"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Keyword") + .HasColumnType("longtext") + .HasColumnName("keyword"); + + b.HasKey("Id") + .HasName("pk_streamrolesettings"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_streamrolesettings_guildconfigid"); + + b.ToTable("streamrolesettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamrolewhitelisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamrolewhitelisteduser_streamrolesettingsid"); + + b.ToTable("streamrolewhitelisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unbantimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unbantimer_guildconfigid"); + + b.ToTable("unbantimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnmuteAt") + .HasColumnType("datetime(6)") + .HasColumnName("unmuteat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unmutetimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unmutetimer_guildconfigid"); + + b.ToTable("unmutetimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unroletimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unroletimer_guildconfigid"); + + b.ToTable("unroletimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UserXpStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AwardedXp") + .HasColumnType("bigint") + .HasColumnName("awardedxp"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("NotifyOnLevelUp") + .HasColumnType("int") + .HasColumnName("notifyonlevelup"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.VcRoleInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.HasKey("Id") + .HasName("pk_vcroleinfo"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_vcroleinfo_guildconfigid"); + + b.ToTable("vcroleinfo", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AffinityId") + .HasColumnType("int") + .HasColumnName("affinityid"); + + b.Property("ClaimerId") + .HasColumnType("int") + .HasColumnName("claimerid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Price") + .HasColumnType("bigint") + .HasColumnName("price"); + + b.Property("WaifuId") + .HasColumnType("int") + .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.Services.Database.Models.WaifuItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemEmoji") + .HasColumnType("longtext") + .HasColumnName("itememoji"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("WaifuInfoId") + .HasColumnType("int") + .HasColumnName("waifuinfoid"); + + b.HasKey("Id") + .HasName("pk_waifuitem"); + + b.HasIndex("WaifuInfoId") + .HasDatabaseName("ix_waifuitem_waifuinfoid"); + + b.ToTable("waifuitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("NewId") + .HasColumnType("int") + .HasColumnName("newid"); + + b.Property("OldId") + .HasColumnType("int") + .HasColumnName("oldid"); + + b.Property("UpdateType") + .HasColumnType("int") + .HasColumnName("updatetype"); + + b.Property("UserId") + .HasColumnType("int") + .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.Services.Database.Models.Warning", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Forgiven") + .HasColumnType("tinyint(1)") + .HasColumnName("forgiven"); + + b.Property("ForgivenBy") + .HasColumnType("longtext") + .HasColumnName("forgivenby"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Moderator") + .HasColumnType("longtext") + .HasColumnName("moderator"); + + b.Property("Reason") + .HasColumnType("longtext") + .HasColumnName("reason"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.WarningPunishment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Count") + .HasColumnType("int") + .HasColumnName("count"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Punishment") + .HasColumnType("int") + .HasColumnName("punishment"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("Time") + .HasColumnType("int") + .HasColumnName("time"); + + b.HasKey("Id") + .HasName("pk_warningpunishment"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_warningpunishment_guildconfigid"); + + b.ToTable("warningpunishment", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("int") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_xpcurrencyreward"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_xpcurrencyreward_xpsettingsid"); + + b.ToTable("xpcurrencyreward", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("Remove") + .HasColumnType("tinyint(1)") + .HasColumnName("remove"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .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.Services.Database.Models.XpSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("ServerExcluded") + .HasColumnType("tinyint(1)") + .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.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.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.FollowedStream", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FollowedStreams") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithOne("AntiAltSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiAltSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiRaidSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiRaidSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.HasOne("EllieBot.Services.Database.Models.AntiSpamSetting", null) + .WithMany("IgnoredChannels") + .HasForeignKey("AntiSpamSettingId") + .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiSpamSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiSpamSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.AutoTranslateChannel", "Channel") + .WithMany("Users") + .HasForeignKey("ChannelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); + + b.Navigation("Channel"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandAliases") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandCooldowns") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("DelMsgOnCmdChannels") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", null) + .WithMany("ExclusionList") + .HasForeignKey("XpSettingsId") + .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("FeedSubs") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_feedsub_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterInvitesChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilteredWords") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterLinksChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterWordsChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("GenerateCurrencyChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("SelfAssignableRoleGroupNames") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_groupname_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany("LogIgnores") + .HasForeignKey("LogSettingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ignoredlogchannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany() + .HasForeignKey("LogSettingId") + .HasConstraintName("fk_ignoredvoicepresencechannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("MutedUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("Permissions") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlaylistSong", b => + { + b.HasOne("EllieBot.Services.Database.Models.MusicPlaylist", null) + .WithMany("Songs") + .HasForeignKey("MusicPlaylistId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Answers") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollanswer_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Votes") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollvote_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("ShopEntries") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.ShopEntry", null) + .WithMany("Items") + .HasForeignKey("ShopEntryId") + .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredRoles") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Blacklist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("StreamRole") + .HasForeignKey("EllieBot.Services.Database.Models.StreamRoleSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Whitelist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnbanTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnmuteTimers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnroleTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.VcRoleInfo", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("VcRoleInfos") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WaifuInfo", "WaifuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); + + b.Navigation("Affinity"); + + b.Navigation("Claimer"); + + b.Navigation("Waifu"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.WaifuInfo", "WaifuInfo") + .WithMany("Items") + .HasForeignKey("WaifuInfoId") + .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); + + b.Navigation("WaifuInfo"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WarningPunishment", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("WarnPunishments") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_warningpunishment_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("CurrencyRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpcurrencyreward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("RoleRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xprolereward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("XpSettings") + .HasForeignKey("EllieBot.Services.Database.Models.XpSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => + { + b.Navigation("Applicants"); + + b.Navigation("Bans"); + + b.Navigation("Members"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Navigation("IgnoredChannels"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.LogSetting", b => + { + b.Navigation("LogIgnores"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlaylist", b => + { + b.Navigation("Songs"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Navigation("Answers"); + + b.Navigation("Votes"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Navigation("Blacklist"); + + b.Navigation("Whitelist"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.Navigation("CurrencyRewards"); + + b.Navigation("ExclusionList"); + + b.Navigation("RoleRewards"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20221003175743_gambling-stats.cs b/src/EllieBot/Migrations/Mysql/20221003175743_gambling-stats.cs new file mode 100644 index 0000000..bb53a5e --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20221003175743_gambling-stats.cs @@ -0,0 +1,44 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + public partial class gamblingstats : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "gamblingstats", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + feature = table.Column(type: "varchar(255)", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + bet = table.Column(type: "decimal(65,30)", nullable: false), + paidout = table.Column(type: "decimal(65,30)", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_gamblingstats", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "ix_gamblingstats_feature", + table: "gamblingstats", + column: "feature", + unique: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "gamblingstats"); + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20221021192758_toggle-global-expressions.Designer.cs b/src/EllieBot/Migrations/Mysql/20221021192758_toggle-global-expressions.Designer.cs new file mode 100644 index 0000000..68aacf9 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20221021192758_toggle-global-expressions.Designer.cs @@ -0,0 +1,3616 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using EllieBot.Services.Database; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + [DbContext(typeof(MysqlContext))] + [Migration("20221021192758_toggle-global-expressions")] + partial class toggleglobalexpressions + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("EllieBot.Db.Models.AutoPublishChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_autopublishchannel"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_autopublishchannel_guildid"); + + b.ToTable("autopublishchannel", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Balance") + .HasColumnType("bigint") + .HasColumnName("balance"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.ClubApplicants", b => + { + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Description") + .HasColumnType("longtext") + .HasColumnName("description"); + + b.Property("ImageUrl") + .HasColumnType("longtext") + .HasColumnName("imageurl"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("name") + .UseCollation("utf8mb4_bin"); + + b.Property("OwnerId") + .HasColumnType("int") + .HasColumnName("ownerid"); + + b.Property("Xp") + .HasColumnType("int") + .HasColumnName("xp"); + + b.HasKey("Id") + .HasName("pk_clubs"); + + b.HasAlternateKey("Name") + .HasName("ak_clubs_name"); + + b.HasIndex("OwnerId") + .IsUnique() + .HasDatabaseName("ix_clubs_ownerid"); + + b.ToTable("clubs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AvatarId") + .HasColumnType("longtext") + .HasColumnName("avatarid"); + + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("CurrencyAmount") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("currencyamount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Discriminator") + .HasColumnType("longtext") + .HasColumnName("discriminator"); + + b.Property("IsClubAdmin") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("isclubadmin"); + + b.Property("NotifyOnLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("notifyonlevelup"); + + b.Property("TotalXp") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("totalxp"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .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.FollowedStream", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.Property("Username") + .HasColumnType("longtext") + .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.PatronQuota", b => + { + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("FeatureType") + .HasColumnType("int") + .HasColumnName("featuretype"); + + b.Property("Feature") + .HasColumnType("varchar(255)") + .HasColumnName("feature"); + + b.Property("DailyCount") + .HasColumnType("int unsigned") + .HasColumnName("dailycount"); + + b.Property("HourlyCount") + .HasColumnType("int unsigned") + .HasColumnName("hourlycount"); + + b.Property("MonthlyCount") + .HasColumnType("int unsigned") + .HasColumnName("monthlycount"); + + b.HasKey("UserId", "FeatureType", "Feature") + .HasName("pk_patronquotas"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_patronquotas_userid"); + + b.ToTable("patronquotas", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => + { + b.Property("UserId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("AmountCents") + .HasColumnType("int") + .HasColumnName("amountcents"); + + b.Property("LastCharge") + .HasColumnType("datetime(6)") + .HasColumnName("lastcharge"); + + b.Property("UniquePlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("uniqueplatformuserid"); + + b.Property("ValidThru") + .HasColumnType("datetime(6)") + .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.StreamOnlineMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_streamonlinemessages"); + + b.ToTable("streamonlinemessages", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.XpShopOwnedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsUsing") + .HasColumnType("tinyint(1)") + .HasColumnName("isusing"); + + b.Property("ItemKey") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("itemkey"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Database.Models.AntiAltSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("ActionDurationMinutes") + .HasColumnType("int") + .HasColumnName("actiondurationminutes"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MinAge") + .HasColumnType("time(6)") + .HasColumnName("minage"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antialtsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antialtsetting_guildconfigid"); + + b.ToTable("antialtsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("PunishDuration") + .HasColumnType("int") + .HasColumnName("punishduration"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.Property("UserThreshold") + .HasColumnType("int") + .HasColumnName("userthreshold"); + + b.HasKey("Id") + .HasName("pk_antiraidsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antiraidsetting_guildconfigid"); + + b.ToTable("antiraidsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AntiSpamSettingId") + .HasColumnType("int") + .HasColumnName("antispamsettingid"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.HasKey("Id") + .HasName("pk_antispamignore"); + + b.HasIndex("AntiSpamSettingId") + .HasDatabaseName("ix_antispamignore_antispamsettingid"); + + b.ToTable("antispamignore", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MessageThreshold") + .HasColumnType("int") + .HasColumnName("messagethreshold"); + + b.Property("MuteTime") + .HasColumnType("int") + .HasColumnName("mutetime"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antispamsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antispamsetting_guildconfigid"); + + b.ToTable("antispamsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoCommand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("ChannelName") + .HasColumnType("longtext") + .HasColumnName("channelname"); + + b.Property("CommandText") + .HasColumnType("longtext") + .HasColumnName("commandtext"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("GuildName") + .HasColumnType("longtext") + .HasColumnName("guildname"); + + b.Property("Interval") + .HasColumnType("int") + .HasColumnName("interval"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.Property("VoiceChannelName") + .HasColumnType("longtext") + .HasColumnName("voicechannelname"); + + b.HasKey("Id") + .HasName("pk_autocommands"); + + b.ToTable("autocommands", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDelete") + .HasColumnType("tinyint(1)") + .HasColumnName("autodelete"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_autotranslatechannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_autotranslatechannels_channelid"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_autotranslatechannels_guildid"); + + b.ToTable("autotranslatechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("int") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Source") + .HasColumnType("longtext") + .HasColumnName("source"); + + b.Property("Target") + .HasColumnType("longtext") + .HasColumnName("target"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_autotranslateusers"); + + b.HasAlternateKey("ChannelId", "UserId") + .HasName("ak_autotranslateusers_channelid_userid"); + + b.ToTable("autotranslateusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BanTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("PruneDays") + .HasColumnType("int") + .HasColumnName("prunedays"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_bantemplates"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_bantemplates_guildid"); + + b.ToTable("bantemplates", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BlacklistEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_blacklist"); + + b.ToTable("blacklist", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Mapping") + .HasColumnType("longtext") + .HasColumnName("mapping"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_commandalias"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandalias_guildconfigid"); + + b.ToTable("commandalias", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("CommandName") + .HasColumnType("longtext") + .HasColumnName("commandname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.HasKey("Id") + .HasName("pk_commandcooldown"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandcooldown_guildconfigid"); + + b.ToTable("commandcooldown", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CurrencyTransaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Extra") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("extra"); + + b.Property("Note") + .HasColumnType("longtext") + .HasColumnName("note"); + + b.Property("OtherId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("otherid") + .HasDefaultValueSql("NULL"); + + b.Property("Type") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("type"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_currencytransactions"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_currencytransactions_userid"); + + b.ToTable("currencytransactions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_delmsgoncmdchannel"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); + + b.ToTable("delmsgoncmdchannel", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DiscordPermOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Command") + .HasColumnType("varchar(255)") + .HasColumnName("command"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Perm") + .HasColumnType("bigint unsigned") + .HasColumnName("perm"); + + b.HasKey("Id") + .HasName("pk_discordpermoverrides"); + + b.HasIndex("GuildId", "Command") + .IsUnique() + .HasDatabaseName("ix_discordpermoverrides_guildid_command"); + + b.ToTable("discordpermoverrides", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_excludeditem"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_excludeditem_xpsettingsid"); + + b.ToTable("excludeditem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Url") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("url"); + + b.HasKey("Id") + .HasName("pk_feedsub"); + + b.HasAlternateKey("GuildConfigId", "Url") + .HasName("ak_feedsub_guildconfigid_url"); + + b.ToTable("feedsub", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterchannelid_guildconfigid"); + + b.ToTable("filterchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Word") + .HasColumnType("longtext") + .HasColumnName("word"); + + b.HasKey("Id") + .HasName("pk_filteredword"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filteredword_guildconfigid"); + + b.ToTable("filteredword", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterlinkschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); + + b.ToTable("filterlinkschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterwordschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); + + b.ToTable("filterwordschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GamblingStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Bet") + .HasColumnType("decimal(65,30)") + .HasColumnName("bet"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Feature") + .HasColumnType("varchar(255)") + .HasColumnName("feature"); + + b.Property("PaidOut") + .HasColumnType("decimal(65,30)") + .HasColumnName("paidout"); + + b.HasKey("Id") + .HasName("pk_gamblingstats"); + + b.HasIndex("Feature") + .IsUnique() + .HasDatabaseName("ix_gamblingstats_feature"); + + b.ToTable("gamblingstats", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_gcchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_gcchannelid_guildconfigid"); + + b.ToTable("gcchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Number") + .HasColumnType("int") + .HasColumnName("number"); + + b.HasKey("Id") + .HasName("pk_groupname"); + + b.HasIndex("GuildConfigId", "Number") + .IsUnique() + .HasDatabaseName("ix_groupname_guildconfigid_number"); + + b.ToTable("groupname", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GuildConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoAssignRoleIds") + .HasColumnType("longtext") + .HasColumnName("autoassignroleids"); + + b.Property("AutoDeleteByeMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletebyemessagestimer"); + + b.Property("AutoDeleteGreetMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletegreetmessagestimer"); + + b.Property("AutoDeleteSelfAssignedRoleMessages") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeleteselfassignedrolemessages"); + + b.Property("BoostMessage") + .HasColumnType("longtext") + .HasColumnName("boostmessage"); + + b.Property("BoostMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("boostmessagechannelid"); + + b.Property("BoostMessageDeleteAfter") + .HasColumnType("int") + .HasColumnName("boostmessagedeleteafter"); + + b.Property("ByeMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("byemessagechannelid"); + + b.Property("ChannelByeMessageText") + .HasColumnType("longtext") + .HasColumnName("channelbyemessagetext"); + + b.Property("ChannelGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("channelgreetmessagetext"); + + b.Property("CleverbotEnabled") + .HasColumnType("tinyint(1)") + .HasColumnName("cleverbotenabled"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DeleteMessageOnCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("deletemessageoncommand"); + + b.Property("DeleteStreamOnlineMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("deletestreamonlinemessage"); + + b.Property("DisableGlobalExpressions") + .HasColumnType("tinyint(1)") + .HasColumnName("disableglobalexpressions"); + + b.Property("DmGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("dmgreetmessagetext"); + + b.Property("ExclusiveSelfAssignedRoles") + .HasColumnType("tinyint(1)") + .HasColumnName("exclusiveselfassignedroles"); + + b.Property("FilterInvites") + .HasColumnType("tinyint(1)") + .HasColumnName("filterinvites"); + + b.Property("FilterLinks") + .HasColumnType("tinyint(1)") + .HasColumnName("filterlinks"); + + b.Property("FilterWords") + .HasColumnType("tinyint(1)") + .HasColumnName("filterwords"); + + b.Property("GameVoiceChannel") + .HasColumnType("bigint unsigned") + .HasColumnName("gamevoicechannel"); + + b.Property("GreetMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("greetmessagechannelid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Locale") + .HasColumnType("longtext") + .HasColumnName("locale"); + + b.Property("MuteRoleName") + .HasColumnType("longtext") + .HasColumnName("muterolename"); + + b.Property("NotifyStreamOffline") + .HasColumnType("tinyint(1)") + .HasColumnName("notifystreamoffline"); + + b.Property("PermissionRole") + .HasColumnType("longtext") + .HasColumnName("permissionrole"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasColumnName("prefix"); + + b.Property("SendBoostMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendboostmessage"); + + b.Property("SendChannelByeMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelbyemessage"); + + b.Property("SendChannelGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelgreetmessage"); + + b.Property("SendDmGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("senddmgreetmessage"); + + b.Property("TimeZoneId") + .HasColumnType("longtext") + .HasColumnName("timezoneid"); + + b.Property("VerboseErrors") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true) + .HasColumnName("verboseerrors"); + + b.Property("VerbosePermissions") + .HasColumnType("tinyint(1)") + .HasColumnName("verbosepermissions"); + + b.Property("WarnExpireAction") + .HasColumnType("int") + .HasColumnName("warnexpireaction"); + + b.Property("WarnExpireHours") + .HasColumnType("int") + .HasColumnName("warnexpirehours"); + + b.Property("WarningsInitialized") + .HasColumnType("tinyint(1)") + .HasColumnName("warningsinitialized"); + + b.HasKey("Id") + .HasName("pk_guildconfigs"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_guildconfigs_guildid"); + + b.HasIndex("WarnExpireHours") + .HasDatabaseName("ix_guildconfigs_warnexpirehours"); + + b.ToTable("guildconfigs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("LogItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("logitemid"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredlogchannels"); + + b.HasIndex("LogSettingId", "LogItemId", "ItemType") + .IsUnique() + .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype"); + + b.ToTable("ignoredlogchannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredvoicepresencechannels"); + + b.HasIndex("LogSettingId") + .HasDatabaseName("ix_ignoredvoicepresencechannels_logsettingid"); + + b.ToTable("ignoredvoicepresencechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ImageOnlyChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_imageonlychannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_imageonlychannels_channelid"); + + b.ToTable("imageonlychannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.LogSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelCreatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelcreatedid"); + + b.Property("ChannelDestroyedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channeldestroyedid"); + + b.Property("ChannelUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelupdatedid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LogOtherId") + .HasColumnType("bigint unsigned") + .HasColumnName("logotherid"); + + b.Property("LogUserPresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("loguserpresenceid"); + + b.Property("LogVoicePresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresenceid"); + + b.Property("LogVoicePresenceTTSId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresencettsid"); + + b.Property("LogWarnsId") + .HasColumnType("bigint unsigned") + .HasColumnName("logwarnsid"); + + b.Property("MessageDeletedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messagedeletedid"); + + b.Property("MessageUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageupdatedid"); + + b.Property("UserBannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userbannedid"); + + b.Property("UserJoinedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userjoinedid"); + + b.Property("UserLeftId") + .HasColumnType("bigint unsigned") + .HasColumnName("userleftid"); + + b.Property("UserMutedId") + .HasColumnType("bigint unsigned") + .HasColumnName("usermutedid"); + + b.Property("UserUnbannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userunbannedid"); + + b.Property("UserUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userupdatedid"); + + b.HasKey("Id") + .HasName("pk_logsettings"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_logsettings_guildid"); + + b.ToTable("logsettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlayerSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDisconnect") + .HasColumnType("tinyint(1)") + .HasColumnName("autodisconnect"); + + b.Property("AutoPlay") + .HasColumnType("tinyint(1)") + .HasColumnName("autoplay"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MusicChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("musicchannelid"); + + b.Property("PlayerRepeat") + .HasColumnType("int") + .HasColumnName("playerrepeat"); + + b.Property("QualityPreset") + .HasColumnType("int") + .HasColumnName("qualitypreset"); + + b.Property("Volume") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .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.Services.Database.Models.MusicPlaylist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Author") + .HasColumnType("longtext") + .HasColumnName("author"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.HasKey("Id") + .HasName("pk_musicplaylists"); + + b.ToTable("musicplaylists", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_muteduserid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_muteduserid_guildconfigid"); + + b.ToTable("muteduserid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AllowTarget") + .HasColumnType("tinyint(1)") + .HasColumnName("allowtarget"); + + b.Property("AutoDeleteTrigger") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeletetrigger"); + + b.Property("ContainsAnywhere") + .HasColumnType("tinyint(1)") + .HasColumnName("containsanywhere"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DmResponse") + .HasColumnType("tinyint(1)") + .HasColumnName("dmresponse"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Reactions") + .HasColumnType("longtext") + .HasColumnName("reactions"); + + b.Property("Response") + .HasColumnType("longtext") + .HasColumnName("response"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_expressions"); + + b.ToTable("expressions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NsfwBlacklistedTag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Tag") + .HasColumnType("longtext") + .HasColumnName("tag"); + + b.HasKey("Id") + .HasName("pk_nsfwblacklistedtags"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_nsfwblacklistedtags_guildid"); + + b.ToTable("nsfwblacklistedtags", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("IsCustomCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("iscustomcommand"); + + b.Property("PrimaryTarget") + .HasColumnType("int") + .HasColumnName("primarytarget"); + + b.Property("PrimaryTargetId") + .HasColumnType("bigint unsigned") + .HasColumnName("primarytargetid"); + + b.Property("SecondaryTarget") + .HasColumnType("int") + .HasColumnName("secondarytarget"); + + b.Property("SecondaryTargetName") + .HasColumnType("longtext") + .HasColumnName("secondarytargetname"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_permissions"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_permissions_guildconfigid"); + + b.ToTable("permissions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlantedCurrency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Password") + .HasColumnType("longtext") + .HasColumnName("password"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.PlaylistSong", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MusicPlaylistId") + .HasColumnType("int") + .HasColumnName("musicplaylistid"); + + b.Property("Provider") + .HasColumnType("longtext") + .HasColumnName("provider"); + + b.Property("ProviderType") + .HasColumnType("int") + .HasColumnName("providertype"); + + b.Property("Query") + .HasColumnType("longtext") + .HasColumnName("query"); + + b.Property("Title") + .HasColumnType("longtext") + .HasColumnName("title"); + + b.Property("Uri") + .HasColumnType("longtext") + .HasColumnName("uri"); + + b.HasKey("Id") + .HasName("pk_playlistsong"); + + b.HasIndex("MusicPlaylistId") + .HasDatabaseName("ix_playlistsong_musicplaylistid"); + + b.ToTable("playlistsong", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Question") + .HasColumnType("longtext") + .HasColumnName("question"); + + b.HasKey("Id") + .HasName("pk_poll"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_poll_guildid"); + + b.ToTable("poll", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_pollanswer"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollanswer_pollid"); + + b.ToTable("pollanswer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("VoteIndex") + .HasColumnType("int") + .HasColumnName("voteindex"); + + b.HasKey("Id") + .HasName("pk_pollvote"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollvote_pollid"); + + b.ToTable("pollvote", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Quote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("AuthorName") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("authorname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Keyword") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("keyword"); + + b.Property("Text") + .IsRequired() + .HasColumnType("longtext") + .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.Services.Database.Models.ReactionRoleV2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Emote") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("emote"); + + b.Property("Group") + .HasColumnType("int") + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelReq") + .HasColumnType("int") + .HasColumnName("levelreq"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.Reminder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsPrivate") + .HasColumnType("tinyint(1)") + .HasColumnName("isprivate"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("ServerId") + .HasColumnType("bigint unsigned") + .HasColumnName("serverid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("When") + .HasColumnType("datetime(6)") + .HasColumnName("when"); + + b.HasKey("Id") + .HasName("pk_reminders"); + + b.HasIndex("When") + .HasDatabaseName("ix_reminders_when"); + + b.ToTable("reminders", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Repeater", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Interval") + .HasColumnType("time(6)") + .HasColumnName("interval"); + + b.Property("LastMessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("lastmessageid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("NoRedundant") + .HasColumnType("tinyint(1)") + .HasColumnName("noredundant"); + + b.Property("StartTimeOfDay") + .HasColumnType("time(6)") + .HasColumnName("starttimeofday"); + + b.HasKey("Id") + .HasName("pk_repeaters"); + + b.ToTable("repeaters", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RewardedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AmountRewardedThisMonth") + .HasColumnType("bigint") + .HasColumnName("amountrewardedthismonth"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LastReward") + .HasColumnType("datetime(6)") + .HasColumnName("lastreward"); + + b.Property("PlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("platformuserid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_rewardedusers"); + + b.HasIndex("PlatformUserId") + .IsUnique() + .HasDatabaseName("ix_rewardedusers_platformuserid"); + + b.ToTable("rewardedusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RotatingPlayingStatus", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Status") + .HasColumnType("longtext") + .HasColumnName("status"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_rotatingstatus"); + + b.ToTable("rotatingstatus", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SelfAssignedRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Group") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelRequirement") + .HasColumnType("int") + .HasColumnName("levelrequirement"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.ShopEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Price") + .HasColumnType("int") + .HasColumnName("price"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("RoleName") + .HasColumnType("longtext") + .HasColumnName("rolename"); + + b.Property("RoleRequirement") + .HasColumnType("bigint unsigned") + .HasColumnName("rolerequirement"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_shopentry"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_shopentry_guildconfigid"); + + b.ToTable("shopentry", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ShopEntryId") + .HasColumnType("int") + .HasColumnName("shopentryid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_shopentryitem"); + + b.HasIndex("ShopEntryId") + .HasDatabaseName("ix_shopentryitem_shopentryid"); + + b.ToTable("shopentryitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoredrole"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoredrole_guildconfigid"); + + b.ToTable("slowmodeignoredrole", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoreduser"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoreduser_guildconfigid"); + + b.ToTable("slowmodeignoreduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamroleblacklisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamroleblacklisteduser_streamrolesettingsid"); + + b.ToTable("streamroleblacklisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AddRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("addroleid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)") + .HasColumnName("enabled"); + + b.Property("FromRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("fromroleid"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Keyword") + .HasColumnType("longtext") + .HasColumnName("keyword"); + + b.HasKey("Id") + .HasName("pk_streamrolesettings"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_streamrolesettings_guildconfigid"); + + b.ToTable("streamrolesettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamrolewhitelisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamrolewhitelisteduser_streamrolesettingsid"); + + b.ToTable("streamrolewhitelisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unbantimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unbantimer_guildconfigid"); + + b.ToTable("unbantimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnmuteAt") + .HasColumnType("datetime(6)") + .HasColumnName("unmuteat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unmutetimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unmutetimer_guildconfigid"); + + b.ToTable("unmutetimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unroletimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unroletimer_guildconfigid"); + + b.ToTable("unroletimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UserXpStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AwardedXp") + .HasColumnType("bigint") + .HasColumnName("awardedxp"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("NotifyOnLevelUp") + .HasColumnType("int") + .HasColumnName("notifyonlevelup"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.VcRoleInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.HasKey("Id") + .HasName("pk_vcroleinfo"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_vcroleinfo_guildconfigid"); + + b.ToTable("vcroleinfo", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AffinityId") + .HasColumnType("int") + .HasColumnName("affinityid"); + + b.Property("ClaimerId") + .HasColumnType("int") + .HasColumnName("claimerid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Price") + .HasColumnType("bigint") + .HasColumnName("price"); + + b.Property("WaifuId") + .HasColumnType("int") + .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.Services.Database.Models.WaifuItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemEmoji") + .HasColumnType("longtext") + .HasColumnName("itememoji"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("WaifuInfoId") + .HasColumnType("int") + .HasColumnName("waifuinfoid"); + + b.HasKey("Id") + .HasName("pk_waifuitem"); + + b.HasIndex("WaifuInfoId") + .HasDatabaseName("ix_waifuitem_waifuinfoid"); + + b.ToTable("waifuitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("NewId") + .HasColumnType("int") + .HasColumnName("newid"); + + b.Property("OldId") + .HasColumnType("int") + .HasColumnName("oldid"); + + b.Property("UpdateType") + .HasColumnType("int") + .HasColumnName("updatetype"); + + b.Property("UserId") + .HasColumnType("int") + .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.Services.Database.Models.Warning", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Forgiven") + .HasColumnType("tinyint(1)") + .HasColumnName("forgiven"); + + b.Property("ForgivenBy") + .HasColumnType("longtext") + .HasColumnName("forgivenby"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Moderator") + .HasColumnType("longtext") + .HasColumnName("moderator"); + + b.Property("Reason") + .HasColumnType("longtext") + .HasColumnName("reason"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.WarningPunishment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Count") + .HasColumnType("int") + .HasColumnName("count"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Punishment") + .HasColumnType("int") + .HasColumnName("punishment"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("Time") + .HasColumnType("int") + .HasColumnName("time"); + + b.HasKey("Id") + .HasName("pk_warningpunishment"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_warningpunishment_guildconfigid"); + + b.ToTable("warningpunishment", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("int") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_xpcurrencyreward"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_xpcurrencyreward_xpsettingsid"); + + b.ToTable("xpcurrencyreward", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("Remove") + .HasColumnType("tinyint(1)") + .HasColumnName("remove"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .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.Services.Database.Models.XpSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("ServerExcluded") + .HasColumnType("tinyint(1)") + .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.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.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.FollowedStream", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FollowedStreams") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithOne("AntiAltSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiAltSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiRaidSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiRaidSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.HasOne("EllieBot.Services.Database.Models.AntiSpamSetting", null) + .WithMany("IgnoredChannels") + .HasForeignKey("AntiSpamSettingId") + .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiSpamSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiSpamSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.AutoTranslateChannel", "Channel") + .WithMany("Users") + .HasForeignKey("ChannelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); + + b.Navigation("Channel"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandAliases") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandCooldowns") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("DelMsgOnCmdChannels") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", null) + .WithMany("ExclusionList") + .HasForeignKey("XpSettingsId") + .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("FeedSubs") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_feedsub_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterInvitesChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilteredWords") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterLinksChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterWordsChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("GenerateCurrencyChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("SelfAssignableRoleGroupNames") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_groupname_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany("LogIgnores") + .HasForeignKey("LogSettingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ignoredlogchannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany() + .HasForeignKey("LogSettingId") + .HasConstraintName("fk_ignoredvoicepresencechannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("MutedUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("Permissions") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlaylistSong", b => + { + b.HasOne("EllieBot.Services.Database.Models.MusicPlaylist", null) + .WithMany("Songs") + .HasForeignKey("MusicPlaylistId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Answers") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollanswer_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Votes") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollvote_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("ShopEntries") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.ShopEntry", null) + .WithMany("Items") + .HasForeignKey("ShopEntryId") + .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredRoles") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Blacklist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("StreamRole") + .HasForeignKey("EllieBot.Services.Database.Models.StreamRoleSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Whitelist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnbanTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnmuteTimers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnroleTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.VcRoleInfo", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("VcRoleInfos") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WaifuInfo", "WaifuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); + + b.Navigation("Affinity"); + + b.Navigation("Claimer"); + + b.Navigation("Waifu"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.WaifuInfo", "WaifuInfo") + .WithMany("Items") + .HasForeignKey("WaifuInfoId") + .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); + + b.Navigation("WaifuInfo"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WarningPunishment", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("WarnPunishments") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_warningpunishment_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("CurrencyRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpcurrencyreward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("RoleRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xprolereward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("XpSettings") + .HasForeignKey("EllieBot.Services.Database.Models.XpSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => + { + b.Navigation("Applicants"); + + b.Navigation("Bans"); + + b.Navigation("Members"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Navigation("IgnoredChannels"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.LogSetting", b => + { + b.Navigation("LogIgnores"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlaylist", b => + { + b.Navigation("Songs"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Navigation("Answers"); + + b.Navigation("Votes"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Navigation("Blacklist"); + + b.Navigation("Whitelist"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.Navigation("CurrencyRewards"); + + b.Navigation("ExclusionList"); + + b.Navigation("RoleRewards"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20221021192758_toggle-global-expressions.cs b/src/EllieBot/Migrations/Mysql/20221021192758_toggle-global-expressions.cs new file mode 100644 index 0000000..ebbcc38 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20221021192758_toggle-global-expressions.cs @@ -0,0 +1,26 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + public partial class toggleglobalexpressions : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "disableglobalexpressions", + table: "guildconfigs", + type: "tinyint(1)", + nullable: false, + defaultValue: false); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "disableglobalexpressions", + table: "guildconfigs"); + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20221118195208_log-thread.Designer.cs b/src/EllieBot/Migrations/Mysql/20221118195208_log-thread.Designer.cs new file mode 100644 index 0000000..a31fad2 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20221118195208_log-thread.Designer.cs @@ -0,0 +1,3624 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using EllieBot.Services.Database; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + [DbContext(typeof(MysqlContext))] + [Migration("20221118195208_log-thread")] + partial class logthread + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("EllieBot.Db.Models.AutoPublishChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_autopublishchannel"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_autopublishchannel_guildid"); + + b.ToTable("autopublishchannel", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.BankUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Balance") + .HasColumnType("bigint") + .HasColumnName("balance"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.ClubApplicants", b => + { + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("clubid"); + + b.Property("UserId") + .HasColumnType("int") + .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("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Description") + .HasColumnType("longtext") + .HasColumnName("description"); + + b.Property("ImageUrl") + .HasColumnType("longtext") + .HasColumnName("imageurl"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("varchar(20)") + .HasColumnName("name") + .UseCollation("utf8mb4_bin"); + + b.Property("OwnerId") + .HasColumnType("int") + .HasColumnName("ownerid"); + + b.Property("Xp") + .HasColumnType("int") + .HasColumnName("xp"); + + b.HasKey("Id") + .HasName("pk_clubs"); + + b.HasAlternateKey("Name") + .HasName("ak_clubs_name"); + + b.HasIndex("OwnerId") + .IsUnique() + .HasDatabaseName("ix_clubs_ownerid"); + + b.ToTable("clubs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.DiscordUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AvatarId") + .HasColumnType("longtext") + .HasColumnName("avatarid"); + + b.Property("ClubId") + .HasColumnType("int") + .HasColumnName("clubid"); + + b.Property("CurrencyAmount") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("currencyamount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Discriminator") + .HasColumnType("longtext") + .HasColumnName("discriminator"); + + b.Property("IsClubAdmin") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(false) + .HasColumnName("isclubadmin"); + + b.Property("NotifyOnLevelUp") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("notifyonlevelup"); + + b.Property("TotalXp") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(0L) + .HasColumnName("totalxp"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .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.FollowedStream", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.Property("Username") + .HasColumnType("longtext") + .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.PatronQuota", b => + { + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("FeatureType") + .HasColumnType("int") + .HasColumnName("featuretype"); + + b.Property("Feature") + .HasColumnType("varchar(255)") + .HasColumnName("feature"); + + b.Property("DailyCount") + .HasColumnType("int unsigned") + .HasColumnName("dailycount"); + + b.Property("HourlyCount") + .HasColumnType("int unsigned") + .HasColumnName("hourlycount"); + + b.Property("MonthlyCount") + .HasColumnType("int unsigned") + .HasColumnName("monthlycount"); + + b.HasKey("UserId", "FeatureType", "Feature") + .HasName("pk_patronquotas"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_patronquotas_userid"); + + b.ToTable("patronquotas", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => + { + b.Property("UserId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("AmountCents") + .HasColumnType("int") + .HasColumnName("amountcents"); + + b.Property("LastCharge") + .HasColumnType("datetime(6)") + .HasColumnName("lastcharge"); + + b.Property("UniquePlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("uniqueplatformuserid"); + + b.Property("ValidThru") + .HasColumnType("datetime(6)") + .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.StreamOnlineMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_streamonlinemessages"); + + b.ToTable("streamonlinemessages", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.XpShopOwnedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsUsing") + .HasColumnType("tinyint(1)") + .HasColumnName("isusing"); + + b.Property("ItemKey") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("itemkey"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Database.Models.AntiAltSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("ActionDurationMinutes") + .HasColumnType("int") + .HasColumnName("actiondurationminutes"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MinAge") + .HasColumnType("time(6)") + .HasColumnName("minage"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antialtsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antialtsetting_guildconfigid"); + + b.ToTable("antialtsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("PunishDuration") + .HasColumnType("int") + .HasColumnName("punishduration"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.Property("UserThreshold") + .HasColumnType("int") + .HasColumnName("userthreshold"); + + b.HasKey("Id") + .HasName("pk_antiraidsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antiraidsetting_guildconfigid"); + + b.ToTable("antiraidsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AntiSpamSettingId") + .HasColumnType("int") + .HasColumnName("antispamsettingid"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.HasKey("Id") + .HasName("pk_antispamignore"); + + b.HasIndex("AntiSpamSettingId") + .HasDatabaseName("ix_antispamignore_antispamsettingid"); + + b.ToTable("antispamignore", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MessageThreshold") + .HasColumnType("int") + .HasColumnName("messagethreshold"); + + b.Property("MuteTime") + .HasColumnType("int") + .HasColumnName("mutetime"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antispamsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antispamsetting_guildconfigid"); + + b.ToTable("antispamsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoCommand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("ChannelName") + .HasColumnType("longtext") + .HasColumnName("channelname"); + + b.Property("CommandText") + .HasColumnType("longtext") + .HasColumnName("commandtext"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("GuildName") + .HasColumnType("longtext") + .HasColumnName("guildname"); + + b.Property("Interval") + .HasColumnType("int") + .HasColumnName("interval"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.Property("VoiceChannelName") + .HasColumnType("longtext") + .HasColumnName("voicechannelname"); + + b.HasKey("Id") + .HasName("pk_autocommands"); + + b.ToTable("autocommands", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDelete") + .HasColumnType("tinyint(1)") + .HasColumnName("autodelete"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_autotranslatechannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_autotranslatechannels_channelid"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_autotranslatechannels_guildid"); + + b.ToTable("autotranslatechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("int") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Source") + .HasColumnType("longtext") + .HasColumnName("source"); + + b.Property("Target") + .HasColumnType("longtext") + .HasColumnName("target"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_autotranslateusers"); + + b.HasAlternateKey("ChannelId", "UserId") + .HasName("ak_autotranslateusers_channelid_userid"); + + b.ToTable("autotranslateusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BanTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("PruneDays") + .HasColumnType("int") + .HasColumnName("prunedays"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_bantemplates"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_bantemplates_guildid"); + + b.ToTable("bantemplates", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BlacklistEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_blacklist"); + + b.ToTable("blacklist", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Mapping") + .HasColumnType("longtext") + .HasColumnName("mapping"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_commandalias"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandalias_guildconfigid"); + + b.ToTable("commandalias", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("CommandName") + .HasColumnType("longtext") + .HasColumnName("commandname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.HasKey("Id") + .HasName("pk_commandcooldown"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandcooldown_guildconfigid"); + + b.ToTable("commandcooldown", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CurrencyTransaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Extra") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("extra"); + + b.Property("Note") + .HasColumnType("longtext") + .HasColumnName("note"); + + b.Property("OtherId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("otherid") + .HasDefaultValueSql("NULL"); + + b.Property("Type") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("type"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_currencytransactions"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_currencytransactions_userid"); + + b.ToTable("currencytransactions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_delmsgoncmdchannel"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); + + b.ToTable("delmsgoncmdchannel", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DiscordPermOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Command") + .HasColumnType("varchar(255)") + .HasColumnName("command"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Perm") + .HasColumnType("bigint unsigned") + .HasColumnName("perm"); + + b.HasKey("Id") + .HasName("pk_discordpermoverrides"); + + b.HasIndex("GuildId", "Command") + .IsUnique() + .HasDatabaseName("ix_discordpermoverrides_guildid_command"); + + b.ToTable("discordpermoverrides", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_excludeditem"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_excludeditem_xpsettingsid"); + + b.ToTable("excludeditem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Url") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("url"); + + b.HasKey("Id") + .HasName("pk_feedsub"); + + b.HasAlternateKey("GuildConfigId", "Url") + .HasName("ak_feedsub_guildconfigid_url"); + + b.ToTable("feedsub", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterchannelid_guildconfigid"); + + b.ToTable("filterchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Word") + .HasColumnType("longtext") + .HasColumnName("word"); + + b.HasKey("Id") + .HasName("pk_filteredword"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filteredword_guildconfigid"); + + b.ToTable("filteredword", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterlinkschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); + + b.ToTable("filterlinkschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterwordschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); + + b.ToTable("filterwordschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GamblingStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Bet") + .HasColumnType("decimal(65,30)") + .HasColumnName("bet"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Feature") + .HasColumnType("varchar(255)") + .HasColumnName("feature"); + + b.Property("PaidOut") + .HasColumnType("decimal(65,30)") + .HasColumnName("paidout"); + + b.HasKey("Id") + .HasName("pk_gamblingstats"); + + b.HasIndex("Feature") + .IsUnique() + .HasDatabaseName("ix_gamblingstats_feature"); + + b.ToTable("gamblingstats", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_gcchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_gcchannelid_guildconfigid"); + + b.ToTable("gcchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Number") + .HasColumnType("int") + .HasColumnName("number"); + + b.HasKey("Id") + .HasName("pk_groupname"); + + b.HasIndex("GuildConfigId", "Number") + .IsUnique() + .HasDatabaseName("ix_groupname_guildconfigid_number"); + + b.ToTable("groupname", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GuildConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoAssignRoleIds") + .HasColumnType("longtext") + .HasColumnName("autoassignroleids"); + + b.Property("AutoDeleteByeMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletebyemessagestimer"); + + b.Property("AutoDeleteGreetMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletegreetmessagestimer"); + + b.Property("AutoDeleteSelfAssignedRoleMessages") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeleteselfassignedrolemessages"); + + b.Property("BoostMessage") + .HasColumnType("longtext") + .HasColumnName("boostmessage"); + + b.Property("BoostMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("boostmessagechannelid"); + + b.Property("BoostMessageDeleteAfter") + .HasColumnType("int") + .HasColumnName("boostmessagedeleteafter"); + + b.Property("ByeMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("byemessagechannelid"); + + b.Property("ChannelByeMessageText") + .HasColumnType("longtext") + .HasColumnName("channelbyemessagetext"); + + b.Property("ChannelGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("channelgreetmessagetext"); + + b.Property("CleverbotEnabled") + .HasColumnType("tinyint(1)") + .HasColumnName("cleverbotenabled"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DeleteMessageOnCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("deletemessageoncommand"); + + b.Property("DeleteStreamOnlineMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("deletestreamonlinemessage"); + + b.Property("DisableGlobalExpressions") + .HasColumnType("tinyint(1)") + .HasColumnName("disableglobalexpressions"); + + b.Property("DmGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("dmgreetmessagetext"); + + b.Property("ExclusiveSelfAssignedRoles") + .HasColumnType("tinyint(1)") + .HasColumnName("exclusiveselfassignedroles"); + + b.Property("FilterInvites") + .HasColumnType("tinyint(1)") + .HasColumnName("filterinvites"); + + b.Property("FilterLinks") + .HasColumnType("tinyint(1)") + .HasColumnName("filterlinks"); + + b.Property("FilterWords") + .HasColumnType("tinyint(1)") + .HasColumnName("filterwords"); + + b.Property("GameVoiceChannel") + .HasColumnType("bigint unsigned") + .HasColumnName("gamevoicechannel"); + + b.Property("GreetMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("greetmessagechannelid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Locale") + .HasColumnType("longtext") + .HasColumnName("locale"); + + b.Property("MuteRoleName") + .HasColumnType("longtext") + .HasColumnName("muterolename"); + + b.Property("NotifyStreamOffline") + .HasColumnType("tinyint(1)") + .HasColumnName("notifystreamoffline"); + + b.Property("PermissionRole") + .HasColumnType("longtext") + .HasColumnName("permissionrole"); + + b.Property("Prefix") + .HasColumnType("longtext") + .HasColumnName("prefix"); + + b.Property("SendBoostMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendboostmessage"); + + b.Property("SendChannelByeMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelbyemessage"); + + b.Property("SendChannelGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelgreetmessage"); + + b.Property("SendDmGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("senddmgreetmessage"); + + b.Property("TimeZoneId") + .HasColumnType("longtext") + .HasColumnName("timezoneid"); + + b.Property("VerboseErrors") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint(1)") + .HasDefaultValue(true) + .HasColumnName("verboseerrors"); + + b.Property("VerbosePermissions") + .HasColumnType("tinyint(1)") + .HasColumnName("verbosepermissions"); + + b.Property("WarnExpireAction") + .HasColumnType("int") + .HasColumnName("warnexpireaction"); + + b.Property("WarnExpireHours") + .HasColumnType("int") + .HasColumnName("warnexpirehours"); + + b.Property("WarningsInitialized") + .HasColumnType("tinyint(1)") + .HasColumnName("warningsinitialized"); + + b.HasKey("Id") + .HasName("pk_guildconfigs"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_guildconfigs_guildid"); + + b.HasIndex("WarnExpireHours") + .HasDatabaseName("ix_guildconfigs_warnexpirehours"); + + b.ToTable("guildconfigs", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("LogItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("logitemid"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredlogchannels"); + + b.HasIndex("LogSettingId", "LogItemId", "ItemType") + .IsUnique() + .HasDatabaseName("ix_ignoredlogchannels_logsettingid_logitemid_itemtype"); + + b.ToTable("ignoredlogchannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredvoicepresencechannels"); + + b.HasIndex("LogSettingId") + .HasDatabaseName("ix_ignoredvoicepresencechannels_logsettingid"); + + b.ToTable("ignoredvoicepresencechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ImageOnlyChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_imageonlychannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_imageonlychannels_channelid"); + + b.ToTable("imageonlychannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.LogSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelCreatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelcreatedid"); + + b.Property("ChannelDestroyedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channeldestroyedid"); + + b.Property("ChannelUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelupdatedid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LogOtherId") + .HasColumnType("bigint unsigned") + .HasColumnName("logotherid"); + + b.Property("LogUserPresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("loguserpresenceid"); + + b.Property("LogVoicePresenceId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresenceid"); + + b.Property("LogVoicePresenceTTSId") + .HasColumnType("bigint unsigned") + .HasColumnName("logvoicepresencettsid"); + + b.Property("LogWarnsId") + .HasColumnType("bigint unsigned") + .HasColumnName("logwarnsid"); + + b.Property("MessageDeletedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messagedeletedid"); + + b.Property("MessageUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageupdatedid"); + + b.Property("ThreadCreatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("threadcreatedid"); + + b.Property("ThreadDeletedId") + .HasColumnType("bigint unsigned") + .HasColumnName("threaddeletedid"); + + b.Property("UserBannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userbannedid"); + + b.Property("UserJoinedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userjoinedid"); + + b.Property("UserLeftId") + .HasColumnType("bigint unsigned") + .HasColumnName("userleftid"); + + b.Property("UserMutedId") + .HasColumnType("bigint unsigned") + .HasColumnName("usermutedid"); + + b.Property("UserUnbannedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userunbannedid"); + + b.Property("UserUpdatedId") + .HasColumnType("bigint unsigned") + .HasColumnName("userupdatedid"); + + b.HasKey("Id") + .HasName("pk_logsettings"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_logsettings_guildid"); + + b.ToTable("logsettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlayerSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDisconnect") + .HasColumnType("tinyint(1)") + .HasColumnName("autodisconnect"); + + b.Property("AutoPlay") + .HasColumnType("tinyint(1)") + .HasColumnName("autoplay"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MusicChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("musicchannelid"); + + b.Property("PlayerRepeat") + .HasColumnType("int") + .HasColumnName("playerrepeat"); + + b.Property("QualityPreset") + .HasColumnType("int") + .HasColumnName("qualitypreset"); + + b.Property("Volume") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .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.Services.Database.Models.MusicPlaylist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Author") + .HasColumnType("longtext") + .HasColumnName("author"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.HasKey("Id") + .HasName("pk_musicplaylists"); + + b.ToTable("musicplaylists", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_muteduserid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_muteduserid_guildconfigid"); + + b.ToTable("muteduserid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AllowTarget") + .HasColumnType("tinyint(1)") + .HasColumnName("allowtarget"); + + b.Property("AutoDeleteTrigger") + .HasColumnType("tinyint(1)") + .HasColumnName("autodeletetrigger"); + + b.Property("ContainsAnywhere") + .HasColumnType("tinyint(1)") + .HasColumnName("containsanywhere"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("DmResponse") + .HasColumnType("tinyint(1)") + .HasColumnName("dmresponse"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Reactions") + .HasColumnType("longtext") + .HasColumnName("reactions"); + + b.Property("Response") + .HasColumnType("longtext") + .HasColumnName("response"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_expressions"); + + b.ToTable("expressions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.NsfwBlacklistedTag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Tag") + .HasColumnType("longtext") + .HasColumnName("tag"); + + b.HasKey("Id") + .HasName("pk_nsfwblacklistedtags"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_nsfwblacklistedtags_guildid"); + + b.ToTable("nsfwblacklistedtags", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("IsCustomCommand") + .HasColumnType("tinyint(1)") + .HasColumnName("iscustomcommand"); + + b.Property("PrimaryTarget") + .HasColumnType("int") + .HasColumnName("primarytarget"); + + b.Property("PrimaryTargetId") + .HasColumnType("bigint unsigned") + .HasColumnName("primarytargetid"); + + b.Property("SecondaryTarget") + .HasColumnType("int") + .HasColumnName("secondarytarget"); + + b.Property("SecondaryTargetName") + .HasColumnType("longtext") + .HasColumnName("secondarytargetname"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_permissions"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_permissions_guildconfigid"); + + b.ToTable("permissions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlantedCurrency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Password") + .HasColumnType("longtext") + .HasColumnName("password"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.PlaylistSong", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("MusicPlaylistId") + .HasColumnType("int") + .HasColumnName("musicplaylistid"); + + b.Property("Provider") + .HasColumnType("longtext") + .HasColumnName("provider"); + + b.Property("ProviderType") + .HasColumnType("int") + .HasColumnName("providertype"); + + b.Property("Query") + .HasColumnType("longtext") + .HasColumnName("query"); + + b.Property("Title") + .HasColumnType("longtext") + .HasColumnName("title"); + + b.Property("Uri") + .HasColumnType("longtext") + .HasColumnName("uri"); + + b.HasKey("Id") + .HasName("pk_playlistsong"); + + b.HasIndex("MusicPlaylistId") + .HasDatabaseName("ix_playlistsong_musicplaylistid"); + + b.ToTable("playlistsong", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Question") + .HasColumnType("longtext") + .HasColumnName("question"); + + b.HasKey("Id") + .HasName("pk_poll"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_poll_guildid"); + + b.ToTable("poll", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_pollanswer"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollanswer_pollid"); + + b.ToTable("pollanswer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("VoteIndex") + .HasColumnType("int") + .HasColumnName("voteindex"); + + b.HasKey("Id") + .HasName("pk_pollvote"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollvote_pollid"); + + b.ToTable("pollvote", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Quote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("AuthorName") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("authorname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Keyword") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("keyword"); + + b.Property("Text") + .IsRequired() + .HasColumnType("longtext") + .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.Services.Database.Models.ReactionRoleV2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Emote") + .HasMaxLength(100) + .HasColumnType("varchar(100)") + .HasColumnName("emote"); + + b.Property("Group") + .HasColumnType("int") + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelReq") + .HasColumnType("int") + .HasColumnName("levelreq"); + + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.Reminder", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsPrivate") + .HasColumnType("tinyint(1)") + .HasColumnName("isprivate"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("ServerId") + .HasColumnType("bigint unsigned") + .HasColumnName("serverid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("When") + .HasColumnType("datetime(6)") + .HasColumnName("when"); + + b.HasKey("Id") + .HasName("pk_reminders"); + + b.HasIndex("When") + .HasDatabaseName("ix_reminders_when"); + + b.ToTable("reminders", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Repeater", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Interval") + .HasColumnType("time(6)") + .HasColumnName("interval"); + + b.Property("LastMessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("lastmessageid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("NoRedundant") + .HasColumnType("tinyint(1)") + .HasColumnName("noredundant"); + + b.Property("StartTimeOfDay") + .HasColumnType("time(6)") + .HasColumnName("starttimeofday"); + + b.HasKey("Id") + .HasName("pk_repeaters"); + + b.ToTable("repeaters", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RewardedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AmountRewardedThisMonth") + .HasColumnType("bigint") + .HasColumnName("amountrewardedthismonth"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LastReward") + .HasColumnType("datetime(6)") + .HasColumnName("lastreward"); + + b.Property("PlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("platformuserid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_rewardedusers"); + + b.HasIndex("PlatformUserId") + .IsUnique() + .HasDatabaseName("ix_rewardedusers_platformuserid"); + + b.ToTable("rewardedusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.RotatingPlayingStatus", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Status") + .HasColumnType("longtext") + .HasColumnName("status"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_rotatingstatus"); + + b.ToTable("rotatingstatus", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SelfAssignedRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Group") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("group"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("LevelRequirement") + .HasColumnType("int") + .HasColumnName("levelrequirement"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.ShopEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") + .HasColumnName("authorid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Price") + .HasColumnType("int") + .HasColumnName("price"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("RoleName") + .HasColumnType("longtext") + .HasColumnName("rolename"); + + b.Property("RoleRequirement") + .HasColumnType("bigint unsigned") + .HasColumnName("rolerequirement"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_shopentry"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_shopentry_guildconfigid"); + + b.ToTable("shopentry", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ShopEntryId") + .HasColumnType("int") + .HasColumnName("shopentryid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_shopentryitem"); + + b.HasIndex("ShopEntryId") + .HasDatabaseName("ix_shopentryitem_shopentryid"); + + b.ToTable("shopentryitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoredrole"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoredrole_guildconfigid"); + + b.ToTable("slowmodeignoredrole", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_slowmodeignoreduser"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_slowmodeignoreduser_guildconfigid"); + + b.ToTable("slowmodeignoreduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamroleblacklisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamroleblacklisteduser_streamrolesettingsid"); + + b.ToTable("streamroleblacklisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AddRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("addroleid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)") + .HasColumnName("enabled"); + + b.Property("FromRoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("fromroleid"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Keyword") + .HasColumnType("longtext") + .HasColumnName("keyword"); + + b.HasKey("Id") + .HasName("pk_streamrolesettings"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_streamrolesettings_guildconfigid"); + + b.ToTable("streamrolesettings", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("StreamRoleSettingsId") + .HasColumnType("int") + .HasColumnName("streamrolesettingsid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("Username") + .HasColumnType("longtext") + .HasColumnName("username"); + + b.HasKey("Id") + .HasName("pk_streamrolewhitelisteduser"); + + b.HasIndex("StreamRoleSettingsId") + .HasDatabaseName("ix_streamrolewhitelisteduser_streamrolesettingsid"); + + b.ToTable("streamrolewhitelisteduser", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unbantimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unbantimer_guildconfigid"); + + b.ToTable("unbantimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("UnmuteAt") + .HasColumnType("datetime(6)") + .HasColumnName("unmuteat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unmutetimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unmutetimer_guildconfigid"); + + b.ToTable("unmutetimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("UnbanAt") + .HasColumnType("datetime(6)") + .HasColumnName("unbanat"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_unroletimer"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_unroletimer_guildconfigid"); + + b.ToTable("unroletimer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UserXpStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AwardedXp") + .HasColumnType("bigint") + .HasColumnName("awardedxp"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("NotifyOnLevelUp") + .HasColumnType("int") + .HasColumnName("notifyonlevelup"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.VcRoleInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.HasKey("Id") + .HasName("pk_vcroleinfo"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_vcroleinfo_guildconfigid"); + + b.ToTable("vcroleinfo", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AffinityId") + .HasColumnType("int") + .HasColumnName("affinityid"); + + b.Property("ClaimerId") + .HasColumnType("int") + .HasColumnName("claimerid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Price") + .HasColumnType("bigint") + .HasColumnName("price"); + + b.Property("WaifuId") + .HasColumnType("int") + .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.Services.Database.Models.WaifuItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemEmoji") + .HasColumnType("longtext") + .HasColumnName("itememoji"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("WaifuInfoId") + .HasColumnType("int") + .HasColumnName("waifuinfoid"); + + b.HasKey("Id") + .HasName("pk_waifuitem"); + + b.HasIndex("WaifuInfoId") + .HasDatabaseName("ix_waifuitem_waifuinfoid"); + + b.ToTable("waifuitem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("NewId") + .HasColumnType("int") + .HasColumnName("newid"); + + b.Property("OldId") + .HasColumnType("int") + .HasColumnName("oldid"); + + b.Property("UpdateType") + .HasColumnType("int") + .HasColumnName("updatetype"); + + b.Property("UserId") + .HasColumnType("int") + .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.Services.Database.Models.Warning", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Forgiven") + .HasColumnType("tinyint(1)") + .HasColumnName("forgiven"); + + b.Property("ForgivenBy") + .HasColumnType("longtext") + .HasColumnName("forgivenby"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Moderator") + .HasColumnType("longtext") + .HasColumnName("moderator"); + + b.Property("Reason") + .HasColumnType("longtext") + .HasColumnName("reason"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Services.Database.Models.WarningPunishment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Count") + .HasColumnType("int") + .HasColumnName("count"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Punishment") + .HasColumnType("int") + .HasColumnName("punishment"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("Time") + .HasColumnType("int") + .HasColumnName("time"); + + b.HasKey("Id") + .HasName("pk_warningpunishment"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_warningpunishment_guildconfigid"); + + b.ToTable("warningpunishment", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("int") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_xpcurrencyreward"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_xpcurrencyreward_xpsettingsid"); + + b.ToTable("xpcurrencyreward", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Level") + .HasColumnType("int") + .HasColumnName("level"); + + b.Property("Remove") + .HasColumnType("tinyint(1)") + .HasColumnName("remove"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .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.Services.Database.Models.XpSettings", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("ServerExcluded") + .HasColumnType("tinyint(1)") + .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.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.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.FollowedStream", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FollowedStreams") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithOne("AntiAltSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiAltSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiRaidSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiRaidSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.HasOne("EllieBot.Services.Database.Models.AntiSpamSetting", null) + .WithMany("IgnoredChannels") + .HasForeignKey("AntiSpamSettingId") + .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiSpamSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiSpamSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.AutoTranslateChannel", "Channel") + .WithMany("Users") + .HasForeignKey("ChannelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); + + b.Navigation("Channel"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandAliases") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandCooldowns") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("DelMsgOnCmdChannels") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", null) + .WithMany("ExclusionList") + .HasForeignKey("XpSettingsId") + .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("FeedSubs") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_feedsub_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterInvitesChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilteredWords") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterLinksChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterWordsChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("GenerateCurrencyChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithMany("SelfAssignableRoleGroupNames") + .HasForeignKey("GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_groupname_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany("LogIgnores") + .HasForeignKey("LogSettingId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_ignoredlogchannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany() + .HasForeignKey("LogSettingId") + .HasConstraintName("fk_ignoredvoicepresencechannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("MutedUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("Permissions") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PlaylistSong", b => + { + b.HasOne("EllieBot.Services.Database.Models.MusicPlaylist", null) + .WithMany("Songs") + .HasForeignKey("MusicPlaylistId") + .OnDelete(DeleteBehavior.Cascade) + .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Answers") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollanswer_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Votes") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollvote_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("ShopEntries") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.ShopEntry", null) + .WithMany("Items") + .HasForeignKey("ShopEntryId") + .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredRoles") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("SlowmodeIgnoredUsers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Blacklist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("StreamRole") + .HasForeignKey("EllieBot.Services.Database.Models.StreamRoleSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) + .WithMany("Whitelist") + .HasForeignKey("StreamRoleSettingsId") + .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnbanTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnmuteTimers") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("UnroleTimer") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.VcRoleInfo", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("VcRoleInfos") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WaifuInfo", "WaifuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); + + b.Navigation("Affinity"); + + b.Navigation("Claimer"); + + b.Navigation("Waifu"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.WaifuInfo", "WaifuInfo") + .WithMany("Items") + .HasForeignKey("WaifuInfoId") + .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); + + b.Navigation("WaifuInfo"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.WarningPunishment", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("WarnPunishments") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_warningpunishment_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("CurrencyRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpcurrencyreward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") + .WithMany("RoleRewards") + .HasForeignKey("XpSettingsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xprolereward_xpsettings_xpsettingsid"); + + b.Navigation("XpSettings"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("XpSettings") + .HasForeignKey("EllieBot.Services.Database.Models.XpSettings", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Db.Models.ClubInfo", b => + { + b.Navigation("Applicants"); + + b.Navigation("Bans"); + + b.Navigation("Members"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Navigation("IgnoredChannels"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.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.Services.Database.Models.LogSetting", b => + { + b.Navigation("LogIgnores"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlaylist", b => + { + b.Navigation("Songs"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Navigation("Answers"); + + b.Navigation("Votes"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => + { + b.Navigation("Blacklist"); + + b.Navigation("Whitelist"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => + { + b.Navigation("Items"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => + { + b.Navigation("CurrencyRewards"); + + b.Navigation("ExclusionList"); + + b.Navigation("RoleRewards"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/EllieBot/Migrations/Mysql/20221118195208_log-thread.cs b/src/EllieBot/Migrations/Mysql/20221118195208_log-thread.cs new file mode 100644 index 0000000..5b2b38d --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20221118195208_log-thread.cs @@ -0,0 +1,35 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + public partial class logthread : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "threadcreatedid", + table: "logsettings", + type: "bigint unsigned", + nullable: true); + + migrationBuilder.AddColumn( + name: "threaddeletedid", + table: "logsettings", + type: "bigint unsigned", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "threadcreatedid", + table: "logsettings"); + + migrationBuilder.DropColumn( + name: "threaddeletedid", + table: "logsettings"); + } + } +} diff --git a/src/EllieBot/Migrations/PostgreSql/20241018004623_warn-split.Designer.cs b/src/EllieBot/Migrations/Mysql/20221122204432_feed-text.Designer.cs similarity index 60% rename from src/EllieBot/Migrations/PostgreSql/20241018004623_warn-split.Designer.cs rename to src/EllieBot/Migrations/Mysql/20221122204432_feed-text.Designer.cs index 2326a13..63be61d 100644 --- a/src/EllieBot/Migrations/PostgreSql/20241018004623_warn-split.Designer.cs +++ b/src/EllieBot/Migrations/Mysql/20221122204432_feed-text.Designer.cs @@ -1,278 +1,43 @@ -// +// 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; +using EllieBot.Services.Database; #nullable disable -namespace EllieBot.Migrations.PostgreSql +namespace EllieBot.Migrations.Mysql { - [DbContext(typeof(PostgreSqlContext))] - [Migration("20241018004623_warn-split")] - partial class warnsplit + [DbContext(typeof(MysqlContext))] + [Migration("20221122204432_feed-text")] + partial class feedtext { - /// 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); - }); + .HasAnnotation("ProductVersion", "6.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 64); modelBuilder.Entity("EllieBot.Db.Models.AutoPublishChannel", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.HasKey("Id") @@ -285,136 +50,23 @@ namespace EllieBot.Migrations.PostgreSql 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") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Balance") .HasColumnType("bigint") .HasColumnName("balance"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -427,41 +79,14 @@ namespace EllieBot.Migrations.PostgreSql 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") + .HasColumnType("int") .HasColumnName("clubid"); b.Property("UserId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("userid"); b.HasKey("ClubId", "UserId") @@ -476,11 +101,11 @@ namespace EllieBot.Migrations.PostgreSql modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => { b.Property("ClubId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("clubid"); b.Property("UserId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("userid"); b.HasKey("ClubId", "UserId") @@ -496,42 +121,41 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Description") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("description"); b.Property("ImageUrl") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("imageurl"); b.Property("Name") + .IsRequired() .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("name"); + .HasColumnType("varchar(20)") + .HasColumnName("name") + .UseCollation("utf8mb4_bin"); b.Property("OwnerId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("ownerid"); b.Property("Xp") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("xp"); b.HasKey("Id") .HasName("pk_clubs"); - b.HasIndex("Name") - .IsUnique() - .HasDatabaseName("ix_clubs_name"); + b.HasAlternateKey("Name") + .HasName("ak_clubs_name"); b.HasIndex("OwnerId") .IsUnique() @@ -540,208 +164,19 @@ namespace EllieBot.Migrations.PostgreSql 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") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("AvatarId") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("avatarid"); b.Property("ClubId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("clubid"); b.Property("CurrencyAmount") @@ -751,22 +186,22 @@ namespace EllieBot.Migrations.PostgreSql .HasColumnName("currencyamount"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Discriminator") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("discriminator"); b.Property("IsClubAdmin") .ValueGeneratedOnAdd() - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasDefaultValue(false) .HasColumnName("isclubadmin"); b.Property("NotifyOnLevelUp") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasDefaultValue(0) .HasColumnName("notifyonlevelup"); @@ -776,12 +211,12 @@ namespace EllieBot.Migrations.PostgreSql .HasDefaultValue(0L) .HasColumnName("totalxp"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("Username") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("username"); b.HasKey("Id") @@ -805,234 +240,39 @@ namespace EllieBot.Migrations.PostgreSql 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") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Message") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("message"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); b.Property("Username") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("username"); b.HasKey("Id") @@ -1044,59 +284,850 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("followedstream", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.GCChannelId", b => + modelBuilder.Entity("EllieBot.Db.Models.PatronQuota", b => + { + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("FeatureType") + .HasColumnType("int") + .HasColumnName("featuretype"); + + b.Property("Feature") + .HasColumnType("varchar(255)") + .HasColumnName("feature"); + + b.Property("DailyCount") + .HasColumnType("int unsigned") + .HasColumnName("dailycount"); + + b.Property("HourlyCount") + .HasColumnType("int unsigned") + .HasColumnName("hourlycount"); + + b.Property("MonthlyCount") + .HasColumnType("int unsigned") + .HasColumnName("monthlycount"); + + b.HasKey("UserId", "FeatureType", "Feature") + .HasName("pk_patronquotas"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_patronquotas_userid"); + + b.ToTable("patronquotas", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => + { + b.Property("UserId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("AmountCents") + .HasColumnType("int") + .HasColumnName("amountcents"); + + b.Property("LastCharge") + .HasColumnType("datetime(6)") + .HasColumnName("lastcharge"); + + b.Property("UniquePlatformUserId") + .HasColumnType("varchar(255)") + .HasColumnName("uniqueplatformuserid"); + + b.Property("ValidThru") + .HasColumnType("datetime(6)") + .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.StreamOnlineMessage", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") - .HasColumnName("guildconfigid"); + b.Property("MessageId") + .HasColumnType("bigint unsigned") + .HasColumnName("messageid"); + + b.Property("Name") + .HasColumnType("longtext") + .HasColumnName("name"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); b.HasKey("Id") - .HasName("pk_gcchannelid"); + .HasName("pk_streamonlinemessages"); - b.HasIndex("GuildConfigId") - .HasDatabaseName("ix_gcchannelid_guildconfigid"); - - b.ToTable("gcchannelid", (string)null); + b.ToTable("streamonlinemessages", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.GamblingStats", b => + modelBuilder.Entity("EllieBot.Db.Models.XpShopOwnedItem", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("IsUsing") + .HasColumnType("tinyint(1)") + .HasColumnName("isusing"); + + b.Property("ItemKey") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("itemkey"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .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.Database.Models.AntiAltSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("ActionDurationMinutes") + .HasColumnType("int") + .HasColumnName("actiondurationminutes"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MinAge") + .HasColumnType("time(6)") + .HasColumnName("minage"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antialtsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antialtsetting_guildconfigid"); + + b.ToTable("antialtsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("PunishDuration") + .HasColumnType("int") + .HasColumnName("punishduration"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.Property("UserThreshold") + .HasColumnType("int") + .HasColumnName("userthreshold"); + + b.HasKey("Id") + .HasName("pk_antiraidsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antiraidsetting_guildconfigid"); + + b.ToTable("antiraidsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AntiSpamSettingId") + .HasColumnType("int") + .HasColumnName("antispamsettingid"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.HasKey("Id") + .HasName("pk_antispamignore"); + + b.HasIndex("AntiSpamSettingId") + .HasDatabaseName("ix_antispamignore_antispamsettingid"); + + b.ToTable("antispamignore", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Action") + .HasColumnType("int") + .HasColumnName("action"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("MessageThreshold") + .HasColumnType("int") + .HasColumnName("messagethreshold"); + + b.Property("MuteTime") + .HasColumnType("int") + .HasColumnName("mutetime"); + + b.Property("RoleId") + .HasColumnType("bigint unsigned") + .HasColumnName("roleid"); + + b.HasKey("Id") + .HasName("pk_antispamsetting"); + + b.HasIndex("GuildConfigId") + .IsUnique() + .HasDatabaseName("ix_antispamsetting_guildconfigid"); + + b.ToTable("antispamsetting", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoCommand", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("ChannelName") + .HasColumnType("longtext") + .HasColumnName("channelname"); + + b.Property("CommandText") + .HasColumnType("longtext") + .HasColumnName("commandtext"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("GuildName") + .HasColumnType("longtext") + .HasColumnName("guildname"); + + b.Property("Interval") + .HasColumnType("int") + .HasColumnName("interval"); + + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("voicechannelid"); + + b.Property("VoiceChannelName") + .HasColumnType("longtext") + .HasColumnName("voicechannelname"); + + b.HasKey("Id") + .HasName("pk_autocommands"); + + b.ToTable("autocommands", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AutoDelete") + .HasColumnType("tinyint(1)") + .HasColumnName("autodelete"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.HasKey("Id") + .HasName("pk_autotranslatechannels"); + + b.HasIndex("ChannelId") + .IsUnique() + .HasDatabaseName("ix_autotranslatechannels_channelid"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_autotranslatechannels_guildid"); + + b.ToTable("autotranslatechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("int") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Source") + .HasColumnType("longtext") + .HasColumnName("source"); + + b.Property("Target") + .HasColumnType("longtext") + .HasColumnName("target"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_autotranslateusers"); + + b.HasAlternateKey("ChannelId", "UserId") + .HasName("ak_autotranslateusers_channelid_userid"); + + b.ToTable("autotranslateusers", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BanTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("PruneDays") + .HasColumnType("int") + .HasColumnName("prunedays"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_bantemplates"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_bantemplates_guildid"); + + b.ToTable("bantemplates", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.BlacklistEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("type"); + + b.HasKey("Id") + .HasName("pk_blacklist"); + + b.ToTable("blacklist", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Mapping") + .HasColumnType("longtext") + .HasColumnName("mapping"); + + b.Property("Trigger") + .HasColumnType("longtext") + .HasColumnName("trigger"); + + b.HasKey("Id") + .HasName("pk_commandalias"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandalias_guildconfigid"); + + b.ToTable("commandalias", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("CommandName") + .HasColumnType("longtext") + .HasColumnName("commandname"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Seconds") + .HasColumnType("int") + .HasColumnName("seconds"); + + b.HasKey("Id") + .HasName("pk_commandcooldown"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_commandcooldown_guildconfigid"); + + b.ToTable("commandcooldown", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CurrencyTransaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Amount") + .HasColumnType("bigint") + .HasColumnName("amount"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Extra") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("extra"); + + b.Property("Note") + .HasColumnType("longtext") + .HasColumnName("note"); + + b.Property("OtherId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("otherid") + .HasDefaultValueSql("NULL"); + + b.Property("Type") + .IsRequired() + .HasColumnType("longtext") + .HasColumnName("type"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.HasKey("Id") + .HasName("pk_currencytransactions"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_currencytransactions_userid"); + + b.ToTable("currencytransactions", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("State") + .HasColumnType("tinyint(1)") + .HasColumnName("state"); + + b.HasKey("Id") + .HasName("pk_delmsgoncmdchannel"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_delmsgoncmdchannel_guildconfigid"); + + b.ToTable("delmsgoncmdchannel", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DiscordPermOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("Command") + .HasColumnType("varchar(255)") + .HasColumnName("command"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Perm") + .HasColumnType("bigint unsigned") + .HasColumnName("perm"); + + b.HasKey("Id") + .HasName("pk_discordpermoverrides"); + + b.HasIndex("GuildId", "Command") + .IsUnique() + .HasDatabaseName("ix_discordpermoverrides_guildid_command"); + + b.ToTable("discordpermoverrides", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("ItemId") + .HasColumnType("bigint unsigned") + .HasColumnName("itemid"); + + b.Property("ItemType") + .HasColumnType("int") + .HasColumnName("itemtype"); + + b.Property("XpSettingsId") + .HasColumnType("int") + .HasColumnName("xpsettingsid"); + + b.HasKey("Id") + .HasName("pk_excludeditem"); + + b.HasIndex("XpSettingsId") + .HasDatabaseName("ix_excludeditem_xpsettingsid"); + + b.ToTable("excludeditem", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Message") + .HasColumnType("longtext") + .HasColumnName("message"); + + b.Property("Url") + .IsRequired() + .HasColumnType("varchar(255)") + .HasColumnName("url"); + + b.HasKey("Id") + .HasName("pk_feedsub"); + + b.HasAlternateKey("GuildConfigId", "Url") + .HasName("ak_feedsub_guildconfigid_url"); + + b.ToTable("feedsub", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterchannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterchannelid_guildconfigid"); + + b.ToTable("filterchannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.Property("Word") + .HasColumnType("longtext") + .HasColumnName("word"); + + b.HasKey("Id") + .HasName("pk_filteredword"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filteredword_guildconfigid"); + + b.ToTable("filteredword", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterlinkschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterlinkschannelid_guildconfigid"); + + b.ToTable("filterlinkschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); + + b.HasKey("Id") + .HasName("pk_filterwordschannelid"); + + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_filterwordschannelid_guildconfigid"); + + b.ToTable("filterwordschannelid", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GamblingStats", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); b.Property("Bet") - .HasColumnType("numeric") + .HasColumnType("decimal(65,30)") .HasColumnName("bet"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Feature") - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("feature"); b.Property("PaidOut") - .HasColumnType("numeric") + .HasColumnType("decimal(65,30)") .HasColumnName("paidout"); b.HasKey("Id") @@ -1109,95 +1140,55 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("gamblingstats", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); - b.Property("EndsAt") - .HasColumnType("timestamp without time zone") - .HasColumnName("endsat"); + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); - 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.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); b.HasKey("Id") - .HasName("pk_giveawaymodel"); + .HasName("pk_gcchannelid"); - b.ToTable("giveawaymodel", (string)null); + b.HasIndex("GuildConfigId") + .HasDatabaseName("ix_gcchannelid_guildconfigid"); + + b.ToTable("gcchannelid", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.GiveawayUser", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .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") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); b.Property("Number") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("number"); b.HasKey("Id") @@ -1210,115 +1201,165 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("groupname", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.GuildConfig", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.GuildConfig", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("AutoAssignRoleIds") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("autoassignroleids"); + b.Property("AutoDeleteByeMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletebyemessagestimer"); + + b.Property("AutoDeleteGreetMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletegreetmessagestimer"); + b.Property("AutoDeleteSelfAssignedRoleMessages") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("autodeleteselfassignedrolemessages"); + b.Property("BoostMessage") + .HasColumnType("longtext") + .HasColumnName("boostmessage"); + + b.Property("BoostMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("boostmessagechannelid"); + + b.Property("BoostMessageDeleteAfter") + .HasColumnType("int") + .HasColumnName("boostmessagedeleteafter"); + + b.Property("ByeMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("byemessagechannelid"); + + b.Property("ChannelByeMessageText") + .HasColumnType("longtext") + .HasColumnName("channelbyemessagetext"); + + b.Property("ChannelGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("channelgreetmessagetext"); + b.Property("CleverbotEnabled") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("cleverbotenabled"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("DeleteMessageOnCommand") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("deletemessageoncommand"); b.Property("DeleteStreamOnlineMessage") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("deletestreamonlinemessage"); b.Property("DisableGlobalExpressions") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("disableglobalexpressions"); + b.Property("DmGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("dmgreetmessagetext"); + b.Property("ExclusiveSelfAssignedRoles") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("exclusiveselfassignedroles"); b.Property("FilterInvites") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("filterinvites"); b.Property("FilterLinks") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("filterlinks"); b.Property("FilterWords") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("filterwords"); - b.Property("GameVoiceChannel") - .HasColumnType("numeric(20,0)") + b.Property("GameVoiceChannel") + .HasColumnType("bigint unsigned") .HasColumnName("gamevoicechannel"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GreetMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("greetmessagechannelid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Locale") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("locale"); b.Property("MuteRoleName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("muterolename"); b.Property("NotifyStreamOffline") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("notifystreamoffline"); b.Property("PermissionRole") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("permissionrole"); b.Property("Prefix") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("prefix"); - b.Property("StickyRoles") - .HasColumnType("boolean") - .HasColumnName("stickyroles"); + b.Property("SendBoostMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendboostmessage"); + + b.Property("SendChannelByeMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelbyemessage"); + + b.Property("SendChannelGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelgreetmessage"); + + b.Property("SendDmGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("senddmgreetmessage"); b.Property("TimeZoneId") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("timezoneid"); b.Property("VerboseErrors") .ValueGeneratedOnAdd() - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasDefaultValue(true) .HasColumnName("verboseerrors"); b.Property("VerbosePermissions") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("verbosepermissions"); b.Property("WarnExpireAction") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("warnexpireaction"); b.Property("WarnExpireHours") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("warnexpirehours"); b.Property("WarningsInitialized") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("warningsinitialized"); b.HasKey("Id") @@ -1334,46 +1375,27 @@ namespace EllieBot.Migrations.PostgreSql 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 => + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("ItemType") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("itemtype"); - b.Property("LogItemId") - .HasColumnType("numeric(20,0)") + b.Property("LogItemId") + .HasColumnType("bigint unsigned") .HasColumnName("logitemid"); b.Property("LogSettingId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("logsettingid"); b.HasKey("Id") @@ -1386,29 +1408,55 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("ignoredlogchannels", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.ImageOnlyChannel", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredvoicepresencechannels"); + + b.HasIndex("LogSettingId") + .HasDatabaseName("ix_ignoredvoicepresencechannels_logsettingid"); + + b.ToTable("ignoredvoicepresencechannels", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ImageOnlyChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); b.HasKey("Id") @@ -1421,93 +1469,91 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("imageonlychannels", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.LogSetting", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelCreatedId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelCreatedId") + .HasColumnType("bigint unsigned") .HasColumnName("channelcreatedid"); - b.Property("ChannelDestroyedId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelDestroyedId") + .HasColumnType("bigint unsigned") .HasColumnName("channeldestroyedid"); - b.Property("ChannelUpdatedId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelUpdatedId") + .HasColumnType("bigint unsigned") .HasColumnName("channelupdatedid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); - b.Property("LogOtherId") - .HasColumnType("numeric(20,0)") + b.Property("LogOtherId") + .HasColumnType("bigint unsigned") .HasColumnName("logotherid"); - b.Property("LogUserPresenceId") - .HasColumnType("numeric(20,0)") + b.Property("LogUserPresenceId") + .HasColumnType("bigint unsigned") .HasColumnName("loguserpresenceid"); - b.Property("LogVoicePresenceId") - .HasColumnType("numeric(20,0)") + b.Property("LogVoicePresenceId") + .HasColumnType("bigint unsigned") .HasColumnName("logvoicepresenceid"); - b.Property("LogVoicePresenceTTSId") - .HasColumnType("numeric(20,0)") + b.Property("LogVoicePresenceTTSId") + .HasColumnType("bigint unsigned") .HasColumnName("logvoicepresencettsid"); - b.Property("LogWarnsId") - .HasColumnType("numeric(20,0)") + b.Property("LogWarnsId") + .HasColumnType("bigint unsigned") .HasColumnName("logwarnsid"); - b.Property("MessageDeletedId") - .HasColumnType("numeric(20,0)") + b.Property("MessageDeletedId") + .HasColumnType("bigint unsigned") .HasColumnName("messagedeletedid"); - b.Property("MessageUpdatedId") - .HasColumnType("numeric(20,0)") + b.Property("MessageUpdatedId") + .HasColumnType("bigint unsigned") .HasColumnName("messageupdatedid"); - b.Property("ThreadCreatedId") - .HasColumnType("numeric(20,0)") + b.Property("ThreadCreatedId") + .HasColumnType("bigint unsigned") .HasColumnName("threadcreatedid"); - b.Property("ThreadDeletedId") - .HasColumnType("numeric(20,0)") + b.Property("ThreadDeletedId") + .HasColumnType("bigint unsigned") .HasColumnName("threaddeletedid"); - b.Property("UserBannedId") - .HasColumnType("numeric(20,0)") + b.Property("UserBannedId") + .HasColumnType("bigint unsigned") .HasColumnName("userbannedid"); - b.Property("UserJoinedId") - .HasColumnType("numeric(20,0)") + b.Property("UserJoinedId") + .HasColumnType("bigint unsigned") .HasColumnName("userjoinedid"); - b.Property("UserLeftId") - .HasColumnType("numeric(20,0)") + b.Property("UserLeftId") + .HasColumnType("bigint unsigned") .HasColumnName("userleftid"); - b.Property("UserMutedId") - .HasColumnType("numeric(20,0)") + b.Property("UserMutedId") + .HasColumnType("bigint unsigned") .HasColumnName("usermutedid"); - b.Property("UserUnbannedId") - .HasColumnType("numeric(20,0)") + b.Property("UserUnbannedId") + .HasColumnType("bigint unsigned") .HasColumnName("userunbannedid"); - b.Property("UserUpdatedId") - .HasColumnType("numeric(20,0)") + b.Property("UserUpdatedId") + .HasColumnType("bigint unsigned") .HasColumnName("userupdatedid"); b.HasKey("Id") @@ -1520,42 +1566,40 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("logsettings", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.MusicPlayerSettings", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlayerSettings", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("AutoDisconnect") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("autodisconnect"); b.Property("AutoPlay") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("autoplay"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); - b.Property("MusicChannelId") - .HasColumnType("numeric(20,0)") + b.Property("MusicChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("musicchannelid"); b.Property("PlayerRepeat") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("playerrepeat"); b.Property("QualityPreset") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("qualitypreset"); b.Property("Volume") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasDefaultValue(100) .HasColumnName("volume"); @@ -1569,29 +1613,27 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("musicplayersettings", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlaylist", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Author") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("author"); - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") + b.Property("AuthorId") + .HasColumnType("bigint unsigned") .HasColumnName("authorid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); b.HasKey("Id") @@ -1600,25 +1642,23 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("musicplaylists", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -1630,49 +1670,47 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("muteduserid", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("AllowTarget") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("allowtarget"); b.Property("AutoDeleteTrigger") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("autodeletetrigger"); b.Property("ContainsAnywhere") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("containsanywhere"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("DmResponse") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("dmresponse"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Reactions") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("reactions"); b.Property("Response") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("response"); b.Property("Trigger") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("trigger"); b.HasKey("Id") @@ -1681,82 +1719,75 @@ namespace EllieBot.Migrations.PostgreSql 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 => + modelBuilder.Entity("EllieBot.Services.Database.Models.NsfwBlacklistedTag", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Tag") + .HasColumnType("longtext") + .HasColumnName("tag"); + + b.HasKey("Id") + .HasName("pk_nsfwblacklistedtags"); + + b.HasIndex("GuildId") + .HasDatabaseName("ix_nsfwblacklistedtags_guildid"); + + b.ToTable("nsfwblacklistedtags", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Index") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("index"); b.Property("IsCustomCommand") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("iscustomcommand"); b.Property("PrimaryTarget") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("primarytarget"); - b.Property("PrimaryTargetId") - .HasColumnType("numeric(20,0)") + b.Property("PrimaryTargetId") + .HasColumnType("bigint unsigned") .HasColumnName("primarytargetid"); b.Property("SecondaryTarget") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("secondarytarget"); b.Property("SecondaryTargetName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("secondarytargetname"); b.Property("State") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("state"); b.HasKey("Id") @@ -1768,41 +1799,39 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("permissions", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.PlantedCurrency", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.PlantedCurrency", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Amount") .HasColumnType("bigint") .HasColumnName("amount"); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); - b.Property("MessageId") - .HasColumnType("numeric(20,0)") + b.Property("MessageId") + .HasColumnType("bigint unsigned") .HasColumnName("messageid"); b.Property("Password") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("password"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -1818,41 +1847,39 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("plantedcurrency", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.PlaylistSong", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("MusicPlaylistId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("musicplaylistid"); b.Property("Provider") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("provider"); b.Property("ProviderType") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("providertype"); b.Property("Query") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("query"); b.Property("Title") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("title"); b.Property("Uri") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("uri"); b.HasKey("Id") @@ -1864,40 +1891,135 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("playlistsong", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.Quote", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") + .HasColumnName("guildid"); + + b.Property("Question") + .HasColumnType("longtext") + .HasColumnName("question"); + + b.HasKey("Id") + .HasName("pk_poll"); + + b.HasIndex("GuildId") + .IsUnique() + .HasDatabaseName("ix_poll_guildid"); + + b.ToTable("poll", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("Index") + .HasColumnType("int") + .HasColumnName("index"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("Text") + .HasColumnType("longtext") + .HasColumnName("text"); + + b.HasKey("Id") + .HasName("pk_pollanswer"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollanswer_pollid"); + + b.ToTable("pollanswer", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("PollId") + .HasColumnType("int") + .HasColumnName("pollid"); + + b.Property("UserId") + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + b.Property("VoteIndex") + .HasColumnType("int") + .HasColumnName("voteindex"); + + b.HasKey("Id") + .HasName("pk_pollvote"); + + b.HasIndex("PollId") + .HasDatabaseName("ix_pollvote_pollid"); + + b.ToTable("pollvote", (string)null); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.Quote", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + b.Property("AuthorId") + .HasColumnType("bigint unsigned") .HasColumnName("authorid"); b.Property("AuthorName") .IsRequired() - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("authorname"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Keyword") .IsRequired() - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("keyword"); b.Property("Text") .IsRequired() - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("text"); b.HasKey("Id") @@ -1912,46 +2034,44 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("quotes", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.ReactionRoleV2", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.ReactionRoleV2", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Emote") .HasMaxLength(100) - .HasColumnType("character varying(100)") + .HasColumnType("varchar(100)") .HasColumnName("emote"); b.Property("Group") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("group"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("LevelReq") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("levelreq"); - b.Property("MessageId") - .HasColumnType("numeric(20,0)") + b.Property("MessageId") + .HasColumnType("bigint unsigned") .HasColumnName("messageid"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.HasKey("Id") @@ -1967,45 +2087,39 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("reactionroles", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.Reminder", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.Reminder", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("IsPrivate") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("isprivate"); b.Property("Message") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("message"); - b.Property("ServerId") - .HasColumnType("numeric(20,0)") + b.Property("ServerId") + .HasColumnType("bigint unsigned") .HasColumnName("serverid"); - b.Property("Type") - .HasColumnType("integer") - .HasColumnName("type"); - - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("When") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("when"); b.HasKey("Id") @@ -2017,45 +2131,43 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("reminders", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.Repeater", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.Repeater", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Interval") - .HasColumnType("interval") + .HasColumnType("time(6)") .HasColumnName("interval"); - b.Property("LastMessageId") - .HasColumnType("numeric(20,0)") + b.Property("LastMessageId") + .HasColumnType("bigint unsigned") .HasColumnName("lastmessageid"); b.Property("Message") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("message"); b.Property("NoRedundant") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("noredundant"); b.Property("StartTimeOfDay") - .HasColumnType("interval") + .HasColumnType("time(6)") .HasColumnName("starttimeofday"); b.HasKey("Id") @@ -2064,33 +2176,31 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("repeaters", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.RewardedUser", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.RewardedUser", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("AmountRewardedThisMonth") .HasColumnType("bigint") .HasColumnName("amountrewardedthismonth"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("LastReward") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("lastreward"); b.Property("PlatformUserId") - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("platformuserid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2103,25 +2213,23 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("rewardedusers", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.RotatingPlayingStatus", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.RotatingPlayingStatus", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Status") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("status"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); b.HasKey("Id") @@ -2130,35 +2238,33 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("rotatingstatus", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.SelfAssignedRole", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.SelfAssignedRole", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Group") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasDefaultValue(0) .HasColumnName("group"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("LevelRequirement") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("levelrequirement"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.HasKey("Id") @@ -2171,57 +2277,51 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("selfassignableroles", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") + b.Property("AuthorId") + .HasColumnType("bigint unsigned") .HasColumnName("authorid"); - b.Property("Command") - .HasColumnType("text") - .HasColumnName("command"); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Index") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("index"); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); b.Property("Price") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("price"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.Property("RoleName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("rolename"); - b.Property("RoleRequirement") - .HasColumnType("numeric(20,0)") + b.Property("RoleRequirement") + .HasColumnType("bigint unsigned") .HasColumnName("rolerequirement"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); b.HasKey("Id") @@ -2233,25 +2333,23 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("shopentry", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("ShopEntryId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("shopentryid"); b.Property("Text") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("text"); b.HasKey("Id") @@ -2263,25 +2361,23 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("shopentryitem", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.HasKey("Id") @@ -2293,25 +2389,23 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("slowmodeignoredrole", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2323,99 +2417,27 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("slowmodeignoreduser", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.StickyRole", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .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") + b.Property("StreamRoleSettingsId") + .HasColumnType("int") .HasColumnName("streamrolesettingsid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("Username") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("username"); b.HasKey("Id") @@ -2427,37 +2449,35 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("streamroleblacklisteduser", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - - b.Property("AddRoleId") - .HasColumnType("numeric(20,0)") + b.Property("AddRoleId") + .HasColumnType("bigint unsigned") .HasColumnName("addroleid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Enabled") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("enabled"); - b.Property("FromRoleId") - .HasColumnType("numeric(20,0)") + b.Property("FromRoleId") + .HasColumnType("bigint unsigned") .HasColumnName("fromroleid"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Keyword") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("keyword"); b.HasKey("Id") @@ -2470,29 +2490,27 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("streamrolesettings", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("StreamRoleSettingsId") - .HasColumnType("integer") + b.Property("StreamRoleSettingsId") + .HasColumnType("int") .HasColumnName("streamrolesettingsid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("Username") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("username"); b.HasKey("Id") @@ -2504,70 +2522,27 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("streamrolewhitelisteduser", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .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") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("UnbanAt") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("unbanat"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2579,29 +2554,27 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("unbantimer", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("UnmuteAt") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("unmuteat"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2613,33 +2586,31 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("unmutetimer", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.Property("UnbanAt") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("unbanat"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2651,33 +2622,31 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("unroletimer", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.UserXpStats", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.UserXpStats", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("AwardedXp") .HasColumnType("bigint") .HasColumnName("awardedxp"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("NotifyOnLevelUp") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("notifyonlevelup"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("Xp") @@ -2706,29 +2675,27 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("userxpstats", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.VcRoleInfo", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.VcRoleInfo", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); - b.Property("VoiceChannelId") - .HasColumnType("numeric(20,0)") + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("voicechannelid"); b.HasKey("Id") @@ -2740,25 +2707,23 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("vcroleinfo", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("AffinityId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("affinityid"); b.Property("ClaimerId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("claimerid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Price") @@ -2766,7 +2731,7 @@ namespace EllieBot.Migrations.PostgreSql .HasColumnName("price"); b.Property("WaifuId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("waifuid"); b.HasKey("Id") @@ -2788,29 +2753,27 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("waifuinfo", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuItem", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("ItemEmoji") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("itememoji"); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); b.Property("WaifuInfoId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("waifuinfoid"); b.HasKey("Id") @@ -2822,33 +2785,31 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("waifuitem", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuUpdate", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("NewId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("newid"); b.Property("OldId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("oldid"); b.Property("UpdateType") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("updatetype"); b.Property("UserId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("userid"); b.HasKey("Id") @@ -2866,41 +2827,39 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("waifuupdates", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.Warning", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.Warning", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Forgiven") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("forgiven"); b.Property("ForgivenBy") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("forgivenby"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Moderator") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("moderator"); b.Property("Reason") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("reason"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("Weight") @@ -2924,71 +2883,67 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("warnings", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.WarningPunishment", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.WarningPunishment", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Count") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("count"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") - .HasColumnName("guildid"); + b.Property("GuildConfigId") + .HasColumnType("int") + .HasColumnName("guildconfigid"); b.Property("Punishment") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("punishment"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.Property("Time") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("time"); 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); }); - modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Amount") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("amount"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Level") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("level"); b.Property("XpSettingsId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("xpsettingsid"); b.HasKey("Id") @@ -3000,33 +2955,31 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("xpcurrencyreward", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Level") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("level"); b.Property("Remove") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("remove"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.Property("XpSettingsId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("xpsettingsid"); b.HasKey("Id") @@ -3039,25 +2992,23 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("xprolereward", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("ServerExcluded") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("serverexcluded"); b.HasKey("Id") @@ -3070,144 +3021,6 @@ namespace EllieBot.Migrations.PostgreSql 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") @@ -3261,34 +3074,6 @@ namespace EllieBot.Migrations.PostgreSql 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") @@ -3300,20 +3085,103 @@ namespace EllieBot.Migrations.PostgreSql b.Navigation("Club"); }); - modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => + modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") - .WithMany("ExclusionList") - .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); - - b.Navigation("XpSettings"); + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FollowedStreams") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); }); - modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiAltSetting", b => { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithOne("AntiAltSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiAltSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antialtsetting_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiRaidSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiRaidSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiRaidSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamIgnore", b => + { + b.HasOne("EllieBot.Services.Database.Models.AntiSpamSetting", null) + .WithMany("IgnoredChannels") + .HasForeignKey("AntiSpamSettingId") + .HasConstraintName("fk_antispamignore_antispamsetting_antispamsettingid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") + .WithOne("AntiSpamSetting") + .HasForeignKey("EllieBot.Services.Database.Models.AntiSpamSetting", "GuildConfigId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateUser", b => + { + b.HasOne("EllieBot.Services.Database.Models.AutoTranslateChannel", "Channel") + .WithMany("Users") + .HasForeignKey("ChannelId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_autotranslateusers_autotranslatechannels_channelid"); + + b.Navigation("Channel"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandAlias", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandAliases") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.CommandCooldown", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("CommandCooldowns") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.DelMsgOnCmdChannel", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("DelMsgOnCmdChannels") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ExcludedItem", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", null) + .WithMany("ExclusionList") + .HasForeignKey("XpSettingsId") + .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.FeedSub", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") .WithMany("FeedSubs") .HasForeignKey("GuildConfigId") .OnDelete(DeleteBehavior.Cascade) @@ -3323,75 +3191,51 @@ namespace EllieBot.Migrations.PostgreSql b.Navigation("GuildConfig"); }); - modelBuilder.Entity("EllieBot.Db.Models.FilterChannelId", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterChannelId", b => { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) .WithMany("FilterInvitesChannelIds") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); }); - modelBuilder.Entity("EllieBot.Db.Models.FilterLinksChannelId", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.FilteredWord", 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) + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) .WithMany("FilteredWords") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); }); - modelBuilder.Entity("EllieBot.Db.Models.FollowedStream", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterLinksChannelId", b => { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) - .WithMany("FollowedStreams") + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterLinksChannelIds") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); + .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); }); - modelBuilder.Entity("EllieBot.Db.Models.GCChannelId", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.FilterWordsChannelId", b => { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("FilterWordsChannelIds") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GCChannelId", b => + { + b.HasOne("EllieBot.Services.Database.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 => + modelBuilder.Entity("EllieBot.Services.Database.Models.GroupName", 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") + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") .WithMany("SelfAssignableRoleGroupNames") .HasForeignKey("GuildConfigId") .OnDelete(DeleteBehavior.Cascade) @@ -3401,9 +3245,9 @@ namespace EllieBot.Migrations.PostgreSql b.Navigation("GuildConfig"); }); - modelBuilder.Entity("EllieBot.Db.Models.IgnoredLogItem", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredLogItem", b => { - b.HasOne("EllieBot.Db.Models.LogSetting", "LogSetting") + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") .WithMany("LogIgnores") .HasForeignKey("LogSettingId") .OnDelete(DeleteBehavior.Cascade) @@ -3413,86 +3257,102 @@ namespace EllieBot.Migrations.PostgreSql b.Navigation("LogSetting"); }); - modelBuilder.Entity("EllieBot.Db.Models.MutedUserId", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.IgnoredVoicePresenceChannel", b => { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) + b.HasOne("EllieBot.Services.Database.Models.LogSetting", "LogSetting") + .WithMany() + .HasForeignKey("LogSettingId") + .HasConstraintName("fk_ignoredvoicepresencechannels_logsettings_logsettingid"); + + b.Navigation("LogSetting"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.MutedUserId", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) .WithMany("MutedUsers") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_muteduserid_guildconfigs_guildconfigid"); }); - modelBuilder.Entity("EllieBot.Db.Models.Permissionv2", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.Permissionv2", b => { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) .WithMany("Permissions") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); }); - modelBuilder.Entity("EllieBot.Db.Models.PlaylistSong", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.PlaylistSong", b => { - b.HasOne("EllieBot.Db.Models.MusicPlaylist", null) + b.HasOne("EllieBot.Services.Database.Models.MusicPlaylist", null) .WithMany("Songs") .HasForeignKey("MusicPlaylistId") .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_playlistsong_musicplaylists_musicplaylistid"); }); - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.PollAnswer", b => { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Answers") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollanswer_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.PollVote", b => + { + b.HasOne("EllieBot.Services.Database.Models.Poll", null) + .WithMany("Votes") + .HasForeignKey("PollId") + .HasConstraintName("fk_pollvote_poll_pollid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => + { + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) .WithMany("ShopEntries") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); }); - modelBuilder.Entity("EllieBot.Db.Models.ShopEntryItem", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntryItem", b => { - b.HasOne("EllieBot.Db.Models.ShopEntry", null) + b.HasOne("EllieBot.Services.Database.Models.ShopEntry", null) .WithMany("Items") .HasForeignKey("ShopEntryId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); }); - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredRole", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredRole", b => { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) .WithMany("SlowmodeIgnoredRoles") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); }); - modelBuilder.Entity("EllieBot.Db.Models.SlowmodeIgnoredUser", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.SlowmodeIgnoredUser", b => { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) .WithMany("SlowmodeIgnoredUsers") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_slowmodeignoreduser_guildconfigs_guildconfigid"); }); - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleBlacklistedUser", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleBlacklistedUser", b => { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) .WithMany("Blacklist") .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesett~"); - - b.Navigation("StreamRoleSettings"); + .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~"); }); - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") .WithOne("StreamRole") - .HasForeignKey("EllieBot.Db.Models.StreamRoleSettings", "GuildConfigId") + .HasForeignKey("EllieBot.Services.Database.Models.StreamRoleSettings", "GuildConfigId") .OnDelete(DeleteBehavior.Cascade) .IsRequired() .HasConstraintName("fk_streamrolesettings_guildconfigs_guildconfigid"); @@ -3500,64 +3360,47 @@ namespace EllieBot.Migrations.PostgreSql b.Navigation("GuildConfig"); }); - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleWhitelistedUser", b => { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") + b.HasOne("EllieBot.Services.Database.Models.StreamRoleSettings", null) .WithMany("Whitelist") .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesett~"); - - b.Navigation("StreamRoleSettings"); + .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~"); }); - modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.UnbanTimer", 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) + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) .WithMany("UnbanTimer") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); }); - modelBuilder.Entity("EllieBot.Db.Models.UnmuteTimer", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.UnmuteTimer", b => { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) .WithMany("UnmuteTimers") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); }); - modelBuilder.Entity("EllieBot.Db.Models.UnroleTimer", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.UnroleTimer", b => { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) .WithMany("UnroleTimer") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); }); - modelBuilder.Entity("EllieBot.Db.Models.VcRoleInfo", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.VcRoleInfo", b => { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) .WithMany("VcRoleInfos") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); }); - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => { b.HasOne("EllieBot.Db.Models.DiscordUser", "Affinity") .WithMany() @@ -3571,7 +3414,7 @@ namespace EllieBot.Migrations.PostgreSql b.HasOne("EllieBot.Db.Models.DiscordUser", "Waifu") .WithOne() - .HasForeignKey("EllieBot.Db.Models.WaifuInfo", "WaifuId") + .HasForeignKey("EllieBot.Services.Database.Models.WaifuInfo", "WaifuId") .OnDelete(DeleteBehavior.Cascade) .IsRequired() .HasConstraintName("fk_waifuinfo_discorduser_waifuid"); @@ -3583,9 +3426,9 @@ namespace EllieBot.Migrations.PostgreSql b.Navigation("Waifu"); }); - modelBuilder.Entity("EllieBot.Db.Models.WaifuItem", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuItem", b => { - b.HasOne("EllieBot.Db.Models.WaifuInfo", "WaifuInfo") + b.HasOne("EllieBot.Services.Database.Models.WaifuInfo", "WaifuInfo") .WithMany("Items") .HasForeignKey("WaifuInfoId") .HasConstraintName("fk_waifuitem_waifuinfo_waifuinfoid"); @@ -3593,7 +3436,7 @@ namespace EllieBot.Migrations.PostgreSql b.Navigation("WaifuInfo"); }); - modelBuilder.Entity("EllieBot.Db.Models.WaifuUpdate", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuUpdate", b => { b.HasOne("EllieBot.Db.Models.DiscordUser", "New") .WithMany() @@ -3619,9 +3462,17 @@ namespace EllieBot.Migrations.PostgreSql b.Navigation("User"); }); - modelBuilder.Entity("EllieBot.Db.Models.XpCurrencyReward", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.WarningPunishment", b => { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", null) + .WithMany("WarnPunishments") + .HasForeignKey("GuildConfigId") + .HasConstraintName("fk_warningpunishment_guildconfigs_guildconfigid"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.XpCurrencyReward", b => + { + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") .WithMany("CurrencyRewards") .HasForeignKey("XpSettingsId") .OnDelete(DeleteBehavior.Cascade) @@ -3631,9 +3482,9 @@ namespace EllieBot.Migrations.PostgreSql b.Navigation("XpSettings"); }); - modelBuilder.Entity("EllieBot.Db.Models.XpRoleReward", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.XpRoleReward", b => { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") + b.HasOne("EllieBot.Services.Database.Models.XpSettings", "XpSettings") .WithMany("RoleRewards") .HasForeignKey("XpSettingsId") .OnDelete(DeleteBehavior.Cascade) @@ -3643,11 +3494,11 @@ namespace EllieBot.Migrations.PostgreSql b.Navigation("XpSettings"); }); - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => { - b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") + b.HasOne("EllieBot.Services.Database.Models.GuildConfig", "GuildConfig") .WithOne("XpSettings") - .HasForeignKey("EllieBot.Db.Models.XpSettings", "GuildConfigId") + .HasForeignKey("EllieBot.Services.Database.Models.XpSettings", "GuildConfigId") .OnDelete(DeleteBehavior.Cascade) .IsRequired() .HasConstraintName("fk_xpsettings_guildconfigs_guildconfigid"); @@ -3655,21 +3506,6 @@ namespace EllieBot.Migrations.PostgreSql 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"); @@ -3679,12 +3515,17 @@ namespace EllieBot.Migrations.PostgreSql b.Navigation("Members"); }); - modelBuilder.Entity("EllieBot.Db.Models.GiveawayModel", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.AntiSpamSetting", b => { - b.Navigation("Participants"); + b.Navigation("IgnoredChannels"); }); - modelBuilder.Entity("EllieBot.Db.Models.GuildConfig", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.AutoTranslateChannel", b => + { + b.Navigation("Users"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.GuildConfig", b => { b.Navigation("AntiAltSetting"); @@ -3734,37 +3575,46 @@ namespace EllieBot.Migrations.PostgreSql b.Navigation("VcRoleInfos"); + b.Navigation("WarnPunishments"); + b.Navigation("XpSettings"); }); - modelBuilder.Entity("EllieBot.Db.Models.LogSetting", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.LogSetting", b => { b.Navigation("LogIgnores"); }); - modelBuilder.Entity("EllieBot.Db.Models.MusicPlaylist", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.MusicPlaylist", b => { b.Navigation("Songs"); }); - modelBuilder.Entity("EllieBot.Db.Models.ShopEntry", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.Poll", b => + { + b.Navigation("Answers"); + + b.Navigation("Votes"); + }); + + modelBuilder.Entity("EllieBot.Services.Database.Models.ShopEntry", b => { b.Navigation("Items"); }); - modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.StreamRoleSettings", b => { b.Navigation("Blacklist"); b.Navigation("Whitelist"); }); - modelBuilder.Entity("EllieBot.Db.Models.WaifuInfo", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.WaifuInfo", b => { b.Navigation("Items"); }); - modelBuilder.Entity("EllieBot.Db.Models.XpSettings", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.XpSettings", b => { b.Navigation("CurrencyRewards"); diff --git a/src/EllieBot/Migrations/Mysql/20221122204432_feed-text.cs b/src/EllieBot/Migrations/Mysql/20221122204432_feed-text.cs new file mode 100644 index 0000000..c9760b4 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20221122204432_feed-text.cs @@ -0,0 +1,26 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + public partial class feedtext : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "message", + table: "feedsub", + type: "longtext", + nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "message", + table: "feedsub"); + } + } +} diff --git a/src/EllieBot/Migrations/PostgreSql/20240912124719_greet-settings.Designer.cs b/src/EllieBot/Migrations/Mysql/20240502233216_v5.Designer.cs similarity index 70% rename from src/EllieBot/Migrations/PostgreSql/20240912124719_greet-settings.Designer.cs rename to src/EllieBot/Migrations/Mysql/20240502233216_v5.Designer.cs index bb3e2f5..d20fae3 100644 --- a/src/EllieBot/Migrations/PostgreSql/20240912124719_greet-settings.Designer.cs +++ b/src/EllieBot/Migrations/Mysql/20240502233216_v5.Designer.cs @@ -2,56 +2,56 @@ using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using EllieBot.Db; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable -namespace EllieBot.Migrations.PostgreSql +namespace EllieBot.Migrations.Mysql { - [DbContext(typeof(PostgreSqlContext))] - [Migration("20240912124719_greet-settings")] - partial class greetsettings + [DbContext(typeof(MysqlContext))] + [Migration("20240502233216_v5")] + partial class v5 { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "8.0.8") - .HasAnnotation("Relational:MaxIdentifierLength", 63); + .HasAnnotation("ProductVersion", "8.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 64); - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Action") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("action"); b.Property("ActionDurationMinutes") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("actiondurationminutes"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("MinAge") - .HasColumnType("interval") + .HasColumnType("time(6)") .HasColumnName("minage"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.HasKey("Id") @@ -68,33 +68,33 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Action") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("action"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("PunishDuration") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("punishduration"); b.Property("Seconds") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("seconds"); b.Property("UserThreshold") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("userthreshold"); b.HasKey("Id") @@ -111,21 +111,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AntiSpamSettingId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("antispamsettingid"); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.HasKey("Id") @@ -141,33 +141,33 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Action") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("action"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("MessageThreshold") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("messagethreshold"); b.Property("MuteTime") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("mutetime"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.HasKey("Id") @@ -184,17 +184,17 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -207,45 +207,45 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("ChannelName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("channelname"); b.Property("CommandText") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("commandtext"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("GuildName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("guildname"); b.Property("Interval") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("interval"); - b.Property("VoiceChannelId") - .HasColumnType("numeric(20,0)") + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("voicechannelid"); b.Property("VoiceChannelName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("voicechannelname"); b.HasKey("Id") @@ -258,21 +258,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.HasKey("Id") @@ -289,25 +289,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AutoDelete") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("autodelete"); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.HasKey("Id") @@ -327,29 +327,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("ChannelId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Source") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("source"); b.Property("Target") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("target"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -365,25 +365,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("PruneDays") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("prunedays"); b.Property("Text") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("text"); b.HasKey("Id") @@ -400,21 +400,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Balance") .HasColumnType("bigint") .HasColumnName("balance"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -431,21 +431,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("ItemId") - .HasColumnType("numeric(20,0)") + b.Property("ItemId") + .HasColumnType("bigint unsigned") .HasColumnName("itemid"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); b.HasKey("Id") @@ -457,11 +457,11 @@ namespace EllieBot.Migrations.PostgreSql modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => { b.Property("ClubId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("clubid"); b.Property("UserId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("userid"); b.HasKey("ClubId", "UserId") @@ -476,11 +476,11 @@ namespace EllieBot.Migrations.PostgreSql modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => { b.Property("ClubId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("clubid"); b.Property("UserId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("userid"); b.HasKey("ClubId", "UserId") @@ -496,34 +496,35 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Description") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("description"); b.Property("ImageUrl") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("imageurl"); b.Property("Name") .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("name"); + .HasColumnType("varchar(20)") + .HasColumnName("name") + .UseCollation("utf8mb4_bin"); b.Property("OwnerId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("ownerid"); b.Property("Xp") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("xp"); b.HasKey("Id") @@ -544,25 +545,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Mapping") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("mapping"); b.Property("Trigger") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("trigger"); b.HasKey("Id") @@ -578,25 +579,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("CommandName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("commandname"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Seconds") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("seconds"); b.HasKey("Id") @@ -612,41 +613,41 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Amount") .HasColumnType("bigint") .HasColumnName("amount"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Extra") .IsRequired() - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("extra"); b.Property("Note") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("note"); - b.Property("OtherId") + b.Property("OtherId") .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") + .HasColumnType("bigint unsigned") .HasColumnName("otherid") .HasDefaultValueSql("NULL"); b.Property("Type") .IsRequired() - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("type"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -662,25 +663,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildConfigId") - .HasColumnType("integer") + b.Property("GuildConfigId") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("State") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("state"); b.HasKey("Id") @@ -696,25 +697,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Command") - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("command"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); - b.Property("Perm") - .HasColumnType("numeric(20,0)") + b.Property("Perm") + .HasColumnType("bigint unsigned") .HasColumnName("perm"); b.HasKey("Id") @@ -731,17 +732,17 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AvatarId") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("avatarid"); b.Property("ClubId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("clubid"); b.Property("CurrencyAmount") @@ -751,22 +752,22 @@ namespace EllieBot.Migrations.PostgreSql .HasColumnName("currencyamount"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Discriminator") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("discriminator"); b.Property("IsClubAdmin") .ValueGeneratedOnAdd() - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasDefaultValue(false) .HasColumnName("isclubadmin"); b.Property("NotifyOnLevelUp") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasDefaultValue(0) .HasColumnName("notifyonlevelup"); @@ -776,12 +777,12 @@ namespace EllieBot.Migrations.PostgreSql .HasDefaultValue(0L) .HasColumnName("totalxp"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("Username") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("username"); b.HasKey("Id") @@ -809,25 +810,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("ItemId") - .HasColumnType("numeric(20,0)") + b.Property("ItemId") + .HasColumnType("bigint unsigned") .HasColumnName("itemid"); b.Property("ItemType") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("itemtype"); b.Property("XpSettingsId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("xpsettingsid"); b.HasKey("Id") @@ -843,30 +844,30 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Message") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("message"); b.Property("Url") .IsRequired() - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("url"); b.HasKey("Id") @@ -882,21 +883,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.HasKey("Id") @@ -912,21 +913,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.HasKey("Id") @@ -942,21 +943,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.HasKey("Id") @@ -972,21 +973,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Word") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("word"); b.HasKey("Id") @@ -1002,37 +1003,37 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Message") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("message"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); b.Property("Username") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("username"); b.HasKey("Id") @@ -1048,21 +1049,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.HasKey("Id") @@ -1078,25 +1079,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Bet") - .HasColumnType("numeric") + .HasColumnType("decimal(65,30)") .HasColumnName("bet"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Feature") - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("feature"); b.Property("PaidOut") - .HasColumnType("numeric") + .HasColumnType("decimal(65,30)") .HasColumnName("paidout"); b.HasKey("Id") @@ -1113,29 +1114,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("EndsAt") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("endsat"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Message") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("message"); - b.Property("MessageId") - .HasColumnType("numeric(20,0)") + b.Property("MessageId") + .HasColumnType("bigint unsigned") .HasColumnName("messageid"); b.HasKey("Id") @@ -1148,21 +1149,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("GiveawayId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("giveawayid"); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -1179,25 +1180,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); b.Property("Number") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("number"); b.HasKey("Id") @@ -1214,111 +1215,167 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AutoAssignRoleIds") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("autoassignroleids"); + b.Property("AutoDeleteByeMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletebyemessagestimer"); + + b.Property("AutoDeleteGreetMessagesTimer") + .HasColumnType("int") + .HasColumnName("autodeletegreetmessagestimer"); + b.Property("AutoDeleteSelfAssignedRoleMessages") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("autodeleteselfassignedrolemessages"); + b.Property("BoostMessage") + .HasColumnType("longtext") + .HasColumnName("boostmessage"); + + b.Property("BoostMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("boostmessagechannelid"); + + b.Property("BoostMessageDeleteAfter") + .HasColumnType("int") + .HasColumnName("boostmessagedeleteafter"); + + b.Property("ByeMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("byemessagechannelid"); + + b.Property("ChannelByeMessageText") + .HasColumnType("longtext") + .HasColumnName("channelbyemessagetext"); + + b.Property("ChannelGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("channelgreetmessagetext"); + b.Property("CleverbotEnabled") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("cleverbotenabled"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("DeleteMessageOnCommand") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("deletemessageoncommand"); b.Property("DeleteStreamOnlineMessage") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("deletestreamonlinemessage"); b.Property("DisableGlobalExpressions") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("disableglobalexpressions"); + b.Property("DmGreetMessageText") + .HasColumnType("longtext") + .HasColumnName("dmgreetmessagetext"); + b.Property("ExclusiveSelfAssignedRoles") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("exclusiveselfassignedroles"); b.Property("FilterInvites") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("filterinvites"); b.Property("FilterLinks") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("filterlinks"); b.Property("FilterWords") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("filterwords"); - b.Property("GameVoiceChannel") - .HasColumnType("numeric(20,0)") + b.Property("GameVoiceChannel") + .HasColumnType("bigint unsigned") .HasColumnName("gamevoicechannel"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GreetMessageChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("greetmessagechannelid"); + + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Locale") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("locale"); b.Property("MuteRoleName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("muterolename"); b.Property("NotifyStreamOffline") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("notifystreamoffline"); b.Property("PermissionRole") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("permissionrole"); b.Property("Prefix") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("prefix"); + b.Property("SendBoostMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendboostmessage"); + + b.Property("SendChannelByeMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelbyemessage"); + + b.Property("SendChannelGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("sendchannelgreetmessage"); + + b.Property("SendDmGreetMessage") + .HasColumnType("tinyint(1)") + .HasColumnName("senddmgreetmessage"); + b.Property("StickyRoles") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("stickyroles"); b.Property("TimeZoneId") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("timezoneid"); b.Property("VerboseErrors") .ValueGeneratedOnAdd() - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasDefaultValue(true) .HasColumnName("verboseerrors"); b.Property("VerbosePermissions") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("verbosepermissions"); b.Property("WarnExpireAction") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("warnexpireaction"); b.Property("WarnExpireHours") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("warnexpirehours"); b.Property("WarningsInitialized") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("warningsinitialized"); b.HasKey("Id") @@ -1334,46 +1391,29 @@ namespace EllieBot.Migrations.PostgreSql 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") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("ItemType") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("itemtype"); - b.Property("LogItemId") - .HasColumnType("numeric(20,0)") + b.Property("LogItemId") + .HasColumnType("bigint unsigned") .HasColumnName("logitemid"); b.Property("LogSettingId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("logsettingid"); b.HasKey("Id") @@ -1386,29 +1426,59 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("ignoredlogchannels", (string)null); }); + modelBuilder.Entity("EllieBot.Db.Models.IgnoredVoicePresenceChannel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("id"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); + + b.Property("ChannelId") + .HasColumnType("bigint unsigned") + .HasColumnName("channelid"); + + b.Property("DateAdded") + .HasColumnType("datetime(6)") + .HasColumnName("dateadded"); + + b.Property("LogSettingId") + .HasColumnType("int") + .HasColumnName("logsettingid"); + + b.HasKey("Id") + .HasName("pk_ignoredvoicepresencechannels"); + + b.HasIndex("LogSettingId") + .HasDatabaseName("ix_ignoredvoicepresencechannels_logsettingid"); + + b.ToTable("ignoredvoicepresencechannels", (string)null); + }); + modelBuilder.Entity("EllieBot.Db.Models.ImageOnlyChannel", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); b.HasKey("Id") @@ -1425,89 +1495,89 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelCreatedId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelCreatedId") + .HasColumnType("bigint unsigned") .HasColumnName("channelcreatedid"); - b.Property("ChannelDestroyedId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelDestroyedId") + .HasColumnType("bigint unsigned") .HasColumnName("channeldestroyedid"); - b.Property("ChannelUpdatedId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelUpdatedId") + .HasColumnType("bigint unsigned") .HasColumnName("channelupdatedid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); - b.Property("LogOtherId") - .HasColumnType("numeric(20,0)") + b.Property("LogOtherId") + .HasColumnType("bigint unsigned") .HasColumnName("logotherid"); - b.Property("LogUserPresenceId") - .HasColumnType("numeric(20,0)") + b.Property("LogUserPresenceId") + .HasColumnType("bigint unsigned") .HasColumnName("loguserpresenceid"); - b.Property("LogVoicePresenceId") - .HasColumnType("numeric(20,0)") + b.Property("LogVoicePresenceId") + .HasColumnType("bigint unsigned") .HasColumnName("logvoicepresenceid"); - b.Property("LogVoicePresenceTTSId") - .HasColumnType("numeric(20,0)") + b.Property("LogVoicePresenceTTSId") + .HasColumnType("bigint unsigned") .HasColumnName("logvoicepresencettsid"); - b.Property("LogWarnsId") - .HasColumnType("numeric(20,0)") + b.Property("LogWarnsId") + .HasColumnType("bigint unsigned") .HasColumnName("logwarnsid"); - b.Property("MessageDeletedId") - .HasColumnType("numeric(20,0)") + b.Property("MessageDeletedId") + .HasColumnType("bigint unsigned") .HasColumnName("messagedeletedid"); - b.Property("MessageUpdatedId") - .HasColumnType("numeric(20,0)") + b.Property("MessageUpdatedId") + .HasColumnType("bigint unsigned") .HasColumnName("messageupdatedid"); - b.Property("ThreadCreatedId") - .HasColumnType("numeric(20,0)") + b.Property("ThreadCreatedId") + .HasColumnType("bigint unsigned") .HasColumnName("threadcreatedid"); - b.Property("ThreadDeletedId") - .HasColumnType("numeric(20,0)") + b.Property("ThreadDeletedId") + .HasColumnType("bigint unsigned") .HasColumnName("threaddeletedid"); - b.Property("UserBannedId") - .HasColumnType("numeric(20,0)") + b.Property("UserBannedId") + .HasColumnType("bigint unsigned") .HasColumnName("userbannedid"); - b.Property("UserJoinedId") - .HasColumnType("numeric(20,0)") + b.Property("UserJoinedId") + .HasColumnType("bigint unsigned") .HasColumnName("userjoinedid"); - b.Property("UserLeftId") - .HasColumnType("numeric(20,0)") + b.Property("UserLeftId") + .HasColumnType("bigint unsigned") .HasColumnName("userleftid"); - b.Property("UserMutedId") - .HasColumnType("numeric(20,0)") + b.Property("UserMutedId") + .HasColumnType("bigint unsigned") .HasColumnName("usermutedid"); - b.Property("UserUnbannedId") - .HasColumnType("numeric(20,0)") + b.Property("UserUnbannedId") + .HasColumnType("bigint unsigned") .HasColumnName("userunbannedid"); - b.Property("UserUpdatedId") - .HasColumnType("numeric(20,0)") + b.Property("UserUpdatedId") + .HasColumnType("bigint unsigned") .HasColumnName("userupdatedid"); b.HasKey("Id") @@ -1524,38 +1594,38 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AutoDisconnect") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("autodisconnect"); b.Property("AutoPlay") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("autoplay"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); - b.Property("MusicChannelId") - .HasColumnType("numeric(20,0)") + b.Property("MusicChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("musicchannelid"); b.Property("PlayerRepeat") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("playerrepeat"); b.Property("QualityPreset") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("qualitypreset"); b.Property("Volume") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasDefaultValue(100) .HasColumnName("volume"); @@ -1573,25 +1643,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Author") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("author"); - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") + b.Property("AuthorId") + .HasColumnType("bigint unsigned") .HasColumnName("authorid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); b.HasKey("Id") @@ -1604,21 +1674,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -1630,49 +1700,49 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("muteduserid", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => + modelBuilder.Entity("EllieBot.Db.Models.NadekoExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AllowTarget") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("allowtarget"); b.Property("AutoDeleteTrigger") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("autodeletetrigger"); b.Property("ContainsAnywhere") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("containsanywhere"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("DmResponse") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("dmresponse"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Reactions") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("reactions"); b.Property("Response") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("response"); b.Property("Trigger") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("trigger"); b.HasKey("Id") @@ -1681,27 +1751,64 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("expressions", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => + modelBuilder.Entity("EllieBot.Db.Models.PatronQuota", b => { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); + b.Property("FeatureType") + .HasColumnType("int") + .HasColumnName("featuretype"); + + b.Property("Feature") + .HasColumnType("varchar(255)") + .HasColumnName("feature"); + + b.Property("DailyCount") + .HasColumnType("int unsigned") + .HasColumnName("dailycount"); + + b.Property("HourlyCount") + .HasColumnType("int unsigned") + .HasColumnName("hourlycount"); + + b.Property("MonthlyCount") + .HasColumnType("int unsigned") + .HasColumnName("monthlycount"); + + b.HasKey("UserId", "FeatureType", "Feature") + .HasName("pk_patronquotas"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_patronquotas_userid"); + + b.ToTable("patronquotas", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => + { + b.Property("UserId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("UserId")); + b.Property("AmountCents") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("amountcents"); b.Property("LastCharge") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("lastcharge"); b.Property("UniquePlatformUserId") - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("uniqueplatformuserid"); b.Property("ValidThru") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("validthru"); b.HasKey("UserId") @@ -1718,45 +1825,45 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Index") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("index"); b.Property("IsCustomCommand") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("iscustomcommand"); b.Property("PrimaryTarget") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("primarytarget"); - b.Property("PrimaryTargetId") - .HasColumnType("numeric(20,0)") + b.Property("PrimaryTargetId") + .HasColumnType("bigint unsigned") .HasColumnName("primarytargetid"); b.Property("SecondaryTarget") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("secondarytarget"); b.Property("SecondaryTargetName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("secondarytargetname"); b.Property("State") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("state"); b.HasKey("Id") @@ -1772,37 +1879,37 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Amount") .HasColumnType("bigint") .HasColumnName("amount"); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); - b.Property("MessageId") - .HasColumnType("numeric(20,0)") + b.Property("MessageId") + .HasColumnType("bigint unsigned") .HasColumnName("messageid"); b.Property("Password") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("password"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -1822,37 +1929,37 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("MusicPlaylistId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("musicplaylistid"); b.Property("Provider") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("provider"); b.Property("ProviderType") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("providertype"); b.Property("Query") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("query"); b.Property("Title") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("title"); b.Property("Uri") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("uri"); b.HasKey("Id") @@ -1868,36 +1975,36 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") + b.Property("AuthorId") + .HasColumnType("bigint unsigned") .HasColumnName("authorid"); b.Property("AuthorName") .IsRequired() - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("authorname"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Keyword") .IsRequired() - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("keyword"); b.Property("Text") .IsRequired() - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("text"); b.HasKey("Id") @@ -1916,42 +2023,42 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Emote") .HasMaxLength(100) - .HasColumnType("character varying(100)") + .HasColumnType("varchar(100)") .HasColumnName("emote"); b.Property("Group") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("group"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("LevelReq") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("levelreq"); - b.Property("MessageId") - .HasColumnType("numeric(20,0)") + b.Property("MessageId") + .HasColumnType("bigint unsigned") .HasColumnName("messageid"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.HasKey("Id") @@ -1971,41 +2078,41 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("IsPrivate") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("isprivate"); b.Property("Message") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("message"); - b.Property("ServerId") - .HasColumnType("numeric(20,0)") + b.Property("ServerId") + .HasColumnType("bigint unsigned") .HasColumnName("serverid"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("When") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("when"); b.HasKey("Id") @@ -2021,41 +2128,41 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Interval") - .HasColumnType("interval") + .HasColumnType("time(6)") .HasColumnName("interval"); - b.Property("LastMessageId") - .HasColumnType("numeric(20,0)") + b.Property("LastMessageId") + .HasColumnType("bigint unsigned") .HasColumnName("lastmessageid"); b.Property("Message") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("message"); b.Property("NoRedundant") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("noredundant"); b.Property("StartTimeOfDay") - .HasColumnType("interval") + .HasColumnType("time(6)") .HasColumnName("starttimeofday"); b.HasKey("Id") @@ -2068,29 +2175,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AmountRewardedThisMonth") .HasColumnType("bigint") .HasColumnName("amountrewardedthismonth"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("LastReward") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("lastreward"); b.Property("PlatformUserId") - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("platformuserid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2107,21 +2214,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Status") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("status"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); b.HasKey("Id") @@ -2134,31 +2241,31 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Group") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasDefaultValue(0) .HasColumnName("group"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("LevelRequirement") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("levelrequirement"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.HasKey("Id") @@ -2175,53 +2282,53 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") + b.Property("AuthorId") + .HasColumnType("bigint unsigned") .HasColumnName("authorid"); b.Property("Command") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("command"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Index") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("index"); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); b.Property("Price") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("price"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.Property("RoleName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("rolename"); - b.Property("RoleRequirement") - .HasColumnType("numeric(20,0)") + b.Property("RoleRequirement") + .HasColumnType("bigint unsigned") .HasColumnName("rolerequirement"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); b.HasKey("Id") @@ -2237,21 +2344,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("ShopEntryId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("shopentryid"); b.Property("Text") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("text"); b.HasKey("Id") @@ -2267,21 +2374,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.HasKey("Id") @@ -2297,21 +2404,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2327,25 +2434,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("RoleIds") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("roleids"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2362,29 +2469,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("MessageId") - .HasColumnType("numeric(20,0)") + b.Property("MessageId") + .HasColumnType("bigint unsigned") .HasColumnName("messageid"); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); b.HasKey("Id") @@ -2397,25 +2504,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("StreamRoleSettingsId") - .HasColumnType("integer") + b.Property("StreamRoleSettingsId") + .HasColumnType("int") .HasColumnName("streamrolesettingsid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("Username") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("username"); b.HasKey("Id") @@ -2431,33 +2538,33 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("AddRoleId") - .HasColumnType("numeric(20,0)") + b.Property("AddRoleId") + .HasColumnType("bigint unsigned") .HasColumnName("addroleid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Enabled") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("enabled"); - b.Property("FromRoleId") - .HasColumnType("numeric(20,0)") + b.Property("FromRoleId") + .HasColumnType("bigint unsigned") .HasColumnName("fromroleid"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Keyword") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("keyword"); b.HasKey("Id") @@ -2474,25 +2581,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("StreamRoleSettingsId") - .HasColumnType("integer") + b.Property("StreamRoleSettingsId") + .HasColumnType("int") .HasColumnName("streamrolesettingsid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("Username") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("username"); b.HasKey("Id") @@ -2508,29 +2615,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("ArchiveId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("archiveid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("IsDone") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("isdone"); b.Property("Todo") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("todo"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2549,25 +2656,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("UnbanAt") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("unbanat"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2583,25 +2690,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("UnmuteAt") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("unmuteat"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2617,29 +2724,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.Property("UnbanAt") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("unbanat"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2655,29 +2762,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AwardedXp") .HasColumnType("bigint") .HasColumnName("awardedxp"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("NotifyOnLevelUp") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("notifyonlevelup"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("Xp") @@ -2710,25 +2817,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); - b.Property("VoiceChannelId") - .HasColumnType("numeric(20,0)") + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("voicechannelid"); b.HasKey("Id") @@ -2744,21 +2851,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AffinityId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("affinityid"); b.Property("ClaimerId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("claimerid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Price") @@ -2766,7 +2873,7 @@ namespace EllieBot.Migrations.PostgreSql .HasColumnName("price"); b.Property("WaifuId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("waifuid"); b.HasKey("Id") @@ -2792,25 +2899,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("ItemEmoji") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("itememoji"); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); b.Property("WaifuInfoId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("waifuinfoid"); b.HasKey("Id") @@ -2826,29 +2933,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("NewId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("newid"); b.Property("OldId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("oldid"); b.Property("UpdateType") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("updatetype"); b.Property("UserId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("userid"); b.HasKey("Id") @@ -2870,37 +2977,37 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Forgiven") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("forgiven"); b.Property("ForgivenBy") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("forgivenby"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Moderator") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("moderator"); b.Property("Reason") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("reason"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("Weight") @@ -2928,33 +3035,33 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Count") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("count"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Punishment") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("punishment"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.Property("Time") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("time"); b.HasKey("Id") @@ -2970,25 +3077,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Amount") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("amount"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Level") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("level"); b.Property("XpSettingsId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("xpsettingsid"); b.HasKey("Id") @@ -3004,29 +3111,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Level") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("level"); b.Property("Remove") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("remove"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.Property("XpSettingsId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("xpsettingsid"); b.HasKey("Id") @@ -3043,21 +3150,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("ServerExcluded") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("serverexcluded"); b.HasKey("Id") @@ -3074,30 +3181,30 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("IsUsing") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("isusing"); b.Property("ItemKey") .IsRequired() - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("itemkey"); b.Property("ItemType") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("itemtype"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -3110,53 +3217,6 @@ namespace EllieBot.Migrations.PostgreSql 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) @@ -3169,12 +3229,14 @@ namespace EllieBot.Migrations.PostgreSql modelBuilder.Entity("EllieBot.Db.Models.AntiRaidSetting", b => { - b.HasOne("EllieBot.Db.Models.GuildConfig", null) + b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") .WithOne("AntiRaidSetting") .HasForeignKey("EllieBot.Db.Models.AntiRaidSetting", "GuildConfigId") .OnDelete(DeleteBehavior.Cascade) .IsRequired() .HasConstraintName("fk_antiraidsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); }); modelBuilder.Entity("EllieBot.Db.Models.AntiSpamIgnore", b => @@ -3182,18 +3244,19 @@ namespace EllieBot.Migrations.PostgreSql 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) + b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") .WithOne("AntiSpamSetting") .HasForeignKey("EllieBot.Db.Models.AntiSpamSetting", "GuildConfigId") .OnDelete(DeleteBehavior.Cascade) .IsRequired() .HasConstraintName("fk_antispamsetting_guildconfigs_guildconfigid"); + + b.Navigation("GuildConfig"); }); modelBuilder.Entity("EllieBot.Db.Models.AutoTranslateUser", b => @@ -3266,7 +3329,6 @@ namespace EllieBot.Migrations.PostgreSql b.HasOne("EllieBot.Db.Models.GuildConfig", null) .WithMany("CommandAliases") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_commandalias_guildconfigs_guildconfigid"); }); @@ -3275,7 +3337,6 @@ namespace EllieBot.Migrations.PostgreSql b.HasOne("EllieBot.Db.Models.GuildConfig", null) .WithMany("CommandCooldowns") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_commandcooldown_guildconfigs_guildconfigid"); }); @@ -3284,8 +3345,6 @@ namespace EllieBot.Migrations.PostgreSql b.HasOne("EllieBot.Db.Models.GuildConfig", null) .WithMany("DelMsgOnCmdChannels") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() .HasConstraintName("fk_delmsgoncmdchannel_guildconfigs_guildconfigid"); }); @@ -3302,13 +3361,10 @@ namespace EllieBot.Migrations.PostgreSql modelBuilder.Entity("EllieBot.Db.Models.ExcludedItem", b => { - b.HasOne("EllieBot.Db.Models.XpSettings", "XpSettings") + b.HasOne("EllieBot.Db.Models.XpSettings", null) .WithMany("ExclusionList") .HasForeignKey("XpSettingsId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_excludeditem_xpsettings_xpsettingsid"); - - b.Navigation("XpSettings"); }); modelBuilder.Entity("EllieBot.Db.Models.FeedSub", b => @@ -3328,7 +3384,6 @@ namespace EllieBot.Migrations.PostgreSql b.HasOne("EllieBot.Db.Models.GuildConfig", null) .WithMany("FilterInvitesChannelIds") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_filterchannelid_guildconfigs_guildconfigid"); }); @@ -3337,7 +3392,6 @@ namespace EllieBot.Migrations.PostgreSql b.HasOne("EllieBot.Db.Models.GuildConfig", null) .WithMany("FilterLinksChannelIds") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_filterlinkschannelid_guildconfigs_guildconfigid"); }); @@ -3346,7 +3400,6 @@ namespace EllieBot.Migrations.PostgreSql b.HasOne("EllieBot.Db.Models.GuildConfig", null) .WithMany("FilterWordsChannelIds") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_filterwordschannelid_guildconfigs_guildconfigid"); }); @@ -3355,7 +3408,6 @@ namespace EllieBot.Migrations.PostgreSql b.HasOne("EllieBot.Db.Models.GuildConfig", null) .WithMany("FilteredWords") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_filteredword_guildconfigs_guildconfigid"); }); @@ -3364,7 +3416,6 @@ namespace EllieBot.Migrations.PostgreSql b.HasOne("EllieBot.Db.Models.GuildConfig", null) .WithMany("FollowedStreams") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_followedstream_guildconfigs_guildconfigid"); }); @@ -3373,7 +3424,6 @@ namespace EllieBot.Migrations.PostgreSql b.HasOne("EllieBot.Db.Models.GuildConfig", "GuildConfig") .WithMany("GenerateCurrencyChannelIds") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_gcchannelid_guildconfigs_guildconfigid"); b.Navigation("GuildConfig"); @@ -3413,12 +3463,21 @@ namespace EllieBot.Migrations.PostgreSql b.Navigation("LogSetting"); }); + modelBuilder.Entity("EllieBot.Db.Models.IgnoredVoicePresenceChannel", b => + { + b.HasOne("EllieBot.Db.Models.LogSetting", "LogSetting") + .WithMany() + .HasForeignKey("LogSettingId") + .HasConstraintName("fk_ignoredvoicepresencechannels_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"); }); @@ -3427,7 +3486,6 @@ namespace EllieBot.Migrations.PostgreSql b.HasOne("EllieBot.Db.Models.GuildConfig", null) .WithMany("Permissions") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_permissions_guildconfigs_guildconfigid"); }); @@ -3445,7 +3503,6 @@ namespace EllieBot.Migrations.PostgreSql b.HasOne("EllieBot.Db.Models.GuildConfig", null) .WithMany("ShopEntries") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_shopentry_guildconfigs_guildconfigid"); }); @@ -3454,7 +3511,6 @@ namespace EllieBot.Migrations.PostgreSql b.HasOne("EllieBot.Db.Models.ShopEntry", null) .WithMany("Items") .HasForeignKey("ShopEntryId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_shopentryitem_shopentry_shopentryid"); }); @@ -3463,7 +3519,6 @@ namespace EllieBot.Migrations.PostgreSql b.HasOne("EllieBot.Db.Models.GuildConfig", null) .WithMany("SlowmodeIgnoredRoles") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_slowmodeignoredrole_guildconfigs_guildconfigid"); }); @@ -3472,20 +3527,15 @@ namespace EllieBot.Migrations.PostgreSql 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") + b.HasOne("EllieBot.Db.Models.StreamRoleSettings", null) .WithMany("Blacklist") .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesett~"); - - b.Navigation("StreamRoleSettings"); + .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~"); }); modelBuilder.Entity("EllieBot.Db.Models.StreamRoleSettings", b => @@ -3502,14 +3552,10 @@ namespace EllieBot.Migrations.PostgreSql modelBuilder.Entity("EllieBot.Db.Models.StreamRoleWhitelistedUser", b => { - b.HasOne("EllieBot.Db.Models.StreamRoleSettings", "StreamRoleSettings") + b.HasOne("EllieBot.Db.Models.StreamRoleSettings", null) .WithMany("Whitelist") .HasForeignKey("StreamRoleSettingsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesett~"); - - b.Navigation("StreamRoleSettings"); + .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~"); }); modelBuilder.Entity("EllieBot.Db.Models.TodoModel", b => @@ -3526,7 +3572,6 @@ namespace EllieBot.Migrations.PostgreSql b.HasOne("EllieBot.Db.Models.GuildConfig", null) .WithMany("UnbanTimer") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_unbantimer_guildconfigs_guildconfigid"); }); @@ -3535,7 +3580,6 @@ namespace EllieBot.Migrations.PostgreSql b.HasOne("EllieBot.Db.Models.GuildConfig", null) .WithMany("UnmuteTimers") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_unmutetimer_guildconfigs_guildconfigid"); }); @@ -3544,7 +3588,6 @@ namespace EllieBot.Migrations.PostgreSql b.HasOne("EllieBot.Db.Models.GuildConfig", null) .WithMany("UnroleTimer") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_unroletimer_guildconfigs_guildconfigid"); }); @@ -3553,7 +3596,6 @@ namespace EllieBot.Migrations.PostgreSql b.HasOne("EllieBot.Db.Models.GuildConfig", null) .WithMany("VcRoleInfos") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_vcroleinfo_guildconfigs_guildconfigid"); }); @@ -3624,7 +3666,6 @@ namespace EllieBot.Migrations.PostgreSql b.HasOne("EllieBot.Db.Models.GuildConfig", null) .WithMany("WarnPunishments") .HasForeignKey("GuildConfigId") - .OnDelete(DeleteBehavior.Cascade) .HasConstraintName("fk_warningpunishment_guildconfigs_guildconfigid"); }); diff --git a/src/EllieBot/Migrations/Mysql/20240502233216_v5.cs b/src/EllieBot/Migrations/Mysql/20240502233216_v5.cs new file mode 100644 index 0000000..4ed5d52 --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20240502233216_v5.cs @@ -0,0 +1,1615 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + /// + public partial class v5 : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "nsfwblacklistedtags"); + + migrationBuilder.DropTable( + name: "pollanswer"); + + migrationBuilder.DropTable( + name: "pollvote"); + + migrationBuilder.DropTable( + name: "poll"); + + migrationBuilder.DropUniqueConstraint( + name: "ak_clubs_name", + table: "clubs"); + + migrationBuilder.AlterColumn( + name: "id", + table: "xpshopowneditem", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "xpsettings", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "xprolereward", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "xpcurrencyreward", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "warnings", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "warningpunishment", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "waifuupdates", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "waifuitem", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "waifuinfo", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "vcroleinfo", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "userxpstats", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "unroletimer", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "unmutetimer", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "unbantimer", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "streamrolewhitelisteduser", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "streamrolesettings", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "streamroleblacklisteduser", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "streamonlinemessages", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "slowmodeignoreduser", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "slowmodeignoredrole", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "shopentryitem", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "shopentry", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AddColumn( + name: "command", + table: "shopentry", + type: "longtext", + nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "id", + table: "selfassignableroles", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "rotatingstatus", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "rewardedusers", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "repeaters", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "reminders", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AddColumn( + name: "type", + table: "reminders", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.AlterColumn( + name: "id", + table: "reactionroles", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "quotes", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "playlistsong", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "plantedcurrency", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "permissions", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "userid", + table: "patrons", + type: "bigint unsigned", + nullable: false, + oldClrType: typeof(ulong), + oldType: "bigint unsigned") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "muteduserid", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "musicplaylists", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "musicplayersettings", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "logsettings", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "imageonlychannels", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "ignoredvoicepresencechannels", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "ignoredlogchannels", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "guildconfigs", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AddColumn( + name: "stickyroles", + table: "guildconfigs", + type: "tinyint(1)", + nullable: false, + defaultValue: false); + + migrationBuilder.AlterColumn( + name: "id", + table: "groupname", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "gcchannelid", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "gamblingstats", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "followedstream", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "filterwordschannelid", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "filterlinkschannelid", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "filteredword", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "filterchannelid", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "feedsub", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "expressions", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "excludeditem", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "discorduser", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "discordpermoverrides", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "delmsgoncmdchannel", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "currencytransactions", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "commandcooldown", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "commandalias", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "name", + table: "clubs", + type: "varchar(20)", + maxLength: 20, + nullable: true, + collation: "utf8mb4_bin", + oldClrType: typeof(string), + oldType: "varchar(20)", + oldMaxLength: 20, + oldCollation: "utf8mb4_bin") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "id", + table: "clubs", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "blacklist", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "bantemplates", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "bankusers", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "autotranslateusers", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "autotranslatechannels", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "autopublishchannel", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "autocommands", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "antispamsetting", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "antispamignore", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "antiraidsetting", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "antialtsetting", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.CreateTable( + name: "giveawaymodel", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildid = table.Column(type: "bigint unsigned", nullable: false), + messageid = table.Column(type: "bigint unsigned", nullable: false), + channelid = table.Column(type: "bigint unsigned", nullable: false), + message = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + endsat = table.Column(type: "datetime(6)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_giveawaymodel", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "stickyroles", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + guildid = table.Column(type: "bigint unsigned", nullable: false), + roleids = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + userid = table.Column(type: "bigint unsigned", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_stickyroles", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "todosarchive", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + userid = table.Column(type: "bigint unsigned", nullable: false), + name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("pk_todosarchive", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "giveawayuser", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + giveawayid = table.Column(type: "int", nullable: false), + userid = table.Column(type: "bigint unsigned", nullable: false), + name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("pk_giveawayuser", x => x.id); + table.ForeignKey( + name: "fk_giveawayuser_giveawaymodel_giveawayid", + column: x => x.giveawayid, + principalTable: "giveawaymodel", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "todos", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + userid = table.Column(type: "bigint unsigned", nullable: false), + todo = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + dateadded = table.Column(type: "datetime(6)", nullable: false), + isdone = table.Column(type: "tinyint(1)", nullable: false), + archiveid = table.Column(type: "int", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_todos", x => x.id); + table.ForeignKey( + name: "fk_todos_todosarchive_archiveid", + column: x => x.archiveid, + principalTable: "todosarchive", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "ix_clubs_name", + table: "clubs", + column: "name", + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_giveawayuser_giveawayid_userid", + table: "giveawayuser", + columns: new[] { "giveawayid", "userid" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_stickyroles_guildid_userid", + table: "stickyroles", + columns: new[] { "guildid", "userid" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_todos_archiveid", + table: "todos", + column: "archiveid"); + + migrationBuilder.CreateIndex( + name: "ix_todos_userid", + table: "todos", + column: "userid"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "giveawayuser"); + + migrationBuilder.DropTable( + name: "stickyroles"); + + migrationBuilder.DropTable( + name: "todos"); + + migrationBuilder.DropTable( + name: "giveawaymodel"); + + migrationBuilder.DropTable( + name: "todosarchive"); + + migrationBuilder.DropIndex( + name: "ix_clubs_name", + table: "clubs"); + + migrationBuilder.DropColumn( + name: "command", + table: "shopentry"); + + migrationBuilder.DropColumn( + name: "type", + table: "reminders"); + + migrationBuilder.DropColumn( + name: "stickyroles", + table: "guildconfigs"); + + migrationBuilder.AlterColumn( + name: "id", + table: "xpshopowneditem", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "xpsettings", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "xprolereward", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "xpcurrencyreward", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "warnings", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "warningpunishment", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "waifuupdates", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "waifuitem", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "waifuinfo", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "vcroleinfo", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "userxpstats", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "unroletimer", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "unmutetimer", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "unbantimer", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "streamrolewhitelisteduser", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "streamrolesettings", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "streamroleblacklisteduser", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "streamonlinemessages", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "slowmodeignoreduser", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "slowmodeignoredrole", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "shopentryitem", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "shopentry", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "selfassignableroles", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "rotatingstatus", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "rewardedusers", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "repeaters", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "reminders", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "reactionroles", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "quotes", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "playlistsong", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "plantedcurrency", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "permissions", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "userid", + table: "patrons", + type: "bigint unsigned", + nullable: false, + oldClrType: typeof(ulong), + oldType: "bigint unsigned") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "muteduserid", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "musicplaylists", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "musicplayersettings", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "logsettings", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "imageonlychannels", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "ignoredvoicepresencechannels", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "ignoredlogchannels", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "guildconfigs", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "groupname", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "gcchannelid", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "gamblingstats", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "followedstream", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "filterwordschannelid", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "filterlinkschannelid", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "filteredword", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "filterchannelid", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "feedsub", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "expressions", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "excludeditem", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "discorduser", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "discordpermoverrides", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "delmsgoncmdchannel", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "currencytransactions", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "commandcooldown", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "commandalias", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.UpdateData( + table: "clubs", + keyColumn: "name", + keyValue: null, + column: "name", + value: ""); + + migrationBuilder.AlterColumn( + name: "name", + table: "clubs", + type: "varchar(20)", + maxLength: 20, + nullable: false, + collation: "utf8mb4_bin", + oldClrType: typeof(string), + oldType: "varchar(20)", + oldMaxLength: 20, + oldNullable: true, + oldCollation: "utf8mb4_bin") + .Annotation("MySql:CharSet", "utf8mb4") + .OldAnnotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.AlterColumn( + name: "id", + table: "clubs", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "blacklist", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "bantemplates", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "bankusers", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "autotranslateusers", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "autotranslatechannels", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "autopublishchannel", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "autocommands", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "antispamsetting", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "antispamignore", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "antiraidsetting", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + name: "id", + table: "antialtsetting", + type: "int", + nullable: false, + oldClrType: typeof(int), + oldType: "int") + .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AddUniqueConstraint( + name: "ak_clubs_name", + table: "clubs", + column: "name"); + + migrationBuilder.CreateTable( + name: "nsfwblacklistedtags", + columns: table => new + { + id = table.Column(type: "int", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true), + guildid = table.Column(type: "bigint unsigned", nullable: false), + tag = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("pk_nsfwblacklistedtags", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "poll", + columns: table => new + { + id = table.Column(type: "int", nullable: false), + channelid = table.Column(type: "bigint unsigned", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true), + guildid = table.Column(type: "bigint unsigned", nullable: false), + question = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("pk_poll", x => x.id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "pollanswer", + columns: table => new + { + id = table.Column(type: "int", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true), + index = table.Column(type: "int", nullable: false), + pollid = table.Column(type: "int", nullable: true), + text = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("pk_pollanswer", x => x.id); + table.ForeignKey( + name: "fk_pollanswer_poll_pollid", + column: x => x.pollid, + principalTable: "poll", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "pollvote", + columns: table => new + { + id = table.Column(type: "int", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true), + pollid = table.Column(type: "int", nullable: true), + userid = table.Column(type: "bigint unsigned", nullable: false), + voteindex = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_pollvote", x => x.id); + table.ForeignKey( + name: "fk_pollvote_poll_pollid", + column: x => x.pollid, + principalTable: "poll", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "ix_nsfwblacklistedtags_guildid", + table: "nsfwblacklistedtags", + column: "guildid"); + + migrationBuilder.CreateIndex( + name: "ix_poll_guildid", + table: "poll", + column: "guildid", + unique: true); + + migrationBuilder.CreateIndex( + name: "ix_pollanswer_pollid", + table: "pollanswer", + column: "pollid"); + + migrationBuilder.CreateIndex( + name: "ix_pollvote_pollid", + table: "pollvote", + column: "pollid"); + } + } +} diff --git a/src/EllieBot/Migrations/PostgreSql/20240611180506_remove-patron-limits.Designer.cs b/src/EllieBot/Migrations/Mysql/20240518221440_guidlconfig-cleanup.Designer.cs similarity index 73% rename from src/EllieBot/Migrations/PostgreSql/20240611180506_remove-patron-limits.Designer.cs rename to src/EllieBot/Migrations/Mysql/20240518221440_guidlconfig-cleanup.Designer.cs index 18a4651..aa5e2cb 100644 --- a/src/EllieBot/Migrations/PostgreSql/20240611180506_remove-patron-limits.Designer.cs +++ b/src/EllieBot/Migrations/Mysql/20240518221440_guidlconfig-cleanup.Designer.cs @@ -2,18 +2,18 @@ using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using EllieBot.Db; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable -namespace EllieBot.Migrations.PostgreSql +namespace EllieBot.Migrations.Mysql { - [DbContext(typeof(PostgreSqlContext))] - [Migration("20240611180506_remove-patron-limits")] - partial class removepatronlimits + [DbContext(typeof(MysqlContext))] + [Migration("20240518221440_guidlconfig-cleanup")] + partial class guidlconfigcleanup { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -21,37 +21,37 @@ namespace EllieBot.Migrations.PostgreSql #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "8.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 63); + .HasAnnotation("Relational:MaxIdentifierLength", 64); - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Action") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("action"); b.Property("ActionDurationMinutes") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("actiondurationminutes"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("MinAge") - .HasColumnType("interval") + .HasColumnType("time(6)") .HasColumnName("minage"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.HasKey("Id") @@ -68,33 +68,33 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Action") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("action"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("PunishDuration") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("punishduration"); b.Property("Seconds") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("seconds"); b.Property("UserThreshold") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("userthreshold"); b.HasKey("Id") @@ -111,21 +111,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AntiSpamSettingId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("antispamsettingid"); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.HasKey("Id") @@ -141,33 +141,33 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Action") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("action"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("MessageThreshold") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("messagethreshold"); b.Property("MuteTime") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("mutetime"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.HasKey("Id") @@ -184,17 +184,17 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -207,45 +207,45 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("ChannelName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("channelname"); b.Property("CommandText") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("commandtext"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("GuildName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("guildname"); b.Property("Interval") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("interval"); - b.Property("VoiceChannelId") - .HasColumnType("numeric(20,0)") + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("voicechannelid"); b.Property("VoiceChannelName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("voicechannelname"); b.HasKey("Id") @@ -258,21 +258,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.HasKey("Id") @@ -289,25 +289,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AutoDelete") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("autodelete"); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.HasKey("Id") @@ -327,29 +327,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("ChannelId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Source") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("source"); b.Property("Target") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("target"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -365,25 +365,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("PruneDays") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("prunedays"); b.Property("Text") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("text"); b.HasKey("Id") @@ -400,21 +400,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Balance") .HasColumnType("bigint") .HasColumnName("balance"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -431,21 +431,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("ItemId") - .HasColumnType("numeric(20,0)") + b.Property("ItemId") + .HasColumnType("bigint unsigned") .HasColumnName("itemid"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); b.HasKey("Id") @@ -457,11 +457,11 @@ namespace EllieBot.Migrations.PostgreSql modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => { b.Property("ClubId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("clubid"); b.Property("UserId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("userid"); b.HasKey("ClubId", "UserId") @@ -476,11 +476,11 @@ namespace EllieBot.Migrations.PostgreSql modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => { b.Property("ClubId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("clubid"); b.Property("UserId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("userid"); b.HasKey("ClubId", "UserId") @@ -496,34 +496,35 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Description") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("description"); b.Property("ImageUrl") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("imageurl"); b.Property("Name") .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("name"); + .HasColumnType("varchar(20)") + .HasColumnName("name") + .UseCollation("utf8mb4_bin"); b.Property("OwnerId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("ownerid"); b.Property("Xp") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("xp"); b.HasKey("Id") @@ -544,25 +545,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Mapping") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("mapping"); b.Property("Trigger") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("trigger"); b.HasKey("Id") @@ -578,25 +579,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("CommandName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("commandname"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Seconds") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("seconds"); b.HasKey("Id") @@ -612,41 +613,41 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Amount") .HasColumnType("bigint") .HasColumnName("amount"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Extra") .IsRequired() - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("extra"); b.Property("Note") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("note"); - b.Property("OtherId") + b.Property("OtherId") .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") + .HasColumnType("bigint unsigned") .HasColumnName("otherid") .HasDefaultValueSql("NULL"); b.Property("Type") .IsRequired() - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("type"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -662,25 +663,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("State") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("state"); b.HasKey("Id") @@ -696,25 +697,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Command") - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("command"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); - b.Property("Perm") - .HasColumnType("numeric(20,0)") + b.Property("Perm") + .HasColumnType("bigint unsigned") .HasColumnName("perm"); b.HasKey("Id") @@ -731,17 +732,17 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AvatarId") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("avatarid"); b.Property("ClubId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("clubid"); b.Property("CurrencyAmount") @@ -751,22 +752,22 @@ namespace EllieBot.Migrations.PostgreSql .HasColumnName("currencyamount"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Discriminator") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("discriminator"); b.Property("IsClubAdmin") .ValueGeneratedOnAdd() - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasDefaultValue(false) .HasColumnName("isclubadmin"); b.Property("NotifyOnLevelUp") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasDefaultValue(0) .HasColumnName("notifyonlevelup"); @@ -776,12 +777,12 @@ namespace EllieBot.Migrations.PostgreSql .HasDefaultValue(0L) .HasColumnName("totalxp"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("Username") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("username"); b.HasKey("Id") @@ -809,25 +810,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("ItemId") - .HasColumnType("numeric(20,0)") + b.Property("ItemId") + .HasColumnType("bigint unsigned") .HasColumnName("itemid"); b.Property("ItemType") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("itemtype"); b.Property("XpSettingsId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("xpsettingsid"); b.HasKey("Id") @@ -843,30 +844,30 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Message") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("message"); b.Property("Url") .IsRequired() - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("url"); b.HasKey("Id") @@ -882,21 +883,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.HasKey("Id") @@ -912,21 +913,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.HasKey("Id") @@ -942,21 +943,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.HasKey("Id") @@ -972,21 +973,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Word") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("word"); b.HasKey("Id") @@ -1002,37 +1003,37 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Message") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("message"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); b.Property("Username") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("username"); b.HasKey("Id") @@ -1048,21 +1049,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.HasKey("Id") @@ -1078,25 +1079,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Bet") - .HasColumnType("numeric") + .HasColumnType("decimal(65,30)") .HasColumnName("bet"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Feature") - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("feature"); b.Property("PaidOut") - .HasColumnType("numeric") + .HasColumnType("decimal(65,30)") .HasColumnName("paidout"); b.HasKey("Id") @@ -1113,29 +1114,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("EndsAt") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("endsat"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Message") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("message"); - b.Property("MessageId") - .HasColumnType("numeric(20,0)") + b.Property("MessageId") + .HasColumnType("bigint unsigned") .HasColumnName("messageid"); b.HasKey("Id") @@ -1148,21 +1149,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("GiveawayId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("giveawayid"); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -1179,25 +1180,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); b.Property("Number") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("number"); b.HasKey("Id") @@ -1214,167 +1215,167 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AutoAssignRoleIds") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("autoassignroleids"); b.Property("AutoDeleteByeMessagesTimer") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("autodeletebyemessagestimer"); b.Property("AutoDeleteGreetMessagesTimer") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("autodeletegreetmessagestimer"); b.Property("AutoDeleteSelfAssignedRoleMessages") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("autodeleteselfassignedrolemessages"); b.Property("BoostMessage") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("boostmessage"); - b.Property("BoostMessageChannelId") - .HasColumnType("numeric(20,0)") + b.Property("BoostMessageChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("boostmessagechannelid"); b.Property("BoostMessageDeleteAfter") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("boostmessagedeleteafter"); - b.Property("ByeMessageChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ByeMessageChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("byemessagechannelid"); b.Property("ChannelByeMessageText") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("channelbyemessagetext"); b.Property("ChannelGreetMessageText") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("channelgreetmessagetext"); b.Property("CleverbotEnabled") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("cleverbotenabled"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("DeleteMessageOnCommand") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("deletemessageoncommand"); b.Property("DeleteStreamOnlineMessage") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("deletestreamonlinemessage"); b.Property("DisableGlobalExpressions") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("disableglobalexpressions"); b.Property("DmGreetMessageText") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("dmgreetmessagetext"); b.Property("ExclusiveSelfAssignedRoles") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("exclusiveselfassignedroles"); b.Property("FilterInvites") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("filterinvites"); b.Property("FilterLinks") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("filterlinks"); b.Property("FilterWords") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("filterwords"); - b.Property("GameVoiceChannel") - .HasColumnType("numeric(20,0)") + b.Property("GameVoiceChannel") + .HasColumnType("bigint unsigned") .HasColumnName("gamevoicechannel"); - b.Property("GreetMessageChannelId") - .HasColumnType("numeric(20,0)") + b.Property("GreetMessageChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("greetmessagechannelid"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Locale") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("locale"); b.Property("MuteRoleName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("muterolename"); b.Property("NotifyStreamOffline") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("notifystreamoffline"); b.Property("PermissionRole") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("permissionrole"); b.Property("Prefix") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("prefix"); b.Property("SendBoostMessage") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("sendboostmessage"); b.Property("SendChannelByeMessage") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("sendchannelbyemessage"); b.Property("SendChannelGreetMessage") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("sendchannelgreetmessage"); b.Property("SendDmGreetMessage") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("senddmgreetmessage"); b.Property("StickyRoles") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("stickyroles"); b.Property("TimeZoneId") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("timezoneid"); b.Property("VerboseErrors") .ValueGeneratedOnAdd() - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasDefaultValue(true) .HasColumnName("verboseerrors"); b.Property("VerbosePermissions") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("verbosepermissions"); b.Property("WarnExpireAction") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("warnexpireaction"); b.Property("WarnExpireHours") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("warnexpirehours"); b.Property("WarningsInitialized") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("warningsinitialized"); b.HasKey("Id") @@ -1394,25 +1395,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("ItemType") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("itemtype"); - b.Property("LogItemId") - .HasColumnType("numeric(20,0)") + b.Property("LogItemId") + .HasColumnType("bigint unsigned") .HasColumnName("logitemid"); b.Property("LogSettingId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("logsettingid"); b.HasKey("Id") @@ -1429,25 +1430,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); b.HasKey("Id") @@ -1464,89 +1465,89 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelCreatedId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelCreatedId") + .HasColumnType("bigint unsigned") .HasColumnName("channelcreatedid"); - b.Property("ChannelDestroyedId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelDestroyedId") + .HasColumnType("bigint unsigned") .HasColumnName("channeldestroyedid"); - b.Property("ChannelUpdatedId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelUpdatedId") + .HasColumnType("bigint unsigned") .HasColumnName("channelupdatedid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); - b.Property("LogOtherId") - .HasColumnType("numeric(20,0)") + b.Property("LogOtherId") + .HasColumnType("bigint unsigned") .HasColumnName("logotherid"); - b.Property("LogUserPresenceId") - .HasColumnType("numeric(20,0)") + b.Property("LogUserPresenceId") + .HasColumnType("bigint unsigned") .HasColumnName("loguserpresenceid"); - b.Property("LogVoicePresenceId") - .HasColumnType("numeric(20,0)") + b.Property("LogVoicePresenceId") + .HasColumnType("bigint unsigned") .HasColumnName("logvoicepresenceid"); - b.Property("LogVoicePresenceTTSId") - .HasColumnType("numeric(20,0)") + b.Property("LogVoicePresenceTTSId") + .HasColumnType("bigint unsigned") .HasColumnName("logvoicepresencettsid"); - b.Property("LogWarnsId") - .HasColumnType("numeric(20,0)") + b.Property("LogWarnsId") + .HasColumnType("bigint unsigned") .HasColumnName("logwarnsid"); - b.Property("MessageDeletedId") - .HasColumnType("numeric(20,0)") + b.Property("MessageDeletedId") + .HasColumnType("bigint unsigned") .HasColumnName("messagedeletedid"); - b.Property("MessageUpdatedId") - .HasColumnType("numeric(20,0)") + b.Property("MessageUpdatedId") + .HasColumnType("bigint unsigned") .HasColumnName("messageupdatedid"); - b.Property("ThreadCreatedId") - .HasColumnType("numeric(20,0)") + b.Property("ThreadCreatedId") + .HasColumnType("bigint unsigned") .HasColumnName("threadcreatedid"); - b.Property("ThreadDeletedId") - .HasColumnType("numeric(20,0)") + b.Property("ThreadDeletedId") + .HasColumnType("bigint unsigned") .HasColumnName("threaddeletedid"); - b.Property("UserBannedId") - .HasColumnType("numeric(20,0)") + b.Property("UserBannedId") + .HasColumnType("bigint unsigned") .HasColumnName("userbannedid"); - b.Property("UserJoinedId") - .HasColumnType("numeric(20,0)") + b.Property("UserJoinedId") + .HasColumnType("bigint unsigned") .HasColumnName("userjoinedid"); - b.Property("UserLeftId") - .HasColumnType("numeric(20,0)") + b.Property("UserLeftId") + .HasColumnType("bigint unsigned") .HasColumnName("userleftid"); - b.Property("UserMutedId") - .HasColumnType("numeric(20,0)") + b.Property("UserMutedId") + .HasColumnType("bigint unsigned") .HasColumnName("usermutedid"); - b.Property("UserUnbannedId") - .HasColumnType("numeric(20,0)") + b.Property("UserUnbannedId") + .HasColumnType("bigint unsigned") .HasColumnName("userunbannedid"); - b.Property("UserUpdatedId") - .HasColumnType("numeric(20,0)") + b.Property("UserUpdatedId") + .HasColumnType("bigint unsigned") .HasColumnName("userupdatedid"); b.HasKey("Id") @@ -1563,38 +1564,38 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AutoDisconnect") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("autodisconnect"); b.Property("AutoPlay") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("autoplay"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); - b.Property("MusicChannelId") - .HasColumnType("numeric(20,0)") + b.Property("MusicChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("musicchannelid"); b.Property("PlayerRepeat") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("playerrepeat"); b.Property("QualityPreset") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("qualitypreset"); b.Property("Volume") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasDefaultValue(100) .HasColumnName("volume"); @@ -1612,25 +1613,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Author") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("author"); - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") + b.Property("AuthorId") + .HasColumnType("bigint unsigned") .HasColumnName("authorid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); b.HasKey("Id") @@ -1643,21 +1644,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -1669,49 +1670,49 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("muteduserid", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => + modelBuilder.Entity("EllieBot.Db.Models.NadekoExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AllowTarget") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("allowtarget"); b.Property("AutoDeleteTrigger") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("autodeletetrigger"); b.Property("ContainsAnywhere") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("containsanywhere"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("DmResponse") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("dmresponse"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Reactions") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("reactions"); b.Property("Response") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("response"); b.Property("Trigger") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("trigger"); b.HasKey("Id") @@ -1720,27 +1721,64 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("expressions", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => + modelBuilder.Entity("EllieBot.Db.Models.PatronQuota", b => { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); + b.Property("FeatureType") + .HasColumnType("int") + .HasColumnName("featuretype"); + + b.Property("Feature") + .HasColumnType("varchar(255)") + .HasColumnName("feature"); + + b.Property("DailyCount") + .HasColumnType("int unsigned") + .HasColumnName("dailycount"); + + b.Property("HourlyCount") + .HasColumnType("int unsigned") + .HasColumnName("hourlycount"); + + b.Property("MonthlyCount") + .HasColumnType("int unsigned") + .HasColumnName("monthlycount"); + + b.HasKey("UserId", "FeatureType", "Feature") + .HasName("pk_patronquotas"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_patronquotas_userid"); + + b.ToTable("patronquotas", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => + { + b.Property("UserId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("UserId")); + b.Property("AmountCents") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("amountcents"); b.Property("LastCharge") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("lastcharge"); b.Property("UniquePlatformUserId") - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("uniqueplatformuserid"); b.Property("ValidThru") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("validthru"); b.HasKey("UserId") @@ -1757,45 +1795,45 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Index") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("index"); b.Property("IsCustomCommand") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("iscustomcommand"); b.Property("PrimaryTarget") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("primarytarget"); - b.Property("PrimaryTargetId") - .HasColumnType("numeric(20,0)") + b.Property("PrimaryTargetId") + .HasColumnType("bigint unsigned") .HasColumnName("primarytargetid"); b.Property("SecondaryTarget") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("secondarytarget"); b.Property("SecondaryTargetName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("secondarytargetname"); b.Property("State") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("state"); b.HasKey("Id") @@ -1811,37 +1849,37 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Amount") .HasColumnType("bigint") .HasColumnName("amount"); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); - b.Property("MessageId") - .HasColumnType("numeric(20,0)") + b.Property("MessageId") + .HasColumnType("bigint unsigned") .HasColumnName("messageid"); b.Property("Password") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("password"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -1861,37 +1899,37 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("MusicPlaylistId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("musicplaylistid"); b.Property("Provider") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("provider"); b.Property("ProviderType") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("providertype"); b.Property("Query") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("query"); b.Property("Title") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("title"); b.Property("Uri") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("uri"); b.HasKey("Id") @@ -1907,36 +1945,36 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") + b.Property("AuthorId") + .HasColumnType("bigint unsigned") .HasColumnName("authorid"); b.Property("AuthorName") .IsRequired() - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("authorname"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Keyword") .IsRequired() - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("keyword"); b.Property("Text") .IsRequired() - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("text"); b.HasKey("Id") @@ -1955,42 +1993,42 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Emote") .HasMaxLength(100) - .HasColumnType("character varying(100)") + .HasColumnType("varchar(100)") .HasColumnName("emote"); b.Property("Group") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("group"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("LevelReq") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("levelreq"); - b.Property("MessageId") - .HasColumnType("numeric(20,0)") + b.Property("MessageId") + .HasColumnType("bigint unsigned") .HasColumnName("messageid"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.HasKey("Id") @@ -2010,41 +2048,41 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("IsPrivate") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("isprivate"); b.Property("Message") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("message"); - b.Property("ServerId") - .HasColumnType("numeric(20,0)") + b.Property("ServerId") + .HasColumnType("bigint unsigned") .HasColumnName("serverid"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("When") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("when"); b.HasKey("Id") @@ -2060,41 +2098,41 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Interval") - .HasColumnType("interval") + .HasColumnType("time(6)") .HasColumnName("interval"); - b.Property("LastMessageId") - .HasColumnType("numeric(20,0)") + b.Property("LastMessageId") + .HasColumnType("bigint unsigned") .HasColumnName("lastmessageid"); b.Property("Message") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("message"); b.Property("NoRedundant") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("noredundant"); b.Property("StartTimeOfDay") - .HasColumnType("interval") + .HasColumnType("time(6)") .HasColumnName("starttimeofday"); b.HasKey("Id") @@ -2107,29 +2145,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AmountRewardedThisMonth") .HasColumnType("bigint") .HasColumnName("amountrewardedthismonth"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("LastReward") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("lastreward"); b.Property("PlatformUserId") - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("platformuserid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2146,21 +2184,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Status") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("status"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); b.HasKey("Id") @@ -2173,31 +2211,31 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Group") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasDefaultValue(0) .HasColumnName("group"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("LevelRequirement") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("levelrequirement"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.HasKey("Id") @@ -2214,53 +2252,53 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") + b.Property("AuthorId") + .HasColumnType("bigint unsigned") .HasColumnName("authorid"); b.Property("Command") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("command"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Index") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("index"); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); b.Property("Price") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("price"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.Property("RoleName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("rolename"); - b.Property("RoleRequirement") - .HasColumnType("numeric(20,0)") + b.Property("RoleRequirement") + .HasColumnType("bigint unsigned") .HasColumnName("rolerequirement"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); b.HasKey("Id") @@ -2276,21 +2314,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("ShopEntryId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("shopentryid"); b.Property("Text") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("text"); b.HasKey("Id") @@ -2306,21 +2344,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.HasKey("Id") @@ -2336,21 +2374,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2366,25 +2404,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("RoleIds") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("roleids"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2401,29 +2439,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("MessageId") - .HasColumnType("numeric(20,0)") + b.Property("MessageId") + .HasColumnType("bigint unsigned") .HasColumnName("messageid"); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); b.HasKey("Id") @@ -2436,25 +2474,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("StreamRoleSettingsId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("streamrolesettingsid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("Username") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("username"); b.HasKey("Id") @@ -2470,33 +2508,33 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("AddRoleId") - .HasColumnType("numeric(20,0)") + b.Property("AddRoleId") + .HasColumnType("bigint unsigned") .HasColumnName("addroleid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Enabled") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("enabled"); - b.Property("FromRoleId") - .HasColumnType("numeric(20,0)") + b.Property("FromRoleId") + .HasColumnType("bigint unsigned") .HasColumnName("fromroleid"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Keyword") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("keyword"); b.HasKey("Id") @@ -2513,25 +2551,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("StreamRoleSettingsId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("streamrolesettingsid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("Username") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("username"); b.HasKey("Id") @@ -2547,29 +2585,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("ArchiveId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("archiveid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("IsDone") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("isdone"); b.Property("Todo") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("todo"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2588,25 +2626,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("UnbanAt") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("unbanat"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2622,25 +2660,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("UnmuteAt") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("unmuteat"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2656,29 +2694,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.Property("UnbanAt") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("unbanat"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2694,29 +2732,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AwardedXp") .HasColumnType("bigint") .HasColumnName("awardedxp"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("NotifyOnLevelUp") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("notifyonlevelup"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("Xp") @@ -2749,25 +2787,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); - b.Property("VoiceChannelId") - .HasColumnType("numeric(20,0)") + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("voicechannelid"); b.HasKey("Id") @@ -2783,21 +2821,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AffinityId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("affinityid"); b.Property("ClaimerId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("claimerid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Price") @@ -2805,7 +2843,7 @@ namespace EllieBot.Migrations.PostgreSql .HasColumnName("price"); b.Property("WaifuId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("waifuid"); b.HasKey("Id") @@ -2831,25 +2869,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("ItemEmoji") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("itememoji"); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); b.Property("WaifuInfoId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("waifuinfoid"); b.HasKey("Id") @@ -2865,29 +2903,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("NewId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("newid"); b.Property("OldId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("oldid"); b.Property("UpdateType") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("updatetype"); b.Property("UserId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("userid"); b.HasKey("Id") @@ -2909,37 +2947,37 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Forgiven") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("forgiven"); b.Property("ForgivenBy") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("forgivenby"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Moderator") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("moderator"); b.Property("Reason") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("reason"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("Weight") @@ -2967,33 +3005,33 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Count") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("count"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Punishment") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("punishment"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.Property("Time") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("time"); b.HasKey("Id") @@ -3009,25 +3047,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Amount") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("amount"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Level") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("level"); b.Property("XpSettingsId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("xpsettingsid"); b.HasKey("Id") @@ -3043,29 +3081,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Level") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("level"); b.Property("Remove") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("remove"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.Property("XpSettingsId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("xpsettingsid"); b.HasKey("Id") @@ -3082,21 +3120,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("ServerExcluded") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("serverexcluded"); b.HasKey("Id") @@ -3113,30 +3151,30 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("IsUsing") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("isusing"); b.Property("ItemKey") .IsRequired() - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("itemkey"); b.Property("ItemType") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("itemtype"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -3475,7 +3513,7 @@ namespace EllieBot.Migrations.PostgreSql .HasForeignKey("StreamRoleSettingsId") .OnDelete(DeleteBehavior.Cascade) .IsRequired() - .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesett~"); + .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~"); b.Navigation("StreamRoleSettings"); }); @@ -3499,7 +3537,7 @@ namespace EllieBot.Migrations.PostgreSql .HasForeignKey("StreamRoleSettingsId") .OnDelete(DeleteBehavior.Cascade) .IsRequired() - .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesett~"); + .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~"); b.Navigation("StreamRoleSettings"); }); diff --git a/src/EllieBot/Migrations/Mysql/20240518221440_guidlconfig-cleanup.cs b/src/EllieBot/Migrations/Mysql/20240518221440_guidlconfig-cleanup.cs new file mode 100644 index 0000000..89c098d --- /dev/null +++ b/src/EllieBot/Migrations/Mysql/20240518221440_guidlconfig-cleanup.cs @@ -0,0 +1,703 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EllieBot.Migrations.Mysql +{ + /// + public partial class guidlconfigcleanup : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "fk_antiraidsetting_guildconfigs_guildconfigid", + table: "antiraidsetting"); + + migrationBuilder.DropForeignKey( + name: "fk_antispamignore_antispamsetting_antispamsettingid", + table: "antispamignore"); + + migrationBuilder.DropForeignKey( + name: "fk_antispamsetting_guildconfigs_guildconfigid", + table: "antispamsetting"); + + migrationBuilder.DropForeignKey( + name: "fk_commandalias_guildconfigs_guildconfigid", + table: "commandalias"); + + migrationBuilder.DropForeignKey( + name: "fk_commandcooldown_guildconfigs_guildconfigid", + table: "commandcooldown"); + + migrationBuilder.DropForeignKey( + name: "fk_delmsgoncmdchannel_guildconfigs_guildconfigid", + table: "delmsgoncmdchannel"); + + migrationBuilder.DropForeignKey( + name: "fk_excludeditem_xpsettings_xpsettingsid", + table: "excludeditem"); + + migrationBuilder.DropForeignKey( + name: "fk_filterchannelid_guildconfigs_guildconfigid", + table: "filterchannelid"); + + migrationBuilder.DropForeignKey( + name: "fk_filteredword_guildconfigs_guildconfigid", + table: "filteredword"); + + migrationBuilder.DropForeignKey( + name: "fk_filterlinkschannelid_guildconfigs_guildconfigid", + table: "filterlinkschannelid"); + + migrationBuilder.DropForeignKey( + name: "fk_filterwordschannelid_guildconfigs_guildconfigid", + table: "filterwordschannelid"); + + migrationBuilder.DropForeignKey( + name: "fk_followedstream_guildconfigs_guildconfigid", + table: "followedstream"); + + migrationBuilder.DropForeignKey( + name: "fk_gcchannelid_guildconfigs_guildconfigid", + table: "gcchannelid"); + + migrationBuilder.DropForeignKey( + name: "fk_muteduserid_guildconfigs_guildconfigid", + table: "muteduserid"); + + migrationBuilder.DropForeignKey( + name: "fk_permissions_guildconfigs_guildconfigid", + table: "permissions"); + + migrationBuilder.DropForeignKey( + name: "fk_shopentry_guildconfigs_guildconfigid", + table: "shopentry"); + + migrationBuilder.DropForeignKey( + name: "fk_shopentryitem_shopentry_shopentryid", + table: "shopentryitem"); + + migrationBuilder.DropForeignKey( + name: "fk_slowmodeignoredrole_guildconfigs_guildconfigid", + table: "slowmodeignoredrole"); + + migrationBuilder.DropForeignKey( + name: "fk_slowmodeignoreduser_guildconfigs_guildconfigid", + table: "slowmodeignoreduser"); + + migrationBuilder.DropForeignKey( + name: "fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~", + table: "streamroleblacklisteduser"); + + migrationBuilder.DropForeignKey( + name: "fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~", + table: "streamrolewhitelisteduser"); + + migrationBuilder.DropForeignKey( + name: "fk_unbantimer_guildconfigs_guildconfigid", + table: "unbantimer"); + + migrationBuilder.DropForeignKey( + name: "fk_unmutetimer_guildconfigs_guildconfigid", + table: "unmutetimer"); + + migrationBuilder.DropForeignKey( + name: "fk_unroletimer_guildconfigs_guildconfigid", + table: "unroletimer"); + + migrationBuilder.DropForeignKey( + name: "fk_vcroleinfo_guildconfigs_guildconfigid", + table: "vcroleinfo"); + + migrationBuilder.DropForeignKey( + name: "fk_warningpunishment_guildconfigs_guildconfigid", + table: "warningpunishment"); + + migrationBuilder.DropTable( + name: "ignoredvoicepresencechannels"); + + migrationBuilder.AlterColumn( + name: "streamrolesettingsid", + table: "streamrolewhitelisteduser", + type: "int", + nullable: false, + defaultValue: 0, + oldClrType: typeof(int), + oldType: "int", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "streamrolesettingsid", + table: "streamroleblacklisteduser", + type: "int", + nullable: false, + defaultValue: 0, + oldClrType: typeof(int), + oldType: "int", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "guildconfigid", + table: "delmsgoncmdchannel", + type: "int", + nullable: false, + defaultValue: 0, + oldClrType: typeof(int), + oldType: "int", + oldNullable: true); + + migrationBuilder.AddForeignKey( + name: "fk_antiraidsetting_guildconfigs_guildconfigid", + table: "antiraidsetting", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_antispamignore_antispamsetting_antispamsettingid", + table: "antispamignore", + column: "antispamsettingid", + principalTable: "antispamsetting", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_antispamsetting_guildconfigs_guildconfigid", + table: "antispamsetting", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_commandalias_guildconfigs_guildconfigid", + table: "commandalias", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_commandcooldown_guildconfigs_guildconfigid", + table: "commandcooldown", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_delmsgoncmdchannel_guildconfigs_guildconfigid", + table: "delmsgoncmdchannel", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_excludeditem_xpsettings_xpsettingsid", + table: "excludeditem", + column: "xpsettingsid", + principalTable: "xpsettings", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_filterchannelid_guildconfigs_guildconfigid", + table: "filterchannelid", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_filteredword_guildconfigs_guildconfigid", + table: "filteredword", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_filterlinkschannelid_guildconfigs_guildconfigid", + table: "filterlinkschannelid", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_filterwordschannelid_guildconfigs_guildconfigid", + table: "filterwordschannelid", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_followedstream_guildconfigs_guildconfigid", + table: "followedstream", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_gcchannelid_guildconfigs_guildconfigid", + table: "gcchannelid", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_muteduserid_guildconfigs_guildconfigid", + table: "muteduserid", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_permissions_guildconfigs_guildconfigid", + table: "permissions", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_shopentry_guildconfigs_guildconfigid", + table: "shopentry", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_shopentryitem_shopentry_shopentryid", + table: "shopentryitem", + column: "shopentryid", + principalTable: "shopentry", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_slowmodeignoredrole_guildconfigs_guildconfigid", + table: "slowmodeignoredrole", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_slowmodeignoreduser_guildconfigs_guildconfigid", + table: "slowmodeignoreduser", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~", + table: "streamroleblacklisteduser", + column: "streamrolesettingsid", + principalTable: "streamrolesettings", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~", + table: "streamrolewhitelisteduser", + column: "streamrolesettingsid", + principalTable: "streamrolesettings", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_unbantimer_guildconfigs_guildconfigid", + table: "unbantimer", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_unmutetimer_guildconfigs_guildconfigid", + table: "unmutetimer", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_unroletimer_guildconfigs_guildconfigid", + table: "unroletimer", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_vcroleinfo_guildconfigs_guildconfigid", + table: "vcroleinfo", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_warningpunishment_guildconfigs_guildconfigid", + table: "warningpunishment", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "fk_antiraidsetting_guildconfigs_guildconfigid", + table: "antiraidsetting"); + + migrationBuilder.DropForeignKey( + name: "fk_antispamignore_antispamsetting_antispamsettingid", + table: "antispamignore"); + + migrationBuilder.DropForeignKey( + name: "fk_antispamsetting_guildconfigs_guildconfigid", + table: "antispamsetting"); + + migrationBuilder.DropForeignKey( + name: "fk_commandalias_guildconfigs_guildconfigid", + table: "commandalias"); + + migrationBuilder.DropForeignKey( + name: "fk_commandcooldown_guildconfigs_guildconfigid", + table: "commandcooldown"); + + migrationBuilder.DropForeignKey( + name: "fk_delmsgoncmdchannel_guildconfigs_guildconfigid", + table: "delmsgoncmdchannel"); + + migrationBuilder.DropForeignKey( + name: "fk_excludeditem_xpsettings_xpsettingsid", + table: "excludeditem"); + + migrationBuilder.DropForeignKey( + name: "fk_filterchannelid_guildconfigs_guildconfigid", + table: "filterchannelid"); + + migrationBuilder.DropForeignKey( + name: "fk_filteredword_guildconfigs_guildconfigid", + table: "filteredword"); + + migrationBuilder.DropForeignKey( + name: "fk_filterlinkschannelid_guildconfigs_guildconfigid", + table: "filterlinkschannelid"); + + migrationBuilder.DropForeignKey( + name: "fk_filterwordschannelid_guildconfigs_guildconfigid", + table: "filterwordschannelid"); + + migrationBuilder.DropForeignKey( + name: "fk_followedstream_guildconfigs_guildconfigid", + table: "followedstream"); + + migrationBuilder.DropForeignKey( + name: "fk_gcchannelid_guildconfigs_guildconfigid", + table: "gcchannelid"); + + migrationBuilder.DropForeignKey( + name: "fk_muteduserid_guildconfigs_guildconfigid", + table: "muteduserid"); + + migrationBuilder.DropForeignKey( + name: "fk_permissions_guildconfigs_guildconfigid", + table: "permissions"); + + migrationBuilder.DropForeignKey( + name: "fk_shopentry_guildconfigs_guildconfigid", + table: "shopentry"); + + migrationBuilder.DropForeignKey( + name: "fk_shopentryitem_shopentry_shopentryid", + table: "shopentryitem"); + + migrationBuilder.DropForeignKey( + name: "fk_slowmodeignoredrole_guildconfigs_guildconfigid", + table: "slowmodeignoredrole"); + + migrationBuilder.DropForeignKey( + name: "fk_slowmodeignoreduser_guildconfigs_guildconfigid", + table: "slowmodeignoreduser"); + + migrationBuilder.DropForeignKey( + name: "fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~", + table: "streamroleblacklisteduser"); + + migrationBuilder.DropForeignKey( + name: "fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~", + table: "streamrolewhitelisteduser"); + + migrationBuilder.DropForeignKey( + name: "fk_unbantimer_guildconfigs_guildconfigid", + table: "unbantimer"); + + migrationBuilder.DropForeignKey( + name: "fk_unmutetimer_guildconfigs_guildconfigid", + table: "unmutetimer"); + + migrationBuilder.DropForeignKey( + name: "fk_unroletimer_guildconfigs_guildconfigid", + table: "unroletimer"); + + migrationBuilder.DropForeignKey( + name: "fk_vcroleinfo_guildconfigs_guildconfigid", + table: "vcroleinfo"); + + migrationBuilder.DropForeignKey( + name: "fk_warningpunishment_guildconfigs_guildconfigid", + table: "warningpunishment"); + + migrationBuilder.AlterColumn( + name: "streamrolesettingsid", + table: "streamrolewhitelisteduser", + type: "int", + nullable: true, + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "streamrolesettingsid", + table: "streamroleblacklisteduser", + type: "int", + nullable: true, + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.AlterColumn( + name: "guildconfigid", + table: "delmsgoncmdchannel", + type: "int", + nullable: true, + oldClrType: typeof(int), + oldType: "int"); + + migrationBuilder.CreateTable( + name: "ignoredvoicepresencechannels", + columns: table => new + { + id = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + logsettingid = table.Column(type: "int", nullable: true), + channelid = table.Column(type: "bigint unsigned", nullable: false), + dateadded = table.Column(type: "datetime(6)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("pk_ignoredvoicepresencechannels", x => x.id); + table.ForeignKey( + name: "fk_ignoredvoicepresencechannels_logsettings_logsettingid", + column: x => x.logsettingid, + principalTable: "logsettings", + principalColumn: "id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "ix_ignoredvoicepresencechannels_logsettingid", + table: "ignoredvoicepresencechannels", + column: "logsettingid"); + + migrationBuilder.AddForeignKey( + name: "fk_antiraidsetting_guildconfigs_guildconfigid", + table: "antiraidsetting", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_antispamignore_antispamsetting_antispamsettingid", + table: "antispamignore", + column: "antispamsettingid", + principalTable: "antispamsetting", + principalColumn: "id"); + + migrationBuilder.AddForeignKey( + name: "fk_antispamsetting_guildconfigs_guildconfigid", + table: "antispamsetting", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "fk_commandalias_guildconfigs_guildconfigid", + table: "commandalias", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id"); + + migrationBuilder.AddForeignKey( + name: "fk_commandcooldown_guildconfigs_guildconfigid", + table: "commandcooldown", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id"); + + migrationBuilder.AddForeignKey( + name: "fk_delmsgoncmdchannel_guildconfigs_guildconfigid", + table: "delmsgoncmdchannel", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id"); + + migrationBuilder.AddForeignKey( + name: "fk_excludeditem_xpsettings_xpsettingsid", + table: "excludeditem", + column: "xpsettingsid", + principalTable: "xpsettings", + principalColumn: "id"); + + migrationBuilder.AddForeignKey( + name: "fk_filterchannelid_guildconfigs_guildconfigid", + table: "filterchannelid", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id"); + + migrationBuilder.AddForeignKey( + name: "fk_filteredword_guildconfigs_guildconfigid", + table: "filteredword", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id"); + + migrationBuilder.AddForeignKey( + name: "fk_filterlinkschannelid_guildconfigs_guildconfigid", + table: "filterlinkschannelid", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id"); + + migrationBuilder.AddForeignKey( + name: "fk_filterwordschannelid_guildconfigs_guildconfigid", + table: "filterwordschannelid", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id"); + + migrationBuilder.AddForeignKey( + name: "fk_followedstream_guildconfigs_guildconfigid", + table: "followedstream", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id"); + + migrationBuilder.AddForeignKey( + name: "fk_gcchannelid_guildconfigs_guildconfigid", + table: "gcchannelid", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id"); + + migrationBuilder.AddForeignKey( + name: "fk_muteduserid_guildconfigs_guildconfigid", + table: "muteduserid", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id"); + + migrationBuilder.AddForeignKey( + name: "fk_permissions_guildconfigs_guildconfigid", + table: "permissions", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id"); + + migrationBuilder.AddForeignKey( + name: "fk_shopentry_guildconfigs_guildconfigid", + table: "shopentry", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id"); + + migrationBuilder.AddForeignKey( + name: "fk_shopentryitem_shopentry_shopentryid", + table: "shopentryitem", + column: "shopentryid", + principalTable: "shopentry", + principalColumn: "id"); + + migrationBuilder.AddForeignKey( + name: "fk_slowmodeignoredrole_guildconfigs_guildconfigid", + table: "slowmodeignoredrole", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id"); + + migrationBuilder.AddForeignKey( + name: "fk_slowmodeignoreduser_guildconfigs_guildconfigid", + table: "slowmodeignoreduser", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id"); + + migrationBuilder.AddForeignKey( + name: "fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~", + table: "streamroleblacklisteduser", + column: "streamrolesettingsid", + principalTable: "streamrolesettings", + principalColumn: "id"); + + migrationBuilder.AddForeignKey( + name: "fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~", + table: "streamrolewhitelisteduser", + column: "streamrolesettingsid", + principalTable: "streamrolesettings", + principalColumn: "id"); + + migrationBuilder.AddForeignKey( + name: "fk_unbantimer_guildconfigs_guildconfigid", + table: "unbantimer", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id"); + + migrationBuilder.AddForeignKey( + name: "fk_unmutetimer_guildconfigs_guildconfigid", + table: "unmutetimer", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id"); + + migrationBuilder.AddForeignKey( + name: "fk_unroletimer_guildconfigs_guildconfigid", + table: "unroletimer", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id"); + + migrationBuilder.AddForeignKey( + name: "fk_vcroleinfo_guildconfigs_guildconfigid", + table: "vcroleinfo", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id"); + + migrationBuilder.AddForeignKey( + name: "fk_warningpunishment_guildconfigs_guildconfigid", + table: "warningpunishment", + column: "guildconfigid", + principalTable: "guildconfigs", + principalColumn: "id"); + } + } +} diff --git a/src/EllieBot/Migrations/PostgreSql/20240627033522_honeypot.Designer.cs b/src/EllieBot/Migrations/Mysql/MysqlContextModelSnapshot.cs similarity index 72% rename from src/EllieBot/Migrations/PostgreSql/20240627033522_honeypot.Designer.cs rename to src/EllieBot/Migrations/Mysql/MysqlContextModelSnapshot.cs index 471ac16..9a6e160 100644 --- a/src/EllieBot/Migrations/PostgreSql/20240627033522_honeypot.Designer.cs +++ b/src/EllieBot/Migrations/Mysql/MysqlContextModelSnapshot.cs @@ -2,56 +2,53 @@ using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using EllieBot.Db; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable -namespace EllieBot.Migrations.PostgreSql +namespace EllieBot.Migrations.Mysql { - [DbContext(typeof(PostgreSqlContext))] - [Migration("20240627033522_honeypot")] - partial class honeypot + [DbContext(typeof(MysqlContext))] + partial class MysqlContextModelSnapshot : ModelSnapshot { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) + protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "8.0.4") - .HasAnnotation("Relational:MaxIdentifierLength", 63); + .HasAnnotation("Relational:MaxIdentifierLength", 64); - NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Action") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("action"); b.Property("ActionDurationMinutes") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("actiondurationminutes"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("MinAge") - .HasColumnType("interval") + .HasColumnType("time(6)") .HasColumnName("minage"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.HasKey("Id") @@ -68,33 +65,33 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Action") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("action"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("PunishDuration") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("punishduration"); b.Property("Seconds") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("seconds"); b.Property("UserThreshold") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("userthreshold"); b.HasKey("Id") @@ -111,21 +108,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AntiSpamSettingId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("antispamsettingid"); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.HasKey("Id") @@ -141,33 +138,33 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Action") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("action"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("MessageThreshold") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("messagethreshold"); b.Property("MuteTime") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("mutetime"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.HasKey("Id") @@ -184,17 +181,17 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -207,45 +204,45 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("ChannelName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("channelname"); b.Property("CommandText") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("commandtext"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("GuildName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("guildname"); b.Property("Interval") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("interval"); - b.Property("VoiceChannelId") - .HasColumnType("numeric(20,0)") + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("voicechannelid"); b.Property("VoiceChannelName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("voicechannelname"); b.HasKey("Id") @@ -258,21 +255,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.HasKey("Id") @@ -289,25 +286,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AutoDelete") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("autodelete"); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.HasKey("Id") @@ -327,29 +324,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("ChannelId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Source") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("source"); b.Property("Target") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("target"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -365,25 +362,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("PruneDays") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("prunedays"); b.Property("Text") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("text"); b.HasKey("Id") @@ -400,21 +397,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Balance") .HasColumnType("bigint") .HasColumnName("balance"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -431,21 +428,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("ItemId") - .HasColumnType("numeric(20,0)") + b.Property("ItemId") + .HasColumnType("bigint unsigned") .HasColumnName("itemid"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); b.HasKey("Id") @@ -457,11 +454,11 @@ namespace EllieBot.Migrations.PostgreSql modelBuilder.Entity("EllieBot.Db.Models.ClubApplicants", b => { b.Property("ClubId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("clubid"); b.Property("UserId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("userid"); b.HasKey("ClubId", "UserId") @@ -476,11 +473,11 @@ namespace EllieBot.Migrations.PostgreSql modelBuilder.Entity("EllieBot.Db.Models.ClubBans", b => { b.Property("ClubId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("clubid"); b.Property("UserId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("userid"); b.HasKey("ClubId", "UserId") @@ -496,34 +493,35 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Description") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("description"); b.Property("ImageUrl") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("imageurl"); b.Property("Name") .HasMaxLength(20) - .HasColumnType("character varying(20)") - .HasColumnName("name"); + .HasColumnType("varchar(20)") + .HasColumnName("name") + .UseCollation("utf8mb4_bin"); b.Property("OwnerId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("ownerid"); b.Property("Xp") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("xp"); b.HasKey("Id") @@ -544,25 +542,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Mapping") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("mapping"); b.Property("Trigger") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("trigger"); b.HasKey("Id") @@ -578,25 +576,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("CommandName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("commandname"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Seconds") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("seconds"); b.HasKey("Id") @@ -612,41 +610,41 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Amount") .HasColumnType("bigint") .HasColumnName("amount"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Extra") .IsRequired() - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("extra"); b.Property("Note") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("note"); - b.Property("OtherId") + b.Property("OtherId") .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") + .HasColumnType("bigint unsigned") .HasColumnName("otherid") .HasDefaultValueSql("NULL"); b.Property("Type") .IsRequired() - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("type"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -662,25 +660,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("State") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("state"); b.HasKey("Id") @@ -696,25 +694,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Command") - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("command"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); - b.Property("Perm") - .HasColumnType("numeric(20,0)") + b.Property("Perm") + .HasColumnType("bigint unsigned") .HasColumnName("perm"); b.HasKey("Id") @@ -731,17 +729,17 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AvatarId") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("avatarid"); b.Property("ClubId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("clubid"); b.Property("CurrencyAmount") @@ -751,22 +749,22 @@ namespace EllieBot.Migrations.PostgreSql .HasColumnName("currencyamount"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Discriminator") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("discriminator"); b.Property("IsClubAdmin") .ValueGeneratedOnAdd() - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasDefaultValue(false) .HasColumnName("isclubadmin"); b.Property("NotifyOnLevelUp") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasDefaultValue(0) .HasColumnName("notifyonlevelup"); @@ -776,12 +774,12 @@ namespace EllieBot.Migrations.PostgreSql .HasDefaultValue(0L) .HasColumnName("totalxp"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("Username") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("username"); b.HasKey("Id") @@ -809,25 +807,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("ItemId") - .HasColumnType("numeric(20,0)") + b.Property("ItemId") + .HasColumnType("bigint unsigned") .HasColumnName("itemid"); b.Property("ItemType") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("itemtype"); b.Property("XpSettingsId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("xpsettingsid"); b.HasKey("Id") @@ -843,30 +841,30 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Message") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("message"); b.Property("Url") .IsRequired() - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("url"); b.HasKey("Id") @@ -882,21 +880,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.HasKey("Id") @@ -912,21 +910,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.HasKey("Id") @@ -942,21 +940,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.HasKey("Id") @@ -972,21 +970,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Word") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("word"); b.HasKey("Id") @@ -1002,37 +1000,37 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Message") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("message"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); b.Property("Username") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("username"); b.HasKey("Id") @@ -1048,21 +1046,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.HasKey("Id") @@ -1078,25 +1076,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Bet") - .HasColumnType("numeric") + .HasColumnType("decimal(65,30)") .HasColumnName("bet"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Feature") - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("feature"); b.Property("PaidOut") - .HasColumnType("numeric") + .HasColumnType("decimal(65,30)") .HasColumnName("paidout"); b.HasKey("Id") @@ -1113,29 +1111,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("EndsAt") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("endsat"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Message") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("message"); - b.Property("MessageId") - .HasColumnType("numeric(20,0)") + b.Property("MessageId") + .HasColumnType("bigint unsigned") .HasColumnName("messageid"); b.HasKey("Id") @@ -1148,21 +1146,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("GiveawayId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("giveawayid"); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -1179,25 +1177,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); b.Property("Number") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("number"); b.HasKey("Id") @@ -1214,167 +1212,167 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AutoAssignRoleIds") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("autoassignroleids"); b.Property("AutoDeleteByeMessagesTimer") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("autodeletebyemessagestimer"); b.Property("AutoDeleteGreetMessagesTimer") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("autodeletegreetmessagestimer"); b.Property("AutoDeleteSelfAssignedRoleMessages") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("autodeleteselfassignedrolemessages"); b.Property("BoostMessage") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("boostmessage"); - b.Property("BoostMessageChannelId") - .HasColumnType("numeric(20,0)") + b.Property("BoostMessageChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("boostmessagechannelid"); b.Property("BoostMessageDeleteAfter") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("boostmessagedeleteafter"); - b.Property("ByeMessageChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ByeMessageChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("byemessagechannelid"); b.Property("ChannelByeMessageText") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("channelbyemessagetext"); b.Property("ChannelGreetMessageText") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("channelgreetmessagetext"); b.Property("CleverbotEnabled") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("cleverbotenabled"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("DeleteMessageOnCommand") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("deletemessageoncommand"); b.Property("DeleteStreamOnlineMessage") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("deletestreamonlinemessage"); b.Property("DisableGlobalExpressions") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("disableglobalexpressions"); b.Property("DmGreetMessageText") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("dmgreetmessagetext"); b.Property("ExclusiveSelfAssignedRoles") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("exclusiveselfassignedroles"); b.Property("FilterInvites") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("filterinvites"); b.Property("FilterLinks") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("filterlinks"); b.Property("FilterWords") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("filterwords"); - b.Property("GameVoiceChannel") - .HasColumnType("numeric(20,0)") + b.Property("GameVoiceChannel") + .HasColumnType("bigint unsigned") .HasColumnName("gamevoicechannel"); - b.Property("GreetMessageChannelId") - .HasColumnType("numeric(20,0)") + b.Property("GreetMessageChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("greetmessagechannelid"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Locale") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("locale"); b.Property("MuteRoleName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("muterolename"); b.Property("NotifyStreamOffline") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("notifystreamoffline"); b.Property("PermissionRole") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("permissionrole"); b.Property("Prefix") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("prefix"); b.Property("SendBoostMessage") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("sendboostmessage"); b.Property("SendChannelByeMessage") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("sendchannelbyemessage"); b.Property("SendChannelGreetMessage") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("sendchannelgreetmessage"); b.Property("SendDmGreetMessage") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("senddmgreetmessage"); b.Property("StickyRoles") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("stickyroles"); b.Property("TimeZoneId") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("timezoneid"); b.Property("VerboseErrors") .ValueGeneratedOnAdd() - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasDefaultValue(true) .HasColumnName("verboseerrors"); b.Property("VerbosePermissions") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("verbosepermissions"); b.Property("WarnExpireAction") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("warnexpireaction"); b.Property("WarnExpireHours") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("warnexpirehours"); b.Property("WarningsInitialized") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("warningsinitialized"); b.HasKey("Id") @@ -1390,46 +1388,29 @@ namespace EllieBot.Migrations.PostgreSql 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") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("ItemType") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("itemtype"); - b.Property("LogItemId") - .HasColumnType("numeric(20,0)") + b.Property("LogItemId") + .HasColumnType("bigint unsigned") .HasColumnName("logitemid"); b.Property("LogSettingId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("logsettingid"); b.HasKey("Id") @@ -1446,25 +1427,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); b.HasKey("Id") @@ -1481,89 +1462,89 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelCreatedId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelCreatedId") + .HasColumnType("bigint unsigned") .HasColumnName("channelcreatedid"); - b.Property("ChannelDestroyedId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelDestroyedId") + .HasColumnType("bigint unsigned") .HasColumnName("channeldestroyedid"); - b.Property("ChannelUpdatedId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelUpdatedId") + .HasColumnType("bigint unsigned") .HasColumnName("channelupdatedid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); - b.Property("LogOtherId") - .HasColumnType("numeric(20,0)") + b.Property("LogOtherId") + .HasColumnType("bigint unsigned") .HasColumnName("logotherid"); - b.Property("LogUserPresenceId") - .HasColumnType("numeric(20,0)") + b.Property("LogUserPresenceId") + .HasColumnType("bigint unsigned") .HasColumnName("loguserpresenceid"); - b.Property("LogVoicePresenceId") - .HasColumnType("numeric(20,0)") + b.Property("LogVoicePresenceId") + .HasColumnType("bigint unsigned") .HasColumnName("logvoicepresenceid"); - b.Property("LogVoicePresenceTTSId") - .HasColumnType("numeric(20,0)") + b.Property("LogVoicePresenceTTSId") + .HasColumnType("bigint unsigned") .HasColumnName("logvoicepresencettsid"); - b.Property("LogWarnsId") - .HasColumnType("numeric(20,0)") + b.Property("LogWarnsId") + .HasColumnType("bigint unsigned") .HasColumnName("logwarnsid"); - b.Property("MessageDeletedId") - .HasColumnType("numeric(20,0)") + b.Property("MessageDeletedId") + .HasColumnType("bigint unsigned") .HasColumnName("messagedeletedid"); - b.Property("MessageUpdatedId") - .HasColumnType("numeric(20,0)") + b.Property("MessageUpdatedId") + .HasColumnType("bigint unsigned") .HasColumnName("messageupdatedid"); - b.Property("ThreadCreatedId") - .HasColumnType("numeric(20,0)") + b.Property("ThreadCreatedId") + .HasColumnType("bigint unsigned") .HasColumnName("threadcreatedid"); - b.Property("ThreadDeletedId") - .HasColumnType("numeric(20,0)") + b.Property("ThreadDeletedId") + .HasColumnType("bigint unsigned") .HasColumnName("threaddeletedid"); - b.Property("UserBannedId") - .HasColumnType("numeric(20,0)") + b.Property("UserBannedId") + .HasColumnType("bigint unsigned") .HasColumnName("userbannedid"); - b.Property("UserJoinedId") - .HasColumnType("numeric(20,0)") + b.Property("UserJoinedId") + .HasColumnType("bigint unsigned") .HasColumnName("userjoinedid"); - b.Property("UserLeftId") - .HasColumnType("numeric(20,0)") + b.Property("UserLeftId") + .HasColumnType("bigint unsigned") .HasColumnName("userleftid"); - b.Property("UserMutedId") - .HasColumnType("numeric(20,0)") + b.Property("UserMutedId") + .HasColumnType("bigint unsigned") .HasColumnName("usermutedid"); - b.Property("UserUnbannedId") - .HasColumnType("numeric(20,0)") + b.Property("UserUnbannedId") + .HasColumnType("bigint unsigned") .HasColumnName("userunbannedid"); - b.Property("UserUpdatedId") - .HasColumnType("numeric(20,0)") + b.Property("UserUpdatedId") + .HasColumnType("bigint unsigned") .HasColumnName("userupdatedid"); b.HasKey("Id") @@ -1580,38 +1561,38 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AutoDisconnect") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("autodisconnect"); b.Property("AutoPlay") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("autoplay"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); - b.Property("MusicChannelId") - .HasColumnType("numeric(20,0)") + b.Property("MusicChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("musicchannelid"); b.Property("PlayerRepeat") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("playerrepeat"); b.Property("QualityPreset") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("qualitypreset"); b.Property("Volume") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasDefaultValue(100) .HasColumnName("volume"); @@ -1629,25 +1610,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Author") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("author"); - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") + b.Property("AuthorId") + .HasColumnType("bigint unsigned") .HasColumnName("authorid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); b.HasKey("Id") @@ -1660,21 +1641,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -1690,45 +1671,45 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AllowTarget") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("allowtarget"); b.Property("AutoDeleteTrigger") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("autodeletetrigger"); b.Property("ContainsAnywhere") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("containsanywhere"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("DmResponse") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("dmresponse"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Reactions") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("reactions"); b.Property("Response") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("response"); b.Property("Trigger") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("trigger"); b.HasKey("Id") @@ -1737,27 +1718,64 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("expressions", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => + modelBuilder.Entity("EllieBot.Db.Models.PatronQuota", b => { - b.Property("UserId") - .ValueGeneratedOnAdd() - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); + b.Property("FeatureType") + .HasColumnType("int") + .HasColumnName("featuretype"); + + b.Property("Feature") + .HasColumnType("varchar(255)") + .HasColumnName("feature"); + + b.Property("DailyCount") + .HasColumnType("int unsigned") + .HasColumnName("dailycount"); + + b.Property("HourlyCount") + .HasColumnType("int unsigned") + .HasColumnName("hourlycount"); + + b.Property("MonthlyCount") + .HasColumnType("int unsigned") + .HasColumnName("monthlycount"); + + b.HasKey("UserId", "FeatureType", "Feature") + .HasName("pk_patronquotas"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_patronquotas_userid"); + + b.ToTable("patronquotas", (string)null); + }); + + modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => + { + b.Property("UserId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint unsigned") + .HasColumnName("userid"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("UserId")); + b.Property("AmountCents") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("amountcents"); b.Property("LastCharge") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("lastcharge"); b.Property("UniquePlatformUserId") - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("uniqueplatformuserid"); b.Property("ValidThru") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("validthru"); b.HasKey("UserId") @@ -1774,45 +1792,45 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Index") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("index"); b.Property("IsCustomCommand") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("iscustomcommand"); b.Property("PrimaryTarget") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("primarytarget"); - b.Property("PrimaryTargetId") - .HasColumnType("numeric(20,0)") + b.Property("PrimaryTargetId") + .HasColumnType("bigint unsigned") .HasColumnName("primarytargetid"); b.Property("SecondaryTarget") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("secondarytarget"); b.Property("SecondaryTargetName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("secondarytargetname"); b.Property("State") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("state"); b.HasKey("Id") @@ -1828,37 +1846,37 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Amount") .HasColumnType("bigint") .HasColumnName("amount"); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); - b.Property("MessageId") - .HasColumnType("numeric(20,0)") + b.Property("MessageId") + .HasColumnType("bigint unsigned") .HasColumnName("messageid"); b.Property("Password") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("password"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -1878,37 +1896,37 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("MusicPlaylistId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("musicplaylistid"); b.Property("Provider") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("provider"); b.Property("ProviderType") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("providertype"); b.Property("Query") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("query"); b.Property("Title") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("title"); b.Property("Uri") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("uri"); b.HasKey("Id") @@ -1924,36 +1942,36 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") + b.Property("AuthorId") + .HasColumnType("bigint unsigned") .HasColumnName("authorid"); b.Property("AuthorName") .IsRequired() - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("authorname"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Keyword") .IsRequired() - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("keyword"); b.Property("Text") .IsRequired() - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("text"); b.HasKey("Id") @@ -1972,42 +1990,42 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Emote") .HasMaxLength(100) - .HasColumnType("character varying(100)") + .HasColumnType("varchar(100)") .HasColumnName("emote"); b.Property("Group") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("group"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("LevelReq") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("levelreq"); - b.Property("MessageId") - .HasColumnType("numeric(20,0)") + b.Property("MessageId") + .HasColumnType("bigint unsigned") .HasColumnName("messageid"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.HasKey("Id") @@ -2027,41 +2045,41 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("IsPrivate") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("isprivate"); b.Property("Message") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("message"); - b.Property("ServerId") - .HasColumnType("numeric(20,0)") + b.Property("ServerId") + .HasColumnType("bigint unsigned") .HasColumnName("serverid"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("When") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("when"); b.HasKey("Id") @@ -2077,41 +2095,41 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Interval") - .HasColumnType("interval") + .HasColumnType("time(6)") .HasColumnName("interval"); - b.Property("LastMessageId") - .HasColumnType("numeric(20,0)") + b.Property("LastMessageId") + .HasColumnType("bigint unsigned") .HasColumnName("lastmessageid"); b.Property("Message") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("message"); b.Property("NoRedundant") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("noredundant"); b.Property("StartTimeOfDay") - .HasColumnType("interval") + .HasColumnType("time(6)") .HasColumnName("starttimeofday"); b.HasKey("Id") @@ -2124,29 +2142,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AmountRewardedThisMonth") .HasColumnType("bigint") .HasColumnName("amountrewardedthismonth"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("LastReward") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("lastreward"); b.Property("PlatformUserId") - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("platformuserid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2163,21 +2181,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Status") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("status"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); b.HasKey("Id") @@ -2190,31 +2208,31 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Group") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasDefaultValue(0) .HasColumnName("group"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("LevelRequirement") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("levelrequirement"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.HasKey("Id") @@ -2231,53 +2249,53 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("AuthorId") - .HasColumnType("numeric(20,0)") + b.Property("AuthorId") + .HasColumnType("bigint unsigned") .HasColumnName("authorid"); b.Property("Command") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("command"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Index") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("index"); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); b.Property("Price") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("price"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.Property("RoleName") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("rolename"); - b.Property("RoleRequirement") - .HasColumnType("numeric(20,0)") + b.Property("RoleRequirement") + .HasColumnType("bigint unsigned") .HasColumnName("rolerequirement"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); b.HasKey("Id") @@ -2293,21 +2311,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("ShopEntryId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("shopentryid"); b.Property("Text") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("text"); b.HasKey("Id") @@ -2323,21 +2341,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.HasKey("Id") @@ -2353,21 +2371,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2383,25 +2401,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("RoleIds") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("roleids"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2418,29 +2436,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("ChannelId") - .HasColumnType("numeric(20,0)") + b.Property("ChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("channelid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("MessageId") - .HasColumnType("numeric(20,0)") + b.Property("MessageId") + .HasColumnType("bigint unsigned") .HasColumnName("messageid"); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); b.Property("Type") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("type"); b.HasKey("Id") @@ -2453,25 +2471,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("StreamRoleSettingsId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("streamrolesettingsid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("Username") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("username"); b.HasKey("Id") @@ -2487,33 +2505,33 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); - b.Property("AddRoleId") - .HasColumnType("numeric(20,0)") + b.Property("AddRoleId") + .HasColumnType("bigint unsigned") .HasColumnName("addroleid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Enabled") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("enabled"); - b.Property("FromRoleId") - .HasColumnType("numeric(20,0)") + b.Property("FromRoleId") + .HasColumnType("bigint unsigned") .HasColumnName("fromroleid"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Keyword") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("keyword"); b.HasKey("Id") @@ -2530,25 +2548,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("StreamRoleSettingsId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("streamrolesettingsid"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("Username") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("username"); b.HasKey("Id") @@ -2564,29 +2582,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("ArchiveId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("archiveid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("IsDone") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("isdone"); b.Property("Todo") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("todo"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2605,25 +2623,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("UnbanAt") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("unbanat"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2639,25 +2657,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("UnmuteAt") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("unmuteat"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2673,29 +2691,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.Property("UnbanAt") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("unbanat"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -2711,29 +2729,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AwardedXp") .HasColumnType("bigint") .HasColumnName("awardedxp"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("NotifyOnLevelUp") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("notifyonlevelup"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("Xp") @@ -2766,25 +2784,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); - b.Property("VoiceChannelId") - .HasColumnType("numeric(20,0)") + b.Property("VoiceChannelId") + .HasColumnType("bigint unsigned") .HasColumnName("voicechannelid"); b.HasKey("Id") @@ -2800,21 +2818,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("AffinityId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("affinityid"); b.Property("ClaimerId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("claimerid"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Price") @@ -2822,7 +2840,7 @@ namespace EllieBot.Migrations.PostgreSql .HasColumnName("price"); b.Property("WaifuId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("waifuid"); b.HasKey("Id") @@ -2848,25 +2866,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("ItemEmoji") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("itememoji"); b.Property("Name") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("name"); b.Property("WaifuInfoId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("waifuinfoid"); b.HasKey("Id") @@ -2882,29 +2900,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("NewId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("newid"); b.Property("OldId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("oldid"); b.Property("UpdateType") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("updatetype"); b.Property("UserId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("userid"); b.HasKey("Id") @@ -2926,37 +2944,37 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Forgiven") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("forgiven"); b.Property("ForgivenBy") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("forgivenby"); - b.Property("GuildId") - .HasColumnType("numeric(20,0)") + b.Property("GuildId") + .HasColumnType("bigint unsigned") .HasColumnName("guildid"); b.Property("Moderator") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("moderator"); b.Property("Reason") - .HasColumnType("text") + .HasColumnType("longtext") .HasColumnName("reason"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.Property("Weight") @@ -2984,33 +3002,33 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Count") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("count"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("Punishment") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("punishment"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.Property("Time") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("time"); b.HasKey("Id") @@ -3026,25 +3044,25 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("Amount") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("amount"); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Level") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("level"); b.Property("XpSettingsId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("xpsettingsid"); b.HasKey("Id") @@ -3060,29 +3078,29 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("Level") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("level"); b.Property("Remove") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("remove"); - b.Property("RoleId") - .HasColumnType("numeric(20,0)") + b.Property("RoleId") + .HasColumnType("bigint unsigned") .HasColumnName("roleid"); b.Property("XpSettingsId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("xpsettingsid"); b.HasKey("Id") @@ -3099,21 +3117,21 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("GuildConfigId") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("guildconfigid"); b.Property("ServerExcluded") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("serverexcluded"); b.HasKey("Id") @@ -3130,30 +3148,30 @@ namespace EllieBot.Migrations.PostgreSql { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("id"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("Id")); b.Property("DateAdded") - .HasColumnType("timestamp without time zone") + .HasColumnType("datetime(6)") .HasColumnName("dateadded"); b.Property("IsUsing") - .HasColumnType("boolean") + .HasColumnType("tinyint(1)") .HasColumnName("isusing"); b.Property("ItemKey") .IsRequired() - .HasColumnType("text") + .HasColumnType("varchar(255)") .HasColumnName("itemkey"); b.Property("ItemType") - .HasColumnType("integer") + .HasColumnType("int") .HasColumnName("itemtype"); - b.Property("UserId") - .HasColumnType("numeric(20,0)") + b.Property("UserId") + .HasColumnType("bigint unsigned") .HasColumnName("userid"); b.HasKey("Id") @@ -3492,7 +3510,7 @@ namespace EllieBot.Migrations.PostgreSql .HasForeignKey("StreamRoleSettingsId") .OnDelete(DeleteBehavior.Cascade) .IsRequired() - .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesett~"); + .HasConstraintName("fk_streamroleblacklisteduser_streamrolesettings_streamrolesetti~"); b.Navigation("StreamRoleSettings"); }); @@ -3516,7 +3534,7 @@ namespace EllieBot.Migrations.PostgreSql .HasForeignKey("StreamRoleSettingsId") .OnDelete(DeleteBehavior.Cascade) .IsRequired() - .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesett~"); + .HasConstraintName("fk_streamrolewhitelisteduser_streamrolesettings_streamrolesetti~"); b.Navigation("StreamRoleSettings"); }); diff --git a/src/EllieBot/Migrations/PostgreSql/20220409170719_mysql-init.cs b/src/EllieBot/Migrations/PostgreSql/20220409170719_mysql-init.cs index 3e0cbc0..47fedf6 100644 --- a/src/EllieBot/Migrations/PostgreSql/20220409170719_mysql-init.cs +++ b/src/EllieBot/Migrations/PostgreSql/20220409170719_mysql-init.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable diff --git a/src/EllieBot/Migrations/PostgreSql/20220428044547_stondel.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20220428044547_stondel.Designer.cs index 296f158..dd928e9 100644 --- a/src/EllieBot/Migrations/PostgreSql/20220428044547_stondel.Designer.cs +++ b/src/EllieBot/Migrations/PostgreSql/20220428044547_stondel.Designer.cs @@ -1490,7 +1490,7 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("muteduserid", (string)null); }); - modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() diff --git a/src/EllieBot/Migrations/PostgreSql/20220429044808_bank.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20220429044808_bank.Designer.cs index 2368670..b4135e5 100644 --- a/src/EllieBot/Migrations/PostgreSql/20220429044808_bank.Designer.cs +++ b/src/EllieBot/Migrations/PostgreSql/20220429044808_bank.Designer.cs @@ -1521,7 +1521,7 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("muteduserid", (string)null); }); - modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() diff --git a/src/EllieBot/Migrations/PostgreSql/20220429044808_bank.cs b/src/EllieBot/Migrations/PostgreSql/20220429044808_bank.cs index 4f0a4a5..6d5cc67 100644 --- a/src/EllieBot/Migrations/PostgreSql/20220429044808_bank.cs +++ b/src/EllieBot/Migrations/PostgreSql/20220429044808_bank.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable diff --git a/src/EllieBot/Migrations/PostgreSql/20220504162457_new-rero.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20220504162457_new-rero.Designer.cs index 24c7cdb..ab78250 100644 --- a/src/EllieBot/Migrations/PostgreSql/20220504162457_new-rero.Designer.cs +++ b/src/EllieBot/Migrations/PostgreSql/20220504162457_new-rero.Designer.cs @@ -1521,7 +1521,7 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("muteduserid", (string)null); }); - modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() diff --git a/src/EllieBot/Migrations/PostgreSql/20220504162457_new-rero.cs b/src/EllieBot/Migrations/PostgreSql/20220504162457_new-rero.cs index 7185c09..237a0d8 100644 --- a/src/EllieBot/Migrations/PostgreSql/20220504162457_new-rero.cs +++ b/src/EllieBot/Migrations/PostgreSql/20220504162457_new-rero.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable diff --git a/src/EllieBot/Migrations/PostgreSql/20220614071421_patronage-system.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20220614071421_patronage-system.Designer.cs index 7f9e828..0684976 100644 --- a/src/EllieBot/Migrations/PostgreSql/20220614071421_patronage-system.Designer.cs +++ b/src/EllieBot/Migrations/PostgreSql/20220614071421_patronage-system.Designer.cs @@ -1591,7 +1591,7 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("muteduserid", (string)null); }); - modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() diff --git a/src/EllieBot/Migrations/PostgreSql/20220614071421_patronage-system.cs b/src/EllieBot/Migrations/PostgreSql/20220614071421_patronage-system.cs index b8fcc2c..f8bb7b9 100644 --- a/src/EllieBot/Migrations/PostgreSql/20220614071421_patronage-system.cs +++ b/src/EllieBot/Migrations/PostgreSql/20220614071421_patronage-system.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/src/EllieBot/Migrations/PostgreSql/20220623090729_stondel-db-cache.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20220623090729_stondel-db-cache.Designer.cs index b8ec8ea..f452d57 100644 --- a/src/EllieBot/Migrations/PostgreSql/20220623090729_stondel-db-cache.Designer.cs +++ b/src/EllieBot/Migrations/PostgreSql/20220623090729_stondel-db-cache.Designer.cs @@ -1626,7 +1626,7 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("muteduserid", (string)null); }); - modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() diff --git a/src/EllieBot/Migrations/PostgreSql/20220623090729_stondel-db-cache.cs b/src/EllieBot/Migrations/PostgreSql/20220623090729_stondel-db-cache.cs index eed96a7..9cb7187 100644 --- a/src/EllieBot/Migrations/PostgreSql/20220623090729_stondel-db-cache.cs +++ b/src/EllieBot/Migrations/PostgreSql/20220623090729_stondel-db-cache.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable diff --git a/src/EllieBot/Migrations/PostgreSql/20220703194412_logwarns.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20220703194412_logwarns.Designer.cs index 2c19566..964d6bd 100644 --- a/src/EllieBot/Migrations/PostgreSql/20220703194412_logwarns.Designer.cs +++ b/src/EllieBot/Migrations/PostgreSql/20220703194412_logwarns.Designer.cs @@ -1630,7 +1630,7 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("muteduserid", (string)null); }); - modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() diff --git a/src/EllieBot/Migrations/PostgreSql/20220725155941_xpitemshop.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20220725155941_xpitemshop.Designer.cs index 0ad20f8..1c2bb86 100644 --- a/src/EllieBot/Migrations/PostgreSql/20220725155941_xpitemshop.Designer.cs +++ b/src/EllieBot/Migrations/PostgreSql/20220725155941_xpitemshop.Designer.cs @@ -1670,7 +1670,7 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("muteduserid", (string)null); }); - modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() diff --git a/src/EllieBot/Migrations/PostgreSql/20220725155941_xpitemshop.cs b/src/EllieBot/Migrations/PostgreSql/20220725155941_xpitemshop.cs index 258dc4c..073f682 100644 --- a/src/EllieBot/Migrations/PostgreSql/20220725155941_xpitemshop.cs +++ b/src/EllieBot/Migrations/PostgreSql/20220725155941_xpitemshop.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable diff --git a/src/EllieBot/Migrations/PostgreSql/20220727033944_linkonly-channels.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20220727033944_linkonly-channels.Designer.cs index a6d9203..8a9bb37 100644 --- a/src/EllieBot/Migrations/PostgreSql/20220727033944_linkonly-channels.Designer.cs +++ b/src/EllieBot/Migrations/PostgreSql/20220727033944_linkonly-channels.Designer.cs @@ -1674,7 +1674,7 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("muteduserid", (string)null); }); - modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() diff --git a/src/EllieBot/Migrations/PostgreSql/20220808142559_remove-obsolete-xp-columns.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20220808142559_remove-obsolete-xp-columns.Designer.cs index 60ef9a6..e315f4d 100644 --- a/src/EllieBot/Migrations/PostgreSql/20220808142559_remove-obsolete-xp-columns.Designer.cs +++ b/src/EllieBot/Migrations/PostgreSql/20220808142559_remove-obsolete-xp-columns.Designer.cs @@ -1662,7 +1662,7 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("muteduserid", (string)null); }); - modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() diff --git a/src/EllieBot/Migrations/PostgreSql/20220808142559_remove-obsolete-xp-columns.cs b/src/EllieBot/Migrations/PostgreSql/20220808142559_remove-obsolete-xp-columns.cs index 64f3334..4cd146c 100644 --- a/src/EllieBot/Migrations/PostgreSql/20220808142559_remove-obsolete-xp-columns.cs +++ b/src/EllieBot/Migrations/PostgreSql/20220808142559_remove-obsolete-xp-columns.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/src/EllieBot/Migrations/PostgreSql/20220831142735_banprune.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20220831142735_banprune.Designer.cs index 812f165..ce4b1a7 100644 --- a/src/EllieBot/Migrations/PostgreSql/20220831142735_banprune.Designer.cs +++ b/src/EllieBot/Migrations/PostgreSql/20220831142735_banprune.Designer.cs @@ -1666,7 +1666,7 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("muteduserid", (string)null); }); - modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() diff --git a/src/EllieBot/Migrations/PostgreSql/20220913192529_shop-role-req.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20220913192529_shop-role-req.Designer.cs index 564fb8d..04644ac 100644 --- a/src/EllieBot/Migrations/PostgreSql/20220913192529_shop-role-req.Designer.cs +++ b/src/EllieBot/Migrations/PostgreSql/20220913192529_shop-role-req.Designer.cs @@ -1666,7 +1666,7 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("muteduserid", (string)null); }); - modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() diff --git a/src/EllieBot/Migrations/PostgreSql/20220916194523_autopub.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20220916194523_autopub.Designer.cs index b372469..41eb2c9 100644 --- a/src/EllieBot/Migrations/PostgreSql/20220916194523_autopub.Designer.cs +++ b/src/EllieBot/Migrations/PostgreSql/20220916194523_autopub.Designer.cs @@ -1697,7 +1697,7 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("muteduserid", (string)null); }); - modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() diff --git a/src/EllieBot/Migrations/PostgreSql/20220916194523_autopub.cs b/src/EllieBot/Migrations/PostgreSql/20220916194523_autopub.cs index 177c650..9718e60 100644 --- a/src/EllieBot/Migrations/PostgreSql/20220916194523_autopub.cs +++ b/src/EllieBot/Migrations/PostgreSql/20220916194523_autopub.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable @@ -9,6 +10,12 @@ namespace EllieBot.Migrations.PostgreSql { protected override void Up(MigrationBuilder migrationBuilder) { + migrationBuilder.AddColumn( + name: "rolerequirement", + table: "shopentry", + type: "numeric(20,0)", + nullable: true); + migrationBuilder.CreateTable( name: "autopublishchannel", columns: table => new @@ -35,6 +42,10 @@ namespace EllieBot.Migrations.PostgreSql { migrationBuilder.DropTable( name: "autopublishchannel"); + + migrationBuilder.DropColumn( + name: "rolerequirement", + table: "shopentry"); } } } diff --git a/src/EllieBot/Migrations/PostgreSql/20221003175752_gambling-stats.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20221003175752_gambling-stats.Designer.cs index 78021a9..3740b60 100644 --- a/src/EllieBot/Migrations/PostgreSql/20221003175752_gambling-stats.Designer.cs +++ b/src/EllieBot/Migrations/PostgreSql/20221003175752_gambling-stats.Designer.cs @@ -1732,7 +1732,7 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("muteduserid", (string)null); }); - modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() diff --git a/src/EllieBot/Migrations/PostgreSql/20221003175752_gambling-stats.cs b/src/EllieBot/Migrations/PostgreSql/20221003175752_gambling-stats.cs index 88c4b12..81dbd5b 100644 --- a/src/EllieBot/Migrations/PostgreSql/20221003175752_gambling-stats.cs +++ b/src/EllieBot/Migrations/PostgreSql/20221003175752_gambling-stats.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable diff --git a/src/EllieBot/Migrations/PostgreSql/20221021192807_toggle-global-expressions.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20221021192807_toggle-global-expressions.Designer.cs index 813ffd1..44486f6 100644 --- a/src/EllieBot/Migrations/PostgreSql/20221021192807_toggle-global-expressions.Designer.cs +++ b/src/EllieBot/Migrations/PostgreSql/20221021192807_toggle-global-expressions.Designer.cs @@ -1736,7 +1736,7 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("muteduserid", (string)null); }); - modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() diff --git a/src/EllieBot/Migrations/PostgreSql/20221118195200_log-thread.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20221118195200_log-thread.Designer.cs index 51c8a35..07a42f2 100644 --- a/src/EllieBot/Migrations/PostgreSql/20221118195200_log-thread.Designer.cs +++ b/src/EllieBot/Migrations/PostgreSql/20221118195200_log-thread.Designer.cs @@ -1744,7 +1744,7 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("muteduserid", (string)null); }); - modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() diff --git a/src/EllieBot/Migrations/PostgreSql/20221122204423_feed-text.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20221122204423_feed-text.Designer.cs index a0a8272..24bfefc 100644 --- a/src/EllieBot/Migrations/PostgreSql/20221122204423_feed-text.Designer.cs +++ b/src/EllieBot/Migrations/PostgreSql/20221122204423_feed-text.Designer.cs @@ -1748,7 +1748,7 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("muteduserid", (string)null); }); - modelBuilder.Entity("EllieBot.Services.Database.Models.EllieExpression", b => + modelBuilder.Entity("EllieBot.Services.Database.Models.NadekoExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() diff --git a/src/EllieBot/Migrations/PostgreSql/20240502233202_v5.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20240502233202_v5.Designer.cs index 2546c39..abbe420 100644 --- a/src/EllieBot/Migrations/PostgreSql/20240502233202_v5.Designer.cs +++ b/src/EllieBot/Migrations/PostgreSql/20240502233202_v5.Designer.cs @@ -1699,7 +1699,7 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("muteduserid", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => + modelBuilder.Entity("EllieBot.Db.Models.NadekoExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() diff --git a/src/EllieBot/Migrations/PostgreSql/20240502233202_v5.cs b/src/EllieBot/Migrations/PostgreSql/20240502233202_v5.cs index 943e959..d3629d8 100644 --- a/src/EllieBot/Migrations/PostgreSql/20240502233202_v5.cs +++ b/src/EllieBot/Migrations/PostgreSql/20240502233202_v5.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable diff --git a/src/EllieBot/Migrations/PostgreSql/20240518221432_guidlconfig-cleanup.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20240518221432_guidlconfig-cleanup.Designer.cs index fde53c6..2227f4a 100644 --- a/src/EllieBot/Migrations/PostgreSql/20240518221432_guidlconfig-cleanup.Designer.cs +++ b/src/EllieBot/Migrations/PostgreSql/20240518221432_guidlconfig-cleanup.Designer.cs @@ -1669,7 +1669,7 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("muteduserid", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => + modelBuilder.Entity("EllieBot.Db.Models.NadekoExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() diff --git a/src/EllieBot/Migrations/PostgreSql/20240518221432_guidlconfig-cleanup.cs b/src/EllieBot/Migrations/PostgreSql/20240518221432_guidlconfig-cleanup.cs index a6a4994..b22df63 100644 --- a/src/EllieBot/Migrations/PostgreSql/20240518221432_guidlconfig-cleanup.cs +++ b/src/EllieBot/Migrations/PostgreSql/20240518221432_guidlconfig-cleanup.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable diff --git a/src/EllieBot/Migrations/PostgreSql/20240611180506_remove-patron-limits.cs b/src/EllieBot/Migrations/PostgreSql/20240611180506_remove-patron-limits.cs deleted file mode 100644 index 7fb11bc..0000000 --- a/src/EllieBot/Migrations/PostgreSql/20240611180506_remove-patron-limits.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace EllieBot.Migrations.PostgreSql -{ - /// - public partial class removepatronlimits : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "patronquotas"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "patronquotas", - columns: table => new - { - userid = table.Column(type: "numeric(20,0)", nullable: false), - featuretype = table.Column(type: "integer", nullable: false), - feature = table.Column(type: "text", nullable: false), - dailycount = table.Column(type: "bigint", nullable: false), - hourlycount = table.Column(type: "bigint", nullable: false), - monthlycount = table.Column(type: "bigint", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_patronquotas", x => new { x.userid, x.featuretype, x.feature }); - }); - - migrationBuilder.CreateIndex( - name: "ix_patronquotas_userid", - table: "patronquotas", - column: "userid"); - } - } -} diff --git a/src/EllieBot/Migrations/PostgreSql/20240627033522_honeypot.cs b/src/EllieBot/Migrations/PostgreSql/20240627033522_honeypot.cs deleted file mode 100644 index 2a40ff3..0000000 --- a/src/EllieBot/Migrations/PostgreSql/20240627033522_honeypot.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace EllieBot.Migrations.PostgreSql -{ - /// - public partial class honeypot : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "honeypotchannels", - columns: table => new - { - guildid = table.Column(type: "numeric(20,0)", nullable: false), - channelid = table.Column(type: "numeric(20,0)", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("pk_honeypotchannels", x => x.guildid); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "honeypotchannels"); - } - } -} diff --git a/src/EllieBot/Migrations/PostgreSql/20240912124719_greet-settings.cs b/src/EllieBot/Migrations/PostgreSql/20240912124719_greet-settings.cs deleted file mode 100644 index 1b4dd19..0000000 --- a/src/EllieBot/Migrations/PostgreSql/20240912124719_greet-settings.cs +++ /dev/null @@ -1,199 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; - -#nullable disable - -namespace EllieBot.Migrations.PostgreSql -{ - /// - public partial class greetsettings : Migration - { - /// - 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"); - - migrationBuilder.DropColumn( - name: "autodeletegreetmessagestimer", - table: "guildconfigs"); - - migrationBuilder.DropColumn( - name: "boostmessage", - table: "guildconfigs"); - - migrationBuilder.DropColumn( - name: "boostmessagechannelid", - table: "guildconfigs"); - - migrationBuilder.DropColumn( - name: "boostmessagedeleteafter", - table: "guildconfigs"); - - migrationBuilder.DropColumn( - name: "byemessagechannelid", - table: "guildconfigs"); - - migrationBuilder.DropColumn( - name: "channelbyemessagetext", - table: "guildconfigs"); - - migrationBuilder.DropColumn( - name: "channelgreetmessagetext", - table: "guildconfigs"); - - migrationBuilder.DropColumn( - name: "dmgreetmessagetext", - table: "guildconfigs"); - - migrationBuilder.DropColumn( - name: "greetmessagechannelid", - table: "guildconfigs"); - - migrationBuilder.DropColumn( - name: "sendboostmessage", - table: "guildconfigs"); - - migrationBuilder.DropColumn( - name: "sendchannelbyemessage", - table: "guildconfigs"); - - migrationBuilder.DropColumn( - name: "sendchannelgreetmessage", - table: "guildconfigs"); - - migrationBuilder.DropColumn( - name: "senddmgreetmessage", - table: "guildconfigs"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "greetsettings"); - - migrationBuilder.AddColumn( - name: "autodeletebyemessagestimer", - table: "guildconfigs", - type: "integer", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "autodeletegreetmessagestimer", - table: "guildconfigs", - type: "integer", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "boostmessage", - table: "guildconfigs", - type: "text", - nullable: true); - - migrationBuilder.AddColumn( - name: "boostmessagechannelid", - table: "guildconfigs", - type: "numeric(20,0)", - nullable: false, - defaultValue: 0m); - - migrationBuilder.AddColumn( - name: "boostmessagedeleteafter", - table: "guildconfigs", - type: "integer", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "byemessagechannelid", - table: "guildconfigs", - type: "numeric(20,0)", - nullable: false, - defaultValue: 0m); - - migrationBuilder.AddColumn( - name: "channelbyemessagetext", - table: "guildconfigs", - type: "text", - nullable: true); - - migrationBuilder.AddColumn( - name: "channelgreetmessagetext", - table: "guildconfigs", - type: "text", - nullable: true); - - migrationBuilder.AddColumn( - name: "dmgreetmessagetext", - table: "guildconfigs", - type: "text", - nullable: true); - - migrationBuilder.AddColumn( - name: "greetmessagechannelid", - table: "guildconfigs", - type: "numeric(20,0)", - nullable: false, - defaultValue: 0m); - - migrationBuilder.AddColumn( - name: "sendboostmessage", - table: "guildconfigs", - type: "boolean", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "sendchannelbyemessage", - table: "guildconfigs", - type: "boolean", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "sendchannelgreetmessage", - table: "guildconfigs", - type: "boolean", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "senddmgreetmessage", - table: "guildconfigs", - type: "boolean", - nullable: false, - defaultValue: false); - } - } -} \ No newline at end of file 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.Designer.cs b/src/EllieBot/Migrations/PostgreSql/20241102022956_no-discrim-and-flag-translate.Designer.cs deleted file mode 100644 index 8109046..0000000 --- a/src/EllieBot/Migrations/PostgreSql/20241102022956_no-discrim-and-flag-translate.Designer.cs +++ /dev/null @@ -1,3851 +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("20241102022956_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") - .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.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.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/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..02d425e 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 @@ -17,7 +17,7 @@ namespace EllieBot.Migrations.PostgreSql { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "8.0.8") + .HasAnnotation("ProductVersion", "8.0.4") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -751,6 +751,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") @@ -795,63 +799,9 @@ namespace EllieBot.Migrations.PostgreSql 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") @@ -1045,37 +995,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") @@ -1301,10 +1220,42 @@ namespace EllieBot.Migrations.PostgreSql .HasColumnType("text") .HasColumnName("autoassignroleids"); + b.Property("AutoDeleteByeMessagesTimer") + .HasColumnType("integer") + .HasColumnName("autodeletebyemessagestimer"); + + b.Property("AutoDeleteGreetMessagesTimer") + .HasColumnType("integer") + .HasColumnName("autodeletegreetmessagestimer"); + b.Property("AutoDeleteSelfAssignedRoleMessages") .HasColumnType("boolean") .HasColumnName("autodeleteselfassignedrolemessages"); + b.Property("BoostMessage") + .HasColumnType("text") + .HasColumnName("boostmessage"); + + b.Property("BoostMessageChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("boostmessagechannelid"); + + b.Property("BoostMessageDeleteAfter") + .HasColumnType("integer") + .HasColumnName("boostmessagedeleteafter"); + + b.Property("ByeMessageChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("byemessagechannelid"); + + b.Property("ChannelByeMessageText") + .HasColumnType("text") + .HasColumnName("channelbyemessagetext"); + + b.Property("ChannelGreetMessageText") + .HasColumnType("text") + .HasColumnName("channelgreetmessagetext"); + b.Property("CleverbotEnabled") .HasColumnType("boolean") .HasColumnName("cleverbotenabled"); @@ -1325,6 +1276,10 @@ namespace EllieBot.Migrations.PostgreSql .HasColumnType("boolean") .HasColumnName("disableglobalexpressions"); + b.Property("DmGreetMessageText") + .HasColumnType("text") + .HasColumnName("dmgreetmessagetext"); + b.Property("ExclusiveSelfAssignedRoles") .HasColumnType("boolean") .HasColumnName("exclusiveselfassignedroles"); @@ -1345,6 +1300,10 @@ namespace EllieBot.Migrations.PostgreSql .HasColumnType("numeric(20,0)") .HasColumnName("gamevoicechannel"); + b.Property("GreetMessageChannelId") + .HasColumnType("numeric(20,0)") + .HasColumnName("greetmessagechannelid"); + b.Property("GuildId") .HasColumnType("numeric(20,0)") .HasColumnName("guildid"); @@ -1369,6 +1328,22 @@ namespace EllieBot.Migrations.PostgreSql .HasColumnType("text") .HasColumnName("prefix"); + b.Property("SendBoostMessage") + .HasColumnType("boolean") + .HasColumnName("sendboostmessage"); + + b.Property("SendChannelByeMessage") + .HasColumnType("boolean") + .HasColumnName("sendchannelbyemessage"); + + b.Property("SendChannelGreetMessage") + .HasColumnType("boolean") + .HasColumnName("sendchannelgreetmessage"); + + b.Property("SendDmGreetMessage") + .HasColumnType("boolean") + .HasColumnName("senddmgreetmessage"); + b.Property("StickyRoles") .HasColumnType("boolean") .HasColumnName("stickyroles"); @@ -1412,23 +1387,6 @@ namespace EllieBot.Migrations.PostgreSql 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") @@ -1708,7 +1666,7 @@ namespace EllieBot.Migrations.PostgreSql b.ToTable("muteduserid", (string)null); }); - modelBuilder.Entity("EllieBot.Db.Models.NCPixel", b => + modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -1717,38 +1675,81 @@ namespace EllieBot.Migrations.PostgreSql NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); - b.Property("Color") - .HasColumnType("bigint") - .HasColumnName("color"); + b.Property("AllowTarget") + .HasColumnType("boolean") + .HasColumnName("allowtarget"); - b.Property("OwnerId") + 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("ownerid"); + .HasColumnName("guildid"); - b.Property("Position") - .HasColumnType("integer") - .HasColumnName("position"); + b.Property("Reactions") + .HasColumnType("text") + .HasColumnName("reactions"); - b.Property("Price") - .HasColumnType("bigint") - .HasColumnName("price"); + b.Property("Response") + .HasColumnType("text") + .HasColumnName("response"); - b.Property("Text") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("text"); + b.Property("Trigger") + .HasColumnType("text") + .HasColumnName("trigger"); b.HasKey("Id") - .HasName("pk_ncpixel"); + .HasName("pk_expressions"); - b.HasAlternateKey("Position") - .HasName("ak_ncpixel_position"); + b.ToTable("expressions", (string)null); + }); - b.HasIndex("OwnerId") - .HasDatabaseName("ix_ncpixel_ownerid"); + modelBuilder.Entity("EllieBot.Db.Models.PatronQuota", b => + { + b.Property("UserId") + .HasColumnType("numeric(20,0)") + .HasColumnName("userid"); - b.ToTable("ncpixel", (string)null); + b.Property("FeatureType") + .HasColumnType("integer") + .HasColumnName("featuretype"); + + b.Property("Feature") + .HasColumnType("text") + .HasColumnName("feature"); + + b.Property("DailyCount") + .HasColumnType("bigint") + .HasColumnName("dailycount"); + + b.Property("HourlyCount") + .HasColumnType("bigint") + .HasColumnName("hourlycount"); + + b.Property("MonthlyCount") + .HasColumnType("bigint") + .HasColumnName("monthlycount"); + + b.HasKey("UserId", "FeatureType", "Feature") + .HasName("pk_patronquotas"); + + b.HasIndex("UserId") + .HasDatabaseName("ix_patronquotas_userid"); + + b.ToTable("patronquotas", (string)null); }); modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => @@ -3011,9 +3012,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") @@ -3030,8 +3031,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); }); @@ -3180,121 +3181,6 @@ namespace EllieBot.Migrations.PostgreSql 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) @@ -3757,6 +3643,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") @@ -3872,6 +3767,8 @@ namespace EllieBot.Migrations.PostgreSql b.Navigation("VcRoleInfos"); + b.Navigation("WarnPunishments"); + b.Navigation("XpSettings"); }); diff --git a/src/EllieBot/Migrations/Sqlite/20210621042359_squash.cs b/src/EllieBot/Migrations/Sqlite/20210621042359_squash.cs index 4273df4..c54a634 100644 --- a/src/EllieBot/Migrations/Sqlite/20210621042359_squash.cs +++ b/src/EllieBot/Migrations/Sqlite/20210621042359_squash.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; namespace EllieBot.Migrations { diff --git a/src/EllieBot/Migrations/Sqlite/20210707002343_cleanup.cs b/src/EllieBot/Migrations/Sqlite/20210707002343_cleanup.cs index 1d2dc92..b9cea6d 100644 --- a/src/EllieBot/Migrations/Sqlite/20210707002343_cleanup.cs +++ b/src/EllieBot/Migrations/Sqlite/20210707002343_cleanup.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; namespace EllieBot.Migrations { diff --git a/src/EllieBot/Migrations/Sqlite/20210914180026_image-only-channels.cs b/src/EllieBot/Migrations/Sqlite/20210914180026_image-only-channels.cs index 5dfbf73..3e1ca4a 100644 --- a/src/EllieBot/Migrations/Sqlite/20210914180026_image-only-channels.cs +++ b/src/EllieBot/Migrations/Sqlite/20210914180026_image-only-channels.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; namespace EllieBot.Migrations { diff --git a/src/EllieBot/Migrations/Sqlite/20211015232708_nsfw-blacklist-tags.cs b/src/EllieBot/Migrations/Sqlite/20211015232708_nsfw-blacklist-tags.cs index 760e27f..b1f5b4f 100644 --- a/src/EllieBot/Migrations/Sqlite/20211015232708_nsfw-blacklist-tags.cs +++ b/src/EllieBot/Migrations/Sqlite/20211015232708_nsfw-blacklist-tags.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; namespace EllieBot.Migrations { diff --git a/src/EllieBot/Migrations/Sqlite/20211213145407_atl-rework.cs b/src/EllieBot/Migrations/Sqlite/20211213145407_atl-rework.cs index bb7df2b..c602c24 100644 --- a/src/EllieBot/Migrations/Sqlite/20211213145407_atl-rework.cs +++ b/src/EllieBot/Migrations/Sqlite/20211213145407_atl-rework.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; namespace EllieBot.Migrations { diff --git a/src/EllieBot/Migrations/Sqlite/20220110105942_filter-settings-cleanup.cs b/src/EllieBot/Migrations/Sqlite/20220110105942_filter-settings-cleanup.cs index 0920046..f247be4 100644 --- a/src/EllieBot/Migrations/Sqlite/20220110105942_filter-settings-cleanup.cs +++ b/src/EllieBot/Migrations/Sqlite/20220110105942_filter-settings-cleanup.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/src/EllieBot/Migrations/Sqlite/20220409170828_clubs-refactor.cs b/src/EllieBot/Migrations/Sqlite/20220409170828_clubs-refactor.cs index 1dc81f7..3c863ab 100644 --- a/src/EllieBot/Migrations/Sqlite/20220409170828_clubs-refactor.cs +++ b/src/EllieBot/Migrations/Sqlite/20220409170828_clubs-refactor.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/src/EllieBot/Migrations/Sqlite/20220428051304_bank.cs b/src/EllieBot/Migrations/Sqlite/20220428051304_bank.cs index b3efa7e..3ac27ac 100644 --- a/src/EllieBot/Migrations/Sqlite/20220428051304_bank.cs +++ b/src/EllieBot/Migrations/Sqlite/20220428051304_bank.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/src/EllieBot/Migrations/Sqlite/20220503234243_new-rero.cs b/src/EllieBot/Migrations/Sqlite/20220503234243_new-rero.cs index dce2e4b..acb4e12 100644 --- a/src/EllieBot/Migrations/Sqlite/20220503234243_new-rero.cs +++ b/src/EllieBot/Migrations/Sqlite/20220503234243_new-rero.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/src/EllieBot/Migrations/Sqlite/20220614071359_patronage-system.cs b/src/EllieBot/Migrations/Sqlite/20220614071359_patronage-system.cs index fd1100f..b752b3c 100644 --- a/src/EllieBot/Migrations/Sqlite/20220614071359_patronage-system.cs +++ b/src/EllieBot/Migrations/Sqlite/20220614071359_patronage-system.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/src/EllieBot/Migrations/Sqlite/20220623073903_stondel-db-cache.cs b/src/EllieBot/Migrations/Sqlite/20220623073903_stondel-db-cache.cs index efce911..06eb71d 100644 --- a/src/EllieBot/Migrations/Sqlite/20220623073903_stondel-db-cache.cs +++ b/src/EllieBot/Migrations/Sqlite/20220623073903_stondel-db-cache.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/src/EllieBot/Migrations/Sqlite/20220725112348_xpitemshop.cs b/src/EllieBot/Migrations/Sqlite/20220725112348_xpitemshop.cs index ef8d9c4..84d2b74 100644 --- a/src/EllieBot/Migrations/Sqlite/20220725112348_xpitemshop.cs +++ b/src/EllieBot/Migrations/Sqlite/20220725112348_xpitemshop.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/src/EllieBot/Migrations/Sqlite/20220808141842_remove-obsolete-xp-columns.cs b/src/EllieBot/Migrations/Sqlite/20220808141842_remove-obsolete-xp-columns.cs index 8ef5757..c26f711 100644 --- a/src/EllieBot/Migrations/Sqlite/20220808141842_remove-obsolete-xp-columns.cs +++ b/src/EllieBot/Migrations/Sqlite/20220808141842_remove-obsolete-xp-columns.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/src/EllieBot/Migrations/Sqlite/20220916191702_autopub.cs b/src/EllieBot/Migrations/Sqlite/20220916191702_autopub.cs index f3d98db..d974254 100644 --- a/src/EllieBot/Migrations/Sqlite/20220916191702_autopub.cs +++ b/src/EllieBot/Migrations/Sqlite/20220916191702_autopub.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/src/EllieBot/Migrations/Sqlite/20221003111019_gambling-stats.cs b/src/EllieBot/Migrations/Sqlite/20221003111019_gambling-stats.cs index 6ebf812..cdff8c1 100644 --- a/src/EllieBot/Migrations/Sqlite/20221003111019_gambling-stats.cs +++ b/src/EllieBot/Migrations/Sqlite/20221003111019_gambling-stats.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/src/EllieBot/Migrations/Sqlite/20240502233144_v5.cs b/src/EllieBot/Migrations/Sqlite/20240502233144_v5.cs index da4fdd7..c6f46b5 100644 --- a/src/EllieBot/Migrations/Sqlite/20240502233144_v5.cs +++ b/src/EllieBot/Migrations/Sqlite/20240502233144_v5.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable diff --git a/src/EllieBot/Migrations/Sqlite/20240518221424_guidlconfig-cleanup.cs b/src/EllieBot/Migrations/Sqlite/20240518221424_guidlconfig-cleanup.cs index 33418e2..9f5aa20 100644 --- a/src/EllieBot/Migrations/Sqlite/20240518221424_guidlconfig-cleanup.cs +++ b/src/EllieBot/Migrations/Sqlite/20240518221424_guidlconfig-cleanup.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using System; +using Microsoft.EntityFrameworkCore.Migrations; #nullable disable @@ -10,8 +11,6 @@ namespace EllieBot.Migrations /// protected override void Up(MigrationBuilder migrationBuilder) { - MigrationQueries.GuildConfigCleanup(migrationBuilder); - migrationBuilder.DropForeignKey( name: "FK_AntiRaidSetting_GuildConfigs_GuildConfigId", table: "AntiRaidSetting"); diff --git a/src/EllieBot/Migrations/Sqlite/20240611180456_remove-patron-limits.Designer.cs b/src/EllieBot/Migrations/Sqlite/20240611180456_remove-patron-limits.Designer.cs deleted file mode 100644 index c0d277c..0000000 --- a/src/EllieBot/Migrations/Sqlite/20240611180456_remove-patron-limits.Designer.cs +++ /dev/null @@ -1,2921 +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("20240611180456_remove-patron-limits")] - partial class removepatronlimits - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.4"); - - 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("AutoDeleteByeMessagesTimer") - .HasColumnType("INTEGER"); - - b.Property("AutoDeleteGreetMessagesTimer") - .HasColumnType("INTEGER"); - - b.Property("AutoDeleteSelfAssignedRoleMessages") - .HasColumnType("INTEGER"); - - b.Property("BoostMessage") - .HasColumnType("TEXT"); - - b.Property("BoostMessageChannelId") - .HasColumnType("INTEGER"); - - b.Property("BoostMessageDeleteAfter") - .HasColumnType("INTEGER"); - - b.Property("ByeMessageChannelId") - .HasColumnType("INTEGER"); - - b.Property("ChannelByeMessageText") - .HasColumnType("TEXT"); - - b.Property("ChannelGreetMessageText") - .HasColumnType("TEXT"); - - 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("DmGreetMessageText") - .HasColumnType("TEXT"); - - 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("GreetMessageChannelId") - .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("SendBoostMessage") - .HasColumnType("INTEGER"); - - b.Property("SendChannelByeMessage") - .HasColumnType("INTEGER"); - - b.Property("SendChannelGreetMessage") - .HasColumnType("INTEGER"); - - b.Property("SendDmGreetMessage") - .HasColumnType("INTEGER"); - - 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.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.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/20240611180456_remove-patron-limits.cs b/src/EllieBot/Migrations/Sqlite/20240611180456_remove-patron-limits.cs deleted file mode 100644 index 1091268..0000000 --- a/src/EllieBot/Migrations/Sqlite/20240611180456_remove-patron-limits.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace EllieBot.Migrations -{ - /// - public partial class removepatronlimits : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "PatronQuotas"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "PatronQuotas", - columns: table => new - { - UserId = table.Column(type: "INTEGER", nullable: false), - FeatureType = table.Column(type: "INTEGER", nullable: false), - Feature = table.Column(type: "TEXT", nullable: false), - DailyCount = table.Column(type: "INTEGER", nullable: false), - HourlyCount = table.Column(type: "INTEGER", nullable: false), - MonthlyCount = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_PatronQuotas", x => new { x.UserId, x.FeatureType, x.Feature }); - }); - - migrationBuilder.CreateIndex( - name: "IX_PatronQuotas_UserId", - table: "PatronQuotas", - column: "UserId"); - } - } -} diff --git a/src/EllieBot/Migrations/Sqlite/20240627033508_honeypot.Designer.cs b/src/EllieBot/Migrations/Sqlite/20240627033508_honeypot.Designer.cs deleted file mode 100644 index c9ab166..0000000 --- a/src/EllieBot/Migrations/Sqlite/20240627033508_honeypot.Designer.cs +++ /dev/null @@ -1,2935 +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("20240627033508_honeypot")] - partial class honeypot - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.4"); - - 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("AutoDeleteByeMessagesTimer") - .HasColumnType("INTEGER"); - - b.Property("AutoDeleteGreetMessagesTimer") - .HasColumnType("INTEGER"); - - b.Property("AutoDeleteSelfAssignedRoleMessages") - .HasColumnType("INTEGER"); - - b.Property("BoostMessage") - .HasColumnType("TEXT"); - - b.Property("BoostMessageChannelId") - .HasColumnType("INTEGER"); - - b.Property("BoostMessageDeleteAfter") - .HasColumnType("INTEGER"); - - b.Property("ByeMessageChannelId") - .HasColumnType("INTEGER"); - - b.Property("ChannelByeMessageText") - .HasColumnType("TEXT"); - - b.Property("ChannelGreetMessageText") - .HasColumnType("TEXT"); - - 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("DmGreetMessageText") - .HasColumnType("TEXT"); - - 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("GreetMessageChannelId") - .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("SendBoostMessage") - .HasColumnType("INTEGER"); - - b.Property("SendChannelByeMessage") - .HasColumnType("INTEGER"); - - b.Property("SendChannelGreetMessage") - .HasColumnType("INTEGER"); - - b.Property("SendDmGreetMessage") - .HasColumnType("INTEGER"); - - 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.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/20240627033508_honeypot.cs b/src/EllieBot/Migrations/Sqlite/20240627033508_honeypot.cs deleted file mode 100644 index de5819a..0000000 --- a/src/EllieBot/Migrations/Sqlite/20240627033508_honeypot.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace EllieBot.Migrations -{ - /// - public partial class honeypot : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "HoneyPotChannels", - columns: table => new - { - GuildId = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - ChannelId = table.Column(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_HoneyPotChannels", x => x.GuildId); - }); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "HoneyPotChannels"); - } - } -} 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/20240912124710_greet-settings.cs b/src/EllieBot/Migrations/Sqlite/20240912124710_greet-settings.cs deleted file mode 100644 index 978c129..0000000 --- a/src/EllieBot/Migrations/Sqlite/20240912124710_greet-settings.cs +++ /dev/null @@ -1,197 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace EllieBot.Migrations -{ - /// - public partial class greetsettings : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "GreetSettings", - columns: table => new - { - Id = table.Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - 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), - ChannelId = table.Column(type: "INTEGER", 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"); - - migrationBuilder.DropColumn( - name: "AutoDeleteGreetMessagesTimer", - table: "GuildConfigs"); - - migrationBuilder.DropColumn( - name: "BoostMessage", - table: "GuildConfigs"); - - migrationBuilder.DropColumn( - name: "BoostMessageChannelId", - table: "GuildConfigs"); - - migrationBuilder.DropColumn( - name: "BoostMessageDeleteAfter", - table: "GuildConfigs"); - - migrationBuilder.DropColumn( - name: "ByeMessageChannelId", - table: "GuildConfigs"); - - migrationBuilder.DropColumn( - name: "ChannelByeMessageText", - table: "GuildConfigs"); - - migrationBuilder.DropColumn( - name: "ChannelGreetMessageText", - table: "GuildConfigs"); - - migrationBuilder.DropColumn( - name: "DmGreetMessageText", - table: "GuildConfigs"); - - migrationBuilder.DropColumn( - name: "GreetMessageChannelId", - table: "GuildConfigs"); - - migrationBuilder.DropColumn( - name: "SendBoostMessage", - table: "GuildConfigs"); - - migrationBuilder.DropColumn( - name: "SendChannelByeMessage", - table: "GuildConfigs"); - - migrationBuilder.DropColumn( - name: "SendChannelGreetMessage", - table: "GuildConfigs"); - - migrationBuilder.DropColumn( - name: "SendDmGreetMessage", - table: "GuildConfigs"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "GreetSettings"); - - migrationBuilder.AddColumn( - name: "AutoDeleteByeMessagesTimer", - table: "GuildConfigs", - type: "INTEGER", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "AutoDeleteGreetMessagesTimer", - table: "GuildConfigs", - type: "INTEGER", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "BoostMessage", - table: "GuildConfigs", - type: "TEXT", - nullable: true); - - migrationBuilder.AddColumn( - name: "BoostMessageChannelId", - table: "GuildConfigs", - type: "INTEGER", - nullable: false, - defaultValue: 0ul); - - migrationBuilder.AddColumn( - name: "BoostMessageDeleteAfter", - table: "GuildConfigs", - type: "INTEGER", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "ByeMessageChannelId", - table: "GuildConfigs", - type: "INTEGER", - nullable: false, - defaultValue: 0ul); - - migrationBuilder.AddColumn( - name: "ChannelByeMessageText", - table: "GuildConfigs", - type: "TEXT", - nullable: true); - - migrationBuilder.AddColumn( - name: "ChannelGreetMessageText", - table: "GuildConfigs", - type: "TEXT", - nullable: true); - - migrationBuilder.AddColumn( - name: "DmGreetMessageText", - table: "GuildConfigs", - type: "TEXT", - nullable: true); - - migrationBuilder.AddColumn( - name: "GreetMessageChannelId", - table: "GuildConfigs", - type: "INTEGER", - nullable: false, - defaultValue: 0ul); - - migrationBuilder.AddColumn( - name: "SendBoostMessage", - table: "GuildConfigs", - type: "INTEGER", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "SendChannelByeMessage", - table: "GuildConfigs", - type: "INTEGER", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "SendChannelGreetMessage", - table: "GuildConfigs", - type: "INTEGER", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "SendDmGreetMessage", - table: "GuildConfigs", - type: "INTEGER", - nullable: false, - defaultValue: false); - } - } -} \ No newline at end of file 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.Designer.cs b/src/EllieBot/Migrations/Sqlite/20241028033656_ncanvas.Designer.cs deleted file mode 100644 index d85e305..0000000 --- a/src/EllieBot/Migrations/Sqlite/20241028033656_ncanvas.Designer.cs +++ /dev/null @@ -1,2953 +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("20241028033656_ncanvas")] - partial class ncanvas - { - /// - 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.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.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/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..1d5dcf6 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 @@ -15,7 +15,7 @@ namespace EllieBot.Migrations protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.8"); + modelBuilder.HasAnnotation("ProductVersion", "8.0.4"); modelBuilder.Entity("EllieBot.Db.Models.AntiAltSetting", b => { @@ -560,6 +560,9 @@ namespace EllieBot.Migrations b.Property("DateAdded") .HasColumnType("TEXT"); + b.Property("Discriminator") + .HasColumnType("TEXT"); + b.Property("IsClubAdmin") .ValueGeneratedOnAdd() .HasColumnType("INTEGER") @@ -593,49 +596,9 @@ namespace EllieBot.Migrations 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") @@ -778,29 +741,6 @@ namespace EllieBot.Migrations 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") @@ -967,9 +907,33 @@ namespace EllieBot.Migrations b.Property("AutoAssignRoleIds") .HasColumnType("TEXT"); + b.Property("AutoDeleteByeMessagesTimer") + .HasColumnType("INTEGER"); + + b.Property("AutoDeleteGreetMessagesTimer") + .HasColumnType("INTEGER"); + b.Property("AutoDeleteSelfAssignedRoleMessages") .HasColumnType("INTEGER"); + b.Property("BoostMessage") + .HasColumnType("TEXT"); + + b.Property("BoostMessageChannelId") + .HasColumnType("INTEGER"); + + b.Property("BoostMessageDeleteAfter") + .HasColumnType("INTEGER"); + + b.Property("ByeMessageChannelId") + .HasColumnType("INTEGER"); + + b.Property("ChannelByeMessageText") + .HasColumnType("TEXT"); + + b.Property("ChannelGreetMessageText") + .HasColumnType("TEXT"); + b.Property("CleverbotEnabled") .HasColumnType("INTEGER"); @@ -985,6 +949,9 @@ namespace EllieBot.Migrations b.Property("DisableGlobalExpressions") .HasColumnType("INTEGER"); + b.Property("DmGreetMessageText") + .HasColumnType("TEXT"); + b.Property("ExclusiveSelfAssignedRoles") .HasColumnType("INTEGER"); @@ -1000,6 +967,9 @@ namespace EllieBot.Migrations b.Property("GameVoiceChannel") .HasColumnType("INTEGER"); + b.Property("GreetMessageChannelId") + .HasColumnType("INTEGER"); + b.Property("GuildId") .HasColumnType("INTEGER"); @@ -1018,6 +988,18 @@ namespace EllieBot.Migrations b.Property("Prefix") .HasColumnType("TEXT"); + b.Property("SendBoostMessage") + .HasColumnType("INTEGER"); + + b.Property("SendChannelByeMessage") + .HasColumnType("INTEGER"); + + b.Property("SendChannelGreetMessage") + .HasColumnType("INTEGER"); + + b.Property("SendDmGreetMessage") + .HasColumnType("INTEGER"); + b.Property("StickyRoles") .HasColumnType("INTEGER"); @@ -1051,20 +1033,6 @@ namespace EllieBot.Migrations 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") @@ -1273,36 +1241,69 @@ namespace EllieBot.Migrations b.ToTable("MutedUserId"); }); - modelBuilder.Entity("EllieBot.Db.Models.NCPixel", b => + modelBuilder.Entity("EllieBot.Db.Models.EllieExpression", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); - b.Property("Color") + b.Property("AllowTarget") .HasColumnType("INTEGER"); - b.Property("OwnerId") + b.Property("AutoDeleteTrigger") .HasColumnType("INTEGER"); - b.Property("Position") + b.Property("ContainsAnywhere") .HasColumnType("INTEGER"); - b.Property("Price") + b.Property("DateAdded") + .HasColumnType("TEXT"); + + b.Property("DmResponse") .HasColumnType("INTEGER"); - b.Property("Text") - .IsRequired() - .HasMaxLength(256) + b.Property("GuildId") + .HasColumnType("INTEGER"); + + b.Property("Reactions") + .HasColumnType("TEXT"); + + b.Property("Response") + .HasColumnType("TEXT"); + + b.Property("Trigger") .HasColumnType("TEXT"); b.HasKey("Id"); - b.HasAlternateKey("Position"); + b.ToTable("Expressions"); + }); - b.HasIndex("OwnerId"); + modelBuilder.Entity("EllieBot.Db.Models.PatronQuota", b => + { + b.Property("UserId") + .HasColumnType("INTEGER"); - b.ToTable("NCPixel"); + b.Property("FeatureType") + .HasColumnType("INTEGER"); + + b.Property("Feature") + .HasColumnType("TEXT"); + + b.Property("DailyCount") + .HasColumnType("INTEGER"); + + b.Property("HourlyCount") + .HasColumnType("INTEGER"); + + b.Property("MonthlyCount") + .HasColumnType("INTEGER"); + + b.HasKey("UserId", "FeatureType", "Feature"); + + b.HasIndex("UserId"); + + b.ToTable("PatronQuotas"); }); modelBuilder.Entity("EllieBot.Db.Models.PatronUser", b => @@ -2237,7 +2238,7 @@ namespace EllieBot.Migrations b.Property("DateAdded") .HasColumnType("TEXT"); - b.Property("GuildId") + b.Property("GuildConfigId") .HasColumnType("INTEGER"); b.Property("Punishment") @@ -2251,7 +2252,7 @@ namespace EllieBot.Migrations b.HasKey("Id"); - b.HasAlternateKey("GuildId", "Count"); + b.HasIndex("GuildConfigId"); b.ToTable("WarningPunishment"); }); @@ -2363,94 +2364,6 @@ namespace EllieBot.Migrations 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) @@ -2866,6 +2779,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") @@ -2978,6 +2899,8 @@ namespace EllieBot.Migrations b.Navigation("VcRoleInfos"); + b.Navigation("WarnPunishments"); + b.Navigation("XpSettings"); }); diff --git a/src/EllieBot/Modules/Administration/AdministrationService.cs b/src/EllieBot/Modules/Administration/AdministrationService.cs index b1bec59..de037bd 100644 --- a/src/EllieBot/Modules/Administration/AdministrationService.cs +++ b/src/EllieBot/Modules/Administration/AdministrationService.cs @@ -1,5 +1,6 @@ #nullable disable using Microsoft.EntityFrameworkCore; +using EllieBot.Db; using EllieBot.Db.Models; using EllieBot.Modules.Administration._common.results; 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/AutoAssignableRoles/AutoAssignRoleService.cs b/src/EllieBot/Modules/Administration/AutoAssignableRoles/AutoAssignRoleService.cs index 5e232f8..f373d45 100644 --- a/src/EllieBot/Modules/Administration/AutoAssignableRoles/AutoAssignRoleService.cs +++ b/src/EllieBot/Modules/Administration/AutoAssignableRoles/AutoAssignRoleService.cs @@ -4,6 +4,7 @@ using System.Net; using System.Threading.Channels; using LinqToDB; using Microsoft.EntityFrameworkCore; +using EllieBot.Db; namespace EllieBot.Modules.Administration.Services; diff --git a/src/EllieBot/Modules/Administration/AutoPublishService.cs b/src/EllieBot/Modules/Administration/AutoPublishService.cs index 2e877bb..8f29495 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; @@ -42,31 +43,19 @@ public class AutoPublishService : IExecNoCommand, IReadyExecutor, IEService 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 +64,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..8fee8a3 100644 --- a/src/EllieBot/Modules/Administration/DangerousCommands/CleanupCommands.cs +++ b/src/EllieBot/Modules/Administration/DangerousCommands/CleanupCommands.cs @@ -1,20 +1,14 @@ -using EllieBot.Modules.Administration.DangerousCommands; +namespace EllieBot.Modules.Administration.DangerousCommands; -namespace EllieBot.Modules.Administration; - -public partial class Administration +public partial class Administration { [Group] - public partial class CleanupCommands : CleanupModuleBase + public class CleanupCommands : CleanupModuleBase { private readonly ICleanupService _svc; - private readonly IBotCredsProvider _creds; - public CleanupCommands(ICleanupService svc, IBotCredsProvider creds) - { - _svc = svc; - _creds = creds; - } + public CleanupCommands(ICleanupService svc) + => _svc = svc; [Cmd] [OwnerOnly] @@ -33,42 +27,5 @@ public partial class Administration .Confirm($"{result.GuildCount} guilds' data remain in the database.") .SendAsync(); } - - [Cmd] - [RequireContext(ContextType.Guild)] - [UserPerm(GuildPerm.Administrator)] - public async Task Keep() - { - var result = await _svc.KeepGuild(Context.Guild.Id); - - await Response().Text("This guild's bot data will be saved.").SendAsync(); - } - - [Cmd] - [OwnerOnly] - public async Task LeaveUnkeptServers(int startShardId, int shardMultiplier = 3000) - { - var keptGuildCount = await _svc.GetKeptGuildCount(); - - var response = await PromptUserConfirmAsync(new EmbedBuilder() - .WithDescription($""" - Do you want the bot to leave all unkept servers? - - There are currently {keptGuildCount} kept servers. - - **This is a highly destructive and irreversible action.** - """)); - - if (!response) - return; - - for (var shardId = startShardId; shardId < _creds.GetCreds().TotalShards; shardId++) - { - await _svc.StartLeavingUnkeptServers(shardId); - await Task.Delay(shardMultiplier * 1000); - } - - await ctx.OkAsync(); - } } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Administration/DangerousCommands/CleanupService.cs b/src/EllieBot/Modules/Administration/DangerousCommands/CleanupService.cs index fcf5612..3555a61 100644 --- a/src/EllieBot/Modules/Administration/DangerousCommands/CleanupService.cs +++ b/src/EllieBot/Modules/Administration/DangerousCommands/CleanupService.cs @@ -1,7 +1,6 @@ using LinqToDB; using LinqToDB.Data; using LinqToDB.EntityFrameworkCore; -using LinqToDB.Mapping; using EllieBot.Common.ModuleBehaviors; using EllieBot.Db.Models; @@ -9,12 +8,9 @@ namespace EllieBot.Modules.Administration.DangerousCommands; public sealed class CleanupService : ICleanupService, IReadyExecutor, IEService { - private TypedKey _cleanupReportKey = new("cleanup:report"); - private TypedKey _cleanupTriggerKey = new("cleanup:trigger"); - - private TypedKey _keepTriggerKey = new("keep:trigger"); - private readonly IPubSub _pubSub; + private TypedKey _keepReportKey = new("cleanup:report"); + private TypedKey _keepTriggerKey = new("cleanup:trigger"); private readonly DiscordSocketClient _client; private ConcurrentDictionary guildIds = new(); private readonly IBotCredsProvider _creds; @@ -32,90 +28,11 @@ public sealed class CleanupService : ICleanupService, IReadyExecutor, IEService _db = db; } - public async Task OnReadyAsync() - { - await _pubSub.Sub(_cleanupTriggerKey, OnCleanupTrigger); - await _pubSub.Sub(_keepTriggerKey, InternalTriggerKeep); - - _client.JoinedGuild += ClientOnJoinedGuild; - - if (_client.ShardId == 0) - await _pubSub.Sub(_cleanupReportKey, OnKeepReport); - } - - private bool keepTriggered = false; - - private async ValueTask InternalTriggerKeep(int shardId) - { - if (_client.ShardId != shardId) - return; - - if (keepTriggered) - return; - - keepTriggered = true; - try - { - var allGuildIds = _client.Guilds.Select(x => x.Id).ToArray(); - - HashSet dontDelete; - await using (var db = _db.GetDbContext()) - { - await using var ctx = db.CreateLinqToDBContext(); - var table = ctx.CreateTable(tableOptions: TableOptions.CheckExistence); - - var dontDeleteList = await table - .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", - allGuildIds.Length - dontDelete.Count, - dontDelete.Count); - - foreach (var guildId in allGuildIds) - { - if (dontDelete.Contains(guildId)) - continue; - - await Task.Delay(1016); - - SocketGuild? guild = null; - try - { - guild = _client.GetGuild(guildId); - - if (guild is null) - { - Log.Warning("Unable to find guild {GuildId}", guildId); - continue; - } - - await guild.LeaveAsync(); - } - catch (Exception ex) - { - Log.Warning("Unable to leave guild {GuildName} [{GuildId}]: {ErrorMessage}", - guild?.Name, - guildId, - ex.Message); - } - } - } - finally - { - keepTriggered = false; - } - } - public async Task DeleteMissingGuildDataAsync() { guildIds = new(); var totalShards = _creds.GetCreds().TotalShards; - await _pubSub.Pub(_cleanupTriggerKey, true); + await _pubSub.Pub(_keepTriggerKey, true); var counter = 0; while (guildIds.Keys.Count < totalShards) { @@ -144,128 +61,40 @@ public sealed class CleanupService : ICleanupService, IReadyExecutor, IEService })); } - // delete guild configs await ctx.GetTable() .Where(x => !tempTable.Select(x => x.GuildId) .Contains(x.GuildId)) .DeleteAsync(); - // delete guild xp + await ctx.GetTable() .Where(x => !tempTable.Select(x => x.GuildId) .Contains(x.GuildId)) .DeleteAsync(); - // delete expressions - await ctx.GetTable() - .Where(x => x.GuildId != null - && !tempTable.Select(x => x.GuildId) - .Contains(x.GuildId.Value)) - .DeleteAsync(); - - // delete quotes - await ctx.GetTable() - .Where(x => !tempTable.Select(x => x.GuildId) - .Contains(x.GuildId)) - .DeleteAsync(); - - // delete planted currencies - await ctx.GetTable() - .Where(x => !tempTable.Select(x => x.GuildId) - .Contains(x.GuildId)) - .DeleteAsync(); - - // delete image only channels - await ctx.GetTable() - .Where(x => !tempTable.Select(x => x.GuildId) - .Contains(x.GuildId)) - .DeleteAsync(); - - // delete reaction roles - await ctx.GetTable() - .Where(x => !tempTable.Select(x => x.GuildId) - .Contains(x.GuildId)) - .DeleteAsync(); - - // delete ignored users - await ctx.GetTable() - .Where(x => x.GuildId != null - && !tempTable.Select(x => x.GuildId) - .Contains(x.GuildId.Value)) - .DeleteAsync(); - - // delete perm overrides - await ctx.GetTable() - .Where(x => x.GuildId != null - && !tempTable.Select(x => x.GuildId) - .Contains(x.GuildId.Value)) - .DeleteAsync(); - - // delete repeaters - await ctx.GetTable() - .Where(x => !tempTable.Select(x => x.GuildId) - .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, }; } - - public async Task KeepGuild(ulong guildId) - { - await using var db = _db.GetDbContext(); - await using var ctx = db.CreateLinqToDBContext(); - var table = ctx.CreateTable(tableOptions: TableOptions.CheckExistence); - if (await table.AnyAsyncLinqToDB(x => x.GuildId == guildId)) - return false; - - await table.InsertAsync(() => new() - { - GuildId = guildId - }); - - return true; - } - - public async Task GetKeptGuildCount() - { - await using var db = _db.GetDbContext(); - await using var ctx = db.CreateLinqToDBContext(); - var table = ctx.CreateTable(tableOptions: TableOptions.CheckExistence); - return await table.CountAsync(); - } - - public async Task StartLeavingUnkeptServers(int shardId) - => await _pubSub.Pub(_keepTriggerKey, shardId); - + private ValueTask OnKeepReport(KeepReport report) { guildIds[report.ShardId] = report.GuildIds; return default; } - private async Task ClientOnJoinedGuild(SocketGuild arg) + public async Task OnReadyAsync() { - await KeepGuild(arg.Id); + await _pubSub.Sub(_keepTriggerKey, OnKeepTrigger); + + if (_client.ShardId == 0) + await _pubSub.Sub(_keepReportKey, OnKeepReport); } - private ValueTask OnCleanupTrigger(bool arg) + private ValueTask OnKeepTrigger(bool arg) { - _pubSub.Pub(_cleanupReportKey, + _pubSub.Pub(_keepReportKey, new KeepReport() { ShardId = _client.ShardId, @@ -274,10 +103,4 @@ public sealed class CleanupService : ICleanupService, IReadyExecutor, IEService return default; } -} - -public class KeptGuilds -{ - [PrimaryKey] - public ulong GuildId { get; set; } } \ No newline at end of file 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/DangerousCommands/_common/ICleanupService.cs b/src/EllieBot/Modules/Administration/DangerousCommands/_common/ICleanupService.cs index 8988f32..a396082 100644 --- a/src/EllieBot/Modules/Administration/DangerousCommands/_common/ICleanupService.cs +++ b/src/EllieBot/Modules/Administration/DangerousCommands/_common/ICleanupService.cs @@ -3,7 +3,4 @@ public interface ICleanupService { Task DeleteMissingGuildDataAsync(); - Task KeepGuild(ulong guildId); - Task GetKeptGuildCount(); - Task StartLeavingUnkeptServers(int shardId); } \ No newline at end of file diff --git a/src/EllieBot/Modules/Administration/GameVoiceChannel/GameVoiceChannelService.cs b/src/EllieBot/Modules/Administration/GameVoiceChannel/GameVoiceChannelService.cs index e83e5a3..54f9870 100644 --- a/src/EllieBot/Modules/Administration/GameVoiceChannel/GameVoiceChannelService.cs +++ b/src/EllieBot/Modules/Administration/GameVoiceChannel/GameVoiceChannelService.cs @@ -1,4 +1,6 @@ #nullable disable +using EllieBot.Db; + namespace EllieBot.Modules.Administration.Services; public class GameVoiceChannelService : IEService diff --git a/src/EllieBot/Modules/Administration/GreetBye/GreetCommands.cs b/src/EllieBot/Modules/Administration/GreetBye/GreetCommands.cs index fa404db..53dd058 100644 --- a/src/EllieBot/Modules/Administration/GreetBye/GreetCommands.cs +++ b/src/EllieBot/Modules/Administration/GreetBye/GreetCommands.cs @@ -8,240 +8,222 @@ public partial class Administration [Cmd] [RequireContext(ContextType.Guild)] [UserPerm(GuildPerm.ManageGuild)] - public Task Boost() - => Toggle(GreetType.Boost); - - [Cmd] - [RequireContext(ContextType.Guild)] - [UserPerm(GuildPerm.ManageGuild)] - public Task BoostDel(int timer = 30) - => SetDel(GreetType.Boost, timer); - - [Cmd] - [RequireContext(ContextType.Guild)] - [UserPerm(GuildPerm.ManageGuild)] - public Task BoostMsg([Leftover] string? text = null) - => SetMsg(GreetType.Boost, text); - - [Cmd] - [RequireContext(ContextType.Guild)] - [UserPerm(GuildPerm.ManageGuild)] - public Task Greet() - => Toggle(GreetType.Greet); - - [Cmd] - [RequireContext(ContextType.Guild)] - [UserPerm(GuildPerm.ManageGuild)] - public Task GreetDel(int timer = 30) - => SetDel(GreetType.Greet, timer); - - [Cmd] - [RequireContext(ContextType.Guild)] - [UserPerm(GuildPerm.ManageGuild)] - public Task GreetMsg([Leftover] string? text = null) - => SetMsg(GreetType.Greet, text); - - [Cmd] - [RequireContext(ContextType.Guild)] - [UserPerm(GuildPerm.ManageGuild)] - public Task GreetDm() - => Toggle(GreetType.GreetDm); - - [Cmd] - [RequireContext(ContextType.Guild)] - [UserPerm(GuildPerm.ManageGuild)] - public Task GreetDmMsg([Leftover] string? text = null) - => SetMsg(GreetType.GreetDm, text); - - [Cmd] - [RequireContext(ContextType.Guild)] - [UserPerm(GuildPerm.ManageGuild)] - public Task Bye() - => Toggle(GreetType.Bye); - - [Cmd] - [RequireContext(ContextType.Guild)] - [UserPerm(GuildPerm.ManageGuild)] - public Task ByeDel(int timer = 30) - => SetDel(GreetType.Bye, timer); - - [Cmd] - [RequireContext(ContextType.Guild)] - [UserPerm(GuildPerm.ManageGuild)] - public Task ByeMsg([Leftover] string? text = null) - => SetMsg(GreetType.Bye, text); - - [Cmd] - [RequireContext(ContextType.Guild)] - [UserPerm(GuildPerm.ManageGuild)] - public Task GreetTest([Leftover] IGuildUser? user = null) - => Test(GreetType.Greet, user); - - [Cmd] - [RequireContext(ContextType.Guild)] - [UserPerm(GuildPerm.ManageGuild)] - public Task GreetDmTest([Leftover] IGuildUser? user = null) - => Test(GreetType.GreetDm, user); - - [Cmd] - [RequireContext(ContextType.Guild)] - [UserPerm(GuildPerm.ManageGuild)] - [Ratelimit(5)] - public Task ByeTest([Leftover] IGuildUser? user = null) - => Test(GreetType.Bye, user); - - [Cmd] - [RequireContext(ContextType.Guild)] - [UserPerm(GuildPerm.ManageGuild)] - [Ratelimit(5)] - public Task BoostTest([Leftover] IGuildUser? user = null) - => Test(GreetType.Boost, user); - - - public async Task Toggle(GreetType type) + public async Task Boost() { - var enabled = await _service.SetGreet(ctx.Guild.Id, ctx.Channel.Id, type); + var enabled = await _service.ToggleBoost(ctx.Guild.Id, ctx.Channel.Id); if (enabled) - await Response() - .Confirm( - type switch - { - GreetType.Boost => strs.boost_on, - GreetType.Greet => strs.greet_on, - GreetType.Bye => strs.bye_on, - GreetType.GreetDm => strs.greetdm_on, - _ => strs.error - } - ) - .SendAsync(); + await Response().Confirm(strs.boost_on).SendAsync(); else - await Response() - .Pending( - type switch - { - GreetType.Boost => strs.boost_off, - GreetType.Greet => strs.greet_off, - GreetType.Bye => strs.bye_off, - GreetType.GreetDm => strs.greetdm_off, - _ => strs.error - } - ) - .SendAsync(); + await Response().Pending(strs.boost_off).SendAsync(); } - - public async Task SetDel(GreetType type, int timer) + [Cmd] + [RequireContext(ContextType.Guild)] + [UserPerm(GuildPerm.ManageGuild)] + public async Task BoostDel(int timer = 30) { if (timer is < 0 or > 600) return; - await _service.SetDeleteTimer(ctx.Guild.Id, type, timer); + await _service.SetBoostDel(ctx.Guild.Id, timer); if (timer > 0) - await Response() - .Confirm( - type switch - { - GreetType.Boost => strs.boostdel_on(timer), - GreetType.Greet => strs.greetdel_on(timer), - GreetType.Bye => strs.byedel_on(timer), - _ => strs.error - } - ) - .SendAsync(); + await Response().Confirm(strs.boostdel_on(timer)).SendAsync(); else - await Response() - .Pending( - type switch - { - GreetType.Boost => strs.boostdel_off, - GreetType.Greet => strs.greetdel_off, - GreetType.Bye => strs.byedel_off, - _ => strs.error - }) - .SendAsync(); + await Response().Pending(strs.boostdel_off).SendAsync(); } - - public async Task SetMsg(GreetType type, string? text = null) + [Cmd] + [RequireContext(ContextType.Guild)] + [UserPerm(GuildPerm.ManageGuild)] + public async Task BoostMsg([Leftover] string? text = null) { if (string.IsNullOrWhiteSpace(text)) { - var conf = await _service.GetGreetSettingsAsync(ctx.Guild.Id, type); - var msg = conf?.MessageText ?? GreetService.GetDefaultGreet(type); - await Response() - .Confirm( - type switch - { - GreetType.Boost => strs.boostmsg_cur(msg), - GreetType.Greet => strs.greetmsg_cur(msg), - GreetType.Bye => strs.byemsg_cur(msg), - GreetType.GreetDm => strs.greetdmmsg_cur(msg), - _ => strs.error - }) - .SendAsync(); + var boostMessage = _service.GetBoostMessage(ctx.Guild.Id); + await Response().Confirm(strs.boostmsg_cur(boostMessage?.SanitizeMentions())).SendAsync(); return; } - var isEnabled = await _service.SetMessage(ctx.Guild.Id, type, text); + var sendBoostEnabled = _service.SetBoostMessage(ctx.Guild.Id, ref text); - await Response() - .Confirm(type switch - { - GreetType.Boost => strs.boostmsg_new, - GreetType.Greet => strs.greetmsg_new, - GreetType.Bye => strs.byemsg_new, - GreetType.GreetDm => strs.greetdmmsg_new, - _ => strs.error - }) - .SendAsync(); - - - if (!isEnabled) - { - await SendGreetEnableHint(type); - } + await Response().Confirm(strs.boostmsg_new).SendAsync(); + if (!sendBoostEnabled) + await Response().Pending(strs.boostmsg_enable($"`{prefix}boost`")).SendAsync(); } - private static string GetCmdName(GreetType type) + [Cmd] + [RequireContext(ContextType.Guild)] + [UserPerm(GuildPerm.ManageGuild)] + public async Task GreetDel(int timer = 30) { - var cmdName = type switch - { - GreetType.Greet => "greet", - GreetType.Bye => "bye", - GreetType.Boost => "boost", - GreetType.GreetDm => "greetdm", - _ => "unknown_command" - }; - return cmdName; + if (timer is < 0 or > 600) + return; + + await _service.SetGreetDel(ctx.Guild.Id, timer); + + if (timer > 0) + await Response().Confirm(strs.greetdel_on(timer)).SendAsync(); + else + await Response().Pending(strs.greetdel_off).SendAsync(); } - public async Task Test(GreetType type, IGuildUser? user = null) + [Cmd] + [RequireContext(ContextType.Guild)] + [UserPerm(GuildPerm.ManageGuild)] + public async Task Greet() + { + var enabled = await _service.SetGreet(ctx.Guild.Id, ctx.Channel.Id); + + if (enabled) + await Response().Confirm(strs.greet_on).SendAsync(); + else + await Response().Pending(strs.greet_off).SendAsync(); + } + + [Cmd] + [RequireContext(ContextType.Guild)] + [UserPerm(GuildPerm.ManageGuild)] + public async Task GreetMsg([Leftover] string? text = null) + { + if (string.IsNullOrWhiteSpace(text)) + { + var greetMsg = _service.GetGreetMsg(ctx.Guild.Id); + await Response().Confirm(strs.greetmsg_cur(greetMsg?.SanitizeMentions())).SendAsync(); + return; + } + + var sendGreetEnabled = _service.SetGreetMessage(ctx.Guild.Id, ref text); + + await Response().Confirm(strs.greetmsg_new).SendAsync(); + + if (!sendGreetEnabled) + await Response().Pending(strs.greetmsg_enable($"`{prefix}greet`")).SendAsync(); + } + + [Cmd] + [RequireContext(ContextType.Guild)] + [UserPerm(GuildPerm.ManageGuild)] + public async Task GreetDm() + { + var enabled = await _service.SetGreetDm(ctx.Guild.Id); + + if (enabled) + await Response().Confirm(strs.greetdm_on).SendAsync(); + else + await Response().Confirm(strs.greetdm_off).SendAsync(); + } + + [Cmd] + [RequireContext(ContextType.Guild)] + [UserPerm(GuildPerm.ManageGuild)] + public async Task GreetDmMsg([Leftover] string? text = null) + { + if (string.IsNullOrWhiteSpace(text)) + { + var dmGreetMsg = _service.GetDmGreetMsg(ctx.Guild.Id); + await Response().Confirm(strs.greetdmmsg_cur(dmGreetMsg?.SanitizeMentions())).SendAsync(); + return; + } + + var sendGreetEnabled = _service.SetGreetDmMessage(ctx.Guild.Id, ref text); + + await Response().Confirm(strs.greetdmmsg_new).SendAsync(); + if (!sendGreetEnabled) + await Response().Pending(strs.greetdmmsg_enable($"`{prefix}greetdm`")).SendAsync(); + } + + [Cmd] + [RequireContext(ContextType.Guild)] + [UserPerm(GuildPerm.ManageGuild)] + public async Task Bye() + { + var enabled = await _service.SetBye(ctx.Guild.Id, ctx.Channel.Id); + + if (enabled) + await Response().Confirm(strs.bye_on).SendAsync(); + else + await Response().Confirm(strs.bye_off).SendAsync(); + } + + [Cmd] + [RequireContext(ContextType.Guild)] + [UserPerm(GuildPerm.ManageGuild)] + public async Task ByeMsg([Leftover] string? text = null) + { + if (string.IsNullOrWhiteSpace(text)) + { + var byeMsg = _service.GetByeMessage(ctx.Guild.Id); + await Response().Confirm(strs.byemsg_cur(byeMsg?.SanitizeMentions())).SendAsync(); + return; + } + + var sendByeEnabled = _service.SetByeMessage(ctx.Guild.Id, ref text); + + await Response().Confirm(strs.byemsg_new).SendAsync(); + if (!sendByeEnabled) + await Response().Pending(strs.byemsg_enable($"`{prefix}bye`")).SendAsync(); + } + + [Cmd] + [RequireContext(ContextType.Guild)] + [UserPerm(GuildPerm.ManageGuild)] + public async Task ByeDel(int timer = 30) + { + await _service.SetByeDel(ctx.Guild.Id, timer); + + if (timer > 0) + await Response().Confirm(strs.byedel_on(timer)).SendAsync(); + else + await Response().Pending(strs.byedel_off).SendAsync(); + } + + + [Cmd] + [RequireContext(ContextType.Guild)] + [UserPerm(GuildPerm.ManageGuild)] + [Ratelimit(5)] + public async Task ByeTest([Leftover] IGuildUser? user = null) { user ??= (IGuildUser)ctx.User; - 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); + await _service.ByeTest((ITextChannel)ctx.Channel, user); + var enabled = _service.GetByeEnabled(ctx.Guild.Id); + if (!enabled) + await Response().Pending(strs.byemsg_enable($"`{prefix}bye`")).SendAsync(); } - private async Task SendGreetEnableHint(GreetType type) + [Cmd] + [RequireContext(ContextType.Guild)] + [UserPerm(GuildPerm.ManageGuild)] + [Ratelimit(5)] + public async Task GreetTest([Leftover] IGuildUser? user = null) { - var cmd = $"`{prefix}{GetCmdName(type)}`"; + user ??= (IGuildUser)ctx.User; - 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 _service.GreetTest((ITextChannel)ctx.Channel, user); + var enabled = _service.GetGreetEnabled(ctx.Guild.Id); + if (!enabled) + await Response().Pending(strs.greetmsg_enable($"`{prefix}greet`")).SendAsync(); + } + + [Cmd] + [RequireContext(ContextType.Guild)] + [UserPerm(GuildPerm.ManageGuild)] + [Ratelimit(5)] + public async Task GreetDmTest([Leftover] IGuildUser? user = null) + { + user ??= (IGuildUser)ctx.User; + + var success = await _service.GreetDmTest(user); + if (success) + await ctx.OkAsync(); + else + await ctx.WarningAsync(); + var enabled = _service.GetGreetDmEnabled(ctx.Guild.Id); + if (!enabled) + await Response().Pending(strs.greetdmmsg_enable($"`{prefix}greetdm`")).SendAsync(); } } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Administration/GreetBye/GreetGrouper.cs b/src/EllieBot/Modules/Administration/GreetBye/GreetGrouper.cs new file mode 100644 index 0000000..a92256e --- /dev/null +++ b/src/EllieBot/Modules/Administration/GreetBye/GreetGrouper.cs @@ -0,0 +1,71 @@ +namespace EllieBot.Services; + +public class GreetGrouper +{ + private readonly Dictionary> _group; + private readonly object _locker = new(); + + public GreetGrouper() + => _group = new(); + + + /// + /// Creates a group, if group already exists, adds the specified user + /// + /// Id of the server for which to create group for + /// User to add if group already exists + /// + public bool CreateOrAdd(ulong guildId, T toAddIfExists) + { + lock (_locker) + { + if (_group.TryGetValue(guildId, out var list)) + { + list.Add(toAddIfExists); + return false; + } + + _group[guildId] = new(); + return true; + } + } + + /// + /// Remove the specified amount of items from the group. If all items are removed, group will be removed. + /// + /// Id of the group + /// Maximum number of items to retrieve + /// Items retrieved + /// Whether the group has no more items left and is deleted + public bool ClearGroup(ulong guildId, int count, out IReadOnlyCollection items) + { + lock (_locker) + { + if (_group.TryGetValue(guildId, out var set)) + { + // if we want more than there are, return everything + if (count >= set.Count) + { + items = set; + _group.Remove(guildId); + return true; + } + + // if there are more in the group than what's needed + // take the requested number, remove them from the set + // and return them + var toReturn = set.TakeWhile(_ => count-- != 0).ToList(); + foreach (var item in toReturn) + set.Remove(item); + + items = toReturn; + // returning falsemeans group is not yet deleted + // because there are items left + return false; + } + + items = Array.Empty(); + return true; + } + } +} \ 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..aec7e9e 100644 --- a/src/EllieBot/Modules/Administration/GreetBye/GreetService.cs +++ b/src/EllieBot/Modules/Administration/GreetBye/GreetService.cs @@ -1,101 +1,64 @@ -using LinqToDB; -using LinqToDB.EntityFrameworkCore; -using LinqToDB.Tools; using EllieBot.Common.ModuleBehaviors; +using EllieBot.Db; +using EllieBot.Db.Models; using System.Threading.Channels; namespace EllieBot.Services; public class GreetService : IEService, IReadyExecutor { + public bool GroupGreets + => _bss.Data.GroupGreets; + private readonly DbService _db; - private ConcurrentDictionary> _enabled = new(); - + private readonly ConcurrentDictionary _guildConfigsCache; private readonly DiscordSocketClient _client; + private readonly GreetGrouper _greets = new(); + private readonly GreetGrouper _byes = new(); + private readonly BotConfigService _bss; private readonly IReplacementService _repSvc; - private readonly IBotCache _cache; private readonly IMessageSenderService _sender; - private readonly Channel<(GreetSettings, IUser, ITextChannel?)> _greetQueue = - Channel.CreateBounded<(GreetSettings, IUser, ITextChannel?)>( - new BoundedChannelOptions(60) - { - FullMode = BoundedChannelFullMode.DropOldest - }); - public GreetService( DiscordSocketClient client, + IBot bot, DbService db, + BotConfigService bss, IMessageSenderService sender, - IReplacementService repSvc, - IBotCache cache - ) + IReplacementService repSvc) { _db = db; _client = client; + _bss = bss; _repSvc = repSvc; - _cache = cache; _sender = sender; - - foreach (var type in Enum.GetValues()) - { - _enabled[type] = new(); - } - } - - public async Task OnReadyAsync() - { - // cache all enabled guilds - await using (var uow = _db.GetDbContext()) - { - var guilds = _client.Guilds.Select(x => x.Id).ToList(); - var enabled = await uow.GetTable() - .Where(x => x.GuildId.In(guilds)) - .Where(x => x.IsEnabled) - .Select(x => new - { - x.GuildId, - x.GreetType - }) - .ToListAsync(); - - foreach (var e in enabled) - { - _enabled[e.GreetType].Add(e.GuildId); - } - } + _guildConfigsCache = new(bot.AllGuildConfigs.ToDictionary(g => g.GuildId, GreetSettings.Create)); _client.UserJoined += OnUserJoined; _client.UserLeft += OnUserLeft; + bot.JoinedGuild += OnBotJoinedGuild; _client.LeftGuild += OnClientLeftGuild; _client.GuildMemberUpdated += ClientOnGuildMemberUpdated; + } + public async Task OnReadyAsync() + { while (true) { - 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, compl) = await _greetDmQueue.Reader.ReadAsync(); + var res = await GreetDmUserInternal(conf, user); + compl.TrySetResult(res); + await Task.Delay(2000); } } 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 }) @@ -103,74 +66,60 @@ public class GreetService : IEService, IReadyExecutor && newUser.PremiumSince is { } newDate && newDate > oldDate)) { - _ = Task.Run(async () => - { - var conf = await GetGreetSettingsAsync(newUser.Guild.Id, GreetType.Boost); + var conf = GetOrAddSettingsForGuild(newUser.Guild.Id); + if (!conf.SendBoostMessage) + return Task.CompletedTask; - if (conf is null || !conf.IsEnabled) - return; - - ITextChannel? channel = null; - if (conf.ChannelId is { } cid) - channel = newUser.Guild.GetTextChannel(cid); - - if (channel is null) - return; - - await GreetUsers(conf, channel, newUser); - }); + _ = Task.Run(TriggerBoostMessage(conf, newUser)); } return Task.CompletedTask; } - private async Task OnClientLeftGuild(SocketGuild guild) - { - foreach (var gt in Enum.GetValues()) + private Func TriggerBoostMessage(GreetSettings conf, SocketGuildUser user) + => async () => { - _enabled[gt].TryRemove(guild.Id); + var channel = user.Guild.GetTextChannel(conf.BoostMessageChannelId); + if (channel is null) + return; + + await SendBoostMessage(conf, user, channel); + }; + + private async Task SendBoostMessage(GreetSettings conf, IGuildUser user, ITextChannel channel) + { + if (string.IsNullOrWhiteSpace(conf.BoostMessage)) + return false; + + var toSend = SmartText.CreateFrom(conf.BoostMessage); + + try + { + var newContent = await _repSvc.ReplaceAsync(toSend, + new(client: _client, guild: user.Guild, channel: channel, users: user)); + var toDelete = await _sender.Response(channel).Text(newContent).Sanitize(false).SendAsync(); + if (conf.BoostMessageDeleteAfter > 0) + toDelete.DeleteAfter(conf.BoostMessageDeleteAfter); + + return true; + } + catch (Exception ex) + { + Log.Error(ex, "Error sending boost message"); } - await using var uow = _db.GetDbContext(); - await uow.GetTable() - .Where(x => x.GuildId == guild.Id) - .DeleteAsync(); + return false; } - private Task OnUserJoined(IGuildUser user) + private Task OnClientLeftGuild(SocketGuild arg) { - _ = 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)); - } - } - } + _guildConfigsCache.TryRemove(arg.Id, out _); + return Task.CompletedTask; + } - - 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"); - } - }); + private Task OnBotJoinedGuild(GuildConfig gc) + { + _guildConfigsCache[gc.GuildId] = GreetSettings.Create(gc); return Task.CompletedTask; } @@ -178,27 +127,37 @@ public class GreetService : IEService, IReadyExecutor { _ = Task.Run(async () => { - if (!_enabled[GreetType.Bye].Contains(guild.Id)) - return; - try { - var conf = await GetGreetSettingsAsync(guild.Id, GreetType.Bye); + var conf = GetOrAddSettingsForGuild(guild.Id); - if (conf?.ChannelId is not { } cid) + if (!conf.SendChannelByeMessage) return; + var channel = guild.TextChannels.FirstOrDefault(c => c.Id == conf.ByeMessageChannelId); - var channel = guild.GetChannel(cid) as ITextChannel; 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; - } - await _greetQueue.Writer.WriteAsync((conf, user, channel)); + if (GroupGreets) + { + // if group is newly created, greet that user right away, + // but any user which joins in the next 5 seconds will + // be greeted in a group greet + if (_byes.CreateOrAdd(guild.Id, user)) + { + // greet single user + await ByeUsers(conf, channel, new[] { user }); + var groupClear = false; + while (!groupClear) + { + await Task.Delay(5000); + groupClear = _byes.ClearGroup(guild.Id, 5, out var toBye); + await ByeUsers(conf, channel, toBye); + } + } + } + else + await ByeUsers(conf, channel, new[] { user }); } catch { @@ -208,63 +167,98 @@ public class GreetService : IEService, IReadyExecutor return Task.CompletedTask; } - private TypedKey GreetSettingsKey(ulong gid, GreetType type) - => new($"greet_settings:{gid}:{type}"); - - public async Task GetGreetSettingsAsync(ulong gid, GreetType type) - => await _cache.GetOrAddAsync(GreetSettingsKey(gid, type), - () => InternalGetGreetSettingsAsync(gid, type), - TimeSpan.FromSeconds(3)); - - private async Task InternalGetGreetSettingsAsync(ulong gid, GreetType type) + public string? GetDmGreetMsg(ulong id) { - await using var uow = _db.GetDbContext(); - var res = await uow.GetTable() - .Where(x => x.GuildId == gid && x.GreetType == type) - .FirstOrDefaultAsync(); - - if (res is not null) - res.MessageText ??= GetDefaultGreet(type); - - return res; + using var uow = _db.GetDbContext(); + return uow.GuildConfigsForId(id, set => set).DmGreetMessageText; } - private async Task GreetUsers(GreetSettings conf, ITextChannel? channel, IUser user) + public string? GetGreetMsg(ulong gid) { - if (conf.GreetType == GreetType.GreetDm) - { - if (user is not IGuildUser gu) - return; + using var uow = _db.GetDbContext(); + return uow.GuildConfigsForId(gid, set => set).ChannelGreetMessageText; + } - await GreetDmUserInternal(conf, gu); - return; - } + public string? GetBoostMessage(ulong gid) + { + using var uow = _db.GetDbContext(); + return uow.GuildConfigsForId(gid, set => set).BoostMessage; + } - if (channel is null) + public GreetSettings GetGreetSettings(ulong gid) + { + if (_guildConfigsCache.TryGetValue(gid, out var gs)) + return gs; + + using var uow = _db.GetDbContext(); + return GreetSettings.Create(uow.GuildConfigsForId(gid, set => set)); + } + + private Task ByeUsers(GreetSettings conf, ITextChannel channel, IUser user) + => ByeUsers(conf, channel, new[] { user }); + + private async Task ByeUsers(GreetSettings conf, ITextChannel channel, IReadOnlyCollection users) + { + if (!users.Any()) return; var repCtx = new ReplacementContext(client: _client, guild: channel.Guild, channel: channel, - user: user); + users: users.ToArray()); - var text = SmartText.CreateFrom(conf.MessageText); + var text = SmartText.CreateFrom(conf.ChannelByeMessageText); text = await _repSvc.ReplaceAsync(text, repCtx); try { var toDelete = await _sender.Response(channel).Text(text).Sanitize(false).SendAsync(); - if (conf.AutoDeleteTimer > 0) - toDelete.DeleteAfter(conf.AutoDeleteTimer); + if (conf.AutoDeleteByeMessagesTimer > 0) + toDelete.DeleteAfter(conf.AutoDeleteByeMessagesTimer); } - catch (HttpException ex) when (ex.DiscordCode is DiscordErrorCode.InsufficientPermissions - or DiscordErrorCode.MissingPermissions - or DiscordErrorCode.UnknownChannel) + catch (HttpException ex) when (ex.DiscordCode == DiscordErrorCode.InsufficientPermissions + || ex.DiscordCode == DiscordErrorCode.MissingPermissions + || ex.DiscordCode == 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 bye message will be disabled on server: {GuildId}", channel.GuildId); - await SetGreet(channel.GuildId, channel.Id, conf.GreetType, false); + await SetBye(channel.GuildId, channel.Id, false); + } + catch (Exception ex) + { + Log.Warning(ex, "Error embeding bye message"); + } + } + + private Task GreetUsers(GreetSettings conf, ITextChannel channel, IGuildUser user) + => GreetUsers(conf, channel, new[] { user }); + + private async Task GreetUsers(GreetSettings conf, ITextChannel channel, IReadOnlyCollection users) + { + if (users.Count == 0) + return; + + var repCtx = new ReplacementContext(client: _client, + guild: channel.Guild, + channel: channel, + users: users.ToArray()); + + var text = SmartText.CreateFrom(conf.ChannelGreetMessageText); + text = await _repSvc.ReplaceAsync(text, repCtx); + try + { + var toDelete = await _sender.Response(channel).Text(text).Sanitize(false).SendAsync(); + if (conf.AutoDeleteGreetMessagesTimer > 0) + toDelete.DeleteAfter(conf.AutoDeleteGreetMessagesTimer); + } + catch (HttpException ex) when (ex.DiscordCode == DiscordErrorCode.InsufficientPermissions + || ex.DiscordCode == DiscordErrorCode.MissingPermissions + || ex.DiscordCode == DiscordErrorCode.UnknownChannel) + { + Log.Warning(ex, + "Missing permissions to send a bye message, the greet message will be disabled on server: {GuildId}", + channel.GuildId); + await SetGreet(channel.GuildId, channel.Id, false); } catch (Exception ex) { @@ -272,12 +266,33 @@ public class GreetService : IEService, IReadyExecutor } } + private readonly Channel<(GreetSettings, IGuildUser, TaskCompletionSource)> _greetDmQueue = + Channel.CreateBounded<(GreetSettings, IGuildUser, TaskCompletionSource)>(new BoundedChannelOptions(60) + { + // The limit of 60 users should be only hit when there's a raid. In that case + // probably the best thing to do is to drop newest (raiding) users + FullMode = BoundedChannelFullMode.DropNewest + }); + + + private async Task GreetDmUser(GreetSettings conf, IGuildUser user) + { + var completionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + await _greetDmQueue.Writer.WriteAsync((conf, user, completionSource)); + return await completionSource.Task; + } + private async Task GreetDmUserInternal(GreetSettings conf, IGuildUser user) { try { - var repCtx = new ReplacementContext(client: _client, guild: user.Guild, user: user); - var smartText = SmartText.CreateFrom(conf.MessageText); + // var rep = new ReplacementBuilder() + // .WithUser(user) + // .WithServer(_client, (SocketGuild)user.Guild) + // .Build(); + + var repCtx = new ReplacementContext(client: _client, guild: user.Guild, users: user); + var smartText = SmartText.CreateFrom(conf.DmGreetMessageText); smartText = await _repSvc.ReplaceAsync(smartText, repCtx); if (smartText is SmartPlainText pt) @@ -327,9 +342,9 @@ public class GreetService : IEService, IReadyExecutor { // if there is less than 10 embeds, add an embed with footer only seta.Embeds = seta.Embeds.Append(new SmartEmbedArrayElementText() - { - Footer = CreateFooterSource(user) - }) + { + Footer = CreateFooterSource(user) + }) .ToArray(); } } @@ -337,9 +352,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,156 +367,296 @@ public class GreetService : IEService, IReadyExecutor IconUrl = user.Guild.IconUrl }; - - public static string GetDefaultGreet(GreetType greetType) - => greetType switch + private Task OnUserJoined(IGuildUser user) + { + _ = Task.Run(async () => { - GreetType.Boost => "%user.mention% has boosted the server!", - GreetType.Greet => "%user.mention% has joined the server!", - GreetType.Bye => "%user.name% has left the server!", - GreetType.GreetDm => "Welcome to the server %user.name%", - _ => "%user.name% did something new!" - }; + try + { + var conf = GetOrAddSettingsForGuild(user.GuildId); - public async Task SetGreet( - ulong guildId, - ulong? channelId, - GreetType greetType, - bool? value = null) + if (conf.SendChannelGreetMessage) + { + var channel = await user.Guild.GetTextChannelAsync(conf.GreetMessageChannelId); + if (channel is not null) + { + if (GroupGreets) + { + // if group is newly created, greet that user right away, + // but any user which joins in the next 5 seconds will + // be greeted in a group greet + if (_greets.CreateOrAdd(user.GuildId, user)) + { + // greet single user + await GreetUsers(conf, channel, new[] { user }); + var groupClear = false; + while (!groupClear) + { + await Task.Delay(5000); + groupClear = _greets.ClearGroup(user.GuildId, 5, out var toGreet); + await GreetUsers(conf, channel, toGreet); + } + } + } + else + await GreetUsers(conf, channel, new[] { user }); + } + } + + if (conf.SendDmGreetMessage) + await GreetDmUser(conf, user); + } + catch + { + // ignored + } + }); + return Task.CompletedTask; + } + + public string? GetByeMessage(ulong gid) + { + using var uow = _db.GetDbContext(); + return uow.GuildConfigsForId(gid, set => set).ChannelByeMessageText; + } + + public GreetSettings GetOrAddSettingsForGuild(ulong guildId) + { + if (_guildConfigsCache.TryGetValue(guildId, out var settings)) + return settings; + + using (var uow = _db.GetDbContext()) + { + var gc = uow.GuildConfigsForId(guildId, set => set); + settings = GreetSettings.Create(gc); + } + + _guildConfigsCache.TryAdd(guildId, settings); + return settings; + } + + public async Task SetGreet(ulong guildId, ulong channelId, bool? value = null) { await using var uow = _db.GetDbContext(); - var q = uow.GetTable(); + var conf = uow.GuildConfigsForId(guildId, set => set); + var enabled = conf.SendChannelGreetMessage = value ?? !conf.SendChannelGreetMessage; + conf.GreetMessageChannelId = channelId; - if (value is null) - value = !_enabled[greetType].Contains(guildId); + var toAdd = GreetSettings.Create(conf); + _guildConfigsCache[guildId] = toAdd; - if (value is { } v) - { - await q - .InsertOrUpdateAsync(() => new() - { - GuildId = guildId, - GreetType = greetType, - IsEnabled = v, - ChannelId = channelId, - }, - (old) => new() - { - IsEnabled = v, - ChannelId = channelId, - }, - () => new() - { - GuildId = guildId, - GreetType = greetType, - }); - } - - if (value is true) - { - _enabled[greetType].Add(guildId); - return true; - } - - _enabled[greetType].TryRemove(guildId); - return false; + await uow.SaveChangesAsync(); + return enabled; } - - public async Task SetMessage(ulong guildId, GreetType greetType, string? message) + public bool SetGreetMessage(ulong guildId, ref string message) { - await using (var uow = _db.GetDbContext()) - { - await uow.GetTable() - .InsertOrUpdateAsync(() => new() - { - GuildId = guildId, - GreetType = greetType, - MessageText = message - }, - x => new() - { - MessageText = message - }, - () => new() - { - GuildId = guildId, - GreetType = greetType - }); - } + message = message.SanitizeMentions(); - var conf = await GetGreetSettingsAsync(guildId, greetType); + if (string.IsNullOrWhiteSpace(message)) + throw new ArgumentNullException(nameof(message)); - return conf?.IsEnabled ?? false; + using var uow = _db.GetDbContext(); + var conf = uow.GuildConfigsForId(guildId, set => set); + conf.ChannelGreetMessageText = message; + var greetMsgEnabled = conf.SendChannelGreetMessage; + + var toAdd = GreetSettings.Create(conf); + _guildConfigsCache.AddOrUpdate(guildId, toAdd, (_, _) => toAdd); + + uow.SaveChanges(); + return greetMsgEnabled; } - public async Task SetDeleteTimer(ulong guildId, GreetType greetType, int timer) + public async Task SetGreetDm(ulong guildId, bool? value = null) { - if (timer < 0 || timer > 3600) + await using var uow = _db.GetDbContext(); + var conf = uow.GuildConfigsForId(guildId, set => set); + var enabled = conf.SendDmGreetMessage = value ?? !conf.SendDmGreetMessage; + + var toAdd = GreetSettings.Create(conf); + _guildConfigsCache[guildId] = toAdd; + + await uow.SaveChangesAsync(); + return enabled; + } + + public bool SetGreetDmMessage(ulong guildId, ref string? message) + { + message = message?.SanitizeMentions(); + + if (string.IsNullOrWhiteSpace(message)) + throw new ArgumentNullException(nameof(message)); + + using var uow = _db.GetDbContext(); + var conf = uow.GuildConfigsForId(guildId, set => set); + conf.DmGreetMessageText = message; + + var toAdd = GreetSettings.Create(conf); + _guildConfigsCache[guildId] = toAdd; + + uow.SaveChanges(); + return conf.SendDmGreetMessage; + } + + public async Task SetBye(ulong guildId, ulong channelId, bool? value = null) + { + await using var uow = _db.GetDbContext(); + var conf = uow.GuildConfigsForId(guildId, set => set); + var enabled = conf.SendChannelByeMessage = value ?? !conf.SendChannelByeMessage; + conf.ByeMessageChannelId = channelId; + + var toAdd = GreetSettings.Create(conf); + _guildConfigsCache[guildId] = toAdd; + + await uow.SaveChangesAsync(); + return enabled; + } + + public bool SetByeMessage(ulong guildId, ref string? message) + { + message = message?.SanitizeMentions(); + + if (string.IsNullOrWhiteSpace(message)) + throw new ArgumentNullException(nameof(message)); + + using var uow = _db.GetDbContext(); + var conf = uow.GuildConfigsForId(guildId, set => set); + conf.ChannelByeMessageText = message; + + var toAdd = GreetSettings.Create(conf); + _guildConfigsCache[guildId] = toAdd; + + uow.SaveChanges(); + return conf.SendChannelByeMessage; + } + + public async Task SetByeDel(ulong guildId, int timer) + { + if (timer is < 0 or > 600) + return; + + await using var uow = _db.GetDbContext(); + var conf = uow.GuildConfigsForId(guildId, set => set); + conf.AutoDeleteByeMessagesTimer = timer; + + var toAdd = GreetSettings.Create(conf); + _guildConfigsCache[guildId] = toAdd; + + await uow.SaveChangesAsync(); + } + + public async Task SetGreetDel(ulong guildId, int timer) + { + if (timer is < 0 or > 600) + return; + + await using var uow = _db.GetDbContext(); + var conf = uow.GuildConfigsForId(guildId, set => set); + conf.AutoDeleteGreetMessagesTimer = timer; + + var toAdd = GreetSettings.Create(conf); + _guildConfigsCache[guildId] = toAdd; + + await uow.SaveChangesAsync(); + } + + public bool SetBoostMessage(ulong guildId, ref string message) + { + using var uow = _db.GetDbContext(); + var conf = uow.GuildConfigsForId(guildId, set => set); + conf.BoostMessage = message; + + var toAdd = GreetSettings.Create(conf); + _guildConfigsCache[guildId] = toAdd; + + uow.SaveChanges(); + return conf.SendBoostMessage; + } + + public async Task SetBoostDel(ulong guildId, int timer) + { + if (timer is < 0 or > 600) throw new ArgumentOutOfRangeException(nameof(timer)); - await using (var uow = _db.GetDbContext()) - { - await uow.GetTable() - .InsertOrUpdateAsync(() => new() - { - GuildId = guildId, - GreetType = greetType, - AutoDeleteTimer = timer, - }, - x => new() - { - AutoDeleteTimer = timer - }, - () => new() - { - GuildId = guildId, - GreetType = greetType - }); - } + await using var uow = _db.GetDbContext(); + var conf = uow.GuildConfigsForId(guildId, set => set); + conf.BoostMessageDeleteAfter = timer; - var conf = await GetGreetSettingsAsync(guildId, greetType); + var toAdd = GreetSettings.Create(conf); + _guildConfigsCache[guildId] = toAdd; - return conf?.IsEnabled ?? false; + await uow.SaveChangesAsync(); } - - public async Task Test( - ulong guildId, - GreetType type, - IMessageChannel channel, - IGuildUser user) + public async Task ToggleBoost(ulong guildId, ulong channelId, bool? forceState = null) { - 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) - }; - } + await using var uow = _db.GetDbContext(); + var conf = uow.GuildConfigsForId(guildId, set => set); - await SendMessage(conf, channel, user); - return true; + if (forceState is not bool fs) + conf.SendBoostMessage = !conf.SendBoostMessage; + else + conf.SendBoostMessage = fs; + + conf.BoostMessageChannelId = channelId; + await uow.SaveChangesAsync(); + + var toAdd = GreetSettings.Create(conf); + _guildConfigsCache[guildId] = toAdd; + return conf.SendBoostMessage; } - public async Task SendMessage(GreetSettings conf, IMessageChannel channel, IGuildUser user) + #region Get Enabled Status + + public bool GetGreetDmEnabled(ulong guildId) { - if (conf.GreetType == GreetType.GreetDm) - { - await _greetQueue.Writer.WriteAsync((conf, user, null)); - return true; - } - - if (channel is not ITextChannel ch) - return false; - - await GreetUsers(conf, ch, user); - return true; + using var uow = _db.GetDbContext(); + var conf = uow.GuildConfigsForId(guildId, set => set); + return conf.SendDmGreetMessage; } + + public bool GetGreetEnabled(ulong guildId) + { + using var uow = _db.GetDbContext(); + var conf = uow.GuildConfigsForId(guildId, set => set); + return conf.SendChannelGreetMessage; + } + + public bool GetByeEnabled(ulong guildId) + { + using var uow = _db.GetDbContext(); + var conf = uow.GuildConfigsForId(guildId, set => set); + return conf.SendChannelByeMessage; + } + + #endregion + + #region Test Messages + + public Task ByeTest(ITextChannel channel, IGuildUser user) + { + var conf = GetOrAddSettingsForGuild(user.GuildId); + return ByeUsers(conf, channel, user); + } + + public Task GreetTest(ITextChannel channel, IGuildUser user) + { + var conf = GetOrAddSettingsForGuild(user.GuildId); + return GreetUsers(conf, channel, user); + } + + public Task GreetDmTest(IGuildUser user) + { + var conf = GetOrAddSettingsForGuild(user.GuildId); + return GreetDmUser(conf, user); + } + + public Task BoostTest(ITextChannel channel, IGuildUser user) + { + var conf = GetOrAddSettingsForGuild(user.GuildId); + return SendBoostMessage(conf, user, channel); + } + + #endregion } \ No newline at end of file diff --git a/src/EllieBot/Modules/Administration/GreetBye/GreetSettings.cs b/src/EllieBot/Modules/Administration/GreetBye/GreetSettings.cs index d798f4f..6e4f8ed 100644 --- a/src/EllieBot/Modules/Administration/GreetBye/GreetSettings.cs +++ b/src/EllieBot/Modules/Administration/GreetBye/GreetSettings.cs @@ -1,21 +1,45 @@ -namespace EllieBot.Services; +using EllieBot.Db.Models; -public enum GreetType -{ - Greet, - GreetDm, - Bye, - Boost, -} +namespace EllieBot.Services; 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; } + + public static GreetSettings Create(GuildConfig g) + => new() + { + AutoDeleteByeMessagesTimer = g.AutoDeleteByeMessagesTimer, + AutoDeleteGreetMessagesTimer = g.AutoDeleteGreetMessagesTimer, + GreetMessageChannelId = g.GreetMessageChannelId, + ByeMessageChannelId = g.ByeMessageChannelId, + SendDmGreetMessage = g.SendDmGreetMessage, + DmGreetMessageText = g.DmGreetMessageText, + SendChannelGreetMessage = g.SendChannelGreetMessage, + ChannelGreetMessageText = g.ChannelGreetMessageText, + SendChannelByeMessage = g.SendChannelByeMessage, + ChannelByeMessageText = g.ChannelByeMessageText, + SendBoostMessage = g.SendBoostMessage, + BoostMessage = g.BoostMessage, + BoostMessageDeleteAfter = g.BoostMessageDeleteAfter, + BoostMessageChannelId = g.BoostMessageChannelId + }; } \ No newline at end of file diff --git a/src/EllieBot/Modules/Administration/Honeypot/HoneyPotService.cs b/src/EllieBot/Modules/Administration/Honeypot/HoneyPotService.cs deleted file mode 100644 index 8ff20ac..0000000 --- a/src/EllieBot/Modules/Administration/Honeypot/HoneyPotService.cs +++ /dev/null @@ -1,95 +0,0 @@ -using LinqToDB; -using LinqToDB.EntityFrameworkCore; -using EllieBot.Common.ModuleBehaviors; -using EllieBot.Db.Models; -using System.Threading.Channels; - -namespace EllieBot.Modules.Administration.Honeypot; - -public sealed class HoneyPotService : IHoneyPotService, IReadyExecutor, IExecNoCommand, IEService -{ - private readonly DbService _db; - private readonly CommandHandler _handler; - - private ConcurrentHashSet _channels = new(); - - private Channel _punishments = Channel.CreateBounded( - new BoundedChannelOptions(100) - { - FullMode = BoundedChannelFullMode.DropOldest, - SingleReader = true, - SingleWriter = false, - }); - - public HoneyPotService(DbService db, CommandHandler handler) - { - _db = db; - _handler = handler; - } - - public async Task ToggleHoneypotChannel(ulong guildId, ulong channelId) - { - await using var uow = _db.GetDbContext(); - - var deleted = await uow.HoneyPotChannels - .Where(x => x.GuildId == guildId) - .DeleteWithOutputAsync(); - - if (deleted.Length > 0) - { - _channels.TryRemove(deleted[0].ChannelId); - return false; - } - - await uow.HoneyPotChannels - .ToLinqToDBTable() - .InsertAsync(() => new HoneypotChannel - { - GuildId = guildId, - ChannelId = channelId - }); - - _channels.Add(channelId); - - return true; - } - - public async Task OnReadyAsync() - { - await using var uow = _db.GetDbContext(); - - var channels = await uow.HoneyPotChannels - .Select(x => x.ChannelId) - .ToListAsyncLinqToDB(); - - _channels = new(channels); - - while (await _punishments.Reader.WaitToReadAsync()) - { - while (_punishments.Reader.TryRead(out var user)) - { - try - { - Log.Information("Honeypot caught user {User} [{UserId}]", user, user.Id); - await user.BanAsync(pruneDays: 1); - await user.Guild.RemoveBanAsync(user.Id); - } - catch (Exception e) - { - Log.Warning(e, "Failed banning {User} due to {Error}", user, e.Message); - } - - await Task.Delay(1000); - } - } - } - - public async Task ExecOnNoCommandAsync(IGuild guild, IUserMessage msg) - { - if (_channels.Contains(msg.Channel.Id) && msg.Author is SocketGuildUser sgu) - { - if (!sgu.GuildPermissions.BanMembers) - await _punishments.Writer.WriteAsync(sgu); - } - } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Administration/Honeypot/HoneypotCommands.cs b/src/EllieBot/Modules/Administration/Honeypot/HoneypotCommands.cs deleted file mode 100644 index 897d019..0000000 --- a/src/EllieBot/Modules/Administration/Honeypot/HoneypotCommands.cs +++ /dev/null @@ -1,29 +0,0 @@ -using EllieBot.Modules.Administration.Honeypot; - -namespace EllieBot.Modules.Administration; - -public partial class Administration -{ - [Group] - public partial class HoneypotCommands : EllieModule - { - private readonly IHoneyPotService _service; - - public HoneypotCommands(IHoneyPotService service) - => _service = service; - - [Cmd] - [RequireContext(ContextType.Guild)] - [RequireUserPermission(GuildPermission.Administrator)] - [RequireBotPermission(GuildPermission.BanMembers)] - public async Task Honeypot() - { - var enabled = await _service.ToggleHoneypotChannel(ctx.Guild.Id, ctx.Channel.Id); - - if (enabled) - await Response().Confirm(strs.honeypot_on).SendAsync(); - else - await Response().Confirm(strs.honeypot_off).SendAsync(); - } - } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Administration/Honeypot/IHoneyPotService.cs b/src/EllieBot/Modules/Administration/Honeypot/IHoneyPotService.cs deleted file mode 100644 index 1483590..0000000 --- a/src/EllieBot/Modules/Administration/Honeypot/IHoneyPotService.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace EllieBot.Modules.Administration.Honeypot; - -public interface IHoneyPotService -{ - public Task ToggleHoneypotChannel(ulong guildId, ulong channelId); -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Administration/Mute/MuteService.cs b/src/EllieBot/Modules/Administration/Mute/MuteService.cs index a67610d..a3fbea3 100644 --- a/src/EllieBot/Modules/Administration/Mute/MuteService.cs +++ b/src/EllieBot/Modules/Administration/Mute/MuteService.cs @@ -1,5 +1,6 @@ #nullable disable using Microsoft.EntityFrameworkCore; +using EllieBot.Db; using EllieBot.Db.Models; namespace EllieBot.Modules.Administration.Services; diff --git a/src/EllieBot/Modules/Administration/PlayingRotate/PlayingRotateCommands.cs b/src/EllieBot/Modules/Administration/PlayingRotate/PlayingRotateCommands.cs index 16120f2..bf4909e 100644 --- a/src/EllieBot/Modules/Administration/PlayingRotate/PlayingRotateCommands.cs +++ b/src/EllieBot/Modules/Administration/PlayingRotate/PlayingRotateCommands.cs @@ -18,17 +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) + public async Task AddPlaying(ActivityType t, [Leftover] string status) { - await _service.AddPlaying(statusType, status); + await _service.AddPlaying(t, status); await Response().Confirm(strs.ropl_added).SendAsync(); } diff --git a/src/EllieBot/Modules/Administration/PlayingRotate/PlayingRotateService.cs b/src/EllieBot/Modules/Administration/PlayingRotate/PlayingRotateService.cs index 0c9afff..edf6843 100644 --- a/src/EllieBot/Modules/Administration/PlayingRotate/PlayingRotateService.cs +++ b/src/EllieBot/Modules/Administration/PlayingRotate/PlayingRotateService.cs @@ -58,7 +58,7 @@ public sealed class PlayingRotateService : IEService, IReadyExecutor : rotatingStatuses[index++]; var statusText = await _repService.ReplaceAsync(playingStatus.Status, new (client: _client)); - await _selfService.SetActivityAsync(statusText, (ActivityType)playingStatus.Type); + await _selfService.SetGameAsync(statusText, (ActivityType)playingStatus.Type); } catch (Exception ex) { diff --git a/src/EllieBot/Modules/Administration/Protection/ProtectionService.cs b/src/EllieBot/Modules/Administration/Protection/ProtectionService.cs index c72a941..c28d3c4 100644 --- a/src/EllieBot/Modules/Administration/Protection/ProtectionService.cs +++ b/src/EllieBot/Modules/Administration/Protection/ProtectionService.cs @@ -1,5 +1,6 @@ #nullable disable using Microsoft.EntityFrameworkCore; +using EllieBot.Db; using EllieBot.Db.Models; using System.Threading.Channels; diff --git a/src/EllieBot/Modules/Administration/Prune/PruneCommands.cs b/src/EllieBot/Modules/Administration/Prune/PruneCommands.cs index 5ebafab..58b586e 100644 --- a/src/EllieBot/Modules/Administration/Prune/PruneCommands.cs +++ b/src/EllieBot/Modules/Administration/Prune/PruneCommands.cs @@ -45,23 +45,20 @@ public partial class Administration var progressMsg = await Response().Pending(strs.prune_progress(0, 100)).SendAsync(); var progress = GetProgressTracker(progressMsg); - PruneResult result; if (opts.Safe) - result = await _service.PruneWhere((ITextChannel)ctx.Channel, + await _service.PruneWhere((ITextChannel)ctx.Channel, 100, x => x.Author.Id == user.Id && !x.IsPinned, progress, opts.After); else - result = await _service.PruneWhere((ITextChannel)ctx.Channel, + await _service.PruneWhere((ITextChannel)ctx.Channel, 100, x => x.Author.Id == user.Id, progress, opts.After); ctx.Message.DeleteAfter(3); - - await SendResult(result); await progressMsg.DeleteAsync(); } @@ -86,21 +83,19 @@ public partial class Administration var progressMsg = await Response().Pending(strs.prune_progress(0, count)).SendAsync(); var progress = GetProgressTracker(progressMsg); - PruneResult result; if (opts.Safe) - result = await _service.PruneWhere((ITextChannel)ctx.Channel, + await _service.PruneWhere((ITextChannel)ctx.Channel, count, x => !x.IsPinned && x.Id != progressMsg.Id, progress, opts.After); else - result = await _service.PruneWhere((ITextChannel)ctx.Channel, + await _service.PruneWhere((ITextChannel)ctx.Channel, count, x => x.Id != progressMsg.Id, progress, opts.After); - await SendResult(result); await progressMsg.DeleteAsync(); } @@ -160,10 +155,9 @@ public partial class Administration var progressMsg = await Response().Pending(strs.prune_progress(0, count)).SendAsync(); var progress = GetProgressTracker(progressMsg); - PruneResult result; if (opts.Safe) { - result = await _service.PruneWhere((ITextChannel)ctx.Channel, + await _service.PruneWhere((ITextChannel)ctx.Channel, count, m => m.Author.Id == userId && DateTime.UtcNow - m.CreatedAt < _twoWeeks && !m.IsPinned, progress, @@ -172,7 +166,7 @@ public partial class Administration } else { - result = await _service.PruneWhere((ITextChannel)ctx.Channel, + await _service.PruneWhere((ITextChannel)ctx.Channel, count, m => m.Author.Id == userId && DateTime.UtcNow - m.CreatedAt < _twoWeeks, progress, @@ -180,7 +174,6 @@ public partial class Administration ); } - await SendResult(result); await progressMsg.DeleteAsync(); } @@ -201,27 +194,5 @@ public partial class Administration await Response().Confirm(strs.prune_cancelled).SendAsync(); } - - - private async Task SendResult(PruneResult result) - { - switch (result) - { - case PruneResult.Success: - break; - case PruneResult.AlreadyRunning: - var msg = await Response().Pending(strs.prune_already_running).SendAsync(); - msg.DeleteAfter(5); - break; - case PruneResult.FeatureLimit: - var msg2 = await Response().Pending(strs.feature_limit_reached_owner).SendAsync(); - msg2.DeleteAfter(10); - break; - default: - Log.Error("Unhandled result received in prune: {Result}", result); - await Response().Error(strs.error_occured).SendAsync(); - break; - } - } } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Administration/Prune/PruneResult.cs b/src/EllieBot/Modules/Administration/Prune/PruneResult.cs deleted file mode 100644 index b6ac515..0000000 --- a/src/EllieBot/Modules/Administration/Prune/PruneResult.cs +++ /dev/null @@ -1,9 +0,0 @@ -#nullable disable -namespace EllieBot.Modules.Administration.Services; - -public enum PruneResult -{ - Success, - AlreadyRunning, - FeatureLimit, -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Administration/Prune/PruneService.cs b/src/EllieBot/Modules/Administration/Prune/PruneService.cs index b44406f..006f9e8 100644 --- a/src/EllieBot/Modules/Administration/Prune/PruneService.cs +++ b/src/EllieBot/Modules/Administration/Prune/PruneService.cs @@ -1,6 +1,4 @@ #nullable disable -using EllieBot.Modules.Patronage; - namespace EllieBot.Modules.Administration.Services; public class PruneService : IEService @@ -9,15 +7,11 @@ public class PruneService : IEService private readonly ConcurrentDictionary _pruningGuilds = new(); private readonly TimeSpan _twoWeeks = TimeSpan.FromDays(14); private readonly ILogCommandService _logService; - private readonly IPatronageService _ps; - public PruneService(ILogCommandService logService, IPatronageService ps) - { - _logService = logService; - _ps = ps; - } + public PruneService(ILogCommandService logService) + => _logService = logService; - public async Task PruneWhere( + public async Task PruneWhere( ITextChannel channel, int amount, Func predicate, @@ -26,21 +20,16 @@ public class PruneService : IEService ) { ArgumentNullException.ThrowIfNull(channel, nameof(channel)); - ArgumentOutOfRangeException.ThrowIfNegativeOrZero(amount); var originalAmount = amount; + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(amount); using var cancelSource = new CancellationTokenSource(); if (!_pruningGuilds.TryAdd(channel.GuildId, cancelSource)) - return PruneResult.AlreadyRunning; + return; try { - if (!await _ps.LimitHitAsync(LimitedFeatureName.Prune, channel.Guild.OwnerId)) - { - return PruneResult.FeatureLimit; - } - var now = DateTime.UtcNow; IMessage[] msgs; IMessage lastMessage = null; @@ -58,7 +47,7 @@ public class PruneService : IEService .ToArray(); if (!msgs.Any()) - return PruneResult.Success; + return; lastMessage = msgs[^1]; @@ -99,8 +88,6 @@ public class PruneService : IEService { _pruningGuilds.TryRemove(channel.GuildId, out _); } - - return PruneResult.Success; } public async Task CancelAsync(ulong guildId) diff --git a/src/EllieBot/Modules/Administration/Role/IReactionRoleService.cs b/src/EllieBot/Modules/Administration/Role/IReactionRoleService.cs index 1f2911d..85f7945 100644 --- a/src/EllieBot/Modules/Administration/Role/IReactionRoleService.cs +++ b/src/EllieBot/Modules/Administration/Role/IReactionRoleService.cs @@ -1,4 +1,5 @@ #nullable disable +using EllieBot.Modules.Patronage; using EllieBot.Db.Models; using OneOf; using OneOf.Types; @@ -17,7 +18,7 @@ public interface IReactionRoleService /// /// /// The result of the operation - Task> AddReactionRole( + Task> AddReactionRole( IGuild guild, IMessage msg, string emote, diff --git a/src/EllieBot/Modules/Administration/Role/ReactionRoleCommands.cs b/src/EllieBot/Modules/Administration/Role/ReactionRoleCommands.cs index cfcad28..800512a 100644 --- a/src/EllieBot/Modules/Administration/Role/ReactionRoleCommands.cs +++ b/src/EllieBot/Modules/Administration/Role/ReactionRoleCommands.cs @@ -33,7 +33,7 @@ public partial class Administration var msg = await ctx.Channel.GetMessageAsync(messageId); if (msg is null) { - await Response().Error(strs.rero_message_not_found).SendAsync(); + await Response().Error(strs.not_found).SendAsync(); return; } @@ -55,10 +55,12 @@ public partial class Administration await res.Match( _ => ctx.OkAsync(), - async fl => + fl => { _ = msg.RemoveReactionAsync(emote, ctx.Client.CurrentUser); - await Response().Pending(strs.feature_limit_reached_owner).SendAsync(); + return !fl.IsPatronLimit + ? Response().Error(strs.limit_reached(fl.Quota)).SendAsync() + : Response().Pending(strs.feature_limit_reached_owner(fl.Quota, fl.Name)).SendAsync(); }); } diff --git a/src/EllieBot/Modules/Administration/Role/ReactionRolesService.cs b/src/EllieBot/Modules/Administration/Role/ReactionRolesService.cs index f8550ed..f1216ef 100644 --- a/src/EllieBot/Modules/Administration/Role/ReactionRolesService.cs +++ b/src/EllieBot/Modules/Administration/Role/ReactionRolesService.cs @@ -2,6 +2,7 @@ using LinqToDB; using LinqToDB.EntityFrameworkCore; using EllieBot.Common.ModuleBehaviors; +using EllieBot.Db; using EllieBot.Modules.Patronage; using EllieBot.Db.Models; using OneOf.Types; @@ -13,23 +14,29 @@ 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(); private readonly SemaphoreSlim _assignementLock = new(1, 1); private readonly IPatronageService _ps; + private static readonly FeatureLimitKey _reroFLKey = new() + { + Key = "rero:max_count", + PrettyName = "Reaction Role" + }; + public ReactionRolesService( DiscordSocketClient client, - IPatronageService ps, DbService db, - IBotCreds creds) + IBotCredentials creds, + IPatronageService ps) { _db = db; + _ps = ps; _client = client; _creds = creds; - _ps = ps; _cache = new(); } @@ -235,7 +242,7 @@ public sealed class ReactionRolesService : IReadyExecutor, IEService, IReactionR /// /// /// The result of the operation - public async Task> AddReactionRole( + public async Task> AddReactionRole( IGuild guild, IMessage msg, string emote, @@ -254,12 +261,9 @@ public sealed class ReactionRolesService : IReadyExecutor, IEService, IReactionR .Where(x => x.GuildId == guild.Id) .CountAsync(); - var limit = await _ps.GetUserLimit(LimitedFeatureName.ReactionRole, guild.OwnerId); - - if (!_creds.IsOwner(guild.OwnerId) && (activeReactionRoles >= limit.Quota && limit.Quota >= 0)) - { - return new Error(); - } + var result = await _ps.TryGetFeatureLimitAsync(_reroFLKey, guild.OwnerId, 50); + if (result.Quota != -1 && activeReactionRoles >= result.Quota) + return result; await ctx.GetTable() .InsertOrUpdateAsync(() => new() diff --git a/src/EllieBot/Modules/Administration/Role/StickyRolesService.cs b/src/EllieBot/Modules/Administration/Role/StickyRolesService.cs index 5147daf..1fcfc15 100644 --- a/src/EllieBot/Modules/Administration/Role/StickyRolesService.cs +++ b/src/EllieBot/Modules/Administration/Role/StickyRolesService.cs @@ -3,19 +3,20 @@ using LinqToDB; using LinqToDB.EntityFrameworkCore; using EllieBot.Db.Models; using EllieBot.Common.ModuleBehaviors; +using EllieBot.Db; 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/CheckForUpdatesService.cs b/src/EllieBot/Modules/Administration/Self/CheckForUpdatesService.cs index 66cac5b..8bcf2e1 100644 --- a/src/EllieBot/Modules/Administration/Self/CheckForUpdatesService.cs +++ b/src/EllieBot/Modules/Administration/Self/CheckForUpdatesService.cs @@ -19,7 +19,7 @@ public sealed class CheckForUpdatesService : IEService, IReadyExecutor private readonly IMessageSenderService _sender; - private const string RELEASES_URL = "https://toastielab.dev/api/v1/repos/Emotions-stuff/elliebot/releases"; + private const string RELEASES_URL = "https://toastielab.dev/api/v1/repos/Emotions-stuff/Ellie/releases"; public CheckForUpdatesService( BotConfigService bcs, @@ -51,13 +51,13 @@ public sealed class CheckForUpdatesService : IEService, IReadyExecutor try { using var http = _httpFactory.CreateClient(); - var toastielabRelease = (await http.GetFromJsonAsync(RELEASES_URL)) + var gitlabRelease = (await http.GetFromJsonAsync(RELEASES_URL)) ?.FirstOrDefault(); - if (toastielabRelease?.TagName is null) + if (gitlabRelease?.TagName is null) continue; - var latest = toastielabRelease.TagName; + var latest = gitlabRelease.TagName; var latestVersion = Version.Parse(latest); var lastKnownVersion = GetLastKnownVersion(); @@ -72,7 +72,7 @@ public sealed class CheckForUpdatesService : IEService, IReadyExecutor UpdateLastKnownVersion(latestVersion); // pull changelog - var changelog = await http.GetStringAsync("https://toastielab.dev/Emotions-stuff/elliebot/raw/branch/v5/CHANGELOG.md"); + var changelog = await http.GetStringAsync("https://toastielab.dev/Emotions-stuff/Ellie/raw/branch/main/CHANGELOG.md"); var thisVersionChangelog = GetVersionChangelog(latestVersion, changelog); @@ -95,7 +95,7 @@ public sealed class CheckForUpdatesService : IEService, IReadyExecutor .WithOkColor() .WithAuthor($"EllieBot v{latest} Released!") .WithTitle("Changelog") - .WithUrl("https://toastielab.dev/Emotions-stuff/elliebot/src/branch/v5/CHANGELOG.md") + .WithUrl("https://toastielab.dev/Emotions-stuff/Ellie/src/branch/main/CHANGELOG.md") .WithDescription(thisVersionChangelog.TrimTo(4096)) .WithFooter( "You may disable these messages by typing '.conf bot checkforupdates false'"); diff --git a/src/EllieBot/Modules/Administration/Self/SelfCommands.cs b/src/EllieBot/Modules/Administration/Self/SelfCommands.cs index 57f5765..d67ac93 100644 --- a/src/EllieBot/Modules/Administration/Self/SelfCommands.cs +++ b/src/EllieBot/Modules/Administration/Self/SelfCommands.cs @@ -459,7 +459,7 @@ public partial class Administration await Response().Confirm(strs.bot_name(Format.Bold(newName))).SendAsync(); } - + [Cmd] [OwnerOnly] public async Task SetStatus([Leftover] SettableUserStatus status) @@ -491,25 +491,14 @@ public partial class Administration [Cmd] [OwnerOnly] - public async Task SetActivity(ActivityType? type, [Leftover] string game = null) + public async Task SetGame(ActivityType type, [Leftover] string game = null) { // var rep = new ReplacementBuilder().WithDefault(Context).Build(); var repCtx = new ReplacementContext(ctx); - await _service.SetActivityAsync(game is null ? game : await repSvc.ReplaceAsync(game, repCtx), type); + await _service.SetGameAsync(game is null ? game : await repSvc.ReplaceAsync(game, repCtx), type); - await Response().Confirm(strs.set_activity).SendAsync(); - } - - [Cmd] - [OwnerOnly] - public Task SetActivity([Leftover] string game = null) - => SetActivity(null, game); - - public class SetActivityOptions - { - public ActivityType? Type { get; set; } - public string Game { get; set; } + await Response().Confirm(strs.set_game).SendAsync(); } [Cmd] @@ -552,12 +541,12 @@ public partial class Administration return; } - + var repCtx = new ReplacementContext(ctx); text = await repSvc.ReplaceAsync(text, repCtx); await Response().Channel(ch).Text(text).SendAsync(); - - await ctx.OkAsync(); + + await ctx.OkAsync();; } [Cmd] diff --git a/src/EllieBot/Modules/Administration/Self/SelfService.cs b/src/EllieBot/Modules/Administration/Self/SelfService.cs index c07c16e..82eb68c 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 { @@ -84,14 +85,13 @@ public sealed class SelfService : IExecNoCommand, IReadyExecutor, IEService { await using var uow = _db.GetDbContext(); - autoCommands = uow.Set() - .AsNoTracking() - .Where(x => x.Interval >= 5) - .AsEnumerable() - .GroupBy(x => x.GuildId) - .ToDictionary(x => x.Key, - y => y.ToDictionary(x => x.Id, TimerFromAutoCommand).ToConcurrent()) - .ToConcurrent(); + autoCommands = uow.Set().AsNoTracking() + .Where(x => x.Interval >= 5) + .AsEnumerable() + .GroupBy(x => x.GuildId) + .ToDictionary(x => x.Key, + y => y.ToDictionary(x => x.Id, TimerFromAutoCommand).ToConcurrent()) + .ToConcurrent(); var startupCommands = uow.Set().AsNoTracking().Where(x => x.Interval == 0); foreach (var cmd in startupCommands) @@ -170,18 +170,18 @@ public sealed class SelfService : IExecNoCommand, IReadyExecutor, IEService private async Task LoadOwnerChannels() { var channels = await _creds.OwnerIds.Select(id => - { - var user = _client.GetUser(id); - if (user is null) - return Task.FromResult(null); + { + var user = _client.GetUser(id); + if (user is null) + return Task.FromResult(null); - return user.CreateDMChannelAsync(); - }) - .WhenAll(); + return user.CreateDMChannelAsync(); + }) + .WhenAll(); ownerChannels = channels.Where(x => x is not null) - .ToDictionary(x => x.Recipient.Id, x => x) - .ToImmutableDictionary(); + .ToDictionary(x => x.Recipient.Id, x => x) + .ToImmutableDictionary(); if (!ownerChannels.Any()) { @@ -400,10 +400,7 @@ public sealed class SelfService : IExecNoCommand, IReadyExecutor, IEService { try { - if (data.Type is { } activityType) - await _client.SetGameAsync(data.Name, data.Link, activityType); - else - await _client.SetCustomStatusAsync(data.Name); + await _client.SetGameAsync(data.Name, data.Link, data.Type); } catch (Exception ex) { @@ -411,7 +408,7 @@ public sealed class SelfService : IExecNoCommand, IReadyExecutor, IEService } }); - public Task SetActivityAsync(string game, ActivityType? type) + public Task SetGameAsync(string game, ActivityType type) => _pubSub.Pub(_activitySetKey, new() { @@ -433,10 +430,10 @@ public sealed class SelfService : IExecNoCommand, IReadyExecutor, IEService { public string Name { get; init; } public string Link { get; init; } - public ActivityType? Type { get; init; } + public ActivityType Type { get; init; } } - - + + /// /// Adds the specified to the database. If a database user with placeholder name /// and discriminator is present in , their name and discriminator get updated accordingly. @@ -446,43 +443,41 @@ public sealed class SelfService : IExecNoCommand, IReadyExecutor, IEService /// A tuple with the amount of new users added and old users updated. public async Task<(long UsersAdded, long UsersUpdated)> RefreshUsersAsync(List users) { - await using var ctx = _db.GetDbContext(); + await using var ctx = _db.GetDbContext(); var presentDbUsers = await ctx.GetTable() - .Select(x => new - { - x.UserId, - x.Username, - }) - .Where(x => users.Select(y => y.Id).Contains(x.UserId)) - .ToArrayAsyncEF(); + .Select(x => new { x.UserId, x.Username, x.Discriminator }) + .Where(x => users.Select(y => y.Id).Contains(x.UserId)) + .ToArrayAsyncEF(); var usersToAdd = users - .Where(x => !presentDbUsers.Select(x => x.UserId).Contains(x.Id)) - .Select(x => new DiscordUser() - { - UserId = x.Id, - AvatarId = x.AvatarId, - Username = x.Username, - }); + .Where(x => !presentDbUsers.Select(x => x.UserId).Contains(x.Id)) + .Select(x => new DiscordUser() + { + 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("??")) - .Select(x => x.UserId) - .ToArray(); + .Where(x => x.Username == "Unknown" && x.Discriminator == "????") + .Select(x => x.UserId) + .ToArray(); foreach (var user in users.Where(x => toUpdateUserIds.Contains(x.Id))) { await ctx.GetTable() - .Where(x => x.UserId == user.Id) - .UpdateAsync(x => new DiscordUser() - { - Username = user.Username, + .Where(x => x.UserId == user.Id) + .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, - DateAdded = x.DateAdded ?? DateTime.UtcNow - }); + // .award tends to set AvatarId and DateAdded to NULL, so account for that. + AvatarId = user.AvatarId, + DateAdded = x.DateAdded ?? DateTime.UtcNow + }); } return (added, toUpdateUserIds.Length); diff --git a/src/EllieBot/Modules/Administration/SelfAssignableRoles/SelfAssignedRolesService.cs b/src/EllieBot/Modules/Administration/SelfAssignableRoles/SelfAssignedRolesService.cs index 505f56c..1305835 100644 --- a/src/EllieBot/Modules/Administration/SelfAssignableRoles/SelfAssignedRolesService.cs +++ b/src/EllieBot/Modules/Administration/SelfAssignableRoles/SelfAssignedRolesService.cs @@ -1,5 +1,6 @@ #nullable disable using Microsoft.EntityFrameworkCore; +using EllieBot.Db; using EllieBot.Db.Models; namespace EllieBot.Modules.Administration.Services; diff --git a/src/EllieBot/Modules/Administration/ServerLog/DummyLogCommandService.cs b/src/EllieBot/Modules/Administration/ServerLog/DummyLogCommandService.cs index 00576b7..3cdd4d3 100644 --- a/src/EllieBot/Modules/Administration/ServerLog/DummyLogCommandService.cs +++ b/src/EllieBot/Modules/Administration/ServerLog/DummyLogCommandService.cs @@ -4,7 +4,7 @@ namespace EllieBot.Modules.Administration; public sealed class DummyLogCommandService : ILogCommandService #if GLOBAL_ELLIE -, IEService +, INService #endif { public void AddDeleteIgnore(ulong xId) diff --git a/src/EllieBot/Modules/Administration/ServerLog/ServerLogCommandService.cs b/src/EllieBot/Modules/Administration/ServerLog/ServerLogCommandService.cs index 3b6cd3e..6ea5345 100644 --- a/src/EllieBot/Modules/Administration/ServerLog/ServerLogCommandService.cs +++ b/src/EllieBot/Modules/Administration/ServerLog/ServerLogCommandService.cs @@ -1,6 +1,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Caching.Memory; using EllieBot.Common.ModuleBehaviors; +using EllieBot.Db; using EllieBot.Modules.Administration.Services; using EllieBot.Db.Models; diff --git a/src/EllieBot/Modules/Administration/Ticket/TicketCommands.cs b/src/EllieBot/Modules/Administration/Ticket/TicketCommands.cs deleted file mode 100644 index 67f5ca6..0000000 --- a/src/EllieBot/Modules/Administration/Ticket/TicketCommands.cs +++ /dev/null @@ -1,14 +0,0 @@ -// namespace EllieBot.Modules.Administration; -// -// public partial class Administration -// { -// [Group] -// public partial class TicketCommands : EllieModule -// { -// [Cmd] -// public async Task Ticket() -// { -// -// } -// } -// } \ No newline at end of file diff --git a/src/EllieBot/Modules/Administration/Timezone/GuildTimezoneService.cs b/src/EllieBot/Modules/Administration/Timezone/GuildTimezoneService.cs index f36d7af..e1f2fea 100644 --- a/src/EllieBot/Modules/Administration/Timezone/GuildTimezoneService.cs +++ b/src/EllieBot/Modules/Administration/Timezone/GuildTimezoneService.cs @@ -1,4 +1,5 @@ #nullable disable +using EllieBot.Db; using EllieBot.Db.Models; using EllieBot.Common.ModuleBehaviors; diff --git a/src/EllieBot/Modules/Administration/UserPunish/UserPunishCommands.cs b/src/EllieBot/Modules/Administration/UserPunish/UserPunishCommands.cs index 85e5026..27a3f12 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,38 +266,13 @@ 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(); } - [Cmd] - [RequireContext(ContextType.Guild)] - [UserPerm(GuildPerm.Administrator)] - public Task WarnDelete(IGuildUser user, int index) - => WarnDelete(user.Id, index); - - [Cmd] - [RequireContext(ContextType.Guild)] - [UserPerm(GuildPerm.Administrator)] - public async Task WarnDelete(ulong userId, int index) - { - if (--index < 0) - return; - - var warn = await _service.WarnDelete(ctx.Guild.Id, userId, index); - - if (warn is null) - { - await Response().Error(strs.warning_not_found).SendAsync(); - return; - } - - await Response().Confirm(strs.warning_deleted(Format.Bold(index.ToString()))).SendAsync(); - } - [Cmd] [RequireContext(ContextType.Guild)] [UserPerm(GuildPerm.BanMembers)] @@ -312,7 +286,6 @@ public partial class Administration { if (index < 0) return; - var success = await _service.WarnClearAsync(ctx.Guild.Id, userId, index, ctx.User.ToString()); var userStr = Format.Bold((ctx.Guild as SocketGuild)?.GetUser(userId)?.ToString() ?? userId.ToString()); if (index == 0) @@ -345,7 +318,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 +354,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 +381,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 +391,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 +452,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 +479,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 +517,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 +708,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 +767,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 +800,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 +812,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 +873,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 +893,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 +919,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 +940,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..cdc9900 100644 --- a/src/EllieBot/Modules/Administration/UserPunish/UserPunishService.cs +++ b/src/EllieBot/Modules/Administration/UserPunish/UserPunishService.cs @@ -1,7 +1,10 @@ #nullable disable using LinqToDB; using LinqToDB.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using EllieBot.Common.ModuleBehaviors; +using EllieBot.Common.TypeReaders.Models; +using EllieBot.Db; using EllieBot.Modules.Permissions.Services; using EllieBot.Db.Models; using Newtonsoft.Json; @@ -81,24 +84,16 @@ 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) - .Sum(x => x.Weight); + ps = uow.GuildConfigsForId(guildId, set => set.Include(x => x.WarnPunishments)).WarnPunishments; - await uow.GetTable() - .InsertAsync(() => new() - { - UserId = userId, - GuildId = guildId, - Forgiven = false, - Reason = reason, - Moderator = modName, - Weight = weight, - DateAdded = DateTime.UtcNow, - }); + previousCount = uow.Set().ForId(guildId, userId) + .Where(w => !w.Forgiven && w.UserId == userId) + .Sum(x => x.Weight); + + uow.Set().Add(warn); await uow.SaveChangesAsync(); } @@ -108,7 +103,7 @@ public class UserPunishService : IEService, IReadyExecutor var totalCount = previousCount + weight; var p = ps.Where(x => x.Count > previousCount && x.Count <= totalCount) - .MaxBy(x => x.Count); + .MaxBy(x => x.Count); if (p is not null) { @@ -248,54 +243,43 @@ public class UserPunishService : IEService, IReadyExecutor public async Task CheckAllWarnExpiresAsync() { await using var uow = _db.GetDbContext(); + var cleared = await uow.Set() + .Where(x => uow.Set() + .Any(y => y.GuildId == x.GuildId + && y.WarnExpireHours > 0 + && y.WarnExpireAction == WarnExpireAction.Clear) + && x.Forgiven == false + && x.DateAdded + < DateTime.UtcNow.AddHours(-uow.Set() + .Where(y => x.GuildId == y.GuildId) + .Select(y => y.WarnExpireHours) + .First())) + .UpdateAsync(_ => new() + { + Forgiven = true, + ForgivenBy = "expiry" + }); - var toClear = await uow.GetTable() - .Where(x => uow.GetTable() - .Count(y => y.GuildId == x.GuildId - && y.WarnExpireHours > 0 - && y.WarnExpireAction == WarnExpireAction.Clear) - > 0 - && x.Forgiven == false - && x.DateAdded - < DateTime.UtcNow.AddHours(-uow.GetTable() - .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)) - .DeleteAsync(); + var deleted = await uow.Set() + .Where(x => uow.Set() + .Any(y => y.GuildId == x.GuildId + && y.WarnExpireHours > 0 + && y.WarnExpireAction == WarnExpireAction.Delete) + && x.DateAdded + < DateTime.UtcNow.AddHours(-uow.Set() + .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); } + + await uow.SaveChangesAsync(); } public async Task CheckWarnExpiresAsync(ulong guildId) @@ -309,31 +293,31 @@ public class UserPunishService : IEService, IReadyExecutor if (config.WarnExpireAction == WarnExpireAction.Clear) { await uow.Set() - .Where(x => x.GuildId == guildId - && x.Forgiven == false - && x.DateAdded < DateTime.UtcNow.AddHours(-config.WarnExpireHours)) - .UpdateAsync(_ => new() - { - Forgiven = true, - ForgivenBy = "expiry" - }); + .Where(x => x.GuildId == guildId + && x.Forgiven == false + && x.DateAdded < DateTime.UtcNow.AddHours(-config.WarnExpireHours)) + .UpdateAsync(_ => new() + { + Forgiven = true, + ForgivenBy = "expiry" + }); } else if (config.WarnExpireAction == WarnExpireAction.Delete) { await uow.Set() - .Where(x => x.GuildId == guildId - && x.DateAdded < DateTime.UtcNow.AddHours(-config.WarnExpireHours)) - .DeleteAsync(); + .Where(x => x.GuildId == guildId + && x.DateAdded < DateTime.UtcNow.AddHours(-config.WarnExpireHours)) + .DeleteAsync(); } 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 +366,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 +386,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( @@ -457,20 +436,20 @@ public class UserPunishService : IEService, IReadyExecutor var gusers = guild.Users; //get user objects and reasons var bans = people.Split("\n") - .Select(x => - { - var split = x.Trim().Split(" "); + .Select(x => + { + var split = x.Trim().Split(" "); - var reason = string.Join(" ", split.Skip(1)); + var reason = string.Join(" ", split.Skip(1)); - if (ulong.TryParse(split[0], out var id)) - return (Original: split[0], Id: id, Reason: reason); + if (ulong.TryParse(split[0], out var id)) + return (Original: split[0], Id: id, Reason: reason); - return (Original: split[0], - gusers.FirstOrDefault(u => u.ToString().ToLowerInvariant() == x)?.Id, - Reason: reason); - }) - .ToArray(); + return (Original: split[0], + gusers.FirstOrDefault(u => u.ToString().ToLowerInvariant() == x)?.Id, + Reason: reason); + }) + .ToArray(); //if user is null, means that person couldn't be found var missing = bans.Count(x => !x.Id.HasValue); @@ -504,12 +483,11 @@ public class UserPunishService : IEService, IReadyExecutor } else if (template is null) { - uow.Set() - .Add(new() - { - GuildId = guildId, - Text = text - }); + uow.Set().Add(new() + { + GuildId = guildId, + Text = text + }); } else template.Text = text; @@ -521,31 +499,31 @@ public class UserPunishService : IEService, IReadyExecutor { await using var ctx = _db.GetDbContext(); await ctx.Set() - .ToLinqToDBTable() - .InsertOrUpdateAsync(() => new() - { - GuildId = guildId, - Text = null, - DateAdded = DateTime.UtcNow, - PruneDays = pruneDays - }, - old => new() - { - PruneDays = pruneDays - }, - () => new() - { - GuildId = guildId - }); + .ToLinqToDBTable() + .InsertOrUpdateAsync(() => new() + { + GuildId = guildId, + Text = null, + DateAdded = DateTime.UtcNow, + PruneDays = pruneDays + }, + old => new() + { + PruneDays = pruneDays + }, + () => new() + { + GuildId = guildId + }); } public async Task GetBanPruneAsync(ulong guildId) { await using var ctx = _db.GetDbContext(); return await ctx.Set() - .Where(x => x.GuildId == guildId) - .Select(x => x.PruneDays) - .FirstOrDefaultAsyncLinqToDB(); + .Where(x => x.GuildId == guildId) + .Select(x => x.PruneDays) + .FirstOrDefaultAsyncLinqToDB(); } public Task GetBanUserDmEmbed( @@ -576,18 +554,18 @@ public class UserPunishService : IEService, IReadyExecutor banReason = string.IsNullOrWhiteSpace(banReason) ? "-" : banReason; var repCtx = new ReplacementContext(client, guild) - .WithOverride("%ban.mod%", () => moderator.ToString()) - .WithOverride("%ban.mod.fullname%", () => moderator.ToString()) - .WithOverride("%ban.mod.name%", () => moderator.Username) - .WithOverride("%ban.mod.discrim%", () => moderator.Discriminator) - .WithOverride("%ban.user%", () => target.ToString()) - .WithOverride("%ban.user.fullname%", () => target.ToString()) - .WithOverride("%ban.user.name%", () => target.Username) - .WithOverride("%ban.user.discrim%", () => target.Discriminator) - .WithOverride("%reason%", () => banReason) - .WithOverride("%ban.reason%", () => banReason) - .WithOverride("%ban.duration%", - () => duration?.ToString(@"d\.hh\:mm") ?? "perma"); + .WithOverride("%ban.mod%", () => moderator.ToString()) + .WithOverride("%ban.mod.fullname%", () => moderator.ToString()) + .WithOverride("%ban.mod.name%", () => moderator.Username) + .WithOverride("%ban.mod.discrim%", () => moderator.Discriminator) + .WithOverride("%ban.user%", () => target.ToString()) + .WithOverride("%ban.user.fullname%", () => target.ToString()) + .WithOverride("%ban.user.name%", () => target.Username) + .WithOverride("%ban.user.discrim%", () => target.Discriminator) + .WithOverride("%reason%", () => banReason) + .WithOverride("%ban.reason%", () => banReason) + .WithOverride("%ban.duration%", + () => duration?.ToString(@"d\.hh\:mm") ?? "perma"); // if template isn't set, use the old message style @@ -616,93 +594,4 @@ public class UserPunishService : IEService, IReadyExecutor var output = SmartText.CreateFrom(template); return await _repSvc.ReplaceAsync(output, repCtx); } - - public async Task WarnDelete(ulong guildId, ulong userId, int index) - { - await using var uow = _db.GetDbContext(); - - var warn = await uow.GetTable() - .Where(x => x.GuildId == guildId && x.UserId == userId) - .OrderByDescending(x => x.DateAdded) - .Skip(index) - .FirstOrDefaultAsyncLinqToDB(); - - if (warn is not null) - { - await uow.GetTable() - .Where(x => x.Id == warn.Id) - .DeleteAsync(); - } - - 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/Administration/VcRole/VcRoleService.cs b/src/EllieBot/Modules/Administration/VcRole/VcRoleService.cs index 0ba9feb..c2dc60b 100644 --- a/src/EllieBot/Modules/Administration/VcRole/VcRoleService.cs +++ b/src/EllieBot/Modules/Administration/VcRole/VcRoleService.cs @@ -1,5 +1,6 @@ #nullable disable using Microsoft.EntityFrameworkCore; +using EllieBot.Db; using EllieBot.Db.Models; namespace EllieBot.Modules.Administration.Services; diff --git a/src/EllieBot/Modules/Expressions/EllieExpressionExtensions.cs b/src/EllieBot/Modules/Expressions/EllieExpressionExtensions.cs index 6d8b89c..72606a7 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, + users: 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..5def4f3 100644 --- a/src/EllieBot/Modules/Expressions/EllieExpressions.cs +++ b/src/EllieBot/Modules/Expressions/EllieExpressions.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable using EllieBot.Db.Models; namespace EllieBot.Modules.EllieExpressions; @@ -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; @@ -57,14 +57,14 @@ public partial class EllieExpressions : EllieModule [Cmd] [UserPerm(GuildPerm.Administrator)] - public async Task ExprAddServer(string trigger, [Leftover] string response) + public async Task ExprAddServer(string key, [Leftover] string message) { - if (string.IsNullOrWhiteSpace(response) || string.IsNullOrWhiteSpace(trigger)) + if (string.IsNullOrWhiteSpace(message) || string.IsNullOrWhiteSpace(key)) { return; } - await ExprAddInternalAsync(trigger, response); + await ExprAddInternalAsync(key, message); } @@ -397,11 +397,13 @@ public partial class EllieExpressions : EllieModule var serialized = _service.ExportExpressions(ctx.Guild?.Id); await using var stream = await serialized.ToStream(); - await ctx.User.SendFileAsync(stream, $"exprs-export_{DateTime.UtcNow:yyyy-MM-dd-HH-mm-ss}_{(ctx.Guild?.Id.ToString() ?? "global")}.yml"); + await ctx.Channel.SendFileAsync(stream, "exprs-export.yml"); } [Cmd] - [Ratelimit(300)] +#if GLOBAL_ELLIE + [OwnerOnly] +#endif public async Task ExprsImport([Leftover] string input = null) { if (!AdminInGuildOrOwnerInDm()) diff --git a/src/EllieBot/Modules/Expressions/EllieExpressionsService.cs b/src/EllieBot/Modules/Expressions/EllieExpressionsService.cs index 5e3561d..2f0b740 100644 --- a/src/EllieBot/Modules/Expressions/EllieExpressionsService.cs +++ b/src/EllieBot/Modules/Expressions/EllieExpressionsService.cs @@ -2,6 +2,7 @@ using Microsoft.EntityFrameworkCore; using EllieBot.Common.ModuleBehaviors; using EllieBot.Common.Yml; +using EllieBot.Db; using EllieBot.Db.Models; using System.Runtime.CompilerServices; using LinqToDB.EntityFrameworkCore; @@ -67,6 +68,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 +85,7 @@ public sealed class EllieExpressionsService : IExecOnMessage, IReadyExecutor IBotStrings strings, IBot bot, DiscordSocketClient client, + ICommandHandler cmd, IPubSub pubSub, IMessageSenderService sender, IReplacementService repSvc, @@ -91,6 +94,7 @@ public sealed class EllieExpressionsService : IExecOnMessage, IReadyExecutor { _db = db; _client = client; + _cmd = cmd; _strings = strings; _bot = bot; _pubSub = pubSub; @@ -120,11 +124,11 @@ public sealed class EllieExpressionsService : IExecOnMessage, IReadyExecutor newguildExpressions = guildItems.GroupBy(k => k.GuildId!.Value) .ToDictionary(g => g.Key, g => g.Select(x => - { - x.Trigger = x.Trigger.Replace(MENTION_PH, - _client.CurrentUser.Mention); - return x; - }) + { + x.Trigger = x.Trigger.Replace(MENTION_PH, + _client.CurrentUser.Mention); + return x; + }) .ToArray()) .ToConcurrent(); @@ -246,54 +250,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 +337,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 +790,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/Expressions/ExportedExpr.cs b/src/EllieBot/Modules/Expressions/ExportedExpr.cs index 581c884..c45fbdc 100644 --- a/src/EllieBot/Modules/Expressions/ExportedExpr.cs +++ b/src/EllieBot/Modules/Expressions/ExportedExpr.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable using EllieBot.Db.Models; namespace EllieBot.Modules.EllieExpressions; 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..91388ef 100644 --- a/src/EllieBot/Modules/Gambling/Bank/BankCommands.cs +++ b/src/EllieBot/Modules/Gambling/Bank/BankCommands.cs @@ -73,27 +73,6 @@ public partial class Gambling await Response().Error(strs.cant_dm).SendAsync(); } } - - [Cmd] - [OwnerOnly] - public async Task BankBalance([Leftover] IUser user) - { - var bal = await _bank.GetBalanceAsync(user.Id); - - var eb = _sender.CreateEmbed() - .WithOkColor() - .WithDescription(GetText(strs.bank_balance_other(user.ToString(), N(bal)))); - - try - { - await Response().User(ctx.User).Embed(eb).SendAsync(); - await ctx.OkAsync(); - } - catch - { - await Response().Error(strs.cant_dm).SendAsync(); - } - } private async Task BankTakeInternalAsync(long amount, ulong userId) { 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..45d2e89 100644 --- a/src/EllieBot/Modules/Gambling/Connect4/Connect4.cs +++ b/src/EllieBot/Modules/Gambling/Connect4/Connect4.cs @@ -38,11 +38,11 @@ public sealed class Connect4Game : IDisposable public Phase CurrentPhase { get; private set; } = Phase.Joining; - public IReadOnlyList GameState - => _gameState.AsReadOnly(); + public ImmutableArray GameState + => _gameState.ToImmutableArray(); - public IReadOnlyCollection<(ulong UserId, string Username)?> Players - => _players.AsReadOnly(); + public ImmutableArray<(ulong UserId, string Username)?> Players + => _players.ToImmutableArray(); public (ulong UserId, string Username) CurrentPlayer => CurrentPhase == Phase.P1Move ? _players[0].Value : _players[1].Value; @@ -56,6 +56,7 @@ public sealed class Connect4Game : IDisposable private readonly SemaphoreSlim _locker = new(1, 1); private readonly Options _options; + private readonly ICurrencyService _cs; private readonly EllieRandom _rng; private Timer playerTimeoutTimer; @@ -72,11 +73,12 @@ public sealed class Connect4Game : IDisposable public Connect4Game( ulong userId, string userName, - Options options - ) + Options options, + ICurrencyService cs) { _players[0] = (userId, userName); _options = options; + _cs = cs; _rng = new(); for (var i = 0; i < NUMBER_OF_COLUMNS * NUMBER_OF_ROWS; i++) @@ -97,13 +99,14 @@ public sealed class Connect4Game : IDisposable { _ = OnGameFailedToStart?.Invoke(this); CurrentPhase = Phase.Ended; + await _cs.AddAsync(_players[0].Value.UserId, _options.Bet, new("connect4", "refund")); } } finally { _locker.Release(); } }); } - public async Task Join(ulong userId, string userName) + public async Task Join(ulong userId, string userName, int bet) { await _locker.WaitAsync(); try @@ -114,6 +117,11 @@ public sealed class Connect4Game : IDisposable if (_players[0].Value.UserId == userId) // same user can't join own game return false; + if (bet != _options.Bet) // can't join if bet amount is not the same + return false; + + if (!await _cs.RemoveAsync(userId, bet, new("connect4", "bet"))) // user doesn't have enough money to gamble + return false; if (_rng.Next(0, 2) == 0) //rolling from 0-1, if number is 0, join as first player { @@ -343,8 +351,13 @@ public sealed class Connect4Game : IDisposable if (result == Result.Draw) { + _cs.AddAsync(CurrentPlayer.UserId, _options.Bet, new("connect4", "draw")); + _cs.AddAsync(OtherPlayer.UserId, _options.Bet, new("connect4", "draw")); return; } + + if (winId is not null) + _cs.AddAsync(winId.Value, (long)(_options.Bet * 1.98), new("connect4", "win")); } private Field GetPlayerPiece(ulong userId) @@ -381,10 +394,16 @@ public sealed class Connect4Game : IDisposable HelpText = "Turn time in seconds. It has to be between 5 and 60. Default 15.")] public int TurnTimer { get; set; } = 15; + [Option('b', "bet", Required = false, Default = 0, HelpText = "Amount you bet. Default 0.")] + public int Bet { get; set; } + public void NormalizeOptions() { if (TurnTimer is < 5 or > 60) TurnTimer = 15; + + if (Bet < 0) + Bet = 0; } } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Gambling/Connect4/Connect4Commands.cs b/src/EllieBot/Modules/Gambling/Connect4/Connect4Commands.cs index ca2900c..8210ad4 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 = [ @@ -29,15 +29,17 @@ public partial class Gambling } private readonly DiscordSocketClient _client; + private readonly ICurrencyService _cs; private IUserMessage msg; private int repostCounter; - public Connect4Commands(DiscordSocketClient client, GamblingConfigService gamb) + public Connect4Commands(DiscordSocketClient client, ICurrencyService cs, GamblingConfigService gamb) : base(gamb) { _client = client; + _cs = cs; } [Cmd] @@ -46,8 +48,10 @@ public partial class Gambling public async Task Connect4(params string[] args) { var (options, _) = OptionsParser.ParseFrom(new Connect4Game.Options(), args); + if (!await CheckBetOptional(options.Bet)) + return; - var newGame = new Connect4Game(ctx.User.Id, ctx.User.ToString(), options); + var newGame = new Connect4Game(ctx.User.Id, ctx.User.ToString(), options, _cs); Connect4Game game; if ((game = _service.Connect4Games.GetOrAdd(ctx.Channel.Id, newGame)) != newGame) { @@ -56,17 +60,31 @@ public partial class Gambling newGame.Dispose(); //means game already exists, try to join - await game.Join(ctx.User.Id, ctx.User.ToString()); + await game.Join(ctx.User.Id, ctx.User.ToString(), options.Bet); return; } + if (options.Bet > 0) + { + if (!await _cs.RemoveAsync(ctx.User.Id, options.Bet, new("connect4", "bet"))) + { + await Response().Error(strs.not_enough(CurrencySign)).SendAsync(); + _service.Connect4Games.TryRemove(ctx.Channel.Id, out _); + game.Dispose(); + return; + } + } + game.OnGameStateUpdated += Game_OnGameStateUpdated; game.OnGameFailedToStart += GameOnGameFailedToStart; game.OnGameEnded += GameOnGameEnded; _client.MessageReceived += ClientMessageReceived; game.Initialize(); - await Response().Confirm(strs.connect4_created).SendAsync(); + if (options.Bet == 0) + await Response().Confirm(strs.connect4_created).SendAsync(); + else + await Response().Error(strs.connect4_created_bet(N(options.Bet))).SendAsync(); Task ClientMessageReceived(SocketMessage arg) { @@ -133,19 +151,19 @@ public partial class Gambling title = GetText(strs.connect4_draw); return msg.ModifyAsync(x => x.Embed = _sender.CreateEmbed() - .WithTitle(title) - .WithDescription(GetGameStateText(game)) - .WithOkColor() - .Build()); + .WithTitle(title) + .WithDescription(GetGameStateText(game)) + .WithOkColor() + .Build()); } } private async Task Game_OnGameStateUpdated(Connect4Game game) { var embed = _sender.CreateEmbed() - .WithTitle($"{game.CurrentPlayer.Username} vs {game.OtherPlayer.Username}") - .WithDescription(GetGameStateText(game)) - .WithOkColor(); + .WithTitle($"{game.CurrentPlayer.Username} vs {game.OtherPlayer.Username}") + .WithDescription(GetGameStateText(game)) + .WithOkColor(); if (msg is null) @@ -180,7 +198,7 @@ public partial class Gambling for (var i = 0; i < Connect4Game.NUMBER_OF_COLUMNS; i++) sb.Append(_numbers[i]); - + return sb.ToString(); } } diff --git a/src/EllieBot/Modules/Gambling/Draw/DrawCommands.cs b/src/EllieBot/Modules/Gambling/Draw/DrawCommands.cs index 1bf1986..dd10cf1 100644 --- a/src/EllieBot/Modules/Gambling/Draw/DrawCommands.cs +++ b/src/EllieBot/Modules/Gambling/Draw/DrawCommands.cs @@ -12,13 +12,12 @@ 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; - public DrawCommands(IImageCache images, GamblingConfigService gcs) - : base(gcs) + public DrawCommands(IImageCache images, GamblingConfigService gcs) : base(gcs) => _images = images; private async Task InternalDraw(int count, ulong? guildId = null) @@ -57,8 +56,8 @@ public partial class Gambling i.Dispose(); var eb = _sender.CreateEmbed() - .WithOkColor(); - + .WithOkColor(); + var toSend = string.Empty; if (cardObjects.Count == 5) eb.AddField(GetText(strs.hand_value), Deck.GetHandValue(cardObjects), true); @@ -72,7 +71,7 @@ public partial class Gambling if (count > 1) eb.AddField(GetText(strs.cards), count.ToString(), true); - + await using var imageStream = await img.ToStreamAsync(); await ctx.Channel.SendFileAsync(imageStream, imgName, @@ -85,7 +84,7 @@ public partial class Gambling var cardBytes = await File.ReadAllBytesAsync($"data/images/cards/{cardName}.jpg"); return Image.Load(cardBytes); } - + private async Task> GetCardImageAsync(Deck.Card currentCard) { var cardName = currentCard.ToString().ToLowerInvariant().Replace(' ', '_'); @@ -99,7 +98,7 @@ public partial class Gambling { if (num < 1) return; - + if (num > 10) num = 10; @@ -111,7 +110,7 @@ public partial class Gambling { if (num < 1) return; - + if (num > 10) num = 10; @@ -137,29 +136,19 @@ public partial class Gambling [Cmd] [RequireContext(ContextType.Guild)] - public Task BetDraw( - [OverrideTypeReader(typeof(BalanceTypeReader))] - long amount, - InputValueGuess val, - InputColorGuess? col = null) + public Task BetDraw([OverrideTypeReader(typeof(BalanceTypeReader))] long amount, InputValueGuess val, InputColorGuess? col = null) => BetDrawInternal(amount, val, col); - + [Cmd] [RequireContext(ContextType.Guild)] - public Task BetDraw( - [OverrideTypeReader(typeof(BalanceTypeReader))] - long amount, - InputColorGuess col, - InputValueGuess? val = null) + public Task BetDraw([OverrideTypeReader(typeof(BalanceTypeReader))] long amount, InputColorGuess col, InputValueGuess? val = null) => BetDrawInternal(amount, val, col); - + public async Task BetDrawInternal(long amount, InputValueGuess? val, InputColorGuess? col) { - if (!await CheckBetMandatory(amount)) - { + if (amount <= 0) return; - } - + var res = await _service.BetDrawAsync(ctx.User.Id, amount, (byte?)val, @@ -172,13 +161,13 @@ public partial class Gambling } var eb = _sender.CreateEmbed() - .WithOkColor() - .WithAuthor(ctx.User) - .WithDescription(result.Card.GetEmoji()) - .AddField(GetText(strs.guess), GetGuessInfo(val, col), true) - .AddField(GetText(strs.card), GetCardInfo(result.Card), true) - .AddField(GetText(strs.won), N((long)result.Won), false) - .WithImageUrl("attachment://card.png"); + .WithOkColor() + .WithAuthor(ctx.User) + .WithDescription(result.Card.GetEmoji()) + .AddField(GetText(strs.guess), GetGuessInfo(val, col), true) + .AddField(GetText(strs.card), GetCardInfo(result.Card), true) + .AddField(GetText(strs.won), N((long)result.Won), false) + .WithImageUrl("attachment://card.png"); using var img = await GetCardImageAsync(result.Card); await using var imgStream = await img.ToStreamAsync(); @@ -200,10 +189,9 @@ public partial class Gambling InputColorGuess.Black => "B ⚫", _ => "❓" }; - + return $"{val} / {col}"; } - private string GetCardInfo(RegularCard card) { var val = (int)card.Value switch @@ -220,7 +208,7 @@ public partial class Gambling RegularSuit.Diamonds or RegularSuit.Hearts => "R 🔴", _ => "B ⚫" }; - + return $"{val} / {col}"; } 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..aeb23c0 100644 --- a/src/EllieBot/Modules/Gambling/Events/GameStatusEvent.cs +++ b/src/EllieBot/Modules/Gambling/Events/GameStatusEvent.cs @@ -27,13 +27,17 @@ public class GameStatusEvent : ICurrencyEvent private readonly string _code; + private readonly char[] _sneakyGameStatusChars = Enumerable.Range(48, 10) + .Concat(Enumerable.Range(65, 26)) + .Concat(Enumerable.Range(97, 26)) + .Select(x => (char)x) + .ToArray(); + private readonly object _stopLock = new(); private readonly object _potLock = new(); private readonly IMessageSenderService _sender; - private static readonly EllieRandom _rng = new EllieRandom(); - public GameStatusEvent( DiscordSocketClient client, ICurrencyService cs, @@ -54,8 +58,7 @@ public class GameStatusEvent : ICurrencyEvent _opts = opt; _sender = sender; // generate code - - _code = new kwum(_rng.Next(1_000_000, 10_000_000)).ToString(); + _code = new(_sneakyGameStatusChars.Shuffle().Take(5).ToArray()); _t = new(OnTimerTick, null, Timeout.InfiniteTimeSpan, TimeSpan.FromSeconds(2)); if (_opts.Hours > 0) @@ -85,9 +88,9 @@ public class GameStatusEvent : ICurrencyEvent if (_isPotLimited) { await msg.ModifyAsync(m => - { - m.Embed = GetEmbed(PotSize).Build(); - }); + { + m.Embed = GetEmbed(PotSize).Build(); + }); } Log.Information("Game status event awarded {Count} users {Amount} currency.{Remaining}", 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..428f756 100644 --- a/src/EllieBot/Modules/Gambling/Gambling.cs +++ b/src/EllieBot/Modules/Gambling/Gambling.cs @@ -1,7 +1,7 @@ #nullable disable using LinqToDB; using LinqToDB.EntityFrameworkCore; -using LinqToDB.Tools; +using EllieBot.Db; using EllieBot.Db.Models; using EllieBot.Modules.Gambling.Bank; using EllieBot.Modules.Gambling.Common; @@ -14,13 +14,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 +26,12 @@ 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 IPatronageService _ps; private readonly IRemindService _remind; private readonly GamblingTxTracker _gamblingTxTracker; - private readonly IPatronageService _ps; - private readonly RakebackService _rb; + + private IUserMessage rdMsg; public Gambling( IGamblingService gs, @@ -47,12 +40,10 @@ public partial class Gambling : GamblingModule DiscordSocketClient client, DownloadTracker tracker, GamblingConfigService configService, - FontProvider fonts, IBankService bank, + IPatronageService ps, IRemindService remind, - IPatronageService patronage, - GamblingTxTracker gamblingTxTracker, - RakebackService rb) + GamblingTxTracker gamblingTxTracker) : base(configService) { _gs = gs; @@ -60,18 +51,15 @@ public partial class Gambling : GamblingModule _cs = currency; _client = client; _bank = bank; + _ps = ps; _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 +68,76 @@ 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(); + } + + [Cmd] + public async Task Economy() + { + var ec = await _service.GetEconomyAsync(); + decimal onePercent = 0; + + // This stops the top 1% from owning more than 100% of the money + if (ec.Cash > 0) + { + onePercent = ec.OnePercent / (ec.Cash - ec.Bot); + } + + // [21:03] Bob Page: Kinda remids me of US economy + var embed = _sender.CreateEmbed() + .WithTitle(GetText(strs.economy_state)) + .AddField(GetText(strs.currency_owned), N(ec.Cash - ec.Bot)) + .AddField(GetText(strs.currency_one_percent), (onePercent * 100).ToString("F2") + "%") + .AddField(GetText(strs.currency_planted), N(ec.Planted)) + .AddField(GetText(strs.owned_waifus_total), N(ec.Waifus)) + .AddField(GetText(strs.bot_currency), N(ec.Bot)) + .AddField(GetText(strs.bank_accounts), N(ec.Bank)) + .AddField(GetText(strs.total), N(ec.Cash + ec.Planted + ec.Waifus + ec.Bank)) + .WithOkColor(); + + // ec.Cash already contains ec.Bot as it's the total of all values in the CurrencyAmount column of the DiscordUser table + await Response().Embed(embed).SendAsync(); + } + + private static readonly FeatureLimitKey _timelyKey = new FeatureLimitKey() + { + Key = "timely:extra_percent", + PrettyName = "Timely" + }; private async Task RemindTimelyAction(SocketMessageComponent smc, DateTime when) { @@ -96,7 +154,6 @@ public partial class Gambling : GamblingModule await smc.RespondConfirmAsync(_sender, GetText(strs.remind_timely(tt)), ephemeral: true); } - // Creates timely reminder button, parameter in hours. private EllieInteractionBase CreateRemindMeInteraction(int period) => _inter .Create(ctx.User.Id, @@ -107,32 +164,7 @@ public partial class Gambling : GamblingModule (smc) => RemindTimelyAction(smc, DateTime.UtcNow.Add(TimeSpan.FromHours(period))) ); - // Creates timely reminder button, parameter in milliseconds. - private EllieInteractionBase CreateRemindMeInteraction(double ms) - => _inter - .Create(ctx.User.Id, - new ButtonBuilder( - label: "Remind me", - emote: Emoji.Parse("⏰"), - customId: "timely:remind_me"), - (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,138 +175,29 @@ public partial class Gambling : GamblingModule return; } - if (Config.Timely.ProtType == TimelyProt.Button) + var inter = CreateRemindMeInteraction(period); + + if (await _service.ClaimTimelyAsync(ctx.User.Id, period) is { } rem) { - 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 - var interaction = CreateRemindMeInteraction(remainder.TotalMilliseconds); - // Removes timely button if there is a timely reminder in DB if (_service.UserHasTimelyReminder(ctx.User.Id)) { - interaction = null; + inter = null; } var now = DateTime.UtcNow; - var relativeTag = TimestampTag.FromDateTime(now.Add(remainder), TimestampTagStyles.Relative); - await Response().Pending(strs.timely_already_claimed(relativeTag)).Interaction(interaction).SendAsync(); + var relativeTag = TimestampTag.FromDateTime(now.Add(rem), TimestampTagStyles.Relative); + await Response().Pending(strs.timely_already_claimed(relativeTag)).Interaction(inter).SendAsync(); return; } + var result = await _ps.TryGetFeatureLimitAsync(_timelyKey, ctx.User.Id, 0); - 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); - - var percentBonus = (_ps.PercentBonus(patron) / 100f); - - val += (int)(val * percentBonus); - - var inter = CreateRemindMeInteraction(period); + val = (int)(val * (1 + (result.Quota! * 0.01f))); 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 +308,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 +565,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,10 +586,119 @@ public partial class Gambling : GamblingModule } else { + await Response().Error(strs.take_fail(N(amount), Format.Code(usrId.ToString()), CurrencySign)).SendAsync(); + } + } + + [Cmd] + [RequireContext(ContextType.Guild)] + public async Task RollDuel(IUser u) + { + if (ctx.User.Id == u.Id) + { + return; + } + + //since the challenge is created by another user, we need to reverse the ids + //if it gets removed, means challenge is accepted + if (_service.Duels.TryRemove((ctx.User.Id, u.Id), out var game)) + { + await game.StartGame(); + } + } + + [Cmd] + [RequireContext(ContextType.Guild)] + public async Task RollDuel([OverrideTypeReader(typeof(BalanceTypeReader))] long amount, IUser u) + { + if (ctx.User.Id == u.Id) + { + return; + } + + if (amount <= 0) + { + return; + } + + var embed = _sender.CreateEmbed().WithOkColor().WithTitle(GetText(strs.roll_duel)); + + var description = string.Empty; + + var game = new RollDuelGame(_cs, _client.CurrentUser.Id, ctx.User.Id, u.Id, amount); + //means challenge is just created + if (_service.Duels.TryGetValue((ctx.User.Id, u.Id), out var other)) + { + if (other.Amount != amount) + { + await Response().Error(strs.roll_duel_already_challenged).SendAsync(); + } + else + { + await RollDuel(u); + } + + return; + } + + if (_service.Duels.TryAdd((u.Id, ctx.User.Id), game)) + { + game.OnGameTick += GameOnGameTick; + game.OnEnded += GameOnEnded; + await Response() - .Error(strs.take_fail(N(amount), Format.Code(usrId.ToString()), CurrencySign)) + .Confirm(strs.roll_duel_challenge(Format.Bold(ctx.User.ToString()), + Format.Bold(u.ToString()), + Format.Bold(N(amount)))) .SendAsync(); } + + async Task GameOnGameTick(RollDuelGame arg) + { + var rolls = arg.Rolls.Last(); + description += $@"{Format.Bold(ctx.User.ToString())} rolled **{rolls.Item1}** +{Format.Bold(u.ToString())} rolled **{rolls.Item2}** +-- +"; + embed = embed.WithDescription(description); + + if (rdMsg is null) + { + rdMsg = await Response().Embed(embed).SendAsync(); + } + else + { + await rdMsg.ModifyAsync(x => { x.Embed = embed.Build(); }); + } + } + + async Task GameOnEnded(RollDuelGame rdGame, RollDuelGame.Reason reason) + { + try + { + if (reason == RollDuelGame.Reason.Normal) + { + var winner = rdGame.Winner == rdGame.P1 ? ctx.User : u; + description += $"\n**{winner}** Won {N((long)(rdGame.Amount * 2 * 0.98))}"; + + embed = embed.WithDescription(description); + + await rdMsg.ModifyAsync(x => x.Embed = embed.Build()); + } + else if (reason == RollDuelGame.Reason.Timeout) + { + await Response().Error(strs.roll_duel_timeout).SendAsync(); + } + else if (reason == RollDuelGame.Reason.NoFunds) + { + await Response().Error(strs.roll_duel_no_funds).SendAsync(); + } + } + finally + { + _service.Duels.TryRemove((u.Id, ctx.User.Id), out _); + } + } } [Cmd] @@ -726,6 +755,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 +770,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 +785,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,9 +892,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 +1029,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..0100c88 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; } = 2; [Comment("""Currency settings""")] public CurrencyConfig Currency { get; set; } @@ -20,9 +20,9 @@ public sealed partial class GamblingConfig : ICloneable public int MinBet { get; set; } = 0; [Comment(""" - Maximum amount users can bet - Set 0 for unlimited - """)] + Maximum amount users can bet + Set 0 for unlimited + """)] public int MaxBet { get; set; } = 0; [Comment("""Settings for betflip command""")] @@ -35,14 +35,14 @@ public sealed partial class GamblingConfig : ICloneable public GenerationConfig Generation { get; set; } [Comment(""" - Settings for timely command - (letting people claim X amount of currency every Y hours) - """)] + Settings for timely command + (letting people claim X amount of currency every Y hours) + """)] public TimelyConfig Timely { get; set; } [Comment("""How much will each user's owned currency decay over time.""")] public DecayConfig Decay { get; set; } - + [Comment("""What is the bot's cut on some transactions""")] public BotCutConfig BotCuts { get; set; } @@ -53,25 +53,20 @@ public sealed partial class GamblingConfig : ICloneable public WaifuConfig Waifu { get; set; } [Comment(""" - Amount of currency selfhosters will get PER pledged dollar CENT. - 1 = 100 currency per $. Used almost exclusively on public ellie. - """)] + Amount of currency selfhosters will get PER pledged dollar CENT. + 1 = 100 currency per $. Used almost exclusively on public ellie. + """)] public decimal PatreonCurrencyPerCent { get; set; } = 1; [Comment(""" - Currency reward per vote. - This will work only if you've set up VotesApi and correct credentials for topgg and/or discords voting - """)] + Currency reward per vote. + This will work only if you've set up VotesApi and correct credentials for topgg and/or discords voting + """)] public long VoteReward { get; set; } = 100; [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(); } } @@ -97,9 +91,9 @@ public class CurrencyConfig public string Name { get; set; } = "Ellie Money"; [Comment(""" - For how long (in days) will the transactions be kept in the database (curtrs) - Set 0 to disable cleanup (keep transactions forever) - """)] + For how long (in days) will the transactions be kept in the database (curtrs) + Set 0 to disable cleanup (keep transactions forever) + """)] public int TransactionsLifetime { get; set; } = 0; } @@ -107,29 +101,16 @@ public class CurrencyConfig public partial class TimelyConfig { [Comment(""" - 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; + How much currency will the users get every time they run .timely command + setting to 0 or less will disable this feature + """)] + 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 - """)] + 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] @@ -143,10 +124,10 @@ public partial class BetFlipConfig public partial class BetRollConfig { [Comment(""" - When betroll is played, user will roll a number 0-100. - This setting will describe which multiplier is used for when the roll is higher than the given number. - Doesn't have to be ordered. - """)] + When betroll is played, user will roll a number 0-100. + This setting will describe which multiplier is used for when the roll is higher than the given number. + Doesn't have to be ordered. + """)] public BetRollPair[] Pairs { get; set; } = Array.Empty(); public BetRollConfig() @@ -164,7 +145,7 @@ public partial class BetRollConfig }, new() { - WhenAbove = 65, + WhenAbove = 66, MultiplyBy = 2 } ]; @@ -174,17 +155,17 @@ public partial class BetRollConfig public partial class GenerationConfig { [Comment(""" - when currency is generated, should it also have a random password - associated with it which users have to type after the .pick command - in order to get it - """)] + when currency is generated, should it also have a random password + associated with it which users have to type after the .pick command + in order to get it + """)] public bool HasPassword { get; set; } = true; [Comment(""" - Every message sent has a certain % chance to generate the currency - specify the percentage here (1 being 100%, 0 being 0% - for example - default is 0.02, which is 2% - """)] + Every message sent has a certain % chance to generate the currency + specify the percentage here (1 being 100%, 0 being 0% - for example + default is 0.02, which is 2% + """)] public decimal Chance { get; set; } = 0.02M; [Comment("""How many seconds have to pass for the next message to have a chance to spawn currency""")] @@ -194,9 +175,9 @@ public partial class GenerationConfig public int MinAmount { get; set; } = 1; [Comment(""" - Maximum amount of currency that can spawn. - Set to the same value as MinAmount to always spawn the same amount - """)] + Maximum amount of currency that can spawn. + Set to the same value as MinAmount to always spawn the same amount + """)] public int MaxAmount { get; set; } = 1; } @@ -204,9 +185,9 @@ public partial class GenerationConfig public partial class DecayConfig { [Comment(""" - Percentage of user's current currency which will be deducted every 24h. - 0 - 1 (1 is 100%, 0.5 50%, 0 disabled) - """)] + Percentage of user's current currency which will be deducted every 24h. + 0 - 1 (1 is 100%, 0.5 50%, 0 disabled) + """)] public decimal Percent { get; set; } = 0; [Comment("""Maximum amount of user's currency that can decay at each interval. 0 for unlimited.""")] @@ -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] @@ -238,15 +219,15 @@ public sealed partial class WaifuConfig public MultipliersData Multipliers { get; set; } = new(); [Comment(""" - Settings for periodic waifu price decay. - Waifu price decays only if the waifu has no claimer. - """)] + Settings for periodic waifu price decay. + Waifu price decays only if the waifu has no claimer. + """)] public WaifuDecayConfig Decay { get; set; } = new(); [Comment(""" - List of items available for gifting. - If negative is true, gift will instead reduce waifu value. - """)] + List of items available for gifting. + If negative is true, gift will instead reduce waifu value. + """)] public List Items { get; set; } = []; public WaifuConfig() @@ -293,26 +274,19 @@ public sealed partial class WaifuConfig public class WaifuDecayConfig { [Comment(""" - Unclaimed 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 UnclaimedDecayPercent { get; set; } = 0; - - [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; + 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 Percent { get; set; } = 0; [Comment("""How often to decay waifu values, in hours""")] public int HourInterval { get; set; } = 24; [Comment(""" - Minimum waifu price required for the decay to be applied. - For example if this value is set to 300, any waifu with the price 300 or less will not experience decay. - """)] + Minimum waifu price required for the decay to be applied. + For example if this value is set to 300, any waifu with the price 300 or less will not experience decay. + """)] public long MinPrice { get; set; } = 300; } } @@ -321,54 +295,54 @@ public sealed partial class WaifuConfig public sealed partial class MultipliersData { [Comment(""" - Multiplier for waifureset. Default 150. - Formula (at the time of writing this): - price = (waifu_price * 1.25f) + ((number_of_divorces + changes_of_heart + 2) * WaifuReset) rounded up - """)] + Multiplier for waifureset. Default 150. + Formula (at the time of writing this): + price = (waifu_price * 1.25f) + ((number_of_divorces + changes_of_heart + 2) * WaifuReset) rounded up + """)] public int WaifuReset { get; set; } = 150; [Comment(""" - The minimum amount of currency that you have to pay - in order to buy a waifu who doesn't have a crush on you. - Default is 1.1 - Example: If a waifu is worth 100, you will have to pay at least 100 * NormalClaim currency to claim her. - (100 * 1.1 = 110) - """)] + The minimum amount of currency that you have to pay + in order to buy a waifu who doesn't have a crush on you. + Default is 1.1 + Example: If a waifu is worth 100, you will have to pay at least 100 * NormalClaim currency to claim her. + (100 * 1.1 = 110) + """)] public decimal NormalClaim { get; set; } = 1.1m; [Comment(""" - The minimum amount of currency that you have to pay - in order to buy a waifu that has a crush on you. - Default is 0.88 - Example: If a waifu is worth 100, you will have to pay at least 100 * CrushClaim currency to claim her. - (100 * 0.88 = 88) - """)] + The minimum amount of currency that you have to pay + in order to buy a waifu that has a crush on you. + Default is 0.88 + Example: If a waifu is worth 100, you will have to pay at least 100 * CrushClaim currency to claim her. + (100 * 0.88 = 88) + """)] public decimal CrushClaim { get; set; } = 0.88M; [Comment(""" - When divorcing a waifu, her new value will be her current value multiplied by this number. - Default 0.75 (meaning will lose 25% of her value) - """)] + When divorcing a waifu, her new value will be her current value multiplied by this number. + Default 0.75 (meaning will lose 25% of her value) + """)] public decimal DivorceNewValue { get; set; } = 0.75M; [Comment(""" - All gift prices will be multiplied by this number. - Default 1 (meaning no effect) - """)] + All gift prices will be multiplied by this number. + Default 1 (meaning no effect) + """)] public decimal AllGiftPrices { get; set; } = 1.0M; [Comment(""" - What percentage of the value of the gift will a waifu gain when she's gifted. - Default 0.95 (meaning 95%) - Example: If a waifu is worth 1000, and she receives a gift worth 100, her new value will be 1095) - """)] + What percentage of the value of the gift will a waifu gain when she's gifted. + Default 0.95 (meaning 95%) + Example: If a waifu is worth 1000, and she receives a gift worth 100, her new value will be 1095) + """)] public decimal GiftEffect { get; set; } = 0.95M; [Comment(""" - What percentage of the value of the gift will a waifu lose when she's gifted a gift marked as 'negative'. - Default 0.5 (meaning 50%) - Example: If a waifu is worth 1000, and she receives a negative gift worth 100, her new value will be 950) - """)] + What percentage of the value of the gift will a waifu lose when she's gifted a gift marked as 'negative'. + Default 0.5 (meaning 50%) + Example: If a waifu is worth 1000, and she receives a negative gift worth 100, her new value will be 950) + """)] public decimal NegativeGiftEffect { get; set; } = 0.50M; } @@ -427,15 +401,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..6fb8ff2 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 => @@ -179,27 +190,5 @@ public sealed class GamblingConfigService : ConfigServiceBase c.Version = 7; }); } - - if (data.Version < 8) - { - ModifyConfig(c => - { - c.Version = 8; - 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..a324437 100644 --- a/src/EllieBot/Modules/Gambling/GamblingService.cs +++ b/src/EllieBot/Modules/Gambling/GamblingService.cs @@ -2,6 +2,7 @@ using LinqToDB; using LinqToDB.EntityFrameworkCore; using EllieBot.Common.ModuleBehaviors; +using EllieBot.Db; using EllieBot.Db.Models; using EllieBot.Modules.Gambling.Common; using EllieBot.Modules.Gambling.Common.Connect4; @@ -16,7 +17,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 +30,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 +53,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 +91,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 +105,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(); @@ -137,6 +129,38 @@ public class GamblingService : IEService, IReadyExecutor private static readonly TypedKey _ecoKey = new("ellie:economy"); + public async Task GetEconomyAsync() + { + var data = await _cache.GetOrAddAsync(_ecoKey, + async () => + { + await using var uow = _db.GetDbContext(); + var cash = uow.Set().GetTotalCurrency(); + var onePercent = uow.Set().GetTopOnePercentCurrency(_client.CurrentUser.Id); + decimal planted = uow.Set().AsQueryable().Sum(x => x.Amount); + var waifus = uow.Set().GetTotalValue(); + var bot = await uow.Set().GetUserCurrencyAsync(_client.CurrentUser.Id); + decimal bank = await uow.GetTable() + .SumAsyncLinqToDB(x => x.Balance); + + var result = new EconomyResult + { + Cash = cash, + Planted = planted, + Bot = bot, + Waifus = waifus, + OnePercent = onePercent, + Bank = bank + }; + + return result; + }, + TimeSpan.FromMinutes(3)); + + return data; + } + + private static readonly SemaphoreSlim _timelyLock = new(1, 1); private static TypedKey> _timelyKey @@ -187,9 +211,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..6b50a1e 100644 --- a/src/EllieBot/Modules/Gambling/PlantPick/PlantPickService.cs +++ b/src/EllieBot/Modules/Gambling/PlantPick/PlantPickService.cs @@ -1,11 +1,9 @@ #nullable disable -using LinqToDB; -using LinqToDB.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using EllieBot.Common.ModuleBehaviors; +using EllieBot.Db; using EllieBot.Db.Models; using SixLabors.Fonts; -using SixLabors.Fonts.Unicode; using SixLabors.ImageSharp; using SixLabors.ImageSharp.Drawing.Processing; using SixLabors.ImageSharp.PixelFormats; @@ -28,21 +26,20 @@ 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); public PlantPickService( DbService db, + CommandHandler cmd, IBotStrings strings, IImageCache images, FontProvider fonts, ICurrencyService cs, CommandHandler cmdHandler, DiscordSocketClient client, - GamblingConfigService gss, - GamblingService gs) + GamblingConfigService gss) { _db = db; _strings = strings; @@ -53,8 +50,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 +89,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; } @@ -113,22 +108,19 @@ public class PlantPickService : IEService, IExecNoCommand /// Get a random currency image stream, with an optional password sticked onto it. /// /// Optional password to add to top left corner. + /// Extension of the file, defaults to png /// Stream of the currency image public async Task<(Stream, string)> GetRandomCurrencyImageAsync(string pass) { var curImg = await _images.GetCurrencyImageAsync(); - if (curImg is null) - return (new MemoryStream(), null); - if (string.IsNullOrWhiteSpace(pass)) { // determine the extension - using var load = Image.Load(curImg); + using var load = _ = Image.Load(curImg, out var format); - var format = load.Metadata.DecodedImageFormat; // return the image - return (curImg.ToStream(), format?.FileExtensions.FirstOrDefault() ?? "png"); + return (curImg.ToStream(), format.FileExtensions.FirstOrDefault() ?? "png"); } // get the image stream and extension @@ -145,49 +137,29 @@ public class PlantPickService : IEService, IExecNoCommand { // draw lower, it looks better pass = pass.TrimTo(10, true).ToLowerInvariant(); - using var img = Image.Load(curImg); + using var img = Image.Load(curImg, out var format); // 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) - { - Origin = new PointF(0, 0) - }); + var size = TextMeasurer.Measure(pass, 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 +205,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 +229,66 @@ 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( @@ -377,16 +371,15 @@ public class PlantPickService : IEService, IExecNoCommand string pass) { await using var uow = _db.GetDbContext(); - uow.Set() - .Add(new() - { - Amount = amount, - GuildId = gid, - ChannelId = cid, - Password = pass, - UserId = uid, - MessageId = mid - }); + uow.Set().Add(new() + { + Amount = amount, + GuildId = gid, + ChannelId = cid, + Password = pass, + UserId = uid, + MessageId = mid + }); await uow.SaveChangesAsync(); } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Gambling/Raffle/CurrencyRaffleCommands.cs b/src/EllieBot/Modules/Gambling/Raffle/CurrencyRaffleCommands.cs new file mode 100644 index 0000000..513aa59 --- /dev/null +++ b/src/EllieBot/Modules/Gambling/Raffle/CurrencyRaffleCommands.cs @@ -0,0 +1,61 @@ +#nullable disable +using EllieBot.Common.TypeReaders; +using EllieBot.Modules.Gambling.Common; +using EllieBot.Modules.Gambling.Services; + +namespace EllieBot.Modules.Gambling; + +public partial class Gambling +{ + public partial class CurrencyRaffleCommands : GamblingSubmodule + { + public enum Mixed { Mixed } + + public CurrencyRaffleCommands(GamblingConfigService gamblingConfService) + : base(gamblingConfService) + { + } + + [Cmd] + [RequireContext(ContextType.Guild)] + [Priority(0)] + public Task RaffleCur(Mixed _, [OverrideTypeReader(typeof(BalanceTypeReader))] long amount) + => RaffleCur(amount, true); + + [Cmd] + [RequireContext(ContextType.Guild)] + [Priority(1)] + public async Task RaffleCur([OverrideTypeReader(typeof(BalanceTypeReader))] long amount, bool mixed = false) + { + if (!await CheckBetMandatory(amount)) + return; + + async Task OnEnded(IUser arg, long won) + { + await Response() + .Confirm(GetText(strs.rafflecur_ended(CurrencyName, + Format.Bold(arg.ToString()), + won + CurrencySign))) + .SendAsync(); + } + + var res = await _service.JoinOrCreateGame(ctx.Channel.Id, ctx.User, amount, mixed, OnEnded); + + if (res.Item1 is not null) + { + await Response() + .Confirm(GetText(strs.rafflecur(res.Item1.GameType.ToString())), + string.Join("\n", res.Item1.Users.Select(x => $"{x.DiscordUser} ({N(x.Amount)})")), + footer: GetText(strs.rafflecur_joined(ctx.User.ToString()))) + .SendAsync(); + } + else + { + if (res.Item2 == CurrencyRaffleService.JoinErrorType.AlreadyJoinedOrInvalidAmount) + await Response().Error(strs.rafflecur_already_joined).SendAsync(); + else if (res.Item2 == CurrencyRaffleService.JoinErrorType.NotEnoughCurrency) + await Response().Error(strs.not_enough(CurrencySign)).SendAsync(); + } + } + } +} \ No newline at end of file diff --git a/src/EllieBot/Modules/Gambling/Raffle/CurrencyRaffleGame.cs b/src/EllieBot/Modules/Gambling/Raffle/CurrencyRaffleGame.cs new file mode 100644 index 0000000..d6f5770 --- /dev/null +++ b/src/EllieBot/Modules/Gambling/Raffle/CurrencyRaffleGame.cs @@ -0,0 +1,69 @@ +#nullable disable +namespace EllieBot.Modules.Gambling.Common; + +public class CurrencyRaffleGame +{ + public enum Type + { + Mixed, + Normal + } + + public IEnumerable Users + => _users; + + public Type GameType { get; } + + private readonly HashSet _users = new(); + + public CurrencyRaffleGame(Type type) + => GameType = type; + + public bool AddUser(IUser usr, long amount) + { + // if game type is normal, and someone already joined the game + // (that's the user who created it) + if (GameType == Type.Normal && _users.Count > 0 && _users.First().Amount != amount) + return false; + + if (!_users.Add(new() + { + DiscordUser = usr, + Amount = amount + })) + return false; + + return true; + } + + public User GetWinner() + { + var rng = new EllieRandom(); + if (GameType == Type.Mixed) + { + var num = rng.NextLong(0L, Users.Sum(x => x.Amount)); + var sum = 0L; + foreach (var u in Users) + { + sum += u.Amount; + if (sum > num) + return u; + } + } + + var usrs = _users.ToArray(); + return usrs[rng.Next(0, usrs.Length)]; + } + + public class User + { + public IUser DiscordUser { get; set; } + public long Amount { get; set; } + + public override int GetHashCode() + => DiscordUser.GetHashCode(); + + public override bool Equals(object obj) + => obj is User u ? u.DiscordUser == DiscordUser : false; + } +} \ No newline at end of file diff --git a/src/EllieBot/Modules/Gambling/Raffle/CurrencyRaffleService.cs b/src/EllieBot/Modules/Gambling/Raffle/CurrencyRaffleService.cs new file mode 100644 index 0000000..743549e --- /dev/null +++ b/src/EllieBot/Modules/Gambling/Raffle/CurrencyRaffleService.cs @@ -0,0 +1,81 @@ +#nullable disable +using EllieBot.Modules.Gambling.Common; + +namespace EllieBot.Modules.Gambling.Services; + +public class CurrencyRaffleService : IEService +{ + public enum JoinErrorType + { + NotEnoughCurrency, + AlreadyJoinedOrInvalidAmount + } + + public Dictionary Games { get; } = new(); + private readonly SemaphoreSlim _locker = new(1, 1); + private readonly ICurrencyService _cs; + + public CurrencyRaffleService(ICurrencyService cs) + => _cs = cs; + + public async Task<(CurrencyRaffleGame, JoinErrorType?)> JoinOrCreateGame( + ulong channelId, + IUser user, + long amount, + bool mixed, + Func onEnded) + { + await _locker.WaitAsync(); + try + { + var newGame = false; + if (!Games.TryGetValue(channelId, out var crg)) + { + newGame = true; + crg = new(mixed ? CurrencyRaffleGame.Type.Mixed : CurrencyRaffleGame.Type.Normal); + Games.Add(channelId, crg); + } + + //remove money, and stop the game if this + // user created it and doesn't have the money + if (!await _cs.RemoveAsync(user.Id, amount, new("raffle", "join"))) + { + if (newGame) + Games.Remove(channelId); + return (null, JoinErrorType.NotEnoughCurrency); + } + + if (!crg.AddUser(user, amount)) + { + await _cs.AddAsync(user.Id, amount, new("raffle", "refund")); + return (null, JoinErrorType.AlreadyJoinedOrInvalidAmount); + } + + if (newGame) + { + _ = Task.Run(async () => + { + await Task.Delay(60000); + await _locker.WaitAsync(); + try + { + var winner = crg.GetWinner(); + var won = crg.Users.Sum(x => x.Amount); + + await _cs.AddAsync(winner.DiscordUser.Id, won, new("raffle", "win")); + Games.Remove(channelId, out _); + _ = onEnded(winner.DiscordUser, won); + } + catch { } + finally { _locker.Release(); } + }); + } + + return (crg, null); + } + finally + { + _locker.Release(); + } + } +} \ No newline at end of file diff --git a/src/EllieBot/Modules/Gambling/Shop/ShopCommands.cs b/src/EllieBot/Modules/Gambling/Shop/ShopCommands.cs index 2c2dca6..8b5230b 100644 --- a/src/EllieBot/Modules/Gambling/Shop/ShopCommands.cs +++ b/src/EllieBot/Modules/Gambling/Shop/ShopCommands.cs @@ -1,5 +1,6 @@ #nullable disable using Microsoft.EntityFrameworkCore; +using EllieBot.Db; using EllieBot.Modules.Gambling.Common; using EllieBot.Modules.Gambling.Services; using EllieBot.Db.Models; @@ -10,7 +11,7 @@ namespace EllieBot.Modules.Gambling; public partial class Gambling { [Group] - public partial class ShopCommands : GamblingModule + public partial class ShopCommands : GamblingSubmodule { public enum List { @@ -246,14 +247,7 @@ public partial class Gambling } else { - var buyer = (IGuildUser)ctx.User; - var cmd = entry.Command - .Replace("%you%", buyer.Mention) - .Replace("%you.mention%", buyer.Mention) - .Replace("%you.username%", buyer.Username) - .Replace("%you.name%", buyer.GlobalName ?? buyer.Username) - .Replace("%you.nick%", buyer.DisplayName); - + var cmd = entry.Command.Replace("%you%", ctx.User.Id.ToString()); var eb = _sender.CreateEmbed() .WithPendingColor() .WithTitle("Executing shop command") @@ -265,7 +259,6 @@ public partial class Gambling GetProfitAmount(entry.Price), new("shop", "sell", entry.Name)); - await Task.Delay(250); await _cmdHandler.TryRunCommand(guild, channel, new DoAsUserMessage( diff --git a/src/EllieBot/Modules/Gambling/Shop/ShopService.cs b/src/EllieBot/Modules/Gambling/Shop/ShopService.cs index 9e46aa0..dfe944a 100644 --- a/src/EllieBot/Modules/Gambling/Shop/ShopService.cs +++ b/src/EllieBot/Modules/Gambling/Shop/ShopService.cs @@ -1,5 +1,6 @@ #nullable disable using Microsoft.EntityFrameworkCore; +using EllieBot.Db; using EllieBot.Db.Models; namespace EllieBot.Modules.Gambling.Services; diff --git a/src/EllieBot/Modules/Gambling/Slot/SlotCommands.cs b/src/EllieBot/Modules/Gambling/Slot/SlotCommands.cs index 239b7bc..238e97e 100644 --- a/src/EllieBot/Modules/Gambling/Slot/SlotCommands.cs +++ b/src/EllieBot/Modules/Gambling/Slot/SlotCommands.cs @@ -7,6 +7,7 @@ using SixLabors.ImageSharp; using SixLabors.ImageSharp.Drawing.Processing; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; +using EllieBot.Modules.Gambling; using EllieBot.Common.TypeReaders; using Color = SixLabors.ImageSharp.Color; using Image = SixLabors.ImageSharp.Image; @@ -21,8 +22,11 @@ public enum GamblingError public partial class Gambling { [Group] - public partial class SlotCommands : GamblingModule + public partial class SlotCommands : GamblingSubmodule { + private static decimal totalBet; + private static decimal totalPaidOut; + private readonly IImageCache _images; private readonly FontProvider _fonts; private readonly DbService _db; @@ -66,19 +70,17 @@ public partial class Gambling var eb = _sender.CreateEmbed() - .WithAuthor(ctx.User) - .WithDescription(Format.Bold(text)) - .WithImageUrl($"attachment://result.png") - .WithOkColor(); + .WithAuthor(ctx.User) + .WithDescription(Format.Bold(text)) + .WithImageUrl($"attachment://result.png") + .WithOkColor(); var bb = new ButtonBuilder(emote: Emoji.Parse("🔁"), customId: "slot:again", label: "Pull Again"); - var inter = _inter.Create(ctx.User.Id, - bb, - smc => - { - smc.DeferAsync(); - return Slot(amount); - }); + var inter = _inter.Create(ctx.User.Id, bb, smc => + { + smc.DeferAsync(); + return Slot(amount); + }); var msg = await ctx.Channel.SendFileAsync(imgStream, "result.png", @@ -158,6 +160,12 @@ public partial class Gambling { return null; } + + lock (_slotStatsLock) + { + totalBet += amount; + totalPaidOut += result.Won; + } return result; } @@ -167,19 +175,18 @@ 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; } var slotBg = await _images.GetSlotBgAsync(); - var bgImage = Image.Load(slotBg); + var bgImage = Image.Load(slotBg, out _); var numbers = new int[3]; result.Rolls.CopyTo(numbers, 0); Color fontColor = Config.Slots.CurrencyFontColor; - bgImage.Mutate(x => x.DrawText(new RichTextOptions(_fonts.DottyFont.CreateFont(65)) + bgImage.Mutate(x => x.DrawText(new TextOptions(_fonts.DottyFont.CreateFont(65)) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, @@ -191,7 +198,7 @@ public partial class Gambling var bottomFont = _fonts.DottyFont.CreateFont(50); - bgImage.Mutate(x => x.DrawText(new RichTextOptions(bottomFont) + bgImage.Mutate(x => x.DrawText(new TextOptions(bottomFont) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, @@ -205,7 +212,7 @@ public partial class Gambling { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, - Origin = new(393, 480) + Origin = new(393, 480) }, ownedAmount.ToString(), fontColor)); 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..5f7db11 100644 --- a/src/EllieBot/Modules/Gambling/Waifus/WaifuClaimCommands.cs +++ b/src/EllieBot/Modules/Gambling/Waifus/WaifuClaimCommands.cs @@ -3,14 +3,13 @@ using EllieBot.Modules.Gambling.Common; using EllieBot.Modules.Gambling.Common.Waifu; using EllieBot.Modules.Gambling.Services; using EllieBot.Db.Models; -using System.Globalization; 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) @@ -22,8 +21,8 @@ public partial class Gambling { var price = _service.GetResetPrice(ctx.User); var embed = _sender.CreateEmbed() - .WithTitle(GetText(strs.waifu_reset_confirm)) - .WithDescription(GetText(strs.waifu_reset_price(Format.Bold(N(price))))); + .WithTitle(GetText(strs.waifu_reset_confirm)) + .WithDescription(GetText(strs.waifu_reset_price(Format.Bold(N(price))))); if (!await PromptUserConfirmAsync(embed)) return; @@ -37,45 +36,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) @@ -109,11 +69,7 @@ public partial class Gambling return; } - var msg = GetText(strs.waifu_claimed( - Format.Bold(ctx.User.ToString()), - Format.Bold(target.ToString()), - N(amount))); - + var msg = GetText(strs.waifu_claimed(Format.Bold(target.ToString()), N(amount))); if (w.Affinity?.UserId == ctx.User.Id) msg += "\n" + GetText(strs.waifu_fulfilled(target, N(w.Price))); else @@ -183,7 +139,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 +152,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 + { + await Response() + .Error(strs.waifu_recent_divorce( + Format.Bold(((int)remaining?.TotalHours).ToString()), + Format.Bold(remaining?.Minutes.ToString()))) + .SendAsync(); + } } [Cmd] @@ -226,21 +190,13 @@ public partial class Gambling } if (user is null) - { await Response().Confirm(strs.waifu_affinity_reset).SendAsync(); - } else if (oldAff is null) - { - await Response() - .Confirm(strs.waifu_affinity_set(Format.Bold(ctx.User.ToString()), Format.Bold(user.ToString()))) - .SendAsync(); - } + await Response().Confirm(strs.waifu_affinity_set(Format.Bold(user.ToString()))).SendAsync(); else { await Response() - .Confirm(strs.waifu_affinity_changed( - Format.Bold(ctx.User.ToString()), - Format.Bold(oldAff.ToString()), + .Confirm(strs.waifu_affinity_changed(Format.Bold(oldAff.ToString()), Format.Bold(user.ToString()))) .SendAsync(); } @@ -258,7 +214,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) { @@ -281,20 +237,20 @@ public partial class Gambling private string GetLbString(WaifuLbResult w) { var claimer = "no one"; - string status; + var status = string.Empty; - 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] @@ -351,26 +307,24 @@ public partial class Gambling fansStr = "-"; var embed = _sender.CreateEmbed() - .WithOkColor() - .WithTitle(GetText(strs.waifu) - + " " - + (wi.FullName ?? name ?? targetId.ToString()) - + " - \"the " - + _service.GetClaimTitle(wi.ClaimCount) - + "\"") - .AddField(GetText(strs.price), N(wi.Price), true) - .AddField(GetText(strs.claimed_by), wi.ClaimerName ?? nobody, true) - .AddField(GetText(strs.likes), wi.AffinityName ?? nobody, true) - .AddField(GetText(strs.changes_of_heart), - $"{wi.AffinityCount} - \"the {affInfo}\"", - true) - .AddField(GetText(strs.divorces), wi.DivorceCount.ToString(), true) - .AddField("\u200B", "\u200B", true) - .AddField(GetText(strs.fans(fansList.Count)), fansStr, true) - .AddField($"Waifus ({wi.ClaimCount})", - wi.ClaimCount == 0 ? nobody : claimsStr, - true) - .AddField(GetText(strs.gifts), itemsStr, true); + .WithOkColor() + .WithTitle(GetText(strs.waifu) + + " " + + (wi.FullName ?? name ?? targetId.ToString()) + + " - \"the " + + _service.GetClaimTitle(wi.ClaimCount) + + "\"") + .AddField(GetText(strs.price), N(wi.Price), true) + .AddField(GetText(strs.claimed_by), wi.ClaimerName ?? nobody, true) + .AddField(GetText(strs.likes), wi.AffinityName ?? nobody, true) + .AddField(GetText(strs.changes_of_heart), $"{wi.AffinityCount} - \"the {affInfo}\"", true) + .AddField(GetText(strs.divorces), wi.DivorceCount.ToString(), true) + .AddField("\u200B", "\u200B", true) + .AddField(GetText(strs.fans(fansList.Count)), fansStr, true) + .AddField($"Waifus ({wi.ClaimCount})", + wi.ClaimCount == 0 ? nobody : claimsStr, + true) + .AddField(GetText(strs.gifts), itemsStr, true); await Response().Embed(embed).SendAsync(); } @@ -394,7 +348,7 @@ public partial class Gambling .Page((items, _) => { var embed = _sender.CreateEmbed().WithTitle(GetText(strs.waifu_gift_shop)).WithOkColor(); - + items .ToList() .ForEach(x => embed.AddField( @@ -410,28 +364,30 @@ public partial class Gambling [Cmd] [RequireContext(ContextType.Guild)] [Priority(0)] - public async Task WaifuGift(MultipleWaifuItems items, [Leftover] IUser waifu) + public async Task WaifuGift(string itemName, [Leftover] IUser waifu) { if (waifu.Id == ctx.User.Id) return; - var sucess = await _service.GiftWaifuAsync(ctx.User, waifu, items.Item, items.Count); + var allItems = _service.GetWaifuItems(); + var item = allItems.FirstOrDefault(x => x.Name.ToLowerInvariant() == itemName.ToLowerInvariant()); + if (item is null) + { + await Response().Error(strs.waifu_gift_not_exist).SendAsync(); + return; + } + + var sucess = await _service.GiftWaifuAsync(ctx.User, waifu, item); if (sucess) { await Response() - .Confirm(strs.waifu_gift( - Format.Bold($"{GetCountString(items)}{items.Item} {items.Item.ItemEmoji}"), + .Confirm(strs.waifu_gift(Format.Bold(item + " " + item.ItemEmoji), Format.Bold(waifu.ToString()))) .SendAsync(); } else await Response().Error(strs.not_enough(CurrencySign)).SendAsync(); } - - private static string GetCountString(MultipleWaifuItems items) - => items.Count > 1 - ? $"{items.Count}x " - : string.Empty; } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Gambling/Waifus/WaifuService.cs b/src/EllieBot/Modules/Gambling/Waifus/WaifuService.cs index e929ce9..dded8a9 100644 --- a/src/EllieBot/Modules/Gambling/Waifus/WaifuService.cs +++ b/src/EllieBot/Modules/Gambling/Waifus/WaifuService.cs @@ -3,6 +3,7 @@ using LinqToDB; using LinqToDB.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using EllieBot.Common.ModuleBehaviors; +using EllieBot.Db; using EllieBot.Db.Models; using EllieBot.Modules.Gambling.Common; using EllieBot.Modules.Gambling.Common.Waifu; @@ -15,7 +16,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 +24,7 @@ public class WaifuService : IEService, IReadyExecutor ICurrencyService cs, IBotCache cache, GamblingConfigService gss, - IBotCreds creds, + IBotCredentials creds, DiscordSocketClient client) { _db = db; @@ -88,14 +89,9 @@ public class WaifuService : IEService, IReadyExecutor if (waifu is null) return settings.Waifu.MinPrice; - var divorces = uow.Set() - .Count(x - => x.Old != null - && x.Old.UserId == user.Id - && x.UpdateType == WaifuUpdateType.Claimed - && x.New == null); - var affs = uow.Set() - .AsQueryable() + var divorces = uow.Set().Count(x + => x.Old != null && x.Old.UserId == user.Id && x.UpdateType == WaifuUpdateType.Claimed && x.New == null); + var affs = uow.Set().AsQueryable() .Where(w => w.User.UserId == user.Id && w.UpdateType == WaifuUpdateType.AffinityChanged && w.New != null) @@ -114,14 +110,12 @@ public class WaifuService : IEService, IReadyExecutor if (!await _cs.RemoveAsync(user.Id, price, new("waifu", "reset"))) return false; - var affs = uow.Set() - .AsQueryable() + var affs = uow.Set().AsQueryable() .Where(w => w.User.UserId == user.Id && w.UpdateType == WaifuUpdateType.AffinityChanged && w.New != null); - var divorces = uow.Set() - .AsQueryable() + var divorces = uow.Set().AsQueryable() .Where(x => x.Old != null && x.Old.UserId == user.Id && x.UpdateType == WaifuUpdateType.Claimed @@ -164,22 +158,20 @@ public class WaifuService : IEService, IReadyExecutor result = WaifuClaimResult.NotEnoughFunds; else { - uow.Set() - .Add(w = new() - { - Waifu = waifu, - Claimer = claimer, - Affinity = null, - Price = amount - }); - uow.Set() - .Add(new() - { - User = waifu, - Old = null, - New = claimer, - UpdateType = WaifuUpdateType.Claimed - }); + uow.Set().Add(w = new() + { + Waifu = waifu, + Claimer = claimer, + Affinity = null, + Price = amount + }); + uow.Set().Add(new() + { + User = waifu, + Old = null, + New = claimer, + UpdateType = WaifuUpdateType.Claimed + }); result = WaifuClaimResult.Success; } } @@ -194,14 +186,13 @@ public class WaifuService : IEService, IReadyExecutor w.Price = amount + (amount / 4); result = WaifuClaimResult.Success; - uow.Set() - .Add(new() - { - User = w.Waifu, - Old = oldClaimer, - New = w.Claimer, - UpdateType = WaifuUpdateType.Claimed - }); + uow.Set().Add(new() + { + User = w.Waifu, + Old = oldClaimer, + New = w.Claimer, + UpdateType = WaifuUpdateType.Claimed + }); } } else if (amount >= w.Price * settings.Waifu.Multipliers.NormalClaim) // if no affinity @@ -215,14 +206,13 @@ public class WaifuService : IEService, IReadyExecutor w.Price = amount; result = WaifuClaimResult.Success; - uow.Set() - .Add(new() - { - User = w.Waifu, - Old = oldClaimer, - New = w.Claimer, - UpdateType = WaifuUpdateType.Claimed - }); + uow.Set().Add(new() + { + User = w.Waifu, + Old = oldClaimer, + New = w.Claimer, + UpdateType = WaifuUpdateType.Claimed + }); } } else @@ -251,31 +241,29 @@ public class WaifuService : IEService, IReadyExecutor remaining = await _cache.GetRatelimitAsync(GetAffinityKey(user.Id), 30.Minutes()); - + if (remaining is not null) { } else if (w is null) { var thisUser = uow.GetOrCreateUser(user); - uow.Set() - .Add(new() - { - Affinity = newAff, - Waifu = thisUser, - Price = 1, - Claimer = null - }); + uow.Set().Add(new() + { + Affinity = newAff, + Waifu = thisUser, + Price = 1, + Claimer = null + }); success = true; - uow.Set() - .Add(new() - { - User = thisUser, - Old = null, - New = newAff, - UpdateType = WaifuUpdateType.AffinityChanged - }); + uow.Set().Add(new() + { + User = thisUser, + Old = null, + New = newAff, + UpdateType = WaifuUpdateType.AffinityChanged + }); } else { @@ -284,14 +272,13 @@ public class WaifuService : IEService, IReadyExecutor w.Affinity = newAff; success = true; - uow.Set() - .Add(new() - { - User = w.Waifu, - Old = oldAff, - New = newAff, - UpdateType = WaifuUpdateType.AffinityChanged - }); + uow.Set().Add(new() + { + User = w.Waifu, + Old = oldAff, + New = newAff, + UpdateType = WaifuUpdateType.AffinityChanged + }); } await uow.SaveChangesAsync(); @@ -300,10 +287,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) @@ -314,24 +301,29 @@ public class WaifuService : IEService, IReadyExecutor private static TypedKey GetDivorceKey(ulong userId) => new($"waifu:divorce_cd:{userId}"); - + 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; @@ -351,70 +343,55 @@ public class WaifuService : IEService, IReadyExecutor var oldClaimer = w.Claimer; w.Claimer = null; - uow.Set() - .Add(new() - { - User = w.Waifu, - Old = oldClaimer, - New = null, - UpdateType = WaifuUpdateType.Claimed - }); + uow.Set().Add(new() + { + User = w.Waifu, + Old = oldClaimer, + New = null, + UpdateType = WaifuUpdateType.Claimed + }); } await uow.SaveChangesAsync(); } - return (w, result, amount); + return (w, result, amount, remaining); } - public async Task GiftWaifuAsync( - IUser from, - IUser giftedWaifu, - WaifuItemModel itemObj, - int count) + public async Task GiftWaifuAsync(IUser from, IUser giftedWaifu, WaifuItemModel itemObj) { - ArgumentOutOfRangeException.ThrowIfLessThan(count, 1, nameof(count)); - - if (!await _cs.RemoveAsync(from, itemObj.Price * count, new("waifu", "item"))) + if (!await _cs.RemoveAsync(from, itemObj.Price, new("waifu", "item"))) return false; - var totalValue = itemObj.Price * count; - await using var uow = _db.GetDbContext(); - var w = uow.Set() - .ByWaifuUserId(giftedWaifu.Id, - set => set - .Include(x => x.Items) - .Include(x => x.Claimer)); + var w = uow.Set().ByWaifuUserId(giftedWaifu.Id, set => set.Include(x => x.Items).Include(x => x.Claimer)); if (w is null) { - uow.Set() - .Add(w = new() - { - Affinity = null, - Claimer = null, - Price = 1, - Waifu = uow.GetOrCreateUser(giftedWaifu) - }); + uow.Set().Add(w = new() + { + Affinity = null, + Claimer = null, + Price = 1, + Waifu = uow.GetOrCreateUser(giftedWaifu) + }); } if (!itemObj.Negative) { - w.Items.AddRange(Enumerable.Range(0, count) - .Select((_) => new WaifuItem() - { - Name = itemObj.Name.ToLowerInvariant(), - ItemEmoji = itemObj.ItemEmoji - })); + w.Items.Add(new() + { + Name = itemObj.Name.ToLowerInvariant(), + ItemEmoji = itemObj.ItemEmoji + }); if (w.Claimer?.UserId == from.Id) - w.Price += (long)(totalValue * _gss.Data.Waifu.Multipliers.GiftEffect); + w.Price += (long)(itemObj.Price * _gss.Data.Waifu.Multipliers.GiftEffect); else - w.Price += totalValue / 2; + w.Price += itemObj.Price / 2; } else { - w.Price -= (long)(totalValue * _gss.Data.Waifu.Multipliers.NegativeGiftEffect); + w.Price -= (long)(itemObj.Price * _gss.Data.Waifu.Multipliers.NegativeGiftEffect); if (w.Price < 1) w.Price = 1; } @@ -515,7 +492,6 @@ public class WaifuService : IEService, IReadyExecutor } private static readonly TypedKey _waifuDecayKey = $"waifu:last_decay"; - public async Task OnReadyAsync() { // only decay waifu values from shard 0 @@ -526,25 +502,18 @@ public class WaifuService : IEService, IReadyExecutor { try { - var decay = _gss.Data.Waifu.Decay; + var multi = _gss.Data.Waifu.Decay.Percent / 100f; + var minPrice = _gss.Data.Waifu.Decay.MinPrice; + var decayInterval = _gss.Data.Waifu.Decay.HourInterval; - var unclaimedMulti = 1 - (decay.UnclaimedDecayPercent / 100f); - var claimedMulti = 1 - (decay.ClaimedDecayPercent / 100f); - - var minPrice = decay.MinPrice; - var decayInterval = decay.HourInterval; - - if (decayInterval <= 0) - continue; - - if ((unclaimedMulti < 0 || unclaimedMulti > 1) && (claimedMulti < 0 || claimedMulti > 1)) + if (multi is < 0f or > 1f || decayInterval < 0) continue; var now = DateTime.UtcNow; var nowB = now.ToBinary(); var result = await _cache.GetAsync(_waifuDecayKey); - + if (result.TryGetValue(out var val)) { var lastDecay = DateTime.FromBinary(val); @@ -556,28 +525,15 @@ public class WaifuService : IEService, IReadyExecutor await _cache.AddAsync(_waifuDecayKey, nowB); - if (unclaimedMulti is > 0 and <= 1) - { - await using var uow = _db.GetDbContext(); + await using var uow = _db.GetDbContext(); - await uow.GetTable() - .Where(x => x.Price > minPrice && x.ClaimerId == null) - .UpdateAsync(old => new() - { - Price = (long)(old.Price * unclaimedMulti) - }); - } + await uow.GetTable() + .Where(x => x.Price > minPrice && x.ClaimerId == null) + .UpdateAsync(old => new() + { + Price = (long)(old.Price * multi) + }); - if (claimedMulti is > 0 and <= 1) - { - await using var uow = _db.GetDbContext(); - await uow.GetTable() - .Where(x => x.Price > minPrice && x.ClaimerId != null) - .UpdateAsync(old => new() - { - Price = (long)(old.Price * claimedMulti) - }); - } } catch (Exception ex) { @@ -594,69 +550,33 @@ public class WaifuService : IEService, IReadyExecutor { await using var ctx = _db.GetDbContext(); return await ctx.GetTable() - .Where(x => ctx.GetTable() - .Where(wi => wi.ClaimerId == waifuId) - .Select(wi => wi.WaifuId) - .Contains(x.Id)) - .Select(x => x.Username) - .ToListAsyncEF(); + .Where(x => ctx.GetTable() + .Where(wi => wi.ClaimerId == waifuId) + .Select(wi => wi.WaifuId) + .Contains(x.Id)) + .Select(x => $"{x.Username}#{x.Discriminator}") + .ToListAsyncEF(); } - public async Task> GetFansNames(int waifuId) { await using var ctx = _db.GetDbContext(); return await ctx.GetTable() - .Where(x => ctx.GetTable() - .Where(wi => wi.AffinityId == waifuId) - .Select(wi => wi.WaifuId) - .Contains(x.Id)) - .Select(x => x.Username) - .ToListAsyncEF(); + .Where(x => ctx.GetTable() + .Where(wi => wi.AffinityId == waifuId) + .Select(wi => wi.WaifuId) + .Contains(x.Id)) + .Select(x => $"{x.Username}#{x.Discriminator}") + .ToListAsyncEF(); } public async Task> GetItems(int waifuId) { await using var ctx = _db.GetDbContext(); return await ctx.GetTable() - .Where(x => x.WaifuInfoId - == ctx.GetTable() - .Where(x => x.WaifuId == waifuId) - .Select(x => x.Id) - .FirstOrDefault()) - .ToListAsyncEF(); + .Where(x => x.WaifuInfoId == ctx.GetTable() + .Where(x => x.WaifuId == waifuId) + .Select(x => x.Id) + .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/MultipleWaifuItems.cs b/src/EllieBot/Modules/Gambling/Waifus/_common/MultipleWaifuItems.cs deleted file mode 100644 index 63b5742..0000000 --- a/src/EllieBot/Modules/Gambling/Waifus/_common/MultipleWaifuItems.cs +++ /dev/null @@ -1,6 +0,0 @@ -#nullable disable -using EllieBot.Modules.Gambling.Common; - -namespace EllieBot.Modules.Gambling; - -public record class MultipleWaifuItems(int Count, WaifuItemModel Item); \ 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 deleted file mode 100644 index 21b4c60..0000000 --- a/src/EllieBot/Modules/Gambling/Waifus/_common/MultipleWaifuItemsTypeReader.cs +++ /dev/null @@ -1,47 +0,0 @@ -#nullable disable -using EllieBot.Common.TypeReaders; -using EllieBot.Modules.Gambling.Services; -using System.Text.RegularExpressions; - -namespace EllieBot.Modules.Gambling; - -public partial class MultipleWaifuItemsTypeReader : EllieTypeReader -{ - private readonly WaifuService _service; - - [GeneratedRegex(@"(?:(?\d+)[x*])?(?.+)")] - private static partial Regex ItemRegex(); - - public MultipleWaifuItemsTypeReader(WaifuService service) - { - _service = service; - } - public override ValueTask> ReadAsync(ICommandContext ctx, string input) - { - input = input.ToLowerInvariant(); - var match = ItemRegex().Match(input); - if (!match.Success) - { - return new(Discord.Commands.TypeReaderResult.FromError(CommandError.ParseFailed, "Invalid input.")); - } - - var count = 1; - if (match.Groups["count"].Success) - { - if (!int.TryParse(match.Groups["count"].Value, out count) || count < 1) - { - return new(Discord.Commands.TypeReaderResult.FromError(CommandError.ParseFailed, "Invalid count.")); - } - } - - var itemName = match.Groups["item"].Value?.ToLowerInvariant(); - var allItems = _service.GetWaifuItems(); - var item = allItems.FirstOrDefault(x => x.Name.ToLowerInvariant() == itemName); - if (item is null) - { - return new(Discord.Commands.TypeReaderResult.FromError(CommandError.ParseFailed, "Waifu gift does not exist.")); - } - - return new(Discord.Commands.TypeReaderResult.FromSuccess(new MultipleWaifuItems(count, item))); - } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Gambling/Waifus/db/Waifu.cs b/src/EllieBot/Modules/Gambling/Waifus/db/Waifu.cs index 559f8ba..fa7c5d5 100644 --- a/src/EllieBot/Modules/Gambling/Waifus/db/Waifu.cs +++ b/src/EllieBot/Modules/Gambling/Waifus/db/Waifu.cs @@ -5,7 +5,7 @@ public class WaifuInfo : DbEntity { public int WaifuId { get; set; } public DiscordUser Waifu { get; set; } - + public int? ClaimerId { get; set; } public DiscordUser Claimer { get; set; } diff --git a/src/EllieBot/Modules/Gambling/Waifus/db/WaifuExtensions.cs b/src/EllieBot/Modules/Gambling/Waifus/db/WaifuExtensions.cs index bfde7e9..45f3055 100644 --- a/src/EllieBot/Modules/Gambling/Waifus/db/WaifuExtensions.cs +++ b/src/EllieBot/Modules/Gambling/Waifus/db/WaifuExtensions.cs @@ -25,32 +25,30 @@ public static class WaifuExtensions return includes(waifus).AsQueryable().FirstOrDefault(wi => 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,31 +57,28 @@ 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() - { - AffinityId = null, - ClaimerId = null, - Price = 1, - WaifuId = ctx.Set().Where(x => x.UserId == userId).Select(x => x.Id).First() - }, + { + AffinityId = null, + ClaimerId = null, + Price = 1, + WaifuId = ctx.Set().Where(x => x.UserId == userId).Select(x => x.Id).First() + }, _ => new(), () => new() { WaifuId = ctx.Set().Where(x => x.UserId == userId).Select(x => x.Id).First() }); - var toReturn = ctx.Set() - .AsQueryable() + var toReturn = ctx.Set().AsQueryable() .Where(w => w.WaifuId == ctx.Set() .AsQueryable() @@ -97,7 +92,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 +104,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..89125c8 100644 --- a/src/EllieBot/Modules/Gambling/Waifus/db/WaifuItem.cs +++ b/src/EllieBot/Modules/Gambling/Waifus/db/WaifuItem.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable namespace EllieBot.Db.Models; public class WaifuItem : DbEntity @@ -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/Waifus/db/WaifuUpdate.cs b/src/EllieBot/Modules/Gambling/Waifus/db/WaifuUpdate.cs index 64608c2..736bd0d 100644 --- a/src/EllieBot/Modules/Gambling/Waifus/db/WaifuUpdate.cs +++ b/src/EllieBot/Modules/Gambling/Waifus/db/WaifuUpdate.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable namespace EllieBot.Db.Models; public class WaifuUpdate : DbEntity diff --git a/src/EllieBot/Modules/Gambling/_common/IGamblingService.cs b/src/EllieBot/Modules/Gambling/_common/IGamblingService.cs index 087950a..4ed31c9 100644 --- a/src/EllieBot/Modules/Gambling/_common/IGamblingService.cs +++ b/src/EllieBot/Modules/Gambling/_common/IGamblingService.cs @@ -1,4 +1,5 @@ #nullable disable +using EllieBot.Modules.Gambling; using EllieBot.Modules.Gambling.Betdraw; using EllieBot.Modules.Gambling.Rps; using OneOf; @@ -13,10 +14,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..2412503 100644 --- a/src/EllieBot/Modules/Gambling/_common/NewGamblingService.cs +++ b/src/EllieBot/Modules/Gambling/_common/NewGamblingService.cs @@ -1,6 +1,5 @@ #nullable disable -using LinqToDB; -using LinqToDB.EntityFrameworkCore; +using EllieBot.Modules.Gambling; using EllieBot.Modules.Gambling.Betdraw; using EllieBot.Modules.Gambling.Rps; using EllieBot.Modules.Gambling.Services; @@ -10,15 +9,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 +32,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 +58,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 +89,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 +110,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 +126,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 +156,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 +179,7 @@ public sealed class NewGamblingService : IGamblingService, IEService return Task.FromResult(results); } - + // // // private readonly ConcurrentDictionary _decks = new ConcurrentDictionary(); @@ -242,7 +237,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 +250,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 +266,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/Gambling/_common/TypeReaders/BaseShmartInputAmountReader.cs b/src/EllieBot/Modules/Gambling/_common/TypeReaders/BaseShmartInputAmountReader.cs index 6773b78..42c6f09 100644 --- a/src/EllieBot/Modules/Gambling/_common/TypeReaders/BaseShmartInputAmountReader.cs +++ b/src/EllieBot/Modules/Gambling/_common/TypeReaders/BaseShmartInputAmountReader.cs @@ -1,4 +1,5 @@ using System.Text.RegularExpressions; +using EllieBot.Db; using EllieBot.Db.Models; using EllieBot.Modules.Gambling.Services; using NCalc; diff --git a/src/EllieBot/Modules/Games/ChatterBot/ChatterBotCommands.cs b/src/EllieBot/Modules/Games/ChatterBot/ChatterBotCommands.cs deleted file mode 100644 index 194cf79..0000000 --- a/src/EllieBot/Modules/Games/ChatterBot/ChatterBotCommands.cs +++ /dev/null @@ -1,35 +0,0 @@ -#nullable disable -using EllieBot.Modules.Games.Services; - -namespace EllieBot.Modules.Games; - -public partial class Games -{ - [Group] - public partial class ChatterBotCommands : EllieModule - { - private readonly DbService _db; - - public ChatterBotCommands(DbService db) - => _db = db; - - [Cmd] - [RequireContext(ContextType.Guild)] - [UserPerm(GuildPerm.ManageMessages)] - public async Task CleverBot() - { - var channel = (ITextChannel)ctx.Channel; - - var newState = await _service.ToggleChatterBotAsync(ctx.Guild.Id); - - if (!newState) - { - await Response().Confirm(strs.chatbot_disabled).SendAsync(); - return; - } - - 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 deleted file mode 100644 index 0d2c841..0000000 --- a/src/EllieBot/Modules/Games/ChatterBot/ChatterBotService.cs +++ /dev/null @@ -1,239 +0,0 @@ -#nullable disable -using LinqToDB; -using LinqToDB.EntityFrameworkCore; -using EllieBot.Common.ModuleBehaviors; -using EllieBot.Db.Models; -using EllieBot.Modules.Games.Common; -using EllieBot.Modules.Games.Common.ChatterBot; -using EllieBot.Modules.Patronage; -using EllieBot.Modules.Permissions; - -namespace EllieBot.Modules.Games.Services; - -public class ChatterBotService : IExecOnMessage -{ - private ConcurrentDictionary> ChatterBotGuilds { get; } - - public int Priority - => 1; - - private readonly DiscordSocketClient _client; - private readonly IPermissionChecker _perms; - private readonly IBotCreds _creds; - private readonly IHttpClientFactory _httpFactory; - private readonly GamesConfigService _gcs; - private readonly IMessageSenderService _sender; - private readonly DbService _db; - public readonly IPatronageService _ps; - - public ChatterBotService( - DiscordSocketClient client, - IPermissionChecker perms, - IBot bot, - IPatronageService ps, - IHttpClientFactory factory, - IBotCreds creds, - GamesConfigService gcs, - IMessageSenderService sender, - DbService db) - { - _client = client; - _perms = perms; - _creds = creds; - _sender = sender; - _db = db; - _httpFactory = factory; - _perms = perms; - _gcs = gcs; - _ps = ps; - - ChatterBotGuilds = new(bot.AllGuildConfigs - .Where(gc => gc.CleverbotEnabled) - .ToDictionary(gc => gc.GuildId, - _ => new Lazy(() => CreateSession(), true))); - } - - public IChatterBotSession CreateSession() - { - switch (_gcs.Data.ChatBot) - { - case ChatBotImplementation.Cleverbot: - if (!string.IsNullOrWhiteSpace(_creds.CleverbotApiKey)) - return new OfficialCleverbotSession(_creds.CleverbotApiKey, _httpFactory); - - Log.Information("Cleverbot will not work as the api key is missing"); - return null; - case ChatBotImplementation.OpenAi: - var data = _gcs.Data; - if (!string.IsNullOrWhiteSpace(_creds.Gpt3ApiKey)) - return new OpenAiApiSession( - data.ChatGpt.ApiUrl, - _creds.Gpt3ApiKey, - data.ChatGpt.ModelName, - data.ChatGpt.ChatHistory, - data.ChatGpt.MaxTokens, - data.ChatGpt.MinTokens, - data.ChatGpt.PersonalityPrompt, - _client.CurrentUser.Username, - _httpFactory); - - Log.Information("Openai Api will likely not work as the api key is missing"); - return null; - default: - return null; - } - } - - public IChatterBotSession GetOrCreateSession(ulong guildId) - { - if (ChatterBotGuilds.TryGetValue(guildId, out var lazyChatBot)) - return lazyChatBot.Value; - - lazyChatBot = new(() => CreateSession(), true); - ChatterBotGuilds.TryAdd(guildId, lazyChatBot); - return lazyChatBot.Value; - } - - public string PrepareMessage(IUserMessage msg) - { - var ellieId = _client.CurrentUser.Id; - var normalMention = $"<@{ellieId}> "; - var nickMention = $"<@!{ellieId}> "; - string message; - if (msg.Content.StartsWith(normalMention, StringComparison.InvariantCulture)) - message = msg.Content[normalMention.Length..].Trim(); - else if (msg.Content.StartsWith(nickMention, StringComparison.InvariantCulture)) - message = msg.Content[nickMention.Length..].Trim(); - else if (msg.ReferencedMessage?.Author.Id == ellieId) - message = msg.Content; - else - return null; - - return message; - } - - public async Task ExecOnMessageAsync(IGuild guild, IUserMessage usrMsg) - { - if (guild is not SocketGuild sg) - return false; - - var channel = usrMsg.Channel as ITextChannel; - if (channel is null) - return false; - - if (!ChatterBotGuilds.TryGetValue(channel.Guild.Id, out var lazyChatBot)) - return false; - - var chatBot = lazyChatBot.Value; - var message = PrepareMessage(usrMsg); - if (message is null) - return false; - - return await RunChatterBot(sg, usrMsg, channel, chatBot, message); - } - - public async Task RunChatterBot( - SocketGuild guild, - IUserMessage usrMsg, - ITextChannel channel, - IChatterBotSession chatBot, - string message) - { - try - { - var res = await _perms.CheckPermsAsync(guild, - usrMsg.Channel, - usrMsg.Author, - CleverBotResponseStr.CLEVERBOT_RESPONSE, - CleverBotResponseStr.CLEVERBOT_RESPONSE); - - if (!res.IsAllowed) - return false; - - if (!await _ps.LimitHitAsync(LimitedFeatureName.ChatBot, usrMsg.Author.Id, 2048 / 2)) - { - // limit exceeded - return false; - } - - _ = channel.TriggerTypingAsync(); - var response = await chatBot.Think(message, usrMsg.Author.ToString()); - - if (response.TryPickT0(out var result, out var error)) - { - // calculate the diff in case we overestimated user's usage - var inTokens = (result.TokensIn - 2048) / 2; - - // add the output tokens to the limit - await _ps.LimitForceHit(LimitedFeatureName.ChatBot, - usrMsg.Author.Id, - (inTokens) + (result.TokensOut / 2 * 3)); - - await _sender.Response(channel) - .Confirm(result.Text) - .SendAsync(); - } - else - { - Log.Warning("Error in chatterbot: {Error}", error.Value); - } - - Log.Information(""" - CleverBot Executed - Server: {GuildName} [{GuildId}] - Channel: {ChannelName} [{ChannelId}] - UserId: {Author} [{AuthorId}] - Message: {Content} - """, - guild.Name, - guild.Id, - usrMsg.Channel?.Name, - usrMsg.Channel?.Id, - usrMsg.Author, - usrMsg.Author.Id, - usrMsg.Content); - - return true; - } - catch (Exception ex) - { - Log.Warning(ex, "Error in cleverbot"); - } - - return false; - } - - public async Task ToggleChatterBotAsync(ulong guildId) - { - if (ChatterBotGuilds.TryRemove(guildId, out _)) - { - await using var uow = _db.GetDbContext(); - await uow.Set() - .ToLinqToDBTable() - .Where(x => x.GuildId == guildId) - .UpdateAsync((gc) => new GuildConfig() - { - CleverbotEnabled = false - }); - await uow.SaveChangesAsync(); - return false; - } - - ChatterBotGuilds.TryAdd(guildId, new(() => CreateSession(), true)); - - await using (var uow = _db.GetDbContext()) - { - await uow.Set() - .ToLinqToDBTable() - .Where(x => x.GuildId == guildId) - .UpdateAsync((gc) => new GuildConfig() - { - CleverbotEnabled = true - }); - - await uow.SaveChangesAsync(); - } - - return true; - } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Games/ChatterBot/ChatterbotService.cs b/src/EllieBot/Modules/Games/ChatterBot/ChatterbotService.cs new file mode 100644 index 0000000..30dc17e --- /dev/null +++ b/src/EllieBot/Modules/Games/ChatterBot/ChatterbotService.cs @@ -0,0 +1,215 @@ +#nullable disable +using EllieBot.Common.ModuleBehaviors; +using EllieBot.Db.Models; +using EllieBot.Modules.Games.Common; +using EllieBot.Modules.Games.Common.ChatterBot; +using EllieBot.Modules.Patronage; +using EllieBot.Modules.Permissions; + +namespace EllieBot.Modules.Games.Services; + +public class ChatterBotService : IExecOnMessage +{ + public ConcurrentDictionary> ChatterBotGuilds { get; } + + public int Priority + => 1; + + private readonly FeatureLimitKey _flKey; + + private readonly DiscordSocketClient _client; + private readonly IPermissionChecker _perms; + private readonly CommandHandler _cmd; + private readonly IBotCredentials _creds; + private readonly IHttpClientFactory _httpFactory; + private readonly IPatronageService _ps; + private readonly GamesConfigService _gcs; + private readonly IMessageSenderService _sender; + + public ChatterBotService( + DiscordSocketClient client, + IPermissionChecker perms, + IBot bot, + CommandHandler cmd, + IHttpClientFactory factory, + IBotCredentials creds, + IPatronageService ps, + GamesConfigService gcs, + IMessageSenderService sender) + { + _client = client; + _perms = perms; + _cmd = cmd; + _creds = creds; + _sender = sender; + _httpFactory = factory; + _ps = ps; + _perms = perms; + _gcs = gcs; + + _flKey = new FeatureLimitKey() + { + Key = CleverBotResponseStr.CLEVERBOT_RESPONSE, + PrettyName = "Cleverbot Replies" + }; + + ChatterBotGuilds = new(bot.AllGuildConfigs + .Where(gc => gc.CleverbotEnabled) + .ToDictionary(gc => gc.GuildId, + _ => new Lazy(() => CreateSession(), true))); + } + + public IChatterBotSession CreateSession() + { + switch (_gcs.Data.ChatBot) + { + case ChatBotImplementation.Cleverbot: + if (!string.IsNullOrWhiteSpace(_creds.CleverbotApiKey)) + return new OfficialCleverbotSession(_creds.CleverbotApiKey, _httpFactory); + + Log.Information("Cleverbot will not work as the api key is missing"); + return null; + case ChatBotImplementation.Gpt3: + if (!string.IsNullOrWhiteSpace(_creds.Gpt3ApiKey)) + return new OfficialGpt3Session(_creds.Gpt3ApiKey, + _gcs.Data.ChatGpt.ModelName, + _gcs.Data.ChatGpt.ChatHistory, + _gcs.Data.ChatGpt.MaxTokens, + _gcs.Data.ChatGpt.MinTokens, + _gcs.Data.ChatGpt.PersonalityPrompt, + _client.CurrentUser.Username, + _httpFactory); + + Log.Information("Gpt3 will not work as the api key is missing"); + return null; + default: + return null; + } + } + + public string PrepareMessage(IUserMessage msg, out IChatterBotSession cleverbot) + { + var channel = msg.Channel as ITextChannel; + cleverbot = null; + + if (channel is null) + return null; + + if (!ChatterBotGuilds.TryGetValue(channel.Guild.Id, out var lazyCleverbot)) + return null; + + cleverbot = lazyCleverbot.Value; + + var ellieId = _client.CurrentUser.Id; + var normalMention = $"<@{ellieId}> "; + var nickMention = $"<@!{ellieId}> "; + string message; + if (msg.Content.StartsWith(normalMention, StringComparison.InvariantCulture)) + message = msg.Content[normalMention.Length..].Trim(); + else if (msg.Content.StartsWith(nickMention, StringComparison.InvariantCulture)) + message = msg.Content[nickMention.Length..].Trim(); + else + return null; + + return message; + } + + public async Task ExecOnMessageAsync(IGuild guild, IUserMessage usrMsg) + { + if (guild is not SocketGuild sg) + return false; + + try + { + var message = PrepareMessage(usrMsg, out var cbs); + if (message is null || cbs is null) + return false; + + var res = await _perms.CheckPermsAsync(sg, + usrMsg.Channel, + usrMsg.Author, + CleverBotResponseStr.CLEVERBOT_RESPONSE, + CleverBotResponseStr.CLEVERBOT_RESPONSE); + + if (!res.IsAllowed) + return false; + + var channel = (ITextChannel)usrMsg.Channel; + var conf = _ps.GetConfig(); + if (!_creds.IsOwner(sg.OwnerId) && conf.IsEnabled) + { + var quota = await _ps.TryGetFeatureLimitAsync(_flKey, sg.OwnerId, 0); + + uint? daily = quota.Quota is int dVal and < 0 + ? (uint)-dVal + : null; + + uint? monthly = quota.Quota is int mVal and >= 0 + ? (uint)mVal + : null; + + var maybeLimit = await _ps.TryIncrementQuotaCounterAsync(sg.OwnerId, + sg.OwnerId == usrMsg.Author.Id, + FeatureType.Limit, + _flKey.Key, + null, + daily, + monthly); + + if (maybeLimit.TryPickT1(out var ql, out var counters)) + { + if (ql.Quota == 0) + { + await _sender.Response(channel) + .Error(null, + text: + "In order to use the cleverbot feature, the owner of this server should be [Patron Tier X](https://patreon.com/join/elliebot) on patreon.", + footer: + "You may disable the cleverbot feature, and this message via '.cleverbot' command") + .SendAsync(); + + return true; + } + + await _sender.Response(channel) + .Error( + null!, + $"You've reached your quota limit of **{ql.Quota}** responses {ql.QuotaPeriod.ToFullName()} for the cleverbot feature.", + footer: "You may wait for the quota reset or .") + .SendAsync(); + + return true; + } + } + + _ = channel.TriggerTypingAsync(); + var response = await cbs.Think(message, usrMsg.Author.ToString()); + await _sender.Response(channel) + .Confirm(response) + .SendAsync(); + + Log.Information(""" + CleverBot Executed + Server: {GuildName} [{GuildId}] + Channel: {ChannelName} [{ChannelId}] + UserId: {Author} [{AuthorId}] + Message: {Content} + """, + guild.Name, + guild.Id, + usrMsg.Channel?.Name, + usrMsg.Channel?.Id, + usrMsg.Author, + usrMsg.Author.Id, + usrMsg.Content); + + return true; + } + catch (Exception ex) + { + Log.Warning(ex, "Error in cleverbot"); + } + + return false; + } +} \ No newline at end of file diff --git a/src/EllieBot/Modules/Games/ChatterBot/CleverBotCommands.cs b/src/EllieBot/Modules/Games/ChatterBot/CleverBotCommands.cs new file mode 100644 index 0000000..1a41953 --- /dev/null +++ b/src/EllieBot/Modules/Games/ChatterBot/CleverBotCommands.cs @@ -0,0 +1,48 @@ +#nullable disable +using EllieBot.Db; +using EllieBot.Modules.Games.Services; +using EllieBot.Db.Models; + +namespace EllieBot.Modules.Games; + +public partial class Games +{ + [Group] + public partial class ChatterBotCommands : EllieModule + { + private readonly DbService _db; + + public ChatterBotCommands(DbService db) + => _db = db; + + [Cmd] + [RequireContext(ContextType.Guild)] + [UserPerm(GuildPerm.ManageMessages)] + public async Task Cleverbot() + { + var channel = (ITextChannel)ctx.Channel; + + if (_service.ChatterBotGuilds.TryRemove(channel.Guild.Id, out _)) + { + await using (var uow = _db.GetDbContext()) + { + uow.Set().SetCleverbotEnabled(ctx.Guild.Id, false); + await uow.SaveChangesAsync(); + } + + await Response().Confirm(strs.cleverbot_disabled).SendAsync(); + return; + } + + _service.ChatterBotGuilds.TryAdd(channel.Guild.Id, new(() => _service.CreateSession(), true)); + + await using (var uow = _db.GetDbContext()) + { + uow.Set().SetCleverbotEnabled(ctx.Guild.Id, true); + await uow.SaveChangesAsync(); + } + + await Response().Confirm(strs.cleverbot_enabled).SendAsync(); + } + } +} \ No newline at end of file diff --git a/src/EllieBot/Modules/Games/ChatterBot/_common/Choice.cs b/src/EllieBot/Modules/Games/ChatterBot/_common/Choice.cs deleted file mode 100644 index c1290dd..0000000 --- a/src/EllieBot/Modules/Games/ChatterBot/_common/Choice.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Text.Json.Serialization; - -namespace EllieBot.Modules.Games.Common.ChatterBot; - -public class Choice -{ - [JsonPropertyName("message")] - public required Message Message { get; init; } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Games/ChatterBot/_common/Gpt3Response.cs b/src/EllieBot/Modules/Games/ChatterBot/_common/Gpt3Response.cs new file mode 100644 index 0000000..ad8692a --- /dev/null +++ b/src/EllieBot/Modules/Games/ChatterBot/_common/Gpt3Response.cs @@ -0,0 +1,46 @@ +#nullable disable +using System.Text.Json.Serialization; + +namespace EllieBot.Modules.Games.Common.ChatterBot; + +public class Gpt3Response +{ + [JsonPropertyName("choices")] + public Choice[] Choices { get; set; } +} + +public class Choice +{ + [JsonPropertyName("message")] + public Message Message { get; init; } +} + +public class Message { + [JsonPropertyName("content")] + public string Content { get; init; } +} + +public class Gpt3ApiRequest +{ + [JsonPropertyName("model")] + public string Model { get; init; } + + [JsonPropertyName("messages")] + public List Messages { get; init; } + + [JsonPropertyName("temperature")] + public int Temperature { get; init; } + + [JsonPropertyName("max_tokens")] + public int MaxTokens { get; init; } +} + +public class GPTMessage +{ + [JsonPropertyName("role")] + public string Role {get; init;} + [JsonPropertyName("content")] + public string Content {get; init;} + [JsonPropertyName("name")] + public string Name {get; init;} +} \ No newline at end of file diff --git a/src/EllieBot/Modules/Games/ChatterBot/_common/IChatterBotSession.cs b/src/EllieBot/Modules/Games/ChatterBot/_common/IChatterBotSession.cs index 0372c87..847d661 100644 --- a/src/EllieBot/Modules/Games/ChatterBot/_common/IChatterBotSession.cs +++ b/src/EllieBot/Modules/Games/ChatterBot/_common/IChatterBotSession.cs @@ -1,10 +1,7 @@ #nullable disable -using OneOf; -using OneOf.Types; - namespace EllieBot.Modules.Games.Common.ChatterBot; public interface IChatterBotSession { - Task>> Think(string input, string username); + Task Think(string input, string username); } \ No newline at end of file diff --git a/src/EllieBot/Modules/Games/ChatterBot/_common/Message.cs b/src/EllieBot/Modules/Games/ChatterBot/_common/Message.cs deleted file mode 100644 index df26315..0000000 --- a/src/EllieBot/Modules/Games/ChatterBot/_common/Message.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Text.Json.Serialization; - -namespace EllieBot.Modules.Games.Common.ChatterBot; - -public class Message -{ - [JsonPropertyName("content")] - public required string Content { get; init; } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Games/ChatterBot/_common/OfficialCleverbotSession.cs b/src/EllieBot/Modules/Games/ChatterBot/_common/OfficialCleverbotSession.cs index b20f1d0..83dc060 100644 --- a/src/EllieBot/Modules/Games/ChatterBot/_common/OfficialCleverbotSession.cs +++ b/src/EllieBot/Modules/Games/ChatterBot/_common/OfficialCleverbotSession.cs @@ -1,7 +1,5 @@ #nullable disable using Newtonsoft.Json; -using OneOf; -using OneOf.Types; namespace EllieBot.Modules.Games.Common.ChatterBot; @@ -20,7 +18,7 @@ public class OfficialCleverbotSession : IChatterBotSession _httpFactory = factory; } - public async Task>> Think(string input, string username) + public async Task Think(string input, string username) { using var http = _httpFactory.CreateClient(); var dataString = await http.GetStringAsync(string.Format(QueryString, input, cs ?? "")); @@ -29,17 +27,12 @@ public class OfficialCleverbotSession : IChatterBotSession var data = JsonConvert.DeserializeObject(dataString); cs = data?.Cs; - return new ThinkResult - { - Text = data?.Output, - TokensIn = 2, - TokensOut = 1 - }; + return data?.Output; } catch { - Log.Warning("Unexpected response from CleverBot: {ResponseString}", dataString); - return new Error("Unexpected CleverBot response received"); + Log.Warning("Unexpected cleverbot response received: {ResponseString}", dataString); + return null; } } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Games/ChatterBot/_common/OfficialGpt3Session.cs b/src/EllieBot/Modules/Games/ChatterBot/_common/OfficialGpt3Session.cs new file mode 100644 index 0000000..4711fd6 --- /dev/null +++ b/src/EllieBot/Modules/Games/ChatterBot/_common/OfficialGpt3Session.cs @@ -0,0 +1,105 @@ +#nullable disable +using Newtonsoft.Json; +using System.Net.Http.Json; +using SharpToken; + +namespace EllieBot.Modules.Games.Common.ChatterBot; + +public class OfficialGpt3Session : IChatterBotSession +{ + private string Uri + => $"https://api.openai.com/v1/chat/completions"; + + private readonly string _apiKey; + private readonly string _model; + private readonly int _maxHistory; + private readonly int _maxTokens; + private readonly int _minTokens; + private readonly string _ellieUsername; + private readonly GptEncoding _encoding; + private List messages = new(); + private readonly IHttpClientFactory _httpFactory; + + + + public OfficialGpt3Session( + string apiKey, + ChatGptModel model, + int chatHistory, + int maxTokens, + int minTokens, + string personality, + string ellieUsername, + IHttpClientFactory factory) + { + _apiKey = apiKey; + _httpFactory = factory; + switch (model) + { + case ChatGptModel.Gpt35Turbo: + _model = "gpt-3.5-turbo"; + break; + case ChatGptModel.Gpt4: + _model = "gpt-4"; + break; + case ChatGptModel.Gpt432k: + _model = "gpt-4-32k"; + break; + } + _maxHistory = chatHistory; + _maxTokens = maxTokens; + _minTokens = minTokens; + _ellieUsername = ellieUsername; + _encoding = GptEncoding.GetEncodingForModel(_model); + messages.Add(new GPTMessage(){Role = "user", Content = personality, Name = _ellieUsername}); + } + + public async Task Think(string input, string username) + { + messages.Add(new GPTMessage(){Role = "user", Content = input, Name = username}); + while(messages.Count > _maxHistory + 2){ + messages.RemoveAt(1); + } + int tokensUsed = 0; + foreach(GPTMessage message in messages){ + tokensUsed += _encoding.Encode(message.Content).Count; + } + tokensUsed *= 2; //Unsure why this is the case, but the token count chatgpt reports back is double what I calculate. + //check if we have the minimum number of tokens available to use. Remove messages until we have enough, otherwise exit out and inform the user why. + while(_maxTokens - tokensUsed <= _minTokens){ + if(messages.Count > 2){ + int tokens = _encoding.Encode(messages[1].Content).Count * 2; + tokensUsed -= tokens; + messages.RemoveAt(1); + } + else{ + return "Token count exceeded, please increase the number of tokens in the bot config and restart."; + } + } + using var http = _httpFactory.CreateClient(); + http.DefaultRequestHeaders.Authorization = new("Bearer", _apiKey); + var data = await http.PostAsJsonAsync(Uri, new Gpt3ApiRequest() + { + Model = _model, + Messages = messages, + MaxTokens = _maxTokens - tokensUsed, + Temperature = 1, + }); + var dataString = await data.Content.ReadAsStringAsync(); + try + { + var response = JsonConvert.DeserializeObject(dataString); + string message = response?.Choices[0]?.Message?.Content; + //Can't rely on the return to except, now that we need to add it to the messages list. + _ = message ?? throw new ArgumentNullException(nameof(message)); + messages.Add(new GPTMessage(){Role = "assistant", Content = message, Name = _ellieUsername}); + return message; + } + catch + { + Log.Warning("Unexpected GPT-3 response received: {ResponseString}", dataString); + return null; + } + } +} + diff --git a/src/EllieBot/Modules/Games/ChatterBot/_common/OpenAiApi/OpenAiApiMessage.cs b/src/EllieBot/Modules/Games/ChatterBot/_common/OpenAiApi/OpenAiApiMessage.cs deleted file mode 100644 index 9f0a028..0000000 --- a/src/EllieBot/Modules/Games/ChatterBot/_common/OpenAiApi/OpenAiApiMessage.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Text.Json.Serialization; - -namespace EllieBot.Modules.Games.Common.ChatterBot; - -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/OpenAiApiRequest.cs b/src/EllieBot/Modules/Games/ChatterBot/_common/OpenAiApi/OpenAiApiRequest.cs deleted file mode 100644 index 3ab7d68..0000000 --- a/src/EllieBot/Modules/Games/ChatterBot/_common/OpenAiApi/OpenAiApiRequest.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Text.Json.Serialization; - -namespace EllieBot.Modules.Games.Common.ChatterBot; - -public class OpenAiApiRequest -{ - [JsonPropertyName("model")] - public required string Model { get; init; } - - [JsonPropertyName("messages")] - public required List Messages { get; init; } - - [JsonPropertyName("temperature")] - public required int Temperature { get; init; } - - [JsonPropertyName("max_tokens")] - public required int MaxTokens { 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 deleted file mode 100644 index 174af3e..0000000 --- a/src/EllieBot/Modules/Games/ChatterBot/_common/OpenAiApi/OpenAiApiUsageData.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Text.Json.Serialization; - -namespace EllieBot.Modules.Games.Common.ChatterBot; - -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 deleted file mode 100644 index db0b92f..0000000 --- a/src/EllieBot/Modules/Games/ChatterBot/_common/OpenAiApi/OpenAiCompletionResponse.cs +++ /dev/null @@ -1,13 +0,0 @@ -#nullable disable -using System.Text.Json.Serialization; - -namespace EllieBot.Modules.Games.Common.ChatterBot; - -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/OpenAiApiSession.cs b/src/EllieBot/Modules/Games/ChatterBot/_common/OpenAiApiSession.cs deleted file mode 100644 index 42afd22..0000000 --- a/src/EllieBot/Modules/Games/ChatterBot/_common/OpenAiApiSession.cs +++ /dev/null @@ -1,147 +0,0 @@ -#nullable disable -using Newtonsoft.Json; -using OneOf.Types; -using SharpToken; -using System.Net.Http.Json; -using System.Text.RegularExpressions; - -namespace EllieBot.Modules.Games.Common.ChatterBot; - -public partial class OpenAiApiSession : IChatterBotSession -{ - private readonly string _baseUrl; - private readonly string _apiKey; - private readonly string _model; - private readonly int _maxHistory; - private readonly int _maxTokens; - private readonly int _minTokens; - private readonly string _ellieUsername; - private readonly GptEncoding _encoding; - private List messages = new(); - private readonly IHttpClientFactory _httpFactory; - - - public OpenAiApiSession( - string url, - string apiKey, - string model, - int chatHistory, - int maxTokens, - int minTokens, - string personality, - string ellieUsername, - IHttpClientFactory factory) - { - if (string.IsNullOrWhiteSpace(url) || !Uri.TryCreate(url, UriKind.Absolute, out _)) - { - throw new ArgumentException("Invalid OpenAi api url provided", nameof(url)); - } - - _baseUrl = url.TrimEnd('/'); - - _apiKey = apiKey; - _model = model; - _httpFactory = factory; - _maxHistory = chatHistory; - _maxTokens = maxTokens; - _minTokens = minTokens; - _ellieUsername = UsernameCleaner().Replace(ellieUsername, ""); - _encoding = GptEncoding.GetEncodingForModel("gpt-4o"); - if (!string.IsNullOrWhiteSpace(personality)) - { - messages.Add(new() - { - Role = "system", - Content = personality, - Name = _ellieUsername - }); - } - } - - - [GeneratedRegex("[^a-zA-Z0-9_-]")] - private static partial Regex UsernameCleaner(); - - public async Task>> Think(string input, string username) - { - username = UsernameCleaner().Replace(username, ""); - - messages.Add(new() - { - Role = "user", - Content = input, - Name = username - }); - - while (messages.Count > _maxHistory + 2) - { - messages.RemoveAt(1); - } - - var tokensUsed = messages.Sum(message => _encoding.Encode(message.Content).Count); - - tokensUsed *= 2; - - //check if we have the minimum number of tokens available to use. Remove messages until we have enough, otherwise exit out and inform the user why. - while (_maxTokens - tokensUsed <= _minTokens) - { - if (messages.Count > 2) - { - var tokens = _encoding.Encode(messages[1].Content).Count * 2; - tokensUsed -= tokens; - messages.RemoveAt(1); - } - else - { - return new Error( - "Token count exceeded, please increase the number of tokens in the bot config and restart."); - } - } - - using var http = _httpFactory.CreateClient(); - http.DefaultRequestHeaders.Authorization = new("Bearer", _apiKey); - - var data = await http.PostAsJsonAsync($"{_baseUrl}/v1/chat/completions", - new OpenAiApiRequest() - { - Model = _model, - Messages = messages, - MaxTokens = _maxTokens - tokensUsed, - Temperature = 1, - }); - - var dataString = await data.Content.ReadAsStringAsync(); - try - { - var response = JsonConvert.DeserializeObject(dataString); - - // Log.Information("Received response: {Response} ", dataString); - var res = response?.Choices?[0]; - var message = res?.Message?.Content; - - if (message is null) - { - return new Error("ChatGpt: Received no response."); - } - - messages.Add(new() - { - Role = "assistant", - Content = message, - Name = _ellieUsername - }); - - return new ThinkResult() - { - Text = message, - TokensIn = response.Usage.PromptTokens, - TokensOut = response.Usage.CompletionTokens - }; - } - catch - { - Log.Warning("Unexpected response received from OpenAI: {ResponseString}", dataString); - return new Error("Unexpected response received"); - } - } -} \ 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 deleted file mode 100644 index 3d881e2..0000000 --- a/src/EllieBot/Modules/Games/ChatterBot/_common/ThinkResult.cs +++ /dev/null @@ -1,9 +0,0 @@ -#nullable disable -namespace EllieBot.Modules.Games.Common.ChatterBot; - -public sealed class ThinkResult -{ - public string Text { get; set; } - public int TokensIn { get; set; } - public int TokensOut { get; set; } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Games/GamesConfig.cs b/src/EllieBot/Modules/Games/GamesConfig.cs index 9308329..1502c39 100644 --- a/src/EllieBot/Modules/Games/GamesConfig.cs +++ b/src/EllieBot/Modules/Games/GamesConfig.cs @@ -8,7 +8,7 @@ namespace EllieBot.Modules.Games.Common; public sealed partial class GamesConfig : ICloneable { [Comment("DO NOT CHANGE")] - public int Version { get; set; } = 5; + public int Version { get; set; } = 3; [Comment("Hangman related settings (.hangman command)")] public HangmanConfig Hangman { get; set; } = new() @@ -103,13 +103,10 @@ public sealed partial class GamesConfig : ICloneable } ]; - [Comment( - """ - Which chatbot API should bot use. - 'cleverbot' - bot will use Cleverbot API. - 'openai' - bot will use OpenAi API - """)] - public ChatBotImplementation ChatBot { get; set; } = ChatBotImplementation.OpenAi; + [Comment(@"Which chatbot API should bot use. +'cleverbot' - bot will use Cleverbot API. +'gpt3' - bot will use GPT-3 API")] + public ChatBotImplementation ChatBot { get; set; } = ChatBotImplementation.Gpt3; public ChatGptConfig ChatGpt { get; set; } = new(); } @@ -117,41 +114,22 @@ public sealed partial class GamesConfig : ICloneable [Cloneable] public sealed partial class ChatGptConfig { - [Comment(""" - Url to any openai api compatible url. - Make sure to modify the modelName appropriately - DO NOT add /v1/chat/completions suffix to the url - """)] - public string ApiUrl { get; set; } = "https://api.openai.com"; + [Comment(@"Which GPT-3 Model should bot use. + gpt35turbo - cheapest + gpt4 - 30x more expensive, higher quality + gp432k - same model as above, but with a 32k token limit")] + public ChatGptModel ModelName { get; set; } = ChatGptModel.Gpt35Turbo; - [Comment(""" - Which GPT Model should bot use. - gpt-3.5-turbo - cheapest - gpt-4o - more expensive, higher quality + [Comment(@"How should the chat bot behave, what's its personality? (Usage of this counts towards the max tokens)")] + public string PersonalityPrompt { get; set; } = "You are a chat bot willing to have a conversation with anyone about anything."; - If you are using another openai compatible api, you may use any of the models supported by that api - """)] - public string ModelName { get; set; } = "gpt-3.5-turbo"; - - [Comment(""" - How should the chatbot behave, what's its personality? - This will be sent as a system message. - Usage of this counts towards the max tokens. - """)] - public string PersonalityPrompt { get; set; } = - "You are a chat bot willing to have a conversation with anyone about anything."; - - [Comment( - """ - The maximum number of messages in a conversation that can be remembered. - This will increase the number of tokens used. - """)] + [Comment(@"The maximum number of messages in a conversation that can be remembered. (This will increase the number of tokens used)")] public int ChatHistory { get; set; } = 5; - [Comment(@"The maximum number of tokens to use per OpenAi API call")] + [Comment(@"The maximum number of tokens to use per GPT-3 API call")] public int MaxTokens { get; set; } = 100; - [Comment(@"The minimum number of tokens to use per GPT API call, such that chat history is removed to make room.")] + [Comment(@"The minimum number of tokens to use per GPT-3 API call, such that chat history is removed to make room.")] public int MinTokens { get; set; } = 30; } @@ -169,9 +147,9 @@ public sealed partial class TriviaConfig public long CurrencyReward { get; set; } [Comment(""" - Users won't be able to start trivia games which have - a smaller win requirement than the one specified by this setting. - """)] + Users won't be able to start trivia games which have + a smaller win requirement than the one specified by this setting. + """)] public int MinimumWinReq { get; set; } = 1; } @@ -185,11 +163,12 @@ public sealed partial class RaceAnimal public enum ChatBotImplementation { Cleverbot, - OpenAi = 1, + Gpt3 +} - [Obsolete] - Gpt = 1, - - [Obsolete] - Gpt3 = 1, +public enum ChatGptModel +{ + Gpt35Turbo, + Gpt4, + Gpt432k } \ No newline at end of file diff --git a/src/EllieBot/Modules/Games/GamesConfigService.cs b/src/EllieBot/Modules/Games/GamesConfigService.cs index f6ff635..6446c23 100644 --- a/src/EllieBot/Modules/Games/GamesConfigService.cs +++ b/src/EllieBot/Modules/Games/GamesConfigService.cs @@ -32,21 +32,29 @@ public sealed class GamesConfigService : ConfigServiceBase gs => gs.ChatBot, ConfigParsers.InsensitiveEnum, ConfigPrinters.ToString); - - AddParsedProp("gpt.apiUrl", - gs => gs.ChatGpt.ApiUrl, - ConfigParsers.String, - ConfigPrinters.ToString); - AddParsedProp("gpt.modelName", gs => gs.ChatGpt.ModelName, - ConfigParsers.String, + ConfigParsers.InsensitiveEnum, ConfigPrinters.ToString); - AddParsedProp("gpt.personality", gs => gs.ChatGpt.PersonalityPrompt, ConfigParsers.String, ConfigPrinters.ToString); + AddParsedProp("gpt.chathistory", + gs => gs.ChatGpt.ChatHistory, + int.TryParse, + ConfigPrinters.ToString, + val => val > 0); + AddParsedProp("gpt.max_tokens", + gs => gs.ChatGpt.MaxTokens, + int.TryParse, + ConfigPrinters.ToString, + val => val > 0); + AddParsedProp("gpt.min_tokens", + gs => gs.ChatGpt.MinTokens, + int.TryParse, + ConfigPrinters.ToString, + val => val > 0); Migrate(); } @@ -65,55 +73,21 @@ public sealed class GamesConfigService : ConfigServiceBase }); } + if (data.Version < 2) + { + ModifyConfig(c => + { + c.Version = 2; + c.ChatBot = ChatBotImplementation.Cleverbot; + }); + } + if (data.Version < 3) { ModifyConfig(c => { c.Version = 3; - c.ChatGpt.ModelName = "gpt35turbo"; - }); - } - - if (data.Version < 4) - { - ModifyConfig(c => - { - c.Version = 4; -#pragma warning disable CS0612 // Type or member is obsolete - c.ChatGpt.ModelName = - c.ChatGpt.ModelName.Equals("gpt4", StringComparison.OrdinalIgnoreCase) - || c.ChatGpt.ModelName.Equals("gpt432k", StringComparison.OrdinalIgnoreCase) - ? "gpt-4o" - : "gpt-3.5-turbo"; -#pragma warning restore CS0612 // Type or member is obsolete - }); - } - - if (data.Version < 5) - { - ModifyConfig(c => - { - c.Version = 5; - c.ChatBot = c.ChatBot == ChatBotImplementation.OpenAi - ? ChatBotImplementation.OpenAi - : c.ChatBot; - - if (c.ChatGpt.ModelName.Equals("gpt4o", StringComparison.OrdinalIgnoreCase)) - { - c.ChatGpt.ModelName = "gpt-4o"; - } - else if (c.ChatGpt.ModelName.Equals("gpt35turbo", StringComparison.OrdinalIgnoreCase)) - { - c.ChatGpt.ModelName = "gpt-3.5-turbo"; - } - else - { - Log.Warning( - "Unknown OpenAI api model name: {ModelName}. " - + "It will be reset to 'gpt-3.5-turbo' only this time", - c.ChatGpt.ModelName); - c.ChatGpt.ModelName = "gpt-3.5-turbo"; - } + c.ChatGpt.ModelName = ChatGptModel.Gpt35Turbo; }); } } diff --git a/src/EllieBot/Modules/Games/GamesService.cs b/src/EllieBot/Modules/Games/GamesService.cs index 1436285..9f4f61b 100644 --- a/src/EllieBot/Modules/Games/GamesService.cs +++ b/src/EllieBot/Modules/Games/GamesService.cs @@ -1,5 +1,6 @@ #nullable disable using Microsoft.Extensions.Caching.Memory; +using EllieBot.Common.ModuleBehaviors; using EllieBot.Modules.Games.Common; using EllieBot.Modules.Games.Common.Acrophobia; using EllieBot.Modules.Games.Common.Nunchi; @@ -7,10 +8,11 @@ using Newtonsoft.Json; namespace EllieBot.Modules.Games.Services; -public class GamesService : IEService +public class GamesService : IEService, IReadyExecutor { private const string TYPING_ARTICLES_PATH = "data/typing_articles3.json"; + public ConcurrentDictionary GirlRatings { get; } = new(); public IReadOnlyList EightBallResponses => _gamesConfig.Data.EightBallResponses; @@ -23,6 +25,7 @@ public class GamesService : IEService public ConcurrentDictionary RunningContests { get; } = new(); public ConcurrentDictionary NunchiGames { get; } = new(); + public AsyncLazy Ratings { get; } private readonly GamesConfigService _gamesConfig; private readonly IHttpClientFactory _httpFactory; @@ -38,6 +41,7 @@ public class GamesService : IEService SizeLimit = 500_000 }); + Ratings = new(GetRatingTexts); _rng = new EllieRandom(); try @@ -51,6 +55,22 @@ public class GamesService : IEService } } + public async Task OnReadyAsync() + { + // reset rating once a day + using var timer = new PeriodicTimer(TimeSpan.FromDays(1)); + while (await timer.WaitForNextTickAsync()) + GirlRatings.Clear(); + } + + private async Task GetRatingTexts() + { + using var http = _httpFactory.CreateClient(); + var text = await http.GetStringAsync( + "https://nadeko-pictures.nyc3.digitaloceanspaces.com/other/rategirl/rates.json"); + return JsonConvert.DeserializeObject(text); + } + public void AddTypingArticle(IUser user, string text) { TypingArticles.Add(new() @@ -84,4 +104,15 @@ public class GamesService : IEService File.WriteAllText(TYPING_ARTICLES_PATH, JsonConvert.SerializeObject(articles)); return removed; } + + public class RatingTexts + { + public string Nog { get; set; } + public string Tra { get; set; } + public string Fun { get; set; } + public string Uni { get; set; } + public string Wif { get; set; } + public string Dat { get; set; } + public string Dan { get; set; } + } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Games/GirlRating.cs b/src/EllieBot/Modules/Games/GirlRating.cs new file mode 100644 index 0000000..4576216 --- /dev/null +++ b/src/EllieBot/Modules/Games/GirlRating.cs @@ -0,0 +1,61 @@ +#nullable disable +using SixLabors.ImageSharp; +using SixLabors.ImageSharp.Processing; +using Image = SixLabors.ImageSharp.Image; + +namespace EllieBot.Modules.Games.Common; + +public class GirlRating +{ + public double Crazy { get; } + public double Hot { get; } + public int Roll { get; } + public string Advice { get; } + + public AsyncLazy Stream { get; } + private readonly IImageCache _images; + + public GirlRating( + IImageCache images, + double crazy, + double hot, + int roll, + string advice) + { + _images = images; + Crazy = crazy; + Hot = hot; + Roll = roll; + Advice = advice; // convenient to have it here, even though atm there are only few different ones. + + Stream = new(async () => + { + try + { + var bgBytes = await _images.GetRategirlBgAsync(); + using var img = Image.Load(bgBytes); + const int minx = 35; + const int miny = 385; + const int length = 345; + + var pointx = (int)(minx + (length * (Hot / 10))); + var pointy = (int)(miny - (length * ((Crazy - 4) / 6))); + + var dotBytes = await _images.GetRategirlDotAsync(); + using (var pointImg = Image.Load(dotBytes)) + { + img.Mutate(x => x.DrawImage(pointImg, new(pointx - 10, pointy - 10), new GraphicsOptions())); + } + + var imgStream = new MemoryStream(); + img.SaveAsPng(imgStream); + return imgStream; + } + catch (Exception ex) + { + Log.Warning(ex, "Error getting RateGirl image"); + return null; + } + }); + } +} \ No newline at end of file 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/Games/Trivia/TriviaCommands.cs b/src/EllieBot/Modules/Games/Trivia/Games.cs similarity index 98% rename from src/EllieBot/Modules/Games/Trivia/TriviaCommands.cs rename to src/EllieBot/Modules/Games/Trivia/Games.cs index 72b4eb4..ff7ffbd 100644 --- a/src/EllieBot/Modules/Games/Trivia/TriviaCommands.cs +++ b/src/EllieBot/Modules/Games/Trivia/Games.cs @@ -107,9 +107,9 @@ public partial class Games return sb.ToString(); } - private EmbedBuilder? questionEmbed; - private IUserMessage? questionMessage; - private bool showHowToQuit; + private EmbedBuilder? questionEmbed = null; + private IUserMessage? questionMessage = null; + private bool showHowToQuit = false; private void RegisterEvents(TriviaGame trivia) { diff --git a/src/EllieBot/Modules/Games/Trivia/TriviaGame.cs b/src/EllieBot/Modules/Games/Trivia/TriviaGame.cs index 07c4ab4..4223104 100644 --- a/src/EllieBot/Modules/Games/Trivia/TriviaGame.cs +++ b/src/EllieBot/Modules/Games/Trivia/TriviaGame.cs @@ -11,19 +11,12 @@ public sealed class TriviaGame private readonly IQuestionPool _questionPool; #region Events - public event Func OnQuestion = static delegate { return Task.CompletedTask; }; public event Func OnHint = static delegate { return Task.CompletedTask; }; public event Func OnStats = static delegate { return Task.CompletedTask; }; - - public event Func OnGuess = static delegate - { - return Task.CompletedTask; - }; - + public event Func OnGuess = static delegate { return Task.CompletedTask; }; public event Func OnTimeout = static delegate { return Task.CompletedTask; }; public event Func OnEnded = static delegate { return Task.CompletedTask; }; - #endregion private bool _isStopped; @@ -31,7 +24,7 @@ public sealed class TriviaGame public TriviaQuestion? CurrentQuestion { get; set; } - private readonly ConcurrentDictionary _users = new(); + private readonly ConcurrentDictionary _users = new (); private readonly Channel<(TriviaUser User, string Input)> _inputs = Channel.CreateUnbounded<(TriviaUser, string)>(new UnboundedChannelOptions @@ -48,8 +41,8 @@ public sealed class TriviaGame _questionPool = _opts.IsPokemon ? new PokemonQuestionPool(cache) : new DefaultQuestionPool(cache); - } + } public async Task RunAsync() { await GameLoop(); @@ -57,8 +50,7 @@ public sealed class TriviaGame private async Task GameLoop() { - Task TimeOutFactory() - => Task.Delay(_opts.QuestionTimer * 1000 / 2); + Task TimeOutFactory() => Task.Delay(_opts.QuestionTimer * 1000 / 2); var errorCount = 0; var inactivity = 0; @@ -99,8 +91,7 @@ public sealed class TriviaGame { // clear out all of the past guesses while (_inputs.Reader.TryRead(out _)) - { - } + ; await OnQuestion(this, question); } @@ -130,7 +121,7 @@ public sealed class TriviaGame if (task == halfGuessTimerTask) { readCancel.Cancel(); - + // if hint is already sent, means time expired // break (end the round) if (hintSent) @@ -222,7 +213,7 @@ public sealed class TriviaGame public async Task TriggerQuestionAsync() { - if (CurrentQuestion is TriviaQuestion q) + if(CurrentQuestion is TriviaQuestion q) await OnQuestion(this, q); } } \ No newline at end of file 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..79367b9 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; @@ -9,8 +9,8 @@ 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 PATREON_URL = "https://patreon.com/toastie_t0ast"; + public const string PAYPAL_URL = "https://paypal.me/EmotionChild"; private readonly ICommandsUtilityService _cus; private readonly CommandService _cmds; @@ -175,6 +175,8 @@ public sealed partial class Help : EllieModule return strs.module_description_gambling; case "music": return strs.module_description_music; + case "nsfw": + return strs.module_description_nsfw; case "permissions": return strs.module_description_permissions; case "xp": @@ -209,6 +211,8 @@ public sealed partial class Help : EllieModule return "💰"; case "music": return "🎶"; + case "nsfw": + return "😳"; case "permissions": return "🚓"; case "xp": @@ -505,7 +509,6 @@ public sealed partial class Help : EllieModule // send the indented file to chat await using var rDataStream = new MemoryStream(Encoding.ASCII.GetBytes(readableData)); - await File.WriteAllTextAsync("data/commandlist.json", readableData); await ctx.Channel.SendFileAsync(rDataStream, "cmds.json", GetText(strs.commandlist_regen)); } @@ -513,13 +516,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/Ellie) 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/toastie_t0ast) 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!"); @@ -527,7 +551,7 @@ public sealed partial class Help : EllieModule eb .WithDescription(""" EllieBot relies on donations to keep the servers, services and APIs running. - Donating will give you access to some exclusive features. You can read about them on the [patreon page](https://patreon.com/join/elliebot) + Donating will give you access to some exclusive features. You can read about them on the [patreon page](https://patreon.com/join/toastie_t0ast) """) .AddField("Donation Instructions", $""" @@ -535,7 +559,7 @@ public sealed partial class Help : EllieModule **Step 1:** ❤️ Pledge on Patreon ❤️ - `1.` Go to and choose a tier. + `1.` Go to and choose a tier. `2.` Make sure your payment is processed and accepted. **Step 2** 🤝 Connect your Discord account 🤝 @@ -556,6 +580,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..5904c03 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; @@ -31,7 +31,7 @@ public class HelpService : IExecNoCommand, IEService return; } - var repCtx = new ReplacementContext(guild: guild, channel: msg.Channel, user: msg.Author) + var repCtx = new ReplacementContext(guild: guild, channel: msg.Channel, users: msg.Author) .WithOverride("%prefix%", () => _bss.Data.Prefix) .WithOverride("%bot.prefix%", () => _bss.Data.Prefix); diff --git a/src/EllieBot/Modules/Marmalades/IMarmaladesRepositoryService.cs b/src/EllieBot/Modules/Marmalade/IMarmaladesRepositoryService.cs similarity index 100% rename from src/EllieBot/Modules/Marmalades/IMarmaladesRepositoryService.cs rename to src/EllieBot/Modules/Marmalade/IMarmaladesRepositoryService.cs diff --git a/src/EllieBot/Modules/Marmalades/Marmalade.cs b/src/EllieBot/Modules/Marmalade/Marmalade.cs similarity index 100% rename from src/EllieBot/Modules/Marmalades/Marmalade.cs rename to src/EllieBot/Modules/Marmalade/Marmalade.cs diff --git a/src/EllieBot/Modules/Marmalades/MarmaladeItem.cs b/src/EllieBot/Modules/Marmalade/MarmaladeItem.cs similarity index 100% rename from src/EllieBot/Modules/Marmalades/MarmaladeItem.cs rename to src/EllieBot/Modules/Marmalade/MarmaladeItem.cs diff --git a/src/EllieBot/Modules/Marmalades/MarmaladesRepositoryService.cs b/src/EllieBot/Modules/Marmalade/MarmaladesRepositoryService.cs similarity index 100% rename from src/EllieBot/Modules/Marmalades/MarmaladesRepositoryService.cs rename to src/EllieBot/Modules/Marmalade/MarmaladesRepositoryService.cs diff --git a/src/EllieBot/Modules/Music/PlaylistCommands.cs b/src/EllieBot/Modules/Music/PlaylistCommands.cs index 68a651d..259bb9e 100644 --- a/src/EllieBot/Modules/Music/PlaylistCommands.cs +++ b/src/EllieBot/Modules/Music/PlaylistCommands.cs @@ -1,5 +1,6 @@ #nullable disable using LinqToDB; +using EllieBot.Db; using EllieBot.Modules.Music.Services; using EllieBot.Db.Models; @@ -12,9 +13,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 +137,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..b2b3da3 100644 --- a/src/EllieBot/Modules/Music/Services/MusicService.cs +++ b/src/EllieBot/Modules/Music/Services/MusicService.cs @@ -1,5 +1,5 @@ -using EllieBot.Db.Models; -using EllieBot.Modules.Music.Resolvers; +using EllieBot.Db; +using EllieBot.Db.Models; using System.Diagnostics.CodeAnalysis; namespace EllieBot.Modules.Music.Services; @@ -9,7 +9,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 +25,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 +94,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 +140,6 @@ public sealed class MusicService : IMusicService, IPlaceholderProvider var mp = new MusicPlayer(queue, resolver, - _ytResolver, proxy, _googleApiService, settings.QualityPreset, @@ -213,7 +212,7 @@ public sealed class MusicService : IMusicService, IPlaceholderProvider if (settings.AutoDisconnect) return LeaveVoiceChannelAsync(guildId); } - + return Task.CompletedTask; }; 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/RadioResolveStrategy.cs b/src/EllieBot/Modules/Music/_common/Resolvers/RadioResolveStrategy.cs index 475b026..c3733a4 100644 --- a/src/EllieBot/Modules/Music/_common/Resolvers/RadioResolveStrategy.cs +++ b/src/EllieBot/Modules/Music/_common/Resolvers/RadioResolveStrategy.cs @@ -61,8 +61,8 @@ public class RadioResolver : IRadioResolver try { var m = _m3URegex.Match(file); - var res = m.Groups["url"].ToString(); - return res.Trim(); + var res = m.Groups["url"]?.ToString(); + return res?.Trim(); } catch { @@ -76,8 +76,8 @@ public class RadioResolver : IRadioResolver try { var m = _asxRegex.Match(file); - var res = m.Groups["url"].ToString(); - return res.Trim(); + var res = m.Groups["url"]?.ToString(); + return res?.Trim(); } catch { @@ -91,8 +91,8 @@ public class RadioResolver : IRadioResolver try { var m = _xspfRegex.Match(file); - var res = m.Groups["url"].ToString(); - return res.Trim(); + var res = m.Groups["url"]?.ToString(); + return res?.Trim(); } catch { 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/Music/_common/db/MusicPlaylist.cs b/src/EllieBot/Modules/Music/_common/db/MusicPlaylist.cs index 697e35e..16a755b 100644 --- a/src/EllieBot/Modules/Music/_common/db/MusicPlaylist.cs +++ b/src/EllieBot/Modules/Music/_common/db/MusicPlaylist.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable namespace EllieBot.Db.Models; public class MusicPlaylist : DbEntity diff --git a/src/EllieBot/Modules/Patronage/Config/PatronageConfig.cs b/src/EllieBot/Modules/Patronage/Config/PatronageConfig.cs index 254c3db..56f166f 100644 --- a/src/EllieBot/Modules/Patronage/Config/PatronageConfig.cs +++ b/src/EllieBot/Modules/Patronage/Config/PatronageConfig.cs @@ -4,11 +4,10 @@ namespace EllieBot.Modules.Patronage; public class PatronageConfig : ConfigServiceBase { - public override string Name + public override string Name => "patron"; - private static readonly TypedKey _changeKey - = new("config.patron.updated"); + private static readonly TypedKey _changeKey; private const string FILE_PATH = "data/patron.yml"; @@ -32,14 +31,5 @@ public class PatronageConfig : ConfigServiceBase c.IsEnabled = false; } }); - - - ModifyConfig(c => - { - if (c.Version == 2) - { - c.Version = 3; - } - }); } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Patronage/CurrencyRewardService.cs b/src/EllieBot/Modules/Patronage/CurrencyRewardService.cs index 391ebb4..336fe9c 100644 --- a/src/EllieBot/Modules/Patronage/CurrencyRewardService.cs +++ b/src/EllieBot/Modules/Patronage/CurrencyRewardService.cs @@ -1,7 +1,6 @@ #nullable disable using LinqToDB; using LinqToDB.EntityFrameworkCore; -using EllieBot.Common.ModuleBehaviors; using EllieBot.Modules.Gambling.Services; using EllieBot.Modules.Patronage; using EllieBot.Services.Currency; @@ -9,7 +8,7 @@ using EllieBot.Db.Models; namespace EllieBot.Modules.Utility; -public sealed class CurrencyRewardService : IEService, IReadyExecutor +public sealed class CurrencyRewardService : IEService, IDisposable { private readonly ICurrencyService _cs; private readonly IPatronageService _ps; @@ -33,14 +32,16 @@ public sealed class CurrencyRewardService : IEService, IReadyExecutor _config = config; _client = client; - } - - public Task OnReadyAsync() - { _ps.OnNewPatronPayment += OnNewPayment; _ps.OnPatronRefunded += OnPatronRefund; _ps.OnPatronUpdated += OnPatronUpdate; - return Task.CompletedTask; + } + + public void Dispose() + { + _ps.OnNewPatronPayment -= OnNewPayment; + _ps.OnPatronRefunded -= OnPatronRefund; + _ps.OnPatronUpdated -= OnPatronUpdate; } private async Task OnPatronUpdate(Patron oldPatron, Patron newPatron) @@ -57,17 +58,17 @@ public sealed class CurrencyRewardService : IEService, IReadyExecutor old = await ctx.GetTable() .Where(x => x.PlatformUserId == newPatron.UniquePlatformUserId) .FirstOrDefaultAsync(); - + if (old is null) { await OnNewPayment(newPatron); return; } - + // no action as the amount is the same or lower if (old.AmountRewardedThisMonth >= newAmount) return; - + var count = await ctx.GetTable() .Where(x => x.PlatformUserId == newPatron.UniquePlatformUserId) .UpdateAsync(_ => new() @@ -90,21 +91,21 @@ public sealed class CurrencyRewardService : IEService, IReadyExecutor (int)(newAmount / conf.PatreonCurrencyPerCent), newAmount, out var percentBonus); - + var realOldAmount = GetRealCurrencyReward( (int)(oldAmount / conf.PatreonCurrencyPerCent), oldAmount, out _); - + var diff = realNewAmount - realOldAmount; if (diff <= 0) return; // no action if new is lower // if the user pledges 5$ or more, they will get X % more flowers where X is amount in dollars, // up to 100% - - await _cs.AddAsync(newPatron.UserId, diff, new TxData("patron","update")); - + + await _cs.AddAsync(newPatron.UserId, diff, new TxData("patron", "update")); + _ = SendMessageToUser(newPatron.UserId, $"You've received an additional **{diff}**{_config.Data.Currency.Sign} as a currency reward (+{percentBonus}%)!"); } @@ -122,9 +123,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 @@ -139,12 +140,12 @@ public sealed class CurrencyRewardService : IEService, IReadyExecutor await using var ctx = _db.GetDbContext(); await ctx.GetTable() .InsertOrUpdateAsync(() => new() - { - PlatformUserId = patron.UniquePlatformUserId, - UserId = patron.UserId, - AmountRewardedThisMonth = amount, - LastReward = patron.PaidAt, - }, + { + PlatformUserId = patron.UniquePlatformUserId, + UserId = patron.UserId, + AmountRewardedThisMonth = amount, + LastReward = patron.PaidAt, + }, old => new() { AmountRewardedThisMonth = amount, @@ -155,7 +156,7 @@ public sealed class CurrencyRewardService : IEService, IReadyExecutor { PlatformUserId = patron.UniquePlatformUserId }); - + var realAmount = GetRealCurrencyReward(patron.Amount, amount, out var percentBonus); await _cs.AddAsync(patron.UserId, realAmount, new("patron", "new")); _ = SendMessageToUser(patron.UserId, @@ -173,7 +174,7 @@ public sealed class CurrencyRewardService : IEService, IReadyExecutor var eb = _sender.CreateEmbed() .WithOkColor() .WithDescription(message); - + await _sender.Response(user).Embed(eb).SendAsync(); } catch diff --git a/src/EllieBot/Modules/Patronage/InsufficientTier.cs b/src/EllieBot/Modules/Patronage/InsufficientTier.cs new file mode 100644 index 0000000..26a0675 --- /dev/null +++ b/src/EllieBot/Modules/Patronage/InsufficientTier.cs @@ -0,0 +1,11 @@ +using EllieBot.Db.Models; + +namespace EllieBot.Modules.Patronage; + +public readonly struct InsufficientTier +{ + public FeatureType FeatureType { get; init; } + public string Feature { get; init; } + public PatronTier RequiredTier { get; init; } + public PatronTier UserTier { get; init; } +} \ No newline at end of file diff --git a/src/EllieBot/Modules/Patronage/Patreon/PatreonClient.cs b/src/EllieBot/Modules/Patronage/Patreon/PatreonClient.cs index 2ac5820..ad65448 100644 --- a/src/EllieBot/Modules/Patronage/Patreon/PatreonClient.cs +++ b/src/EllieBot/Modules/Patronage/Patreon/PatreonClient.cs @@ -11,11 +11,11 @@ public class PatreonClient : IDisposable private readonly string _clientId; private readonly string _clientSecret; private string refreshToken; - - + + private string accessToken = string.Empty; private readonly HttpClient _http; - + private DateTime refreshAt = DateTime.UtcNow; public PatreonClient(string clientId, string clientSecret, string refreshToken) @@ -101,7 +101,7 @@ public class PatreonClient : IDisposable return OneOf>, Error>.FromT0( GetMembersInternalAsync(campaignId)); } - + private async IAsyncEnumerable> GetMembersInternalAsync(string campaignId) { _http.DefaultRequestHeaders.Clear(); @@ -140,8 +140,9 @@ public class PatreonClient : IDisposable LastChargeDate = m.Attributes.LastChargeDate, LastChargeStatus = m.Attributes.LastChargeStatus }) + .Where(x => x.UserId == 140788173885276160) .ToArray(); - + yield return userData; } while (!string.IsNullOrWhiteSpace(page = data.Links?.Next)); diff --git a/src/EllieBot/Modules/Patronage/Patreon/PatreonCredentials.cs b/src/EllieBot/Modules/Patronage/Patreon/PatreonCredentials.cs index 768a1f6..5eb6f1f 100644 --- a/src/EllieBot/Modules/Patronage/Patreon/PatreonCredentials.cs +++ b/src/EllieBot/Modules/Patronage/Patreon/PatreonCredentials.cs @@ -7,4 +7,4 @@ public readonly struct PatreonCredentials public string ClientSecret { get; init; } public string AccessToken { get; init; } public string RefreshToken { get; init; } -} \ No newline at end of file +} diff --git a/src/EllieBot/Modules/Patronage/Patreon/PatreonData.cs b/src/EllieBot/Modules/Patronage/Patreon/PatreonData.cs index 6b33a80..f5d120e 100644 --- a/src/EllieBot/Modules/Patronage/Patreon/PatreonData.cs +++ b/src/EllieBot/Modules/Patronage/Patreon/PatreonData.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable using System.Text.Json.Serialization; namespace EllieBot.Modules.Patronage; diff --git a/src/EllieBot/Modules/Patronage/Patreon/PatreonMemberData.cs b/src/EllieBot/Modules/Patronage/Patreon/PatreonMemberData.cs index 4698b43..58656b9 100644 --- a/src/EllieBot/Modules/Patronage/Patreon/PatreonMemberData.cs +++ b/src/EllieBot/Modules/Patronage/Patreon/PatreonMemberData.cs @@ -25,4 +25,9 @@ public sealed class PatreonMemberData : ISubscriberData "Declined" or "Pending" => SubscriptionChargeStatus.Unpaid, _ => SubscriptionChargeStatus.Other, }; +} + +public sealed class PatreonPledgeData +{ + } \ No newline at end of file diff --git a/src/EllieBot/Modules/Patronage/Patreon/PatreonSubscriptionHandler.cs b/src/EllieBot/Modules/Patronage/Patreon/PatreonSubscriptionHandler.cs index edc0f08..1fd170e 100644 --- a/src/EllieBot/Modules/Patronage/Patreon/PatreonSubscriptionHandler.cs +++ b/src/EllieBot/Modules/Patronage/Patreon/PatreonSubscriptionHandler.cs @@ -6,8 +6,8 @@ namespace EllieBot.Modules.Patronage; /// public sealed class PatreonSubscriptionHandler : ISubscriptionHandler, IEService { - private readonly IBotCredsProvider _credsProvider; - private readonly PatreonClient _patreonClient; + private readonly IBotCredsProvider _credsProvider; + private readonly PatreonClient _patreonClient; public PatreonSubscriptionHandler(IBotCredsProvider credsProvider) { @@ -15,26 +15,26 @@ public sealed class PatreonSubscriptionHandler : ISubscriptionHandler, IEService var botCreds = credsProvider.GetCreds(); _patreonClient = new PatreonClient(botCreds.Patreon.ClientId, botCreds.Patreon.ClientSecret, botCreds.Patreon.RefreshToken); } - + public async IAsyncEnumerable> GetPatronsAsync() { var botCreds = _credsProvider.GetCreds(); - + if (string.IsNullOrWhiteSpace(botCreds.Patreon.CampaignId) || string.IsNullOrWhiteSpace(botCreds.Patreon.ClientId) || string.IsNullOrWhiteSpace(botCreds.Patreon.ClientSecret) || string.IsNullOrWhiteSpace(botCreds.Patreon.RefreshToken)) yield break; - + var result = await _patreonClient.RefreshTokenAsync(false); if (!result.TryPickT0(out _, out var error)) { Log.Warning("Unable to refresh patreon token: {ErrorMessage}", error.Value); yield break; } - + var patreonCreds = _patreonClient.GetCredentials(); - + _credsProvider.ModifyCredsFile(c => { c.Patreon.AccessToken = patreonCreds.AccessToken; @@ -58,7 +58,7 @@ public sealed class PatreonSubscriptionHandler : ISubscriptionHandler, IEService Log.Warning(ex, "Unexpected error while refreshing patreon members: {ErroMessage}", ex.Message); - + yield break; } @@ -71,7 +71,7 @@ public sealed class PatreonSubscriptionHandler : ISubscriptionHandler, IEService && x.LastCharge is { } lc && lc.ToUniversalTime().ToDateOnly() >= firstOfThisMonth) .ToArray(); - + if (toReturn.Length > 0) yield return toReturn; } diff --git a/src/EllieBot/Modules/Patronage/PatronageCommands.cs b/src/EllieBot/Modules/Patronage/PatronageCommands.cs index fee2c33..8d0a38a 100644 --- a/src/EllieBot/Modules/Patronage/PatronageCommands.cs +++ b/src/EllieBot/Modules/Patronage/PatronageCommands.cs @@ -71,16 +71,17 @@ public partial class Help return; } - var maybePatron = await _service.GetPatronAsync(user.Id); - - var quotaStats = await _service.LimitStats(user.Id); + var patron = await _service.GetPatronAsync(user.Id); + var quotaStats = await _service.GetUserQuotaStatistic(user.Id); var eb = _sender.CreateEmbed() .WithAuthor(user) .WithTitle(GetText(strs.patron_info)) .WithOkColor(); - if (quotaStats.Count == 0 || maybePatron is not { } patron) + if (quotaStats.Commands.Count == 0 + && quotaStats.Groups.Count == 0 + && quotaStats.Modules.Count == 0) { eb.WithDescription(GetText(strs.no_quota_found)); } @@ -96,9 +97,26 @@ public partial class Help eb.AddField(GetText(strs.quotas), "⁣", false); - var text = GetQuotaList(quotaStats); - if (!string.IsNullOrWhiteSpace(text)) - eb.AddField(GetText(strs.modules), text, true); + if (quotaStats.Commands.Count > 0) + { + var text = GetQuotaList(quotaStats.Commands); + if (!string.IsNullOrWhiteSpace(text)) + eb.AddField(GetText(strs.commands), text, true); + } + + if (quotaStats.Groups.Count > 0) + { + var text = GetQuotaList(quotaStats.Groups); + if (!string.IsNullOrWhiteSpace(text)) + eb.AddField(GetText(strs.groups), text, true); + } + + if (quotaStats.Modules.Count > 0) + { + var text = GetQuotaList(quotaStats.Modules); + if (!string.IsNullOrWhiteSpace(text)) + eb.AddField(GetText(strs.modules), text, true); + } } @@ -113,28 +131,26 @@ public partial class Help } } - private string GetQuotaList( - IReadOnlyDictionary featureQuotaStats) + private string GetQuotaList(IReadOnlyDictionary featureQuotaStats) { var text = string.Empty; - foreach (var (key, (cur, quota)) in featureQuotaStats) + foreach (var (key, q) in featureQuotaStats) { text += $"\n⁣\t`{key}`\n"; - if (quota.QuotaPeriod == QuotaPer.PerHour) - text += $"⁣ ⁣ {cur}/{(quota.Quota == -1 ? "∞" : quota.Quota)} {QuotaPeriodToString(quota.QuotaPeriod)}\n"; + if (q.Hourly != default) + text += $"⁣ ⁣ {GetEmoji(q.Hourly)} {q.Hourly.Cur}/{q.Hourly.Max} per hour\n"; + if (q.Daily != default) + text += $"⁣ ⁣ {GetEmoji(q.Daily)} {q.Daily.Cur}/{q.Daily.Max} per day\n"; + if (q.Monthly != default) + text += $"⁣ ⁣ {GetEmoji(q.Monthly)} {q.Monthly.Cur}/{q.Monthly.Max} per month\n"; } return text; } - public string QuotaPeriodToString(QuotaPer per) - => per switch - { - QuotaPer.PerHour => "per hour", - QuotaPer.PerDay => "per day", - QuotaPer.PerMonth => "per month", - QuotaPer.Total => "total", - _ => throw new ArgumentOutOfRangeException(nameof(per), per, null) - }; + private string GetEmoji((uint Cur, uint Max) limit) + => limit.Cur < limit.Max + ? "✅" + : "⚠️"; } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Patronage/PatronageService.cs b/src/EllieBot/Modules/Patronage/PatronageService.cs index 17e418c..3d5f62c 100644 --- a/src/EllieBot/Modules/Patronage/PatronageService.cs +++ b/src/EllieBot/Modules/Patronage/PatronageService.cs @@ -2,6 +2,9 @@ using LinqToDB.EntityFrameworkCore; using EllieBot.Common.ModuleBehaviors; using EllieBot.Db.Models; +using OneOf; +using OneOf.Types; +using CommandInfo = Discord.Commands.CommandInfo; namespace EllieBot.Modules.Patronage; @@ -9,6 +12,7 @@ namespace EllieBot.Modules.Patronage; public sealed class PatronageService : IPatronageService, IReadyExecutor, + IExecPreCommand, IEService { public event Func OnNewPatronPayment = static delegate { return Task.CompletedTask; }; @@ -19,11 +23,16 @@ public sealed class PatronageService public int Priority => int.MinValue; + private static readonly PatronTier[] _tiers = Enum.GetValues(); + private readonly PatronageConfig _pConf; private readonly DbService _db; private readonly DiscordSocketClient _client; private readonly ISubscriptionHandler _subsHandler; + private static readonly TypedKey _quotaKey + = new($"quota:last_hourly_reset"); + private readonly IBotCache _cache; private readonly IBotCredsProvider _creds; private readonly IMessageSenderService _sender; @@ -51,7 +60,7 @@ public sealed class PatronageService if (_client.ShardId != 0) return Task.CompletedTask; - return Task.WhenAll(LoadSubscribersLoopAsync()); + return Task.WhenAll(ResetLoopAsync(), LoadSubscribersLoopAsync()); } private async Task LoadSubscribersLoopAsync() @@ -76,6 +85,71 @@ public sealed class PatronageService } } + public async Task ResetLoopAsync() + { + await Task.Delay(1.Minutes()); + while (true) + { + try + { + if (!_pConf.Data.IsEnabled) + { + await Task.Delay(1.Minutes()); + continue; + } + + var now = DateTime.UtcNow; + var lastRun = DateTime.MinValue; + + var result = await _cache.GetAsync(_quotaKey); + if (result.TryGetValue(out var lastVal) && lastVal != default) + { + lastRun = DateTime.FromBinary(lastVal); + } + + var nowDate = now.ToDateOnly(); + var lastDate = lastRun.ToDateOnly(); + + await using var ctx = _db.GetDbContext(); + + if ((lastDate.Day == 1 || (lastDate.Month != nowDate.Month)) && nowDate.Day > 1) + { + // assumes bot won't be offline for a year + await ctx.GetTable() + .TruncateAsync(); + } + else if (nowDate.DayNumber != lastDate.DayNumber) + { + // day is different, means hour is different. + // reset both hourly and daily quota counts. + await ctx.GetTable() + .UpdateAsync((old) => new() + { + HourlyCount = 0, + DailyCount = 0, + }); + } + else if (now.Hour != lastRun.Hour) // if it's not, just reset hourly quotas + { + await ctx.GetTable() + .UpdateAsync((old) => new() + { + HourlyCount = 0 + }); + } + + // assumes that the code above runs in less than an hour + await _cache.AddAsync(_quotaKey, now.ToBinary()); + } + catch (Exception ex) + { + Log.Error(ex, "Error in quota reset loop. Message: {ErrorMessage}", ex.Message); + } + + await Task.Delay(TimeSpan.FromHours(1).Add(TimeSpan.FromMinutes(1))); + } + } + private async Task ProcesssPatronsAsync(IReadOnlyCollection subscribersEnum) { // process only users who have discord accounts connected @@ -128,27 +202,27 @@ public sealed class PatronageService // user is charged again for this month // if his sub would end in teh future, extend it by one month. // if it's not, just add 1 month to the last charge date - await ctx.GetTable() - .Where(x => x.UniquePlatformUserId - == subscriber.UniquePlatformUserId) - .UpdateAsync(old => new() - { - UserId = subscriber.UserId, - AmountCents = subscriber.Cents, - LastCharge = lastChargeUtc, - ValidThru = old.ValidThru >= todayDate - // ? Sql.DateAdd(Sql.DateParts.Month, 1, old.ValidThru).Value - ? old.ValidThru.AddMonths(1) - : dateInOneMonth, - }); + var count = await ctx.GetTable() + .Where(x => x.UniquePlatformUserId == subscriber.UniquePlatformUserId) + .UpdateAsync(old => new() + { + UserId = subscriber.UserId, + AmountCents = subscriber.Cents, + LastCharge = lastChargeUtc, + ValidThru = old.ValidThru >= todayDate + // ? Sql.DateAdd(Sql.DateParts.Month, 1, old.ValidThru).Value + ? old.ValidThru.AddMonths(1) + : dateInOneMonth, + }); + // this should never happen + if (count == 0) + { + // await tran.RollbackAsync(); + continue; + } - dbPatron.UserId = subscriber.UserId; - dbPatron.AmountCents = subscriber.Cents; - dbPatron.LastCharge = lastChargeUtc; - dbPatron.ValidThru = dbPatron.ValidThru >= todayDate - ? dbPatron.ValidThru.AddMonths(1) - : dateInOneMonth; + // await tran.CommitAsync(); await OnNewPatronPayment(PatronUserToPatron(dbPatron)); } @@ -210,7 +284,313 @@ public sealed class PatronageService } } - public async Task GetPatronAsync(ulong userId) + public async Task ExecPreCommandAsync( + ICommandContext ctx, + string moduleName, + CommandInfo command) + { + var ownerId = ctx.Guild?.OwnerId ?? 0; + + var result = await AttemptRunCommand( + ctx.User.Id, + ownerId: ownerId, + command.Aliases.First().ToLowerInvariant(), + command.Module.Parent == null ? string.Empty : command.Module.GetGroupName().ToLowerInvariant(), + moduleName.ToLowerInvariant() + ); + + return result.Match( + _ => false, + ins => + { + var eb = _sender.CreateEmbed() + .WithPendingColor() + .WithTitle("Insufficient Patron Tier") + .AddField("For", $"{ins.FeatureType}: `{ins.Feature}`", true) + .AddField("Required Tier", + $"[{ins.RequiredTier.ToFullName()}](https://patreon.com/join/elliebot)", + true); + + if (ctx.Guild is null || ctx.Guild?.OwnerId == ctx.User.Id) + eb.WithDescription("You don't have the sufficent Patron Tier to run this command.") + .WithFooter("You can use '.patron' and '.donate' commands for more info"); + else + eb.WithDescription( + "Neither you nor the server owner have the sufficent Patron Tier to run this command.") + .WithFooter("You can use '.patron' and '.donate' commands for more info"); + + _ = ctx.WarningAsync(); + + if (ctx.Guild?.OwnerId == ctx.User.Id) + _ = _sender.Response(ctx) + .Context(ctx) + .Embed(eb) + .SendAsync(); + else + _ = _sender.Response(ctx).User(ctx.User).Embed(eb).SendAsync(); + + return true; + }, + quota => + { + var eb = _sender.CreateEmbed() + .WithPendingColor() + .WithTitle("Quota Limit Reached"); + + if (quota.IsOwnQuota || ctx.User.Id == ownerId) + { + eb.WithDescription($"You've reached your quota of `{quota.Quota} {quota.QuotaPeriod.ToFullName()}`") + .WithFooter("You may want to check your quota by using the '.patron' command."); + } + else + { + eb.WithDescription( + $"This server reached the quota of {quota.Quota} `{quota.QuotaPeriod.ToFullName()}`") + .WithFooter("You may contact the server owner about this issue.\n" + + "Alternatively, you can become patron yourself by using the '.donate' command.\n" + + "If you're already a patron, it means you've reached your quota.\n" + + "You can use '.patron' command to check your quota status."); + } + + eb.AddField("For", $"{quota.FeatureType}: `{quota.Feature}`", true) + .AddField("Resets At", quota.ResetsAt.ToShortAndRelativeTimestampTag(), true); + + _ = ctx.WarningAsync(); + + // send the message in the server in case it's the owner + if (ctx.Guild?.OwnerId == ctx.User.Id) + _ = _sender.Response(ctx) + .Embed(eb) + .SendAsync(); + else + _ = _sender.Response(ctx).User(ctx.User).Embed(eb).SendAsync(); + + return true; + }); + } + + private async ValueTask> AttemptRunCommand( + ulong userId, + ulong ownerId, + string commandName, + string groupName, + string moduleName) + { + // try to run as a user + var res = await AttemptRunCommand(userId, commandName, groupName, moduleName, true); + + // if it fails, try to run as an owner + // but only if the command is ran in a server + // and if the owner is not the user + if (!res.IsT0 && ownerId != 0 && ownerId != userId) + res = await AttemptRunCommand(ownerId, commandName, groupName, moduleName, false); + + return res; + } + + /// + /// Returns either the current usage counter if limit wasn't reached, or QuotaLimit if it is. + /// + public async ValueTask> TryIncrementQuotaCounterAsync( + ulong userId, + bool isSelf, + FeatureType featureType, + string featureName, + uint? maybeHourly, + uint? maybeDaily, + uint? maybeMonthly) + { + await using var ctx = _db.GetDbContext(); + + var now = DateTime.UtcNow; + await using var tran = await ctx.Database.BeginTransactionAsync(); + + var userQuotaData = await ctx.GetTable() + .FirstOrDefaultAsyncLinqToDB(x => x.UserId == userId + && x.Feature == featureName) + ?? new PatronQuota(); + + // if hourly exists, if daily exists, etc... + if (maybeHourly is uint hourly && userQuotaData.HourlyCount >= hourly) + { + return new QuotaLimit() + { + QuotaPeriod = QuotaPer.PerHour, + Quota = hourly, + // quite a neat trick. https://stackoverflow.com/a/5733560 + ResetsAt = now.Date.AddHours(now.Hour + 1), + Feature = featureName, + FeatureType = featureType, + IsOwnQuota = isSelf + }; + } + + if (maybeDaily is uint daily + && userQuotaData.DailyCount >= daily) + { + return new QuotaLimit() + { + QuotaPeriod = QuotaPer.PerDay, + Quota = daily, + ResetsAt = now.Date.AddDays(1), + Feature = featureName, + FeatureType = featureType, + IsOwnQuota = isSelf + }; + } + + if (maybeMonthly is uint monthly && userQuotaData.MonthlyCount >= monthly) + { + return new QuotaLimit() + { + QuotaPeriod = QuotaPer.PerMonth, + Quota = monthly, + ResetsAt = now.Date.SecondOfNextMonth(), + Feature = featureName, + FeatureType = featureType, + IsOwnQuota = isSelf + }; + } + + await ctx.GetTable() + .InsertOrUpdateAsync(() => new() + { + UserId = userId, + FeatureType = featureType, + Feature = featureName, + DailyCount = 1, + MonthlyCount = 1, + HourlyCount = 1, + }, + (old) => new() + { + HourlyCount = old.HourlyCount + 1, + DailyCount = old.DailyCount + 1, + MonthlyCount = old.MonthlyCount + 1, + }, + () => new() + { + UserId = userId, + FeatureType = featureType, + Feature = featureName, + }); + + await tran.CommitAsync(); + + return (userQuotaData.HourlyCount + 1, userQuotaData.DailyCount + 1, userQuotaData.MonthlyCount + 1); + } + + /// + /// Attempts to add 1 to user's quota for the command, group and module. + /// Input MUST BE lowercase + /// + /// Id of the user who is attempting to run the command + /// Name of the command the user is trying to run + /// Name of the command's group + /// Name of the command's top level module + /// Whether this is check is for the user himself. False if it's someone else's id (owner) + /// Either a succcess (user can run the command) or one of the error values. + private async ValueTask> AttemptRunCommand( + ulong userId, + string commandName, + string groupName, + string moduleName, + bool isSelf) + { + var confData = _pConf.Data; + + if (!confData.IsEnabled) + return default; + + if (_creds.GetCreds().IsOwner(userId)) + return default; + + // get user tier + var patron = await GetPatronAsync(userId); + FeatureType quotaForFeatureType; + + if (confData.Quotas.Commands.TryGetValue(commandName, out var quotaData)) + { + quotaForFeatureType = FeatureType.Command; + } + else if (confData.Quotas.Groups.TryGetValue(groupName, out quotaData)) + { + quotaForFeatureType = FeatureType.Group; + } + else if (confData.Quotas.Modules.TryGetValue(moduleName, out quotaData)) + { + quotaForFeatureType = FeatureType.Module; + } + else + { + return default; + } + + var featureName = quotaForFeatureType switch + { + FeatureType.Command => commandName, + FeatureType.Group => groupName, + FeatureType.Module => moduleName, + _ => throw new ArgumentOutOfRangeException(nameof(quotaForFeatureType)) + }; + + if (!TryGetTierDataOrLower(quotaData, patron.Tier, out var data)) + { + return new InsufficientTier() + { + Feature = featureName, + FeatureType = quotaForFeatureType, + RequiredTier = quotaData.Count == 0 + ? PatronTier.ComingSoon + : quotaData.Keys.First(), + UserTier = patron.Tier, + }; + } + + // no quota limits for this tier + if (data is null) + return default; + + var quotaCheckResult = await TryIncrementQuotaCounterAsync(userId, + isSelf, + quotaForFeatureType, + featureName, + data.TryGetValue(QuotaPer.PerHour, out var hourly) ? hourly : null, + data.TryGetValue(QuotaPer.PerDay, out var daily) ? daily : null, + data.TryGetValue(QuotaPer.PerMonth, out var monthly) ? monthly : null + ); + + return quotaCheckResult.Match>( + _ => new Success(), + x => x); + } + + private bool TryGetTierDataOrLower( + IReadOnlyDictionary data, + PatronTier tier, + out T? o) + { + // check for quotas on this tier + if (data.TryGetValue(tier, out o)) + return true; + + // if there are none, get the quota first tier below this one + // which has quotas specified + for (var i = _tiers.Length - 1; i >= 0; i--) + { + var lowerTier = _tiers[i]; + if (lowerTier < tier && data.TryGetValue(lowerTier, out o)) + return true; + } + + // if there are none, that means the feature is intended + // to be patron-only but the quotas haven't been specified yet + // so it will be marked as "Coming Soon" + o = default; + return false; + } + + public async Task GetPatronAsync(ulong userId) { await using var ctx = _db.GetDbContext(); @@ -236,135 +616,128 @@ public sealed class PatronageService return PatronUserToPatron(max); } - public async Task LimitHitAsync(LimitedFeatureName key, ulong userId, int amount = 1) + public async Task GetUserQuotaStatistic(ulong userId) { - if (_creds.GetCreds().IsOwner(userId)) - return true; + var pConfData = _pConf.Data; - if (!_pConf.Data.IsEnabled) - return true; + if (!pConfData.IsEnabled) + return new(); - var userLimit = await GetUserLimit(key, userId); + var patron = await GetPatronAsync(userId); - if (userLimit.Quota == 0) - return false; + await using var ctx = _db.GetDbContext(); + var allPatronQuotas = await ctx.GetTable() + .Where(x => x.UserId == userId) + .ToListAsync(); - if (userLimit.Quota == -1) - return true; + var allQuotasDict = allPatronQuotas + .GroupBy(static x => x.FeatureType) + .ToDictionary(static x => x.Key, static x => x.ToDictionary(static y => y.Feature)); - return await TryAddLimit(key, userLimit, userId, amount); - } + allQuotasDict.TryGetValue(FeatureType.Command, out var data); + var userCommandQuotaStats = GetFeatureQuotaStats(patron.Tier, data, pConfData.Quotas.Commands); - public async Task LimitForceHit(LimitedFeatureName key, ulong userId, int amount) - { - if (_creds.GetCreds().IsOwner(userId)) - return true; + allQuotasDict.TryGetValue(FeatureType.Group, out data); + var userGroupQuotaStats = GetFeatureQuotaStats(patron.Tier, data, pConfData.Quotas.Groups); - if (!_pConf.Data.IsEnabled) - return true; + allQuotasDict.TryGetValue(FeatureType.Module, out data); + var userModuleQuotaStats = GetFeatureQuotaStats(patron.Tier, data, pConfData.Quotas.Modules); - var userLimit = await GetUserLimit(key, userId); - - var cacheKey = CreateKey(key, userId); - await _cache.GetOrAddAsync(cacheKey, () => Task.FromResult(0), GetExpiry(userLimit)); - - return await TryAddLimit(key, userLimit, userId, amount); - } - - private async Task TryAddLimit( - LimitedFeatureName key, - QuotaLimit userLimit, - ulong userId, - int amount) - { - var cacheKey = CreateKey(key, userId); - var cur = await _cache.GetOrAddAsync(cacheKey, () => Task.FromResult(0), GetExpiry(userLimit)); - - if (cur + amount < userLimit.Quota) + return new UserQuotaStats() { - await _cache.AddAsync(cacheKey, cur + amount); - return true; - } - - return false; + Tier = patron.Tier, + Commands = userCommandQuotaStats, + Groups = userGroupQuotaStats, + Modules = userModuleQuotaStats, + }; } - private TimeSpan? GetExpiry(QuotaLimit userLimit) + private IReadOnlyDictionary GetFeatureQuotaStats( + PatronTier patronTier, + IReadOnlyDictionary? allQuotasDict, + Dictionary?>> commands) { - var now = DateTime.UtcNow; - switch (userLimit.QuotaPeriod) + var userCommandQuotaStats = new Dictionary(); + foreach (var (key, quotaData) in commands) { - case QuotaPer.PerHour: - return TimeSpan.FromMinutes(60 - now.Minute); - case QuotaPer.PerDay: - return TimeSpan.FromMinutes((24 * 60) - ((now.Hour * 60) + now.Minute)); - case QuotaPer.PerMonth: - var firstOfNextMonth = now.FirstOfNextMonth(); - return firstOfNextMonth - now; - default: - return null; - } - } - - private TypedKey CreateKey(LimitedFeatureName key, ulong userId) - => new($"limited_feature:{key}:{userId}"); - - private readonly QuotaLimit _emptyQuota = new QuotaLimit() - { - Quota = 0, - QuotaPeriod = QuotaPer.PerDay, - }; - - private readonly QuotaLimit _infiniteQuota = new QuotaLimit() - { - Quota = -1, - QuotaPeriod = QuotaPer.PerDay, - }; - - public async Task GetUserLimit(LimitedFeatureName name, ulong userId) - { - if (!_pConf.Data.IsEnabled) - return _infiniteQuota; - - var maybePatron = await GetPatronAsync(userId); - - if (maybePatron is not { } patron) - return _emptyQuota; - - if (patron.ValidThru < DateTime.UtcNow) - return _emptyQuota; - - foreach (var (key, value) in _pConf.Data.Limits) - { - if (patron.Amount >= key) + if (TryGetTierDataOrLower(quotaData, patronTier, out var data)) { - if (value.TryGetValue(name, out var quotaLimit)) - { - return quotaLimit; - } + // if data is null that means the quota for the user's tier is unlimited + // no point in returning it? - break; + if (data is null) + continue; + + var (daily, hourly, monthly) = default((uint, uint, uint)); + // try to get users stats for this feature + // if it fails just leave them at 0 + if (allQuotasDict?.TryGetValue(key, out var quota) ?? false) + (daily, hourly, monthly) = (quota.DailyCount, quota.HourlyCount, quota.MonthlyCount); + + userCommandQuotaStats[key] = new FeatureQuotaStats() + { + Hourly = data.TryGetValue(QuotaPer.PerHour, out var hourD) + ? (hourly, hourD) + : default, + Daily = data.TryGetValue(QuotaPer.PerDay, out var maxD) + ? (daily, maxD) + : default, + Monthly = data.TryGetValue(QuotaPer.PerMonth, out var maxM) + ? (monthly, maxM) + : default, + }; } } - return _emptyQuota; + return userCommandQuotaStats; } - public async Task> LimitStats(ulong userId) + public async Task TryGetFeatureLimitAsync(FeatureLimitKey key, ulong userId, int? defaultValue) { - var dict = new Dictionary(); - foreach (var featureName in Enum.GetValues()) + var conf = _pConf.Data; + + // if patron system is disabled, the quota is just default + if (!conf.IsEnabled) + return new() + { + Name = key.PrettyName, + Quota = defaultValue, + IsPatronLimit = false + }; + + + if (!conf.Quotas.Features.TryGetValue(key.Key, out var data)) + return new() + { + Name = key.PrettyName, + Quota = defaultValue, + IsPatronLimit = false, + }; + + var patron = await GetPatronAsync(userId); + if (!TryGetTierDataOrLower(data, patron.Tier, out var limit)) + return new() + { + Name = key.PrettyName, + Quota = 0, + IsPatronLimit = true, + }; + + return new() { - var cacheKey = CreateKey(featureName, userId); - var userLimit = await GetUserLimit(featureName, userId); - var cur = await _cache.GetOrAddAsync(cacheKey, () => Task.FromResult(0), GetExpiry(userLimit)); - - dict[featureName] = (cur, userLimit); - } - - return dict; + Name = key.PrettyName, + Quota = limit, + IsPatronLimit = true + }; } + // public async Task GiftPatronAsync(IUser user, int amount) + // { + // if (amount < 1) + // throw new ArgumentOutOfRangeException(nameof(amount)); + // + // + // } private Patron PatronUserToPatron(PatronUser user) => new Patron() @@ -394,22 +767,6 @@ public sealed class PatronageService }; } - public int PercentBonus(Patron? maybePatron) - => maybePatron is { } user && user.ValidThru > DateTime.UtcNow - ? PercentBonus(user.Amount) - : 0; - - public int PercentBonus(long amount) - => amount switch - { - >= 10_000 => 100, - >= 5000 => 50, - >= 2000 => 30, - >= 1000 => 20, - >= 500 => 10, - _ => 0 - }; - private async Task SendWelcomeMessage(Patron patron) { try @@ -419,28 +776,28 @@ public sealed class PatronageService return; var eb = _sender.CreateEmbed() - .WithOkColor() - .WithTitle("❤️ Thank you for supporting EllieBot! ❤️") - .WithDescription( - "Your donation has been processed and you will receive the rewards shortly.\n" - + "You can visit to see rewards for your tier. 🎉") - .AddField("Tier", Format.Bold(patron.Tier.ToString()), true) - .AddField("Pledge", $"**{patron.Amount / 100.0f:N1}$**", true) - .AddField("Expires", - patron.ValidThru.AddDays(1).ToShortAndRelativeTimestampTag(), - true) - .AddField("Instructions", - """ - *- Within the next **1-2 minutes** you will have all of the benefits of the Tier you've subscribed to.* - *- You can check your benefits on * - *- You can use the `.patron` command in this chat to check your current quota usage for the Patron-only commands* - *- **ALL** of the servers that you **own** will enjoy your Patron benefits.* - *- You can use any of the commands available in your tier on any server (assuming you have sufficient permissions to run those commands)* - *- Any user in any of your servers can use Patron-only commands, but they will spend **your quota**, which is why it's recommended to use Ellie's command cooldown system (.h .cmdcd) or permission system to limit the command usage for your server members.* - *- Permission guide can be found here if you're not familiar with it: * - """, - inline: false) - .WithFooter($"platform id: {patron.UniquePlatformUserId}"); + .WithOkColor() + .WithTitle("❤️ Thank you for supporting EllieBot! ❤️") + .WithDescription( + "Your donation has been processed and you will receive the rewards shortly.\n" + + "You can visit to see rewards for your tier. 🎉") + .AddField("Tier", Format.Bold(patron.Tier.ToString()), true) + .AddField("Pledge", $"**{patron.Amount / 100.0f:N1}$**", true) + .AddField("Expires", + patron.ValidThru.AddDays(1).ToShortAndRelativeTimestampTag(), + true) + .AddField("Instructions", + """ + *- Within the next **1-2 minutes** you will have all of the benefits of the Tier you've subscribed to.* + *- You can check your benefits on * + *- You can use the `.patron` command in this chat to check your current quota usage for the Patron-only commands* + *- **ALL** of the servers that you **own** will enjoy your Patron benefits.* + *- You can use any of the commands available in your tier on any server (assuming you have sufficient permissions to run those commands)* + *- Any user in any of your servers can use Patron-only commands, but they will spend **your quota**, which is why it's recommended to use Ellie's command cooldown system (.h .cmdcd) or permission system to limit the command usage for your server members.* + *- Permission guide can be found here if you're not familiar with it: * + """, + inline: false) + .WithFooter($"platform id: {patron.UniquePlatformUserId}"); await _sender.Response(user).Embed(eb).SendAsync(); } diff --git a/src/EllieBot/Modules/Permissions/Blacklist/BlacklistCommands.cs b/src/EllieBot/Modules/Permissions/Blacklist/BlacklistCommands.cs index 5ce851b..9db46fb 100644 --- a/src/EllieBot/Modules/Permissions/Blacklist/BlacklistCommands.cs +++ b/src/EllieBot/Modules/Permissions/Blacklist/BlacklistCommands.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable using EllieBot.Modules.Permissions.Services; using EllieBot.Db.Models; @@ -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); + + (_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(); + 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/Permissions/CommandCooldown/CmdCdService.cs b/src/EllieBot/Modules/Permissions/CommandCooldown/CmdCdService.cs index 55eb64d..f4ea9e8 100644 --- a/src/EllieBot/Modules/Permissions/CommandCooldown/CmdCdService.cs +++ b/src/EllieBot/Modules/Permissions/CommandCooldown/CmdCdService.cs @@ -1,5 +1,6 @@ using Microsoft.EntityFrameworkCore; using EllieBot.Common.ModuleBehaviors; +using EllieBot.Db; namespace EllieBot.Modules.Permissions.Services; @@ -32,7 +33,7 @@ public sealed class CmdCdService : IExecPreCommand, IReadyExecutor, IEService { if (guild is null) return Task.FromResult(false); - + if (!_settings.TryGetValue(guild.Id, out var cooldownSettings)) return Task.FromResult(false); @@ -81,7 +82,7 @@ public sealed class CmdCdService : IExecPreCommand, IReadyExecutor, IEService _activeCooldowns.Remove((guildId, commandName), out _); continue; } - + Cleanup(dict, cdSeconds); } } @@ -102,7 +103,7 @@ public sealed class CmdCdService : IExecPreCommand, IReadyExecutor, IEService dict.TryRemove(cmdName, out _); _activeCooldowns.TryRemove((guildId, cmdName), out _); - + using var ctx = _db.GetDbContext(); var gc = ctx.GuildConfigsForId(guildId, x => x.Include(x => x.CommandCooldowns)); gc.CommandCooldowns.RemoveWhere(x => x.CommandName == cmdName); @@ -119,7 +120,7 @@ public sealed class CmdCdService : IExecPreCommand, IReadyExecutor, IEService // force cleanup if (_activeCooldowns.TryGetValue((guildId, name), out var dict)) Cleanup(dict, secs); - + using var ctx = _db.GetDbContext(); var gc = ctx.GuildConfigsForId(guildId, x => x.Include(x => x.CommandCooldowns)); gc.CommandCooldowns.RemoveWhere(x => x.CommandName == name); diff --git a/src/EllieBot/Modules/Permissions/CommandCooldown/CmdCdsCommands.cs b/src/EllieBot/Modules/Permissions/CommandCooldown/CmdCdsCommands.cs index a9b7a13..e2c1427 100644 --- a/src/EllieBot/Modules/Permissions/CommandCooldown/CmdCdsCommands.cs +++ b/src/EllieBot/Modules/Permissions/CommandCooldown/CmdCdsCommands.cs @@ -1,6 +1,7 @@ #nullable disable using Microsoft.EntityFrameworkCore; using EllieBot.Common.TypeReaders; +using EllieBot.Db; using EllieBot.Modules.Permissions.Services; using EllieBot.Db.Models; diff --git a/src/EllieBot/Modules/Permissions/Filter/FilterCommands.cs b/src/EllieBot/Modules/Permissions/Filter/FilterCommands.cs index fab1a11..cdd3cad 100644 --- a/src/EllieBot/Modules/Permissions/Filter/FilterCommands.cs +++ b/src/EllieBot/Modules/Permissions/Filter/FilterCommands.cs @@ -1,5 +1,6 @@ #nullable disable using Microsoft.EntityFrameworkCore; +using EllieBot.Db; using EllieBot.Modules.Permissions.Services; using EllieBot.Db.Models; diff --git a/src/EllieBot/Modules/Permissions/Filter/FilterService.cs b/src/EllieBot/Modules/Permissions/Filter/FilterService.cs index dd5fbc0..9dfe01e 100644 --- a/src/EllieBot/Modules/Permissions/Filter/FilterService.cs +++ b/src/EllieBot/Modules/Permissions/Filter/FilterService.cs @@ -1,6 +1,7 @@ #nullable disable using Microsoft.EntityFrameworkCore; using EllieBot.Common.ModuleBehaviors; +using EllieBot.Db; using EllieBot.Db.Models; namespace EllieBot.Modules.Permissions.Services; @@ -170,7 +171,7 @@ public sealed class FilterService : IExecOnMessage // if user has manage messages perm, don't filter if (usrMsg.Channel is ITextChannel ch && usrMsg.Author is IGuildUser gu && gu.GetPermissions(ch).ManageMessages) return false; - + if ((InviteFilteringChannels.Contains(usrMsg.Channel.Id) || InviteFilteringServers.Contains(guild.Id)) && usrMsg.Content.IsDiscordInvite()) { @@ -206,7 +207,7 @@ public sealed class FilterService : IExecOnMessage // if user has manage messages perm, don't filter if (usrMsg.Channel is ITextChannel ch && usrMsg.Author is IGuildUser gu && gu.GetPermissions(ch).ManageMessages) return false; - + if ((LinkFilteringChannels.Contains(usrMsg.Channel.Id) || LinkFilteringServers.Contains(guild.Id)) && usrMsg.Content.TryGetUrlPath(out _)) { diff --git a/src/EllieBot/Modules/Permissions/Filter/ServerFilterSettings.cs b/src/EllieBot/Modules/Permissions/Filter/ServerFilterSettings.cs index 3c60a9f..bf8454b 100644 --- a/src/EllieBot/Modules/Permissions/Filter/ServerFilterSettings.cs +++ b/src/EllieBot/Modules/Permissions/Filter/ServerFilterSettings.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable namespace EllieBot.Modules.Permissions.Services; public readonly struct ServerFilterSettings diff --git a/src/EllieBot/Modules/Permissions/GlobalPermissions/GlobalPermissionService.cs b/src/EllieBot/Modules/Permissions/GlobalPermissions/GlobalPermissionService.cs index 42ad5d7..00dfd78 100644 --- a/src/EllieBot/Modules/Permissions/GlobalPermissions/GlobalPermissionService.cs +++ b/src/EllieBot/Modules/Permissions/GlobalPermissions/GlobalPermissionService.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable using EllieBot.Common.ModuleBehaviors; namespace EllieBot.Modules.Permissions.Services; diff --git a/src/EllieBot/Modules/Permissions/PermissionCache.cs b/src/EllieBot/Modules/Permissions/PermissionCache.cs index 75bd501..47b5983 100644 --- a/src/EllieBot/Modules/Permissions/PermissionCache.cs +++ b/src/EllieBot/Modules/Permissions/PermissionCache.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable using EllieBot.Db.Models; namespace EllieBot.Modules.Permissions.Common; diff --git a/src/EllieBot/Modules/Permissions/PermissionExtensions.cs b/src/EllieBot/Modules/Permissions/PermissionExtensions.cs index 776664e..04eee4e 100644 --- a/src/EllieBot/Modules/Permissions/PermissionExtensions.cs +++ b/src/EllieBot/Modules/Permissions/PermissionExtensions.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable using EllieBot.Db.Models; namespace EllieBot.Modules.Permissions.Common; diff --git a/src/EllieBot/Modules/Permissions/Permissions.cs b/src/EllieBot/Modules/Permissions/Permissions.cs index 5fb6fb2..90de56b 100644 --- a/src/EllieBot/Modules/Permissions/Permissions.cs +++ b/src/EllieBot/Modules/Permissions/Permissions.cs @@ -1,6 +1,7 @@ #nullable disable using EllieBot.Common.TypeReaders; using EllieBot.Common.TypeReaders.Models; +using EllieBot.Db; using EllieBot.Modules.Permissions.Common; using EllieBot.Modules.Permissions.Services; using EllieBot.Db.Models; @@ -540,4 +541,4 @@ public partial class Permissions : EllieModule else await Response().Confirm(strs.asm_disable).SendAsync(); } -} \ No newline at end of file +} diff --git a/src/EllieBot/Modules/Permissions/PermissionsCollection.cs b/src/EllieBot/Modules/Permissions/PermissionsCollection.cs index e869bc7..c2526ea 100644 --- a/src/EllieBot/Modules/Permissions/PermissionsCollection.cs +++ b/src/EllieBot/Modules/Permissions/PermissionsCollection.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable namespace EllieBot.Modules.Permissions.Common; public class PermissionsCollection : IndexedCollection diff --git a/src/EllieBot/Modules/Permissions/PermissionsService.cs b/src/EllieBot/Modules/Permissions/PermissionsService.cs index e0ac658..7bca184 100644 --- a/src/EllieBot/Modules/Permissions/PermissionsService.cs +++ b/src/EllieBot/Modules/Permissions/PermissionsService.cs @@ -1,6 +1,7 @@ #nullable disable using Microsoft.EntityFrameworkCore; using EllieBot.Common.ModuleBehaviors; +using EllieBot.Db; using EllieBot.Modules.Permissions.Common; using EllieBot.Db.Models; @@ -148,7 +149,8 @@ public class PermissionService : IExecPreCommand, IEService returnMsg = "You need Admin permissions in order to use permission commands."; if (pc.Verbose) { - try { await _sender.Response(channel).Error(returnMsg).SendAsync(); } + try + { await _sender.Response(channel).Error(returnMsg).SendAsync(); } catch { } } @@ -160,7 +162,8 @@ public class PermissionService : IExecPreCommand, IEService returnMsg = $"You need the {Format.Bold(role.Name)} role in order to use permission commands."; if (pc.Verbose) { - try { await _sender.Response(channel).Error(returnMsg).SendAsync(); } + try + { await _sender.Response(channel).Error(returnMsg).SendAsync(); } catch { } } diff --git a/src/EllieBot/Modules/Searches/Anime/AnimeSearchCommands.cs b/src/EllieBot/Modules/Searches/Anime/AnimeSearchCommands.cs index 4e95d39..8acae72 100644 --- a/src/EllieBot/Modules/Searches/Anime/AnimeSearchCommands.cs +++ b/src/EllieBot/Modules/Searches/Anime/AnimeSearchCommands.cs @@ -10,6 +10,133 @@ public partial class Searches [Group] public partial class AnimeSearchCommands : EllieModule { + // [EllieCommand, Aliases] + // public async Task Novel([Leftover] string query) + // { + // if (string.IsNullOrWhiteSpace(query)) + // return; + // + // var novelData = await _service.GetNovelData(query); + // + // if (novelData is null) + // { + // await Response().Error(strs.failed_finding_novel).SendAsync(); + // return; + // } + // + // var embed = _sender.CreateEmbed() + // .WithOkColor() + // .WithDescription(novelData.Description.Replace("
", Environment.NewLine, StringComparison.InvariantCulture)) + // .WithTitle(novelData.Title) + // .WithUrl(novelData.Link) + // .WithImageUrl(novelData.ImageUrl) + // .AddField(GetText(strs.authors), string.Join("\n", novelData.Authors), true) + // .AddField(GetText(strs.status), novelData.Status, true) + // .AddField(GetText(strs.genres), string.Join(" ", novelData.Genres.Any() ? novelData.Genres : new[] { "none" }), true) + // .WithFooter($"{GetText(strs.score)} {novelData.Score}"); + // + // await Response().Embed(embed).SendAsync(); + // } + + [Cmd] + [Priority(0)] + public async Task Mal([Leftover] string name) + { + if (string.IsNullOrWhiteSpace(name)) + return; + + var fullQueryLink = "https://myanimelist.net/profile/" + name; + + var config = Configuration.Default.WithDefaultLoader(); + using var document = await BrowsingContext.New(config).OpenAsync(fullQueryLink); + var imageElem = + document.QuerySelector( + "body > div#myanimelist > div.wrapper > div#contentWrapper > div#content > div.content-container > div.container-left > div.user-profile > div.user-image > img"); + var imageUrl = ((IHtmlImageElement)imageElem)?.Source + ?? "http://icecream.me/uploads/870b03f36b59cc16ebfe314ef2dde781.png"; + + var stats = document + .QuerySelectorAll( + "body > div#myanimelist > div.wrapper > div#contentWrapper > div#content > div.content-container > div.container-right > div#statistics > div.user-statistics-stats > div.stats > div.clearfix > ul.stats-status > li > span") + .Select(x => x.InnerHtml) + .ToList(); + + var favorites = document.QuerySelectorAll("div.user-favorites > div.di-tc"); + + var favAnime = GetText(strs.anime_no_fav); + if (favorites.Length > 0 && favorites[0].QuerySelector("p") is null) + { + favAnime = string.Join("\n", + favorites[0] + .QuerySelectorAll("ul > li > div.di-tc.va-t > a") + .Shuffle() + .Take(3) + .Select(x => + { + var elem = (IHtmlAnchorElement)x; + return $"[{elem.InnerHtml}]({elem.Href})"; + })); + } + + var info = document.QuerySelectorAll("ul.user-status:nth-child(3) > li.clearfix") + .Select(x => Tuple.Create(x.Children[0].InnerHtml, x.Children[1].InnerHtml)) + .ToList(); + + var daysAndMean = document.QuerySelectorAll("div.anime:nth-child(1) > div:nth-child(2) > div") + .Select(x => x.TextContent.Split(':').Select(y => y.Trim()).ToArray()) + .ToArray(); + + var embed = _sender.CreateEmbed() + .WithOkColor() + .WithTitle(GetText(strs.mal_profile(name))) + .AddField("💚 " + GetText(strs.watching), stats[0], true) + .AddField("💙 " + GetText(strs.completed), stats[1], true); + if (info.Count < 3) + embed.AddField("💛 " + GetText(strs.on_hold), stats[2], true); + embed.AddField("💔 " + GetText(strs.dropped), stats[3], true) + .AddField("⚪ " + GetText(strs.plan_to_watch), stats[4], true) + .AddField("🕐 " + daysAndMean[0][0], daysAndMean[0][1], true) + .AddField("📊 " + daysAndMean[1][0], daysAndMean[1][1], true) + .AddField(MalInfoToEmoji(info[0].Item1) + " " + info[0].Item1, info[0].Item2.TrimTo(20), true) + .AddField(MalInfoToEmoji(info[1].Item1) + " " + info[1].Item1, info[1].Item2.TrimTo(20), true); + if (info.Count > 2) + embed.AddField(MalInfoToEmoji(info[2].Item1) + " " + info[2].Item1, info[2].Item2.TrimTo(20), true); + + embed.WithDescription($@" +** https://myanimelist.net/animelist/{name} ** + +**{GetText(strs.top_3_fav_anime)}** +{favAnime}") + .WithUrl(fullQueryLink) + .WithImageUrl(imageUrl); + + await Response().Embed(embed).SendAsync(); + } + + private static string MalInfoToEmoji(string info) + { + info = info.Trim().ToLowerInvariant(); + switch (info) + { + case "gender": + return "🚁"; + case "location": + return "🗺"; + case "last online": + return "👥"; + case "birthday": + return "📆"; + default: + return "❔"; + } + } + + [Cmd] + [RequireContext(ContextType.Guild)] + [Priority(1)] + public Task Mal(IGuildUser usr) + => Mal(usr.Username); + [Cmd] public async Task Anime([Leftover] string query) { @@ -25,19 +152,19 @@ public partial class Searches } var embed = _sender.CreateEmbed() - .WithOkColor() - .WithDescription(animeData.Synopsis.Replace("
", - Environment.NewLine, - StringComparison.InvariantCulture)) - .WithTitle(animeData.TitleEnglish) - .WithUrl(animeData.Link) - .WithImageUrl(animeData.ImageUrlLarge) - .AddField(GetText(strs.episodes), animeData.TotalEpisodes.ToString(), true) - .AddField(GetText(strs.status), animeData.AiringStatus, true) - .AddField(GetText(strs.genres), - string.Join(",\n", animeData.Genres.Any() ? animeData.Genres : ["none"]), - true) - .WithFooter($"{GetText(strs.score)} {animeData.AverageScore} / 100"); + .WithOkColor() + .WithDescription(animeData.Synopsis.Replace("
", + Environment.NewLine, + StringComparison.InvariantCulture)) + .WithTitle(animeData.TitleEnglish) + .WithUrl(animeData.Link) + .WithImageUrl(animeData.ImageUrlLarge) + .AddField(GetText(strs.episodes), animeData.TotalEpisodes.ToString(), true) + .AddField(GetText(strs.status), animeData.AiringStatus, true) + .AddField(GetText(strs.genres), + string.Join(",\n", animeData.Genres.Any() ? animeData.Genres : ["none"]), + true) + .WithFooter($"{GetText(strs.score)} {animeData.AverageScore} / 100"); await Response().Embed(embed).SendAsync(); } @@ -57,19 +184,19 @@ 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"); + .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"); 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..37353b1 100644 --- a/src/EllieBot/Modules/Searches/Crypto/CryptoCommands.cs +++ b/src/EllieBot/Modules/Searches/Crypto/CryptoCommands.cs @@ -16,12 +16,12 @@ public partial class Searches _stocksService = stocksService; _stockDrawingService = stockDrawingService; } - + [Cmd] - public async Task Stock([Leftover] string query) + public async Task Stock([Leftover]string query) { using var typing = ctx.Channel.EnterTypingState(); - + var stock = await _stocksService.GetStockDataAsync(query); if (stock is null) @@ -36,9 +36,9 @@ public partial class Searches var symbol = symbols.First(); var promptEmbed = _sender.CreateEmbed() - .WithDescription(symbol.Description) - .WithTitle(GetText(strs.did_you_mean(symbol.Symbol))); - + .WithDescription(symbol.Description) + .WithTitle(GetText(strs.did_you_mean(symbol.Symbol))); + if (!await PromptUserConfirmAsync(promptEmbed)) return; @@ -54,7 +54,7 @@ public partial class Searches var candles = await _stocksService.GetCandleDataAsync(query); var stockImageTask = _stockDrawingService.GenerateCombinedChartAsync(candles); - + var localCulture = (CultureInfo)Culture.Clone(); localCulture.NumberFormat.CurrencySymbol = "$"; @@ -64,22 +64,34 @@ public partial class Searches var change = (stock.Price - stock.Close).ToString("N2", Culture); var changePercent = (1 - (stock.Close / stock.Price)).ToString("P1", Culture); + + var sign50 = stock.Change50d >= 0 + ? "\\🔼" + : "\\🔻"; + var change50 = (stock.Change50d).ToString("P1", Culture); + + var sign200 = stock.Change200d >= 0 + ? "\\🔼" + : "\\🔻"; + + var change200 = (stock.Change200d).ToString("P1", Culture); + var price = stock.Price.ToString("C2", localCulture); var eb = _sender.CreateEmbed() - .WithOkColor() - .WithAuthor(stock.Symbol) - .WithUrl($"https://www.tradingview.com/chart/?symbol={stock.Symbol}") - .WithTitle(stock.Name) - .AddField(GetText(strs.price), $"{sign} **{price}**", true) - .AddField(GetText(strs.market_cap), stock.MarketCap, true) - .AddField(GetText(strs.volume_24h), stock.DailyVolume.ToString("C0", localCulture), true) - .AddField("Change", $"{change} ({changePercent})", true) - // .AddField("Change 50d", $"{sign50}{change50}", true) - // .AddField("Change 200d", $"{sign200}{change200}", true) - .WithFooter(stock.Exchange); - + .WithOkColor() + .WithAuthor(stock.Symbol) + .WithUrl($"https://www.tradingview.com/chart/?symbol={stock.Symbol}") + .WithTitle(stock.Name) + .AddField(GetText(strs.price), $"{sign} **{price}**", true) + .AddField(GetText(strs.market_cap), stock.MarketCap, true) + .AddField(GetText(strs.volume_24h), stock.DailyVolume.ToString("C0", localCulture), true) + .AddField("Change", $"{change} ({changePercent})", true) + // .AddField("Change 50d", $"{sign50}{change50}", true) + // .AddField("Change 200d", $"{sign200}{change200}", true) + .WithFooter(stock.Exchange); + var message = await Response().Embed(eb).SendAsync(); await using var imageData = await stockImageTask; if (imageData is null) @@ -93,12 +105,15 @@ public partial class Searches await message.ModifyAsync(mp => { mp.Attachments = - new(new[] { attachment }); + new(new[] + { + attachment + }); mp.Embed = eb.WithImageUrl($"attachment://{fileName}").Build(); }); } - + [Cmd] public async Task Crypto(string name) @@ -113,9 +128,9 @@ public partial class Searches if (nearest is not null) { var embed = _sender.CreateEmbed() - .WithTitle(GetText(strs.crypto_not_found)) - .WithDescription( - GetText(strs.did_you_mean(Format.Bold($"{nearest.Name} ({nearest.Symbol})")))); + .WithTitle(GetText(strs.crypto_not_found)) + .WithDescription( + GetText(strs.did_you_mean(Format.Bold($"{nearest.Name} ({nearest.Symbol})")))); if (await PromptUserConfirmAsync(embed)) crypto = nearest; @@ -131,7 +146,7 @@ public partial class Searches var localCulture = (CultureInfo)Culture.Clone(); localCulture.NumberFormat.CurrencySymbol = "$"; - + var sevenDay = (usd.PercentChange7d / 100).ToString("P2", localCulture); var lastDay = (usd.PercentChange24h / 100).ToString("P2", localCulture); var price = usd.Price < 0.01 @@ -144,29 +159,28 @@ public partial class Searches await using var sparkline = await _service.GetSparklineAsync(crypto.Id, usd.PercentChange7d >= 0); var fileName = $"{crypto.Slug}_7d.png"; - + var toSend = _sender.CreateEmbed() - .WithOkColor() - .WithAuthor($"#{crypto.CmcRank}") - .WithTitle($"{crypto.Name} ({crypto.Symbol})") - .WithUrl($"https://coinmarketcap.com/currencies/{crypto.Slug}/") - .WithThumbnailUrl( - $"https://s3.coinmarketcap.com/static/img/coins/128x128/{crypto.Id}.png") - .AddField(GetText(strs.market_cap), marketCap, true) - .AddField(GetText(strs.price), price, true) - .AddField(GetText(strs.volume_24h), volume, true) - .AddField(GetText(strs.change_7d_24h), $"{sevenDay} / {lastDay}", true) - .AddField(GetText(strs.market_cap_dominance), dominance, true) - .WithImageUrl($"attachment://{fileName}"); + .WithOkColor() + .WithAuthor($"#{crypto.CmcRank}") + .WithTitle($"{crypto.Name} ({crypto.Symbol})") + .WithUrl($"https://coinmarketcap.com/currencies/{crypto.Slug}/") + .WithThumbnailUrl($"https://s3.coinmarketcap.com/static/img/coins/128x128/{crypto.Id}.png") + .AddField(GetText(strs.market_cap), marketCap, true) + .AddField(GetText(strs.price), price, true) + .AddField(GetText(strs.volume_24h), volume, true) + .AddField(GetText(strs.change_7d_24h), $"{sevenDay} / {lastDay}", true) + .AddField(GetText(strs.market_cap_dominance), dominance, true) + .WithImageUrl($"attachment://{fileName}"); if (crypto.CirculatingSupply is double cs) { var csStr = cs.ToString("N0", localCulture); - + if (crypto.MaxSupply is double ms) { var perc = (cs / ms).ToString("P1", localCulture); - + toSend.AddField(GetText(strs.circulating_supply), $"{csStr} ({perc})", true); } else @@ -178,54 +192,5 @@ public partial class Searches await ctx.Channel.SendFileAsync(sparkline, fileName, embed: toSend.Build()); } - - [Cmd] - public async Task Coins(int page = 1) - { - if (--page < 0) - return; - - if (page > 25) - page = 25; - - await Response() - .Paginated() - .PageItems(async (page) => - { - var coins = await _service.GetTopCoins(page); - return coins; - }) - .PageSize(10) - .Page((items, _) => - { - var embed = _sender.CreateEmbed() - .WithOkColor(); - - if (items.Count > 0) - { - foreach (var coin in items) - { - embed.AddField($"#{coin.MarketCapRank} {coin.Symbol} - {coin.Name}", - $""" - `Price:` {GetArrowEmoji(coin.PercentChange24h)} {coin.CurrentPrice.ToShortString()}$ ({GetSign(coin.PercentChange24h)}{Math.Round(coin.PercentChange24h, 2)}%) - `MarketCap:` {coin.MarketCap.ToShortString()}$ - `Supply:` {(coin.CirculatingSupply?.ToShortString() ?? "?")} / {(coin.TotalSupply?.ToShortString() ?? "?")} - """, - inline: false); - } - } - - return embed; - }) - .CurrentPage(page) - .AddFooter(false) - .SendAsync(); - } - - private static string GetArrowEmoji(decimal value) - => value > 0 ? "▲" : "▼"; - - private static string GetSign(decimal value) - => value >= 0 ? "+" : ""; } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/Crypto/CryptoService.cs b/src/EllieBot/Modules/Searches/Crypto/CryptoService.cs index 8bfeb8d..146dac3 100644 --- a/src/EllieBot/Modules/Searches/Crypto/CryptoService.cs +++ b/src/EllieBot/Modules/Searches/Crypto/CryptoService.cs @@ -6,9 +6,9 @@ using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; using System.Globalization; using System.Net.Http.Json; -using System.Text.Json.Serialization; using System.Xml; using Color = SixLabors.ImageSharp.Color; +using StringExtensions = EllieBot.Extensions.StringExtensions; namespace EllieBot.Modules.Searches.Services; @@ -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; @@ -90,7 +90,7 @@ public class CryptoService : IEService img.Mutate(x => { - x.DrawLine(color, 2, points); + x.DrawLines(color, 2, points); }); return img; @@ -212,55 +212,4 @@ public class CryptoService : IEService var points = GetSparklinePointsFromSvgText(str); return points; } - - private static TypedKey> GetTopCoinsKey() - => new($"crypto:top_coins"); - - public async Task?> GetTopCoins(int page) - { - if (page >= 25) - page = 24; - - using var http = _httpFactory.CreateClient(); - - http.AddFakeHeaders(); - - var result = await _cache.GetOrAddAsync>(GetTopCoinsKey(), - async () => await http.GetFromJsonAsync>( - "https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=250") - ?? [], - expiry: TimeSpan.FromHours(1)); - - return result!.Skip(page * 10).Take(10).ToList(); - } -} - -public sealed class GeckoCoinsResult -{ - [JsonPropertyName("id")] - public required string Id { get; init; } - - [JsonPropertyName("name")] - public required string Name { get; init; } - - [JsonPropertyName("symbol")] - public required string Symbol { get; init; } - - [JsonPropertyName("current_price")] - public required decimal CurrentPrice { get; init; } - - [JsonPropertyName("price_change_percentage_24h")] - public required decimal PercentChange24h { get; init; } - - [JsonPropertyName("market_cap")] - public required decimal MarketCap { get; init; } - - [JsonPropertyName("circulating_supply")] - public required decimal? CirculatingSupply { get; init; } - - [JsonPropertyName("total_supply")] - public required decimal? TotalSupply { get; init; } - - [JsonPropertyName("market_cap_rank")] - public required int MarketCapRank { get; init; } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/Crypto/DefaultStockDataService.cs b/src/EllieBot/Modules/Searches/Crypto/DefaultStockDataService.cs index 9b000bd..5b5bf40 100644 --- a/src/EllieBot/Modules/Searches/Crypto/DefaultStockDataService.cs +++ b/src/EllieBot/Modules/Searches/Crypto/DefaultStockDataService.cs @@ -22,32 +22,46 @@ public sealed class DefaultStockDataService : IStockDataService, IEService using var http = _httpClientFactory.CreateClient(); + + var quoteHtmlPage = $"https://finance.yahoo.com/quote/{query.ToUpperInvariant()}"; var config = Configuration.Default.WithDefaultLoader(); using var document = await BrowsingContext.New(config).OpenAsync(quoteHtmlPage); + var divElem = + document.QuerySelector( + "#quote-header-info > div:nth-child(2) > div > div > h1"); + var tickerName = (divElem)?.TextContent; - var tickerName = document.QuerySelector("div.top > .left > .container > h1") - ?.TextContent; - - if (tickerName is null) - return default; - var marketcap = document - .QuerySelector("li > span > fin-streamer[data-field='marketCap']") + .QuerySelectorAll("table") + .Skip(1) + .First() + .QuerySelector("tbody > tr > td:nth-child(2)") ?.TextContent; - var volume = document.QuerySelector("li > span > fin-streamer[data-field='regularMarketVolume']") + var volume = document.QuerySelector("td[data-test='AVERAGE_VOLUME_3MONTH-value']") ?.TextContent; + + var close= document.QuerySelector("td[data-test='PREV_CLOSE-value']") + ?.TextContent ?? "0"; + + var price = document + .QuerySelector("#quote-header-info") + ?.QuerySelector("fin-streamer[data-field='regularMarketPrice']") + ?.TextContent ?? close; + + // var data = await http.GetFromJsonAsync( + // $"https://query1.finance.yahoo.com/v7/finance/quote?symbols={query}"); + // + // if (data is null) + // return default; - var close = document.QuerySelector("li > span > fin-streamer[data-field='regularMarketPreviousClose']") - ?.TextContent - ?? "0"; + // var symbol = data.QuoteResponse.Result.FirstOrDefault(); - var price = document.QuerySelector("fin-streamer.livePrice > span") - ?.TextContent - ?? "0"; + // if (symbol is null) + // return default; return new() { diff --git a/src/EllieBot/Modules/Searches/Crypto/Drawing/ImagesharpStockChartDrawingService.cs b/src/EllieBot/Modules/Searches/Crypto/Drawing/ImagesharpStockChartDrawingService.cs index 95aa51f..731fc78 100644 --- a/src/EllieBot/Modules/Searches/Crypto/Drawing/ImagesharpStockChartDrawingService.cs +++ b/src/EllieBot/Modules/Searches/Crypto/Drawing/ImagesharpStockChartDrawingService.cs @@ -94,7 +94,7 @@ public sealed class ImagesharpStockChartDrawingService : IStockChartDrawingServi => image.Mutate(ctx => { foreach (var data in drawData) - ctx.DrawLine(data.IsGreen + ctx.DrawLines(data.IsGreen ? _greenBrush : _redBrush, 1, @@ -128,7 +128,7 @@ public sealed class ImagesharpStockChartDrawingService : IStockChartDrawingServi { // draw guides foreach (var y in lines) - ctx.DrawLine(_lineGuideColor, 1, new PointF(0, y), new PointF(WIDTH, y)); + ctx.DrawLines(_lineGuideColor, 1, new PointF(0, y), new PointF(WIDTH, y)); // // draw min and max price on the chart // ctx.DrawText(min.ToString(CultureInfo.InvariantCulture), @@ -156,7 +156,7 @@ public sealed class ImagesharpStockChartDrawingService : IStockChartDrawingServi image.Mutate(ctx => { - ctx.DrawLine(_sparklineColor, 2, points); + ctx.DrawLines(_sparklineColor, 2, points); }); return Task.FromResult(new("png", image.ToStream())); @@ -177,7 +177,7 @@ public sealed class ImagesharpStockChartDrawingService : IStockChartDrawingServi var points = GetSparklinePointsInternal(series); image.Mutate(ctx => { - ctx.DrawLine(Color.ParseHex("00FFFFAA"), 1, points); + ctx.DrawLines(Color.ParseHex("00FFFFAA"), 1, points); }); return Task.FromResult(new("png", image.ToStream())); diff --git a/src/EllieBot/Modules/Searches/Feeds/FeedCommands.cs b/src/EllieBot/Modules/Searches/Feeds/FeedCommands.cs index 316fc73..37376f0 100644 --- a/src/EllieBot/Modules/Searches/Feeds/FeedCommands.cs +++ b/src/EllieBot/Modules/Searches/Feeds/FeedCommands.cs @@ -1,4 +1,5 @@ -using CodeHollow.FeedReader; +#nullable disable +using CodeHollow.FeedReader; using EllieBot.Modules.Searches.Services; using System.Text.RegularExpressions; @@ -16,21 +17,19 @@ public partial class Searches [RequireContext(ContextType.Guild)] [UserPerm(GuildPerm.ManageMessages)] [Priority(1)] - public Task YtUploadNotif(string url, [Leftover] string? message = null) + public Task YtUploadNotif(string url, [Leftover] string message = null) => YtUploadNotif(url, null, message); [Cmd] [RequireContext(ContextType.Guild)] [UserPerm(GuildPerm.ManageMessages)] [Priority(2)] - public Task YtUploadNotif(string url, ITextChannel? channel = null, [Leftover] string? message = null) + public Task YtUploadNotif(string url, ITextChannel channel = null, [Leftover] string message = null) { var m = _ytChannelRegex.Match(url); if (!m.Success) return Response().Error(strs.invalid_input).SendAsync(); - channel ??= ctx.Channel as ITextChannel; - if (!((IGuildUser)ctx.User).GetPermissions(channel).MentionEveryone) message = message?.SanitizeAllMentions(); @@ -43,7 +42,7 @@ public partial class Searches [RequireContext(ContextType.Guild)] [UserPerm(GuildPerm.ManageMessages)] [Priority(0)] - public Task Feed(string url, [Leftover] string? message = null) + public Task Feed(string url, [Leftover] string message = null) => Feed(url, null, message); @@ -51,7 +50,7 @@ public partial class Searches [RequireContext(ContextType.Guild)] [UserPerm(GuildPerm.ManageMessages)] [Priority(1)] - public async Task Feed(string url, ITextChannel? channel = null, [Leftover] string? message = null) + public async Task Feed(string url, ITextChannel channel = null, [Leftover] string message = null) { if (!Uri.TryCreate(url, UriKind.Absolute, out var uri) || (uri.Scheme != Uri.UriSchemeHttp && uri.Scheme != Uri.UriSchemeHttps)) @@ -60,11 +59,10 @@ public partial class Searches return; } - channel ??= (ITextChannel)ctx.Channel; - if (!((IGuildUser)ctx.User).GetPermissions(channel).MentionEveryone) message = message?.SanitizeAllMentions(); + channel ??= (ITextChannel)ctx.Channel; try { await FeedReader.ReadAsync(url); diff --git a/src/EllieBot/Modules/Searches/Feeds/FeedsService.cs b/src/EllieBot/Modules/Searches/Feeds/FeedsService.cs index d08ec0a..d19195c 100644 --- a/src/EllieBot/Modules/Searches/Feeds/FeedsService.cs +++ b/src/EllieBot/Modules/Searches/Feeds/FeedsService.cs @@ -4,6 +4,7 @@ using CodeHollow.FeedReader.Feeds; using LinqToDB; using LinqToDB.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; +using EllieBot.Db; using EllieBot.Db.Models; namespace EllieBot.Modules.Searches.Services; @@ -78,15 +79,6 @@ public class FeedsService : IEService } } - private DateTime? GetPubDate(FeedItem item) - { - if (item.PublishingDate is not null) - return item.PublishingDate; - if (item.SpecificItem is AtomFeedItem atomItem) - return atomItem.UpdatedDate; - return null; - } - public async Task TrackFeeds() { while (true) @@ -102,32 +94,24 @@ public class FeedsService : IEService { var feed = await FeedReader.ReadAsync(rssUrl); - var items = new List<(FeedItem Item, DateTime LastUpdate)>(); - foreach (var item in feed.Items) - { - var pubDate = GetPubDate(item); - - if (pubDate is null) - continue; - - items.Add((item, pubDate.Value.ToUniversalTime())); - - // show at most 3 items if you're behind - if (items.Count > 2) - break; - } - - if (items.Count == 0) - continue; + var items = feed + .Items.Select(item => (Item: item, + LastUpdate: item.PublishingDate?.ToUniversalTime() + ?? (item.SpecificItem as AtomFeedItem)?.UpdatedDate?.ToUniversalTime())) + .Where(data => data.LastUpdate is not null) + .Select(data => (data.Item, LastUpdate: (DateTime)data.LastUpdate)) + .OrderByDescending(data => data.LastUpdate) + .Reverse() // start from the oldest + .ToList(); if (!_lastPosts.TryGetValue(kvp.Key, out var lastFeedUpdate)) { - lastFeedUpdate = _lastPosts[kvp.Key] = items[0].LastUpdate; + lastFeedUpdate = _lastPosts[kvp.Key] = + items.Any() ? items[items.Count - 1].LastUpdate : DateTime.UtcNow; } - for (var index = 1; index <= items.Count; index++) + foreach (var (feedItem, itemUpdateDate) in items) { - var (feedItem, itemUpdateDate) = items[^index]; if (itemUpdateDate <= lastFeedUpdate) continue; @@ -184,26 +168,27 @@ public class FeedsService : IEService if (!string.IsNullOrWhiteSpace(feedItem.Description)) embed.WithDescription(desc.TrimTo(2048)); + //send the created embed to all subscribed channels + var feedSendTasks = kvp.Value + .Where(x => x.GuildConfig is not null) + .Select(x => + { + var ch = _client.GetGuild(x.GuildConfig.GuildId) + ?.GetTextChannel(x.ChannelId); - var tasks = new List(); + if (ch is null) + return null; - foreach (var val in kvp.Value) - { - var ch = _client.GetGuild(val.GuildConfig.GuildId).GetTextChannel(val.ChannelId); + return _sender.Response(ch) + .Embed(embed) + .Text(string.IsNullOrWhiteSpace(x.Message) + ? string.Empty + : x.Message) + .SendAsync(); + }) + .Where(x => x is not null); - if (ch is null) - continue; - - var sendTask = _sender.Response(ch) - .Embed(embed) - .Text(string.IsNullOrWhiteSpace(val.Message) - ? string.Empty - : val.Message) - .SendAsync(); - tasks.Add(sendTask); - } - - allSendTasks.Add(tasks.WhenAll()); + allSendTasks.Add(feedSendTasks.WhenAll()); // as data retrieval was successful, reset error counter ClearErrors(rssUrl); diff --git a/src/EllieBot/Modules/Searches/MemegenCommands.cs b/src/EllieBot/Modules/Searches/MemegenCommands.cs new file mode 100644 index 0000000..dbe2679 --- /dev/null +++ b/src/EllieBot/Modules/Searches/MemegenCommands.cs @@ -0,0 +1,99 @@ +#nullable disable +using Newtonsoft.Json; +using System.Collections.Immutable; +using System.Text; + +namespace EllieBot.Modules.Searches; + +public partial class Searches +{ + [Group] + public partial class MemegenCommands : EllieModule + { + private static readonly ImmutableDictionary _map = new Dictionary + { + { '?', "~q" }, + { '%', "~p" }, + { '#', "~h" }, + { '/', "~s" }, + { ' ', "-" }, + { '-', "--" }, + { '_', "__" }, + { '"', "''" } + }.ToImmutableDictionary(); + + private readonly IHttpClientFactory _httpFactory; + + public MemegenCommands(IHttpClientFactory factory) + => _httpFactory = factory; + + [Cmd] + public async Task Memelist(int page = 1) + { + if (--page < 0) + return; + + using var http = _httpFactory.CreateClient("memelist"); + using var res = await http.GetAsync("https://api.memegen.link/templates/"); + + var rawJson = await res.Content.ReadAsStringAsync(); + + var data = JsonConvert.DeserializeObject>(rawJson)!; + + await Response() + .Paginated() + .Items(data) + .PageSize(15) + .CurrentPage(page) + .Page((items, curPage) => + { + var templates = string.Empty; + foreach (var template in items) + templates += $"**{template.Name}:**\n key: `{template.Id}`\n"; + var embed = _sender.CreateEmbed().WithOkColor().WithDescription(templates); + + return embed; + }) + .SendAsync(); + } + + [Cmd] + public async Task Memegen(string meme, [Leftover] string memeText = null) + { + var memeUrl = $"http://api.memegen.link/{meme}"; + if (!string.IsNullOrWhiteSpace(memeText)) + { + var memeTextArray = memeText.Split(';'); + foreach (var text in memeTextArray) + { + var newText = Replace(text); + memeUrl += $"/{newText}"; + } + } + + memeUrl += ".png"; + await Response().Text(memeUrl).SendAsync(); + } + + private static string Replace(string input) + { + var sb = new StringBuilder(); + + foreach (var c in input) + { + if (_map.TryGetValue(c, out var tmp)) + sb.Append(tmp); + else + sb.Append(c); + } + + return sb.ToString(); + } + + private class MemegenTemplate + { + public string Name { get; set; } + public string Id { get; set; } + } + } +} \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/Osu/OsuCommands.cs b/src/EllieBot/Modules/Searches/Osu/OsuCommands.cs deleted file mode 100644 index 81f354a..0000000 --- a/src/EllieBot/Modules/Searches/Osu/OsuCommands.cs +++ /dev/null @@ -1,124 +0,0 @@ -#nullable disable -using EllieBot.Modules.Searches.Common; -using Newtonsoft.Json; - -namespace EllieBot.Modules.Searches; - -public partial class Searches -{ - [Group] - public partial class OsuCommands : EllieModule - { - private readonly IBotCreds _creds; - private readonly IHttpClientFactory _httpFactory; - - public OsuCommands(IBotCreds creds, IHttpClientFactory factory) - { - _creds = creds; - _httpFactory = factory; - } - - [Cmd] - public async Task Osu(string user, [Leftover] string mode = null) - { - if (string.IsNullOrWhiteSpace(user)) - return; - - try - { - if (string.IsNullOrWhiteSpace(_creds.OsuApiKey)) - { - await Response().Error(strs.osu_api_key).SendAsync(); - return; - } - - var obj = await _service.GetOsuData(user, mode); - if (obj is null) - { - await Response().Error(strs.osu_user_not_found).SendAsync(); - return; - } - - var userId = obj.UserId; - var smode = OsuService.ResolveGameMode(obj.ModeNumber); - - - await Response() - .Embed(_sender.CreateEmbed() - .WithOkColor() - .WithTitle($"osu! {smode} profile for {user}") - .WithThumbnailUrl($"https://a.ppy.sh/{userId}") - .WithDescription($"https://osu.ppy.sh/u/{userId}") - .AddField("Official Rank", $"#{obj.PpRank}", true) - .AddField("Country Rank", - $"#{obj.PpCountryRank} :flag_{obj.Country.ToLower()}:", - true) - .AddField("Total PP", Math.Round(obj.PpRaw, 2), true) - .AddField("Accuracy", Math.Round(obj.Accuracy, 2) + "%", true) - .AddField("Playcount", obj.Playcount, true) - .AddField("Level", Math.Round(obj.Level), true)) - .SendAsync(); - } - catch (Exception ex) - { - await Response().Error(strs.osu_failed).SendAsync(); - Log.Warning(ex, "Osu command failed"); - } - } - - [Cmd] - public async Task Gatari(string user, [Leftover] string mode = null) - { - var modeNumber = OsuService.ResolveGameMode(mode); - var modeStr = OsuService.ResolveGameMode(modeNumber); - var (userData, userStats) = await _service.GetGatariDataAsync(user, mode); - if (userStats is null) - { - await Response().Error(strs.osu_user_not_found).SendAsync(); - return; - } - - var embed = _sender.CreateEmbed() - .WithOkColor() - .WithTitle($"osu!Gatari {modeStr} profile for {user}") - .WithThumbnailUrl($"https://a.gatari.pw/{userStats.Id}") - .WithDescription($"https://osu.gatari.pw/u/{userStats.Id}") - .AddField("Official Rank", $"#{userStats.Rank}", true) - .AddField("Country Rank", - $"#{userStats.CountryRank} :flag_{userData.Country.ToLower()}:", - true) - .AddField("Total PP", userStats.Pp, true) - .AddField("Accuracy", $"{Math.Round(userStats.AvgAccuracy, 2)}%", true) - .AddField("Playcount", userStats.Playcount, true) - .AddField("Level", userStats.Level, true); - - await Response().Embed(embed).SendAsync(); - } - - [Cmd] - public async Task Osu5(string user, [Leftover] string mode = null) - { - if (string.IsNullOrWhiteSpace(_creds.OsuApiKey)) - { - await Response().Error("An osu! API key is required.").SendAsync(); - return; - } - - if (string.IsNullOrWhiteSpace(user)) - { - 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) - eb.AddField(title, desc); - - await Response().Embed(eb).SendAsync(); - } - } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/Osu/OsuService.cs b/src/EllieBot/Modules/Searches/Osu/OsuService.cs deleted file mode 100644 index 9bdb319..0000000 --- a/src/EllieBot/Modules/Searches/Osu/OsuService.cs +++ /dev/null @@ -1,227 +0,0 @@ -#nullable disable -using EllieBot.Modules.Searches.Common; -using Newtonsoft.Json; - -namespace EllieBot.Modules.Searches; - -public sealed class OsuService : IEService -{ - private readonly IHttpClientFactory _httpFactory; - private readonly IBotCreds _creds; - - public OsuService(IHttpClientFactory httpFactory, IBotCreds creds) - { - _httpFactory = httpFactory; - _creds = creds; - } - - public async Task GetOsuData(string username, string mode) - { - using var http = _httpFactory.CreateClient(); - - var modeNumber = string.IsNullOrWhiteSpace(mode) ? 0 : ResolveGameMode(mode); - var userReq = $"https://osu.ppy.sh/api/get_user?k={_creds.OsuApiKey}&u={username}&m={modeNumber}"; - var userResString = await http.GetStringAsync(userReq); - - if (string.IsNullOrWhiteSpace(userResString)) - return null; - var objs = JsonConvert.DeserializeObject>(userResString); - - if (objs.Count == 0) - { - return null; - } - - var obj = objs[0]; - - obj.ModeNumber = modeNumber; - return obj; - } - - public static int ResolveGameMode(string mode) - { - switch (mode?.ToUpperInvariant()) - { - case "STD": - case "STANDARD": - return 0; - case "TAIKO": - return 1; - case "CTB": - case "CATCHTHEBEAT": - return 2; - case "MANIA": - case "OSU!MANIA": - return 3; - default: - return 0; - } - } - - public static string ResolveGameMode(int mode) - { - switch (mode) - { - case 0: - return "Standard"; - case 1: - return "Taiko"; - case 2: - return "Catch"; - case 3: - return "Mania"; - default: - return "Standard"; - } - } - - public async Task<(GatariUserData userData, GatariUserStats userStats)> GetGatariDataAsync( - string user, - string mode) - { - using var http = _httpFactory.CreateClient(); - var modeNumber = string.IsNullOrWhiteSpace(mode) ? 0 : ResolveGameMode(mode); - - var resString = await http.GetStringAsync($"https://api.gatari.pw/user/stats?u={user}&mode={modeNumber}"); - - var statsResponse = JsonConvert.DeserializeObject(resString); - if (statsResponse.Code != 200 || statsResponse.Stats.Id == 0) - { - return default; - } - - var usrResString = await http.GetStringAsync($"https://api.gatari.pw/users/get?u={user}"); - - var userData = JsonConvert.DeserializeObject(usrResString).Users[0]; - var userStats = statsResponse.Stats; - - return (userData, userStats); - } - - public async Task<(string title, string desc)[]> GetOsuPlay(string user, string mode) - { - using var http = _httpFactory.CreateClient(); - var m = 0; - if (!string.IsNullOrWhiteSpace(mode)) - m = OsuService.ResolveGameMode(mode); - - var reqString = "https://osu.ppy.sh/api/get_user_best" - + $"?k={_creds.OsuApiKey}" - + $"&u={Uri.EscapeDataString(user)}" - + "&type=string" - + "&limit=5" - + $"&m={m}"; - - var resString = await http.GetStringAsync(reqString); - var obj = JsonConvert.DeserializeObject>(resString); - - var mapTasks = obj.Select(async item => - { - var mapReqString = "https://osu.ppy.sh/api/get_beatmaps" - + $"?k={_creds.OsuApiKey}" - + $"&b={item.BeatmapId}"; - - var mapResString = await http.GetStringAsync(mapReqString); - var map = JsonConvert.DeserializeObject>(mapResString).FirstOrDefault(); - if (map is null) - return default; - var pp = Math.Round(item.Pp, 2); - var acc = CalculateAcc(item, m); - var mods = ResolveMods(item.EnabledMods); - - var title = $"{map.Artist}-{map.Title} ({map.Version})"; - var desc = $@"[/b/{item.BeatmapId}](https://osu.ppy.sh/b/{item.BeatmapId}) - {pp + "pp",-7} | {acc + "%",-7} - "; - if (mods != "+") - desc += Format.Bold(mods); - - return (title, desc); - }); - - return await Task.WhenAll(mapTasks); - } - - //https://osu.ppy.sh/wiki/Accuracy - private static double CalculateAcc(OsuUserBests play, int mode) - { - double hitPoints; - double totalHits; - if (mode == 0) - { - hitPoints = (play.Count50 * 50) + (play.Count100 * 100) + (play.Count300 * 300); - totalHits = play.Count50 + play.Count100 + play.Count300 + play.Countmiss; - totalHits *= 300; - } - else if (mode == 1) - { - hitPoints = (play.Countmiss * 0) + (play.Count100 * 0.5) + play.Count300; - totalHits = (play.Countmiss + play.Count100 + play.Count300) * 300; - hitPoints *= 300; - } - else if (mode == 2) - { - hitPoints = play.Count50 + play.Count100 + play.Count300; - totalHits = play.Countmiss + play.Count50 + play.Count100 + play.Count300 + play.Countkatu; - } - else - { - hitPoints = (play.Count50 * 50) - + (play.Count100 * 100) - + (play.Countkatu * 200) - + ((play.Count300 + play.Countgeki) * 300); - - totalHits = (play.Countmiss - + play.Count50 - + play.Count100 - + play.Countkatu - + play.Count300 - + play.Countgeki) - * 300; - } - - - return Math.Round(hitPoints / totalHits * 100, 2); - } - - - //https://github.com/ppy/osu-api/wiki#mods - private static string ResolveMods(int mods) - { - var modString = "+"; - - if (IsBitSet(mods, 0)) - modString += "NF"; - if (IsBitSet(mods, 1)) - modString += "EZ"; - if (IsBitSet(mods, 8)) - modString += "HT"; - - if (IsBitSet(mods, 3)) - modString += "HD"; - if (IsBitSet(mods, 4)) - modString += "HR"; - if (IsBitSet(mods, 6) && !IsBitSet(mods, 9)) - modString += "DT"; - if (IsBitSet(mods, 9)) - modString += "NC"; - if (IsBitSet(mods, 10)) - modString += "FL"; - - if (IsBitSet(mods, 5)) - modString += "SD"; - if (IsBitSet(mods, 14)) - modString += "PF"; - - if (IsBitSet(mods, 7)) - modString += "RX"; - if (IsBitSet(mods, 11)) - modString += "AT"; - if (IsBitSet(mods, 12)) - modString += "SO"; - return modString; - } - - private static bool IsBitSet(int mods, int pos) - => (mods & (1 << pos)) != 0; -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/OsuCommands.cs b/src/EllieBot/Modules/Searches/OsuCommands.cs new file mode 100644 index 0000000..599df2d --- /dev/null +++ b/src/EllieBot/Modules/Searches/OsuCommands.cs @@ -0,0 +1,297 @@ +#nullable disable +using EllieBot.Modules.Searches.Common; +using Newtonsoft.Json; + +namespace EllieBot.Modules.Searches; + +public partial class Searches +{ + [Group] + public partial class OsuCommands : EllieModule + { + private readonly IBotCredentials _creds; + private readonly IHttpClientFactory _httpFactory; + + public OsuCommands(IBotCredentials creds, IHttpClientFactory factory) + { + _creds = creds; + _httpFactory = factory; + } + + [Cmd] + public async Task Osu(string user, [Leftover] string mode = null) + { + if (string.IsNullOrWhiteSpace(user)) + return; + + using var http = _httpFactory.CreateClient(); + var modeNumber = string.IsNullOrWhiteSpace(mode) ? 0 : ResolveGameMode(mode); + + try + { + if (string.IsNullOrWhiteSpace(_creds.OsuApiKey)) + { + await Response().Error(strs.osu_api_key).SendAsync(); + return; + } + + var smode = ResolveGameMode(modeNumber); + var userReq = $"https://osu.ppy.sh/api/get_user?k={_creds.OsuApiKey}&u={user}&m={modeNumber}"; + var userResString = await http.GetStringAsync(userReq); + var objs = JsonConvert.DeserializeObject>(userResString); + + if (objs.Count == 0) + { + await Response().Error(strs.osu_user_not_found).SendAsync(); + return; + } + + var obj = objs[0]; + var userId = obj.UserId; + + await Response().Embed(_sender.CreateEmbed() + .WithOkColor() + .WithTitle($"osu! {smode} profile for {user}") + .WithThumbnailUrl($"https://a.ppy.sh/{userId}") + .WithDescription($"https://osu.ppy.sh/u/{userId}") + .AddField("Official Rank", $"#{obj.PpRank}", true) + .AddField("Country Rank", + $"#{obj.PpCountryRank} :flag_{obj.Country.ToLower()}:", + true) + .AddField("Total PP", Math.Round(obj.PpRaw, 2), true) + .AddField("Accuracy", Math.Round(obj.Accuracy, 2) + "%", true) + .AddField("Playcount", obj.Playcount, true) + .AddField("Level", Math.Round(obj.Level), true)).SendAsync(); + } + catch (ArgumentOutOfRangeException) + { + await Response().Error(strs.osu_user_not_found).SendAsync(); + } + catch (Exception ex) + { + await Response().Error(strs.osu_failed).SendAsync(); + Log.Warning(ex, "Osu command failed"); + } + } + + [Cmd] + public async Task Gatari(string user, [Leftover] string mode = null) + { + using var http = _httpFactory.CreateClient(); + var modeNumber = string.IsNullOrWhiteSpace(mode) ? 0 : ResolveGameMode(mode); + + var modeStr = ResolveGameMode(modeNumber); + var resString = await http.GetStringAsync($"https://api.gatari.pw/user/stats?u={user}&mode={modeNumber}"); + + var statsResponse = JsonConvert.DeserializeObject(resString); + if (statsResponse.Code != 200 || statsResponse.Stats.Id == 0) + { + await Response().Error(strs.osu_user_not_found).SendAsync(); + return; + } + + var usrResString = await http.GetStringAsync($"https://api.gatari.pw/users/get?u={user}"); + + var userData = JsonConvert.DeserializeObject(usrResString).Users[0]; + var userStats = statsResponse.Stats; + + var embed = _sender.CreateEmbed() + .WithOkColor() + .WithTitle($"osu!Gatari {modeStr} profile for {user}") + .WithThumbnailUrl($"https://a.gatari.pw/{userStats.Id}") + .WithDescription($"https://osu.gatari.pw/u/{userStats.Id}") + .AddField("Official Rank", $"#{userStats.Rank}", true) + .AddField("Country Rank", + $"#{userStats.CountryRank} :flag_{userData.Country.ToLower()}:", + true) + .AddField("Total PP", userStats.Pp, true) + .AddField("Accuracy", $"{Math.Round(userStats.AvgAccuracy, 2)}%", true) + .AddField("Playcount", userStats.Playcount, true) + .AddField("Level", userStats.Level, true); + + await Response().Embed(embed).SendAsync(); + } + + [Cmd] + public async Task Osu5(string user, [Leftover] string mode = null) + { + if (string.IsNullOrWhiteSpace(_creds.OsuApiKey)) + { + await Response().Error("An osu! API key is required.").SendAsync(); + return; + } + + if (string.IsNullOrWhiteSpace(user)) + { + await Response().Error("Please provide a username.").SendAsync(); + return; + } + + using var http = _httpFactory.CreateClient(); + var m = 0; + if (!string.IsNullOrWhiteSpace(mode)) + m = ResolveGameMode(mode); + + var reqString = "https://osu.ppy.sh/api/get_user_best" + + $"?k={_creds.OsuApiKey}" + + $"&u={Uri.EscapeDataString(user)}" + + "&type=string" + + "&limit=5" + + $"&m={m}"; + + var resString = await http.GetStringAsync(reqString); + var obj = JsonConvert.DeserializeObject>(resString); + + var mapTasks = obj.Select(async item => + { + var mapReqString = "https://osu.ppy.sh/api/get_beatmaps" + + $"?k={_creds.OsuApiKey}" + + $"&b={item.BeatmapId}"; + + var mapResString = await http.GetStringAsync(mapReqString); + var map = JsonConvert.DeserializeObject>(mapResString).FirstOrDefault(); + if (map is null) + return default; + var pp = Math.Round(item.Pp, 2); + var acc = CalculateAcc(item, m); + var mods = ResolveMods(item.EnabledMods); + + var title = $"{map.Artist}-{map.Title} ({map.Version})"; + var desc = $@"[/b/{item.BeatmapId}](https://osu.ppy.sh/b/{item.BeatmapId}) +{pp + "pp",-7} | {acc + "%",-7} +"; + if (mods != "+") + desc += Format.Bold(mods); + + return (title, desc); + }); + + var eb = _sender.CreateEmbed().WithOkColor().WithTitle($"Top 5 plays for {user}"); + + var mapData = await mapTasks.WhenAll(); + foreach (var (title, desc) in mapData.Where(x => x != default)) + eb.AddField(title, desc); + + await Response().Embed(eb).SendAsync(); + } + + //https://osu.ppy.sh/wiki/Accuracy + private static double CalculateAcc(OsuUserBests play, int mode) + { + double hitPoints; + double totalHits; + if (mode == 0) + { + hitPoints = (play.Count50 * 50) + (play.Count100 * 100) + (play.Count300 * 300); + totalHits = play.Count50 + play.Count100 + play.Count300 + play.Countmiss; + totalHits *= 300; + } + else if (mode == 1) + { + hitPoints = (play.Countmiss * 0) + (play.Count100 * 0.5) + play.Count300; + totalHits = (play.Countmiss + play.Count100 + play.Count300) * 300; + hitPoints *= 300; + } + else if (mode == 2) + { + hitPoints = play.Count50 + play.Count100 + play.Count300; + totalHits = play.Countmiss + play.Count50 + play.Count100 + play.Count300 + play.Countkatu; + } + else + { + hitPoints = (play.Count50 * 50) + + (play.Count100 * 100) + + (play.Countkatu * 200) + + ((play.Count300 + play.Countgeki) * 300); + + totalHits = (play.Countmiss + + play.Count50 + + play.Count100 + + play.Countkatu + + play.Count300 + + play.Countgeki) + * 300; + } + + + return Math.Round(hitPoints / totalHits * 100, 2); + } + + private static int ResolveGameMode(string mode) + { + switch (mode.ToUpperInvariant()) + { + case "STD": + case "STANDARD": + return 0; + case "TAIKO": + return 1; + case "CTB": + case "CATCHTHEBEAT": + return 2; + case "MANIA": + case "OSU!MANIA": + return 3; + default: + return 0; + } + } + + private static string ResolveGameMode(int mode) + { + switch (mode) + { + case 0: + return "Standard"; + case 1: + return "Taiko"; + case 2: + return "Catch"; + case 3: + return "Mania"; + default: + return "Standard"; + } + } + + //https://github.com/ppy/osu-api/wiki#mods + private static string ResolveMods(int mods) + { + var modString = "+"; + + if (IsBitSet(mods, 0)) + modString += "NF"; + if (IsBitSet(mods, 1)) + modString += "EZ"; + if (IsBitSet(mods, 8)) + modString += "HT"; + + if (IsBitSet(mods, 3)) + modString += "HD"; + if (IsBitSet(mods, 4)) + modString += "HR"; + if (IsBitSet(mods, 6) && !IsBitSet(mods, 9)) + modString += "DT"; + if (IsBitSet(mods, 9)) + modString += "NC"; + if (IsBitSet(mods, 10)) + modString += "FL"; + + if (IsBitSet(mods, 5)) + modString += "SD"; + if (IsBitSet(mods, 14)) + modString += "PF"; + + if (IsBitSet(mods, 7)) + modString += "RX"; + if (IsBitSet(mods, 11)) + modString += "AT"; + if (IsBitSet(mods, 12)) + modString += "SO"; + return modString; + } + + private static bool IsBitSet(int mods, int pos) + => (mods & (1 << pos)) != 0; + } +} \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/PathOfExileCommands.cs b/src/EllieBot/Modules/Searches/PathOfExileCommands.cs new file mode 100644 index 0000000..a966a5b --- /dev/null +++ b/src/EllieBot/Modules/Searches/PathOfExileCommands.cs @@ -0,0 +1,312 @@ +#nullable disable +using EllieBot.Modules.Searches.Common; +using EllieBot.Modules.Searches.Services; +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; +using System.Globalization; +using System.Text; + +namespace EllieBot.Modules.Searches; + +public partial class Searches +{ + [Group] + public partial class PathOfExileCommands : EllieModule + { + private const string POE_URL = "https://www.pathofexile.com/character-window/get-characters?accountName="; + private const string PON_URL = "http://poe.ninja/api/Data/GetCurrencyOverview?league="; + private const string POGS_URL = "http://pathofexile.gamepedia.com/api.php?action=opensearch&search="; + + private const string POG_URL = + "https://pathofexile.gamepedia.com/api.php?action=browsebysubject&format=json&subject="; + + private const string POGI_URL = + "https://pathofexile.gamepedia.com/api.php?action=query&prop=imageinfo&iiprop=url&format=json&titles=File:"; + + private const string PROFILE_URL = "https://www.pathofexile.com/account/view-profile/"; + + private readonly IHttpClientFactory _httpFactory; + + private Dictionary currencyDictionary = new(StringComparer.OrdinalIgnoreCase) + { + { "Chaos Orb", "Chaos Orb" }, + { "Orb of Alchemy", "Orb of Alchemy" }, + { "Jeweller's Orb", "Jeweller's Orb" }, + { "Exalted Orb", "Exalted Orb" }, + { "Mirror of Kalandra", "Mirror of Kalandra" }, + { "Vaal Orb", "Vaal Orb" }, + { "Orb of Alteration", "Orb of Alteration" }, + { "Orb of Scouring", "Orb of Scouring" }, + { "Divine Orb", "Divine Orb" }, + { "Orb of Annulment", "Orb of Annulment" }, + { "Master Cartographer's Sextant", "Master Cartographer's Sextant" }, + { "Journeyman Cartographer's Sextant", "Journeyman Cartographer's Sextant" }, + { "Apprentice Cartographer's Sextant", "Apprentice Cartographer's Sextant" }, + { "Blessed Orb", "Blessed Orb" }, + { "Orb of Regret", "Orb of Regret" }, + { "Gemcutter's Prism", "Gemcutter's Prism" }, + { "Glassblower's Bauble", "Glassblower's Bauble" }, + { "Orb of Fusing", "Orb of Fusing" }, + { "Cartographer's Chisel", "Cartographer's Chisel" }, + { "Chromatic Orb", "Chromatic Orb" }, + { "Orb of Augmentation", "Orb of Augmentation" }, + { "Blacksmith's Whetstone", "Blacksmith's Whetstone" }, + { "Orb of Transmutation", "Orb of Transmutation" }, + { "Armourer's Scrap", "Armourer's Scrap" }, + { "Scroll of Wisdom", "Scroll of Wisdom" }, + { "Regal Orb", "Regal Orb" }, + { "Chaos", "Chaos Orb" }, + { "Alch", "Orb of Alchemy" }, + { "Alchs", "Orb of Alchemy" }, + { "Jews", "Jeweller's Orb" }, + { "Jeweller", "Jeweller's Orb" }, + { "Jewellers", "Jeweller's Orb" }, + { "Jeweller's", "Jeweller's Orb" }, + { "X", "Exalted Orb" }, + { "Ex", "Exalted Orb" }, + { "Exalt", "Exalted Orb" }, + { "Exalts", "Exalted Orb" }, + { "Mirror", "Mirror of Kalandra" }, + { "Mirrors", "Mirror of Kalandra" }, + { "Vaal", "Vaal Orb" }, + { "Alt", "Orb of Alteration" }, + { "Alts", "Orb of Alteration" }, + { "Scour", "Orb of Scouring" }, + { "Scours", "Orb of Scouring" }, + { "Divine", "Divine Orb" }, + { "Annul", "Orb of Annulment" }, + { "Annulment", "Orb of Annulment" }, + { "Master Sextant", "Master Cartographer's Sextant" }, + { "Journeyman Sextant", "Journeyman Cartographer's Sextant" }, + { "Apprentice Sextant", "Apprentice Cartographer's Sextant" }, + { "Blessed", "Blessed Orb" }, + { "Regret", "Orb of Regret" }, + { "Regrets", "Orb of Regret" }, + { "Gcp", "Gemcutter's Prism" }, + { "Glassblowers", "Glassblower's Bauble" }, + { "Glassblower's", "Glassblower's Bauble" }, + { "Fusing", "Orb of Fusing" }, + { "Fuses", "Orb of Fusing" }, + { "Fuse", "Orb of Fusing" }, + { "Chisel", "Cartographer's Chisel" }, + { "Chisels", "Cartographer's Chisel" }, + { "Chance", "Orb of Chance" }, + { "Chances", "Orb of Chance" }, + { "Chrome", "Chromatic Orb" }, + { "Chromes", "Chromatic Orb" }, + { "Aug", "Orb of Augmentation" }, + { "Augmentation", "Orb of Augmentation" }, + { "Augment", "Orb of Augmentation" }, + { "Augments", "Orb of Augmentation" }, + { "Whetstone", "Blacksmith's Whetstone" }, + { "Whetstones", "Blacksmith's Whetstone" }, + { "Transmute", "Orb of Transmutation" }, + { "Transmutes", "Orb of Transmutation" }, + { "Armourers", "Armourer's Scrap" }, + { "Armourer's", "Armourer's Scrap" }, + { "Wisdom Scroll", "Scroll of Wisdom" }, + { "Wisdom Scrolls", "Scroll of Wisdom" }, + { "Regal", "Regal Orb" }, + { "Regals", "Regal Orb" } + }; + + public PathOfExileCommands(IHttpClientFactory httpFactory) + => _httpFactory = httpFactory; + + [Cmd] + public async Task PathOfExile(string usr, string league = "", int page = 1) + { + if (--page < 0) + return; + + if (string.IsNullOrWhiteSpace(usr)) + { + await Response().Error("Please provide an account name.").SendAsync(); + return; + } + + var characters = new List(); + + try + { + using var http = _httpFactory.CreateClient(); + var res = await http.GetStringAsync($"{POE_URL}{usr}"); + characters = JsonConvert.DeserializeObject>(res); + } + catch + { + var embed = _sender.CreateEmbed().WithDescription(GetText(strs.account_not_found)).WithErrorColor(); + + await Response().Embed(embed).SendAsync(); + return; + } + + if (!string.IsNullOrWhiteSpace(league)) + characters.RemoveAll(c => c.League != league); + + await Response() + .Paginated() + .Items(characters) + .PageSize(9) + .CurrentPage(page) + .Page((items, curPage) => + { + var embed = _sender.CreateEmbed() + .WithAuthor($"Characters on {usr}'s account", + "https://web.poecdn.com/image/favicon/ogimage.png", + $"{PROFILE_URL}{usr}") + .WithOkColor(); + + if (characters.Count == 0) + return embed.WithDescription("This account has no characters."); + + var sb = new StringBuilder(); + sb.AppendLine($"```{"#",-5}{"Character Name",-23}{"League",-10}{"Class",-13}{"Level",-3}"); + for (var i = 0; i < items.Count; i++) + { + var character = items[i]; + + sb.AppendLine( + $"#{i + 1 + (curPage * 9),-4}{character.Name,-23}{ShortLeagueName(character.League),-10}{character.Class,-13}{character.Level,-3}"); + } + + sb.AppendLine("```"); + embed.WithDescription(sb.ToString()); + + return embed; + }) + .SendAsync(); + } + + [Cmd] + public async Task PathOfExileLeagues() + { + var leagues = new List(); + + try + { + using var http = _httpFactory.CreateClient(); + var res = await http.GetStringAsync("http://api.pathofexile.com/leagues?type=main&compact=1"); + leagues = JsonConvert.DeserializeObject>(res); + } + catch + { + var eembed = _sender.CreateEmbed().WithDescription(GetText(strs.leagues_not_found)).WithErrorColor(); + + await Response().Embed(eembed).SendAsync(); + return; + } + + var embed = _sender.CreateEmbed() + .WithAuthor("Path of Exile Leagues", + "https://web.poecdn.com/image/favicon/ogimage.png", + "https://www.pathofexile.com") + .WithOkColor(); + + var sb = new StringBuilder(); + sb.AppendLine($"```{"#",-5}{"League Name",-23}"); + for (var i = 0; i < leagues.Count; i++) + { + var league = leagues[i]; + + sb.AppendLine($"#{i + 1,-4}{league.Id,-23}"); + } + + sb.AppendLine("```"); + + embed.WithDescription(sb.ToString()); + + await Response().Embed(embed).SendAsync(); + } + + [Cmd] + public async Task PathOfExileCurrency( + string leagueName, + string currencyName, + string convertName = "Chaos Orb") + { + if (string.IsNullOrWhiteSpace(leagueName)) + { + await Response().Error("Please provide league name.").SendAsync(); + return; + } + + if (string.IsNullOrWhiteSpace(currencyName)) + { + await Response().Error("Please provide currency name.").SendAsync(); + return; + } + + var cleanCurrency = ShortCurrencyName(currencyName); + var cleanConvert = ShortCurrencyName(convertName); + + try + { + var res = $"{PON_URL}{leagueName}"; + using var http = _httpFactory.CreateClient(); + var obj = JObject.Parse(await http.GetStringAsync(res)); + + var chaosEquivalent = 0.0F; + var conversionEquivalent = 0.0F; + + // poe.ninja API does not include a "chaosEquivalent" property for Chaos Orbs. + if (cleanCurrency == "Chaos Orb") + chaosEquivalent = 1.0F; + else + { + var currencyInput = obj["lines"] + .Values() + .Where(i => i["currencyTypeName"].Value() == cleanCurrency) + .FirstOrDefault(); + chaosEquivalent = float.Parse(currencyInput["chaosEquivalent"].ToString(), + CultureInfo.InvariantCulture); + } + + if (cleanConvert == "Chaos Orb") + conversionEquivalent = 1.0F; + else + { + var currencyOutput = obj["lines"] + .Values() + .Where(i => i["currencyTypeName"].Value() == cleanConvert) + .FirstOrDefault(); + conversionEquivalent = float.Parse(currencyOutput["chaosEquivalent"].ToString(), + CultureInfo.InvariantCulture); + } + + var embed = _sender.CreateEmbed() + .WithAuthor($"{leagueName} Currency Exchange", + "https://web.poecdn.com/image/favicon/ogimage.png", + "http://poe.ninja") + .AddField("Currency Type", cleanCurrency, true) + .AddField($"{cleanConvert} Equivalent", chaosEquivalent / conversionEquivalent, true) + .WithOkColor(); + + await Response().Embed(embed).SendAsync(); + } + catch + { + var embed = _sender.CreateEmbed().WithDescription(GetText(strs.ninja_not_found)).WithErrorColor(); + + await Response().Embed(embed).SendAsync(); + } + } + + private string ShortCurrencyName(string str) + { + if (currencyDictionary.ContainsValue(str)) + return str; + + var currency = currencyDictionary[str]; + + return currency; + } + + private static string ShortLeagueName(string str) + { + var league = str.Replace("Hardcore", "HC", StringComparison.InvariantCultureIgnoreCase); + + return league; + } + } +} \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/Religious/Common/BibleVerse.cs b/src/EllieBot/Modules/Searches/Religious/Common/BibleVerse.cs deleted file mode 100644 index 77b74f5..0000000 --- a/src/EllieBot/Modules/Searches/Religious/Common/BibleVerse.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Text.Json.Serialization; - -namespace EllieBot.Modules.Searches; - -public class BibleVerse -{ - [JsonPropertyName("book_name")] - public required string BookName { get; set; } - - public required int Chapter { get; set; } - public required int Verse { get; set; } - public required string Text { get; set; } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/Religious/Common/BibleVerses.cs b/src/EllieBot/Modules/Searches/Religious/Common/BibleVerses.cs deleted file mode 100644 index 4e7b66d..0000000 --- a/src/EllieBot/Modules/Searches/Religious/Common/BibleVerses.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace EllieBot.Modules.Searches; - -public class BibleVerses -{ - public string? Error { get; set; } - public BibleVerse[]? Verses { get; set; } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/Religious/Common/QuranAyah.cs b/src/EllieBot/Modules/Searches/Religious/Common/QuranAyah.cs deleted file mode 100644 index 6880737..0000000 --- a/src/EllieBot/Modules/Searches/Religious/Common/QuranAyah.cs +++ /dev/null @@ -1,19 +0,0 @@ -#nullable disable -using System.Text.Json.Serialization; - -namespace EllieBot.Modules.Searches; - -public sealed class QuranAyah -{ - [JsonPropertyName("number")] - public int Number { get; set; } - - [JsonPropertyName("audio")] - public string Audio { get; set; } - - [JsonPropertyName("name")] - public string Name { get; set; } - - [JsonPropertyName("text")] - public string Text { get; set; } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/Religious/Common/QuranResponse.cs b/src/EllieBot/Modules/Searches/Religious/Common/QuranResponse.cs deleted file mode 100644 index 86bee95..0000000 --- a/src/EllieBot/Modules/Searches/Religious/Common/QuranResponse.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Text.Json.Serialization; - -namespace EllieBot.Modules.Searches; - -public sealed class QuranResponse -{ - [JsonPropertyName("code")] - public required int Code { get; set; } - - [JsonPropertyName("status")] - public required string Status { get; set; } - - [JsonPropertyName("data")] - public required T[] Data { get; set; } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/Religious/ReligiousApiService.cs b/src/EllieBot/Modules/Searches/Religious/ReligiousApiService.cs deleted file mode 100644 index ccef2b8..0000000 --- a/src/EllieBot/Modules/Searches/Religious/ReligiousApiService.cs +++ /dev/null @@ -1,62 +0,0 @@ -using OneOf; -using OneOf.Types; -using System.Net; -using System.Net.Http.Json; - -namespace EllieBot.Modules.Searches; - -public sealed class ReligiousApiService : IEService -{ - private readonly IHttpClientFactory _httpFactory; - - public ReligiousApiService(IHttpClientFactory httpFactory) - { - _httpFactory = httpFactory; - } - - public async Task>> GetBibleVerseAsync(string book, string chapterAndVerse) - { - if (string.IsNullOrWhiteSpace(book) || string.IsNullOrWhiteSpace(chapterAndVerse)) - return new Error("Invalid input."); - - - book = Uri.EscapeDataString(book); - chapterAndVerse = Uri.EscapeDataString(chapterAndVerse); - - using var http = _httpFactory.CreateClient(); - try - { - var res = await http.GetFromJsonAsync($"https://bible-api.com/{book} {chapterAndVerse}"); - - if (res is null || res.Error is not null || res.Verses is null || res.Verses.Length == 0) - { - return new Error(res?.Error ?? "No verse found."); - } - - return res.Verses[0]; - } - catch (HttpRequestException ex) when (ex.StatusCode == HttpStatusCode.NotFound) - { - return new Error("No verse found."); - } - } - - public async Task, Error>> GetQuranVerseAsync(string ayah) - { - if (string.IsNullOrWhiteSpace(ayah)) - return new Error(strs.invalid_input); - - ayah = Uri.EscapeDataString(ayah); - - using var http = _httpFactory.CreateClient(); - var res = await http.GetFromJsonAsync>( - $"https://api.alquran.cloud/v1/ayah/{ayah}/editions/en.asad,ar.alafasy"); - - if (res is null or not { Code: 200 }) - { - return new Error(strs.not_found); - } - - return res; - } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/Religious/ReligiousCommands.cs b/src/EllieBot/Modules/Searches/Religious/ReligiousCommands.cs deleted file mode 100644 index 074cff5..0000000 --- a/src/EllieBot/Modules/Searches/Religious/ReligiousCommands.cs +++ /dev/null @@ -1,60 +0,0 @@ -namespace EllieBot.Modules.Searches; - -public partial class Searches -{ - public partial class ReligiousCommands : EllieModule - { - private readonly IHttpClientFactory _httpFactory; - - public ReligiousCommands(IHttpClientFactory httpFactory) - => _httpFactory = httpFactory; - - [Cmd] - [RequireContext(ContextType.Guild)] - public async Task Bible(string book, string chapterAndVerse) - { - var res = await _service.GetBibleVerseAsync(book, chapterAndVerse); - - if (!res.TryPickT0(out var verse, out var error)) - { - await Response().Error(error.Value).SendAsync(); - return; - } - - await Response() - .Embed(_sender.CreateEmbed() - .WithOkColor() - .WithTitle($"{verse.BookName} {verse.Chapter}:{verse.Verse}") - .WithDescription(verse.Text)) - .SendAsync(); - } - - [Cmd] - [RequireContext(ContextType.Guild)] - public async Task Quran(string ayah) - { - var res = await _service.GetQuranVerseAsync(ayah); - - if (!res.TryPickT0(out var qr, out var error)) - { - await Response().Error(error.Value).SendAsync(); - return; - } - - var english = qr.Data[0]; - var arabic = qr.Data[1]; - - using var http = _httpFactory.CreateClient(); - await using var audio = await http.GetStreamAsync(arabic.Audio); - - await Response() - .Embed(_sender.CreateEmbed() - .WithOkColor() - .AddField("Arabic", arabic.Text) - .AddField("English", english.Text) - .WithFooter(arabic.Number.ToString())) - .File(audio, Uri.EscapeDataString(ayah) + ".mp3") - .SendAsync(); - } - } -} \ No newline at end of file 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..6a98eac 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 = null) { - 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/Searx/SearxSearchService.cs b/src/EllieBot/Modules/Searches/Search/Searx/SearxSearchService.cs index 5d8ecc6..87e4103 100644 --- a/src/EllieBot/Modules/Searches/Search/Searx/SearxSearchService.cs +++ b/src/EllieBot/Modules/Searches/Search/Searx/SearxSearchService.cs @@ -32,21 +32,20 @@ public sealed class SearxSearchService : SearchServiceBase, IEService var instanceUrl = GetRandomInstance(); Log.Information("Using {Instance} instance for web search...", instanceUrl); - var startTime = Stopwatch.GetTimestamp(); - + var sw = Stopwatch.StartNew(); using var http = _http.CreateClient(); await using var res = await http.GetStreamAsync($"{instanceUrl}" + $"?q={Uri.EscapeDataString(query)}" + $"&format=json" + $"&strict=2"); - var elapsed = Stopwatch.GetElapsedTime(startTime); + sw.Stop(); var dat = await JsonSerializer.DeserializeAsync(res); if (dat is null) return new SearxSearchResult(); - dat.SearchTime = elapsed.TotalSeconds.ToString("N2", CultureInfo.InvariantCulture); + dat.SearchTime = sw.Elapsed.TotalSeconds.ToString("N2", CultureInfo.InvariantCulture); return dat; } @@ -57,7 +56,7 @@ public sealed class SearxSearchService : SearchServiceBase, IEService var instanceUrl = GetRandomInstance(); Log.Information("Using {Instance} instance for img search...", instanceUrl); - var startTime = Stopwatch.GetTimestamp(); + var sw = Stopwatch.StartNew(); using var http = _http.CreateClient(); await using var res = await http.GetStreamAsync($"{instanceUrl}" + $"?q={Uri.EscapeDataString(query)}" @@ -65,13 +64,13 @@ public sealed class SearxSearchService : SearchServiceBase, IEService + $"&category_images=on" + $"&strict=2"); - var elapsed = Stopwatch.GetElapsedTime(startTime); + sw.Stop(); var dat = await JsonSerializer.DeserializeAsync(res); if (dat is null) return new SearxImageSearchResult(); - dat.SearchTime = elapsed.TotalSeconds.ToString("N2", CultureInfo.InvariantCulture); + dat.SearchTime = sw.Elapsed.TotalSeconds.ToString("N2", CultureInfo.InvariantCulture); return dat; } } \ 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..04050e6 100644 --- a/src/EllieBot/Modules/Searches/Searches.cs +++ b/src/EllieBot/Modules/Searches/Searches.cs @@ -1,26 +1,31 @@ +#nullable disable using Microsoft.Extensions.Caching.Memory; using EllieBot.Modules.Searches.Common; using EllieBot.Modules.Searches.Services; using Newtonsoft.Json; +using Newtonsoft.Json.Linq; using SixLabors.ImageSharp; using SixLabors.ImageSharp.Drawing.Processing; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; using System.Diagnostics.CodeAnalysis; +using System.Net; +using System.Net.Http.Json; using Color = SixLabors.ImageSharp.Color; namespace EllieBot.Modules.Searches; public partial class Searches : EllieModule { - private readonly IBotCreds _creds; + private static readonly ConcurrentDictionary _cachedShortenedLinks = new(); + 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, @@ -33,6 +38,16 @@ public partial class Searches : EllieModule _tzSvc = tzSvc; } + [Cmd] + public async Task Rip([Leftover] IGuildUser usr) + { + var av = usr.RealAvatarUrl(); + await using var picStream = await _service.GetRipPictureAsync(usr.Nickname ?? usr.Username, av); + await ctx.Channel.SendFileAsync(picStream, + "rip.png", + $"Rip {Format.Bold(usr.ToString())} \n\t- " + Format.Italics(ctx.User.ToString())); + } + [Cmd] public async Task Weather([Leftover] string query) { @@ -92,7 +107,24 @@ public partial class Searches : EllieModule var (data, err) = await _service.GetTimeDataAsync(query); if (err is not null) { - await HandleErrorAsync(err.Value); + LocStr errorKey; + switch (err) + { + case TimeErrors.ApiKeyMissing: + errorKey = strs.api_key_missing; + break; + case TimeErrors.InvalidInput: + errorKey = strs.invalid_input; + break; + case TimeErrors.NotFound: + errorKey = strs.not_found; + break; + default: + errorKey = strs.error_occured; + break; + } + + await Response().Error(errorKey).SendAsync(); return; } @@ -103,17 +135,17 @@ public partial class Searches : EllieModule } var eb = _sender.CreateEmbed() - .WithOkColor() - .WithTitle(GetText(strs.time_new)) - .WithDescription(Format.Code(data.Time.ToString(Culture))) - .AddField(GetText(strs.location), string.Join('\n', data.Address.Split(", ")), true) - .AddField(GetText(strs.timezone), data.TimeZoneName, true); + .WithOkColor() + .WithTitle(GetText(strs.time_new)) + .WithDescription(Format.Code(data.Time.ToString(Culture))) + .AddField(GetText(strs.location), string.Join('\n', data.Address.Split(", ")), true) + .AddField(GetText(strs.timezone), data.TimeZoneName, true); await Response().Embed(eb).SendAsync(); } [Cmd] - public async Task Movie([Leftover] string query) + public async Task Movie([Leftover] string query = null) { if (!await ValidateQuery(query)) return; @@ -129,16 +161,14 @@ public partial class Searches : EllieModule await Response() .Embed(_sender.CreateEmbed() - .WithOkColor() - .WithTitle(movie.Title) - .WithUrl($"https://www.imdb.com/title/{movie.ImdbId}/") - .WithDescription(movie.Plot.TrimTo(1000)) - .AddField("Rating", movie.ImdbRating, true) - .AddField("Genre", movie.Genre, true) - .AddField("Year", movie.Year, true) - .WithImageUrl(Uri.IsWellFormedUriString(movie.Poster, UriKind.Absolute) - ? movie.Poster - : null)) + .WithOkColor() + .WithTitle(movie.Title) + .WithUrl($"https://www.imdb.com/title/{movie.ImdbId}/") + .WithDescription(movie.Plot.TrimTo(1000)) + .AddField("Rating", movie.ImdbRating, true) + .AddField("Genre", movie.Genre, true) + .AddField("Year", movie.Year, true) + .WithImageUrl(movie.Poster)) .SendAsync(); } @@ -165,13 +195,12 @@ public partial class Searches : EllieModule } [Cmd] - public async Task Lmgtfy([Leftover] string smh) + public async Task Lmgtfy([Leftover] string ffs = null) { - if (!await ValidateQuery(smh)) + if (!await ValidateQuery(ffs)) return; - var link = $"https://letmegooglethat.com/?q={Uri.EscapeDataString(smh)}"; - var shortenedUrl = await _service.ShortenLink(link) ?? link; + var shortenedUrl = await _google.ShortenUrl($"https://letmegooglethat.com/?q={Uri.EscapeDataString(ffs)}"); await Response().Confirm($"<{shortenedUrl}>").SendAsync(); } @@ -181,23 +210,45 @@ public partial class Searches : EllieModule if (!await ValidateQuery(query)) return; - var shortLink = await _service.ShortenLink(query); - - if (shortLink is null) + query = query.Trim(); + if (!_cachedShortenedLinks.TryGetValue(query, out var shortLink)) { - await Response().Error(strs.error_occured).SendAsync(); - return; + try + { + using var http = _httpFactory.CreateClient(); + using var req = new HttpRequestMessage(HttpMethod.Post, "https://goolnk.com/api/v1/shorten"); + var formData = new MultipartFormDataContent + { + { new StringContent(query), "url" } + }; + req.Content = formData; + + using var res = await http.SendAsync(req); + var content = await res.Content.ReadAsStringAsync(); + var data = JsonConvert.DeserializeObject(content); + + if (!string.IsNullOrWhiteSpace(data?.ResultUrl)) + _cachedShortenedLinks.TryAdd(query, data.ResultUrl); + else + return; + + shortLink = data.ResultUrl; + } + catch (Exception ex) + { + Log.Error(ex, "Error shortening a link: {Message}", ex.Message); + return; + } } await Response() .Embed(_sender.CreateEmbed() - .WithOkColor() - .AddField(GetText(strs.original_url), $"<{query}>") - .AddField(GetText(strs.short_url), $"<{shortLink}>")) + .WithOkColor() + .AddField(GetText(strs.original_url), $"<{query}>") + .AddField(GetText(strs.short_url), $"<{shortLink}>")) .SendAsync(); } - [Cmd] public async Task MagicTheGathering([Leftover] string search) { @@ -214,13 +265,13 @@ public partial class Searches : EllieModule } var embed = _sender.CreateEmbed() - .WithOkColor() - .WithTitle(card.Name) - .WithDescription(card.Description) - .WithImageUrl(card.ImageUrl) - .AddField(GetText(strs.store_url), card.StoreUrl, true) - .AddField(GetText(strs.cost), card.ManaCost, true) - .AddField(GetText(strs.types), card.Types, true); + .WithOkColor() + .WithTitle(card.Name) + .WithDescription(card.Description) + .WithImageUrl(card.ImageUrl) + .AddField(GetText(strs.store_url), card.StoreUrl, true) + .AddField(GetText(strs.cost), card.ManaCost, true) + .AddField(GetText(strs.types), card.Types, true); await Response().Embed(embed).SendAsync(); } @@ -255,38 +306,45 @@ public partial class Searches : EllieModule } [Cmd] - public async Task UrbanDict([Leftover] string query) + public async Task UrbanDict([Leftover] string query = null) { if (!await ValidateQuery(query)) return; await ctx.Channel.TriggerTypingAsync(); - using var http = _httpFactory.CreateClient(); - var res = await http.GetStringAsync($"https://api.urbandictionary.com/v0/define?" - + $"term={Uri.EscapeDataString(query)}"); - var allItems = JsonConvert.DeserializeObject(res)?.List; - - if (allItems is null or { Length: 0 }) + using (var http = _httpFactory.CreateClient()) { - await Response().Error(strs.ud_error).SendAsync(); - return; + var res = await http.GetStringAsync( + $"https://api.urbandictionary.com/v0/define?term={Uri.EscapeDataString(query)}"); + try + { + var allItems = JsonConvert.DeserializeObject(res).List; + if (allItems.Any()) + { + await Response() + .Paginated() + .Items(allItems) + .PageSize(1) + .CurrentPage(0) + .Page((items, _) => + { + var item = items[0]; + return _sender.CreateEmbed() + .WithOkColor() + .WithUrl(item.Permalink) + .WithTitle(item.Word) + .WithDescription(item.Definition); + }) + .SendAsync(); + return; + } + } + catch + { + } } - await Response() - .Paginated() - .Items(allItems) - .PageSize(1) - .CurrentPage(0) - .Page((items, _) => - { - var item = items[0]; - return _sender.CreateEmbed() - .WithOkColor() - .WithUrl(item.Permalink) - .WithTitle(item.Word) - .WithDescription(item.Definition); - }) - .SendAsync(); + await Response().Error(strs.ud_error).SendAsync(); } [Cmd] @@ -295,82 +353,100 @@ public partial class Searches : EllieModule if (!await ValidateQuery(word)) return; - - var maybeItems = await _service.GetDefinitionsAsync(word); - - if (!maybeItems.TryPickT0(out var defs, out var error)) + using var http = _httpFactory.CreateClient(); + string res; + try { - await HandleErrorAsync(error); - return; + res = await _cache.GetOrCreateAsync($"define_{word}", + e => + { + e.AbsoluteExpirationRelativeToNow = TimeSpan.FromHours(12); + return http.GetStringAsync("https://api.pearson.com/v2/dictionaries/entries?headword=" + + WebUtility.UrlEncode(word)); + }); + + var responseModel = JsonConvert.DeserializeObject(res); + + var data = responseModel.Results + .Where(x => x.Senses is not null + && x.Senses.Count > 0 + && x.Senses[0].Definition is not null) + .Select(x => (Sense: x.Senses[0], x.PartOfSpeech)) + .ToList(); + + if (!data.Any()) + { + Log.Warning("Definition not found: {Word}", word); + await Response().Error(strs.define_unknown).SendAsync(); + } + + + var col = data.Select(x => ( + Definition: x.Sense.Definition is string + ? x.Sense.Definition.ToString() + : ((JArray)JToken.Parse(x.Sense.Definition.ToString())).First.ToString(), + Example: x.Sense.Examples is null || x.Sense.Examples.Count == 0 + ? string.Empty + : x.Sense.Examples[0].Text, Word: word, + WordType: string.IsNullOrWhiteSpace(x.PartOfSpeech) ? "-" : x.PartOfSpeech)) + .ToList(); + + Log.Information("Sending {Count} definition for: {Word}", col.Count, word); + + await Response() + .Paginated() + .Items(col) + .PageSize(1) + .Page((items, _) => + { + var model = items.First(); + var embed = _sender.CreateEmbed() + .WithDescription(ctx.User.Mention) + .AddField(GetText(strs.word), model.Word, true) + .AddField(GetText(strs._class), model.WordType, true) + .AddField(GetText(strs.definition), model.Definition) + .WithOkColor(); + + if (!string.IsNullOrWhiteSpace(model.Example)) + embed.AddField(GetText(strs.example), model.Example); + + return embed; + }) + .SendAsync(); + } + catch (Exception ex) + { + Log.Error(ex, "Error retrieving definition data for: {Word}", word); } - - await Response() - .Paginated() - .Items(defs) - .PageSize(1) - .Page((items, _) => - { - var model = items.First(); - var embed = _sender.CreateEmbed() - .WithDescription(ctx.User.Mention) - .AddField(GetText(strs.word), model.Word, true) - .AddField(GetText(strs._class), model.WordType, true) - .AddField(GetText(strs.definition), model.Definition) - .WithOkColor(); - - if (!string.IsNullOrWhiteSpace(model.Example)) - embed.AddField(GetText(strs.example), model.Example); - - return embed; - }) - .SendAsync(); } [Cmd] public async Task Catfact() { - var maybeFact = await _service.GetCatFactAsync(); - - if (!maybeFact.TryPickT0(out var fact, out var error)) - { - await HandleErrorAsync(error); - return; - } + using var http = _httpFactory.CreateClient(); + var response = await http.GetStringAsync("https://catfact.ninja/fact"); + var fact = JObject.Parse(response)["fact"].ToString(); await Response().Confirm("🐈" + GetText(strs.catfact), fact).SendAsync(); } [Cmd] - public async Task Wiki([Leftover] string query) + public async Task Wiki([Leftover] string query = null) { - query = query.Trim(); + query = query?.Trim(); if (!await ValidateQuery(query)) return; - var maybeRes = await _service.GetWikipediaPageAsync(query); - if (!maybeRes.TryPickT0(out var res, out var error)) - { - await HandleErrorAsync(error); - return; - } - - var data = res.Data; - await Response().Text(data.Url).SendAsync(); - } - - public Task HandleErrorAsync(ErrorType error) - { - var errorKey = error switch - { - ErrorType.ApiKeyMissing => strs.api_key_missing, - ErrorType.InvalidInput => strs.invalid_input, - ErrorType.NotFound => strs.not_found, - ErrorType.Unknown => strs.error_occured, - _ => strs.error_occured, - }; - - return Response().Error(errorKey).SendAsync(); + using var http = _httpFactory.CreateClient(); + var result = await http.GetStringAsync( + "https://en.wikipedia.org//w/api.php?action=query&format=json&prop=info&redirects=1&formatversion=2&inprop=url&titles=" + + Uri.EscapeDataString(query)); + var data = JsonConvert.DeserializeObject(result); + if (data.Query.Pages[0].Missing || string.IsNullOrWhiteSpace(data.Query.Pages[0].FullUrl)) + await Response().Error(strs.wiki_page_not_found).SendAsync(); + else + await Response().Text(data.Query.Pages[0].FullUrl).SendAsync(); } [Cmd] @@ -385,29 +461,29 @@ public partial class Searches : EllieModule for (var i = 0; i < colorObjects.Length; i++) { var x = i * 50; - var j = i; - img.Mutate(m => m.FillPolygon(colorObjects[j], new(x, 0), new(x + 50, 0), new(x + 50, 50), new(x, 50))); + img.Mutate(m => m.FillPolygon(colorObjects[i], new(x, 0), new(x + 50, 0), new(x + 50, 50), new(x, 50))); } - await using var ms = await img.ToStreamAsync(); + await using var ms = img.ToStream(); await ctx.Channel.SendFileAsync(ms, "colors.png"); } [Cmd] [RequireContext(ContextType.Guild)] - public async Task Avatar([Leftover] IGuildUser? usr = null) + public async Task Avatar([Leftover] IGuildUser usr = null) { - usr ??= (IGuildUser)ctx.User; + if (usr is null) + usr = (IGuildUser)ctx.User; var avatarUrl = usr.RealAvatarUrl(2048); await Response() .Embed( _sender.CreateEmbed() - .WithOkColor() - .AddField("Username", usr.ToString()) - .AddField("Avatar Url", avatarUrl) - .WithThumbnailUrl(avatarUrl.ToString())) + .WithOkColor() + .AddField("Username", usr.ToString()) + .AddField("Avatar Url", avatarUrl) + .WithThumbnailUrl(avatarUrl.ToString())) .SendAsync(); } @@ -420,16 +496,63 @@ public partial class Searches : EllieModule return; } - var maybeRes = await _service.GetWikiaPageAsync(target, query); - - if (!maybeRes.TryPickT0(out var res, out var error)) + await ctx.Channel.TriggerTypingAsync(); + using var http = _httpFactory.CreateClient(); + http.DefaultRequestHeaders.Clear(); + try + { + var res = await http.GetStringAsync($"https://{Uri.EscapeDataString(target)}.fandom.com/api.php" + + "?action=query" + + "&format=json" + + "&list=search" + + $"&srsearch={Uri.EscapeDataString(query)}" + + "&srlimit=1"); + var items = JObject.Parse(res); + var title = items["query"]?["search"]?.FirstOrDefault()?["title"]?.ToString(); + + if (string.IsNullOrWhiteSpace(title)) + { + await Response().Error(strs.wikia_error).SendAsync(); + return; + } + + var url = Uri.EscapeDataString($"https://{target}.fandom.com/wiki/{title}"); + var response = $@"`{GetText(strs.title)}` {title.SanitizeMentions()} +`{GetText(strs.url)}:` {url}"; + await Response().Text(response).SendAsync(); + } + catch + { + await Response().Error(strs.wikia_error).SendAsync(); + } + } + + [Cmd] + [RequireContext(ContextType.Guild)] + public async Task Bible(string book, string chapterAndVerse) + { + var obj = new BibleVerses(); + try + { + using var http = _httpFactory.CreateClient(); + obj = await http.GetFromJsonAsync($"https://bible-api.com/{book} {chapterAndVerse}"); + } + catch { - await HandleErrorAsync(error); - return; } - var response = $"### {res.Title}\n{res.Url}"; - await Response().Text(response).Sanitize().SendAsync(); + if (obj.Error is not null || obj.Verses is null || obj.Verses.Length == 0) + await Response().Error(obj.Error ?? "No verse found.").SendAsync(); + else + { + var v = obj.Verses[0]; + await Response() + .Embed(_sender.CreateEmbed() + .WithOkColor() + .WithTitle($"{v.BookName} {v.Chapter}:{v.Verse}") + .WithDescription(v.Text)) + .SendAsync(); + } } [Cmd] @@ -447,6 +570,16 @@ public partial class Searches : EllieModule return; } + //var embed = _sender.CreateEmbed() + // .WithOkColor() + // .WithDescription(gameData.ShortDescription) + // .WithTitle(gameData.Name) + // .WithUrl(gameData.Link) + // .WithImageUrl(gameData.HeaderImage) + // .AddField(GetText(strs.genres), gameData.TotalEpisodes.ToString(), true) + // .AddField(GetText(strs.price), gameData.IsFree ? GetText(strs.FREE) : game, true) + // .AddField(GetText(strs.links), gameData.GetGenresString(), true) + // .WithFooter(GetText(strs.recommendations(gameData.TotalRecommendations))); await Response().Text($"https://store.steampowered.com/app/{appId}").SendAsync(); } @@ -458,4 +591,10 @@ public partial class Searches : EllieModule await Response().Error(strs.specify_search_params).SendAsync(); return false; } + + public class ShortenData + { + [JsonProperty("result_url")] + public string ResultUrl { get; set; } + } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/SearchesService.cs b/src/EllieBot/Modules/Searches/SearchesService.cs index 039b574..f5e3be4 100644 --- a/src/EllieBot/Modules/Searches/SearchesService.cs +++ b/src/EllieBot/Modules/Searches/SearchesService.cs @@ -2,8 +2,13 @@ using EllieBot.Modules.Searches.Common; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using OneOf; -using System.Text.Json; +using SixLabors.Fonts; +using SixLabors.ImageSharp; +using SixLabors.ImageSharp.Drawing.Processing; +using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.Processing; +using Color = SixLabors.ImageSharp.Color; +using Image = SixLabors.ImageSharp.Image; namespace EllieBot.Modules.Searches.Services; @@ -21,17 +26,19 @@ public class SearchesService : IEService public List MagicItems { get; } = []; private readonly IHttpClientFactory _httpFactory; private readonly IGoogleApiService _google; + private readonly IImageCache _imgs; private readonly IBotCache _c; + private readonly FontProvider _fonts; private readonly IBotCredsProvider _creds; private readonly EllieRandom _rng; private readonly List _yomamaJokes; private readonly object _yomamaLock = new(); private int yomamaJokeIndex; - private readonly ConcurrentDictionary _cachedShortenedLinks = new(); public SearchesService( IGoogleApiService google, + IImageCache images, IBotCache c, IHttpClientFactory factory, FontProvider fonts, @@ -39,7 +46,9 @@ public class SearchesService : IEService { _httpFactory = factory; _google = google; + _imgs = images; _c = c; + _fonts = fonts; _creds = creds; _rng = new(); @@ -63,6 +72,56 @@ public class SearchesService : IEService } } + public async Task GetRipPictureAsync(string text, Uri imgUrl) + => (await GetRipPictureFactory(text, imgUrl)).ToStream(); + + private void DrawAvatar(Image bg, Image avatarImage) + => bg.Mutate(x => x.Grayscale().DrawImage(avatarImage, new(83, 139), new GraphicsOptions())); + + public async Task GetRipPictureFactory(string text, Uri avatarUrl) + { + using var bg = Image.Load(await _imgs.GetRipBgAsync()); + var result = await _c.GetImageDataAsync(avatarUrl); + if (!result.TryPickT0(out var data, out _)) + { + using var http = _httpFactory.CreateClient(); + data = await http.GetByteArrayAsync(avatarUrl); + using (var avatarImg = Image.Load(data)) + { + avatarImg.Mutate(x => x.Resize(85, 85).ApplyRoundedCorners(42)); + await using var avStream = await avatarImg.ToStreamAsync(); + data = avStream.ToArray(); + DrawAvatar(bg, avatarImg); + } + + await _c.SetImageDataAsync(avatarUrl, data); + } + else + { + using var avatarImg = Image.Load(data); + DrawAvatar(bg, avatarImg); + } + + bg.Mutate(x => x.DrawText( + new TextOptions(_fonts.RipFont) + { + HorizontalAlignment = HorizontalAlignment.Center, + FallbackFontFamilies = _fonts.FallBackFonts, + Origin = new(bg.Width / 2, 225), + }, + text, + Color.Black)); + + //flowa + using (var flowers = Image.Load(await _imgs.GetRipOverlayAsync())) + { + bg.Mutate(x => x.DrawImage(flowers, new(0, 0), new GraphicsOptions())); + } + + await using var stream = bg.ToStream(); + return stream.ToArray(); + } + public async Task GetWeatherDataAsync(string query) { query = query.Trim().ToLowerInvariant(); @@ -94,26 +153,26 @@ public class SearchesService : IEService } } - public Task<((string Address, DateTime Time, string TimeZoneName), ErrorType?)> GetTimeDataAsync(string arg) + public Task<((string Address, DateTime Time, string TimeZoneName), TimeErrors?)> GetTimeDataAsync(string arg) => GetTimeDataFactory(arg); //return _cache.GetOrAddCachedDataAsync($"ellie_time_{arg}", // GetTimeDataFactory, // arg, // TimeSpan.FromMinutes(1)); - private async Task<((string Address, DateTime Time, string TimeZoneName), ErrorType?)> GetTimeDataFactory( + private async Task<((string Address, DateTime Time, string TimeZoneName), TimeErrors?)> GetTimeDataFactory( string query) { query = query.Trim(); if (string.IsNullOrEmpty(query)) - return (default, ErrorType.InvalidInput); + return (default, TimeErrors.InvalidInput); var locIqKey = _creds.GetCreds().LocationIqApiKey; var tzDbKey = _creds.GetCreds().TimezoneDbApiKey; if (string.IsNullOrWhiteSpace(locIqKey) || string.IsNullOrWhiteSpace(tzDbKey)) - return (default, ErrorType.ApiKeyMissing); + return (default, TimeErrors.ApiKeyMissing); try { @@ -137,7 +196,7 @@ public class SearchesService : IEService if (responses is null || responses.Length == 0) { Log.Warning("Geocode lookup failed for: {Query}", query); - return (default, ErrorType.NotFound); + return (default, TimeErrors.NotFound); } var geoData = responses[0]; @@ -161,7 +220,7 @@ public class SearchesService : IEService catch (Exception ex) { Log.Error(ex, "Weather error: {Message}", ex.Message); - return (default, ErrorType.NotFound); + return (default, TimeErrors.NotFound); } } @@ -179,7 +238,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"; } @@ -336,11 +395,12 @@ public class SearchesService : IEService private async Task GetMovieDataFactory(string name) { using var http = _httpFactory.CreateClient(); - var res = await http.GetStringAsync("https://omdbapi.nadeko.bot/" - + $"?t={name.Trim().Replace(' ', '+')}" - + "&y=" - + "&plot=full" - + "&r=json"); + var res = await http.GetStringAsync(string.Format("https://omdbapi.nadeko.bot/" + + "?t={0}" + + "&y=" + + "&plot=full" + + "&r=json", + name.Trim().Replace(' ', '+'))); var movie = JsonConvert.DeserializeObject(res); if (movie?.Title is null) return null; @@ -394,223 +454,4 @@ public class SearchesService : IEService return gamesMap[key]; } - - public async Task> GetWikipediaPageAsync(string query) - { - query = query.Trim(); - if (string.IsNullOrEmpty(query)) - { - return ErrorType.InvalidInput; - } - - try - { - var result = await _c.GetOrAddAsync($"wikipedia_{query}", - async () => - { - using var http = _httpFactory.CreateClient(); - http.DefaultRequestHeaders.Clear(); - - return await http.GetStringAsync( - "https://en.wikipedia.org/w/api.php?action=query" - + "&format=json" - + "&prop=info" - + "&redirects=1" - + "&formatversion=2" - + "&inprop=url" - + "&titles=" - + Uri.EscapeDataString(query)); - }, - TimeSpan.FromHours(1)) - .ConfigureAwait(false); - - var data = JsonConvert.DeserializeObject(result); - - if (data.Query.Pages is null || !data.Query.Pages.Any() || data.Query.Pages.First().Missing) - { - return ErrorType.NotFound; - } - - Log.Information("Sending wikipedia url for: {Query}", query); - - return new WikipediaReply - { - Data = new() - { - Url = data.Query.Pages[0].FullUrl, - } - }; - } - catch (Exception ex) - { - Log.Error(ex, "Error retrieving wikipedia data for: '{Query}'", query); - - return ErrorType.Unknown; - } - } - - public async Task> GetCatFactAsync() - { - using var http = _httpFactory.CreateClient(); - var response = await http.GetStringAsync("https://catfact.ninja/fact").ConfigureAwait(false); - - var doc = JsonDocument.Parse(response); - - - if (!doc.RootElement.TryGetProperty("fact", out var factElement)) - { - return ErrorType.Unknown; - } - - return factElement.ToString(); - } - - public async Task> GetWikiaPageAsync(string target, string query) - { - if (string.IsNullOrWhiteSpace(target) || string.IsNullOrWhiteSpace(query)) - { - return ErrorType.InvalidInput; - } - - query = Uri.EscapeDataString(query.Trim()); - target = Uri.EscapeDataString(target.Trim()); - - if (string.IsNullOrEmpty(query)) - { - return ErrorType.InvalidInput; - } - - using var http = _httpFactory.CreateClient(); - http.DefaultRequestHeaders.Clear(); - try - { - var res = await http.GetStringAsync($"https://{Uri.EscapeDataString(target)}.fandom.com/api.php" - + "?action=query" - + "&format=json" - + "&list=search" - + $"&srsearch={Uri.EscapeDataString(query)}" - + "&srlimit=1"); - var items = JObject.Parse(res); - var title = items["query"]?["search"]?.FirstOrDefault()?["title"]?.ToString(); - - if (string.IsNullOrWhiteSpace(title)) - { - return ErrorType.NotFound; - } - - var url = $"https://{target}.fandom.com/wiki/{title}"; - - return new WikiaResponse() - { - Url = url, - Title = title, - }; - } - catch (Exception ex) - { - Log.Warning(ex, "Error getting wikia page: {Message}", ex.Message); - return ErrorType.Unknown; - } - } - - private static TypedKey GetDefineKey(string query) - => new TypedKey($"define_{query}"); - - public async Task, ErrorType>> GetDefinitionsAsync(string query) - { - if (string.IsNullOrWhiteSpace(query)) - { - return ErrorType.InvalidInput; - } - - query = Uri.EscapeDataString(query); - - using var http = _httpFactory.CreateClient(); - string res; - try - { - res = await _c.GetOrAddAsync(GetDefineKey(query), - async () => await http.GetStringAsync( - $"https://api.pearson.com/v2/dictionaries/entries?headword={query}"), - TimeSpan.FromHours(12)); - - var responseModel = JsonConvert.DeserializeObject(res); - - var data = responseModel.Results - .Where(x => x.Senses is not null - && x.Senses.Count > 0 - && x.Senses[0].Definition is not null) - .Select(x => (Sense: x.Senses[0], x.PartOfSpeech)) - .ToList(); - - if (!data.Any()) - { - Log.Warning("Definition not found: {Word}", query); - return ErrorType.NotFound; - } - - - var items = new List(); - - foreach (var d in data) - { - items.Add(new DefineData - { - Definition = d.Sense.Definition is JArray { Count: > 0 } defs - ? defs[0].ToString() - : d.Sense.Definition.ToString(), - Example = d.Sense.Examples is null || d.Sense.Examples.Count == 0 - ? string.Empty - : d.Sense.Examples[0].Text, - WordType = string.IsNullOrWhiteSpace(d.PartOfSpeech) ? "-" : d.PartOfSpeech, - Word = query, - }); - } - - return items.OrderByDescending(x => !string.IsNullOrWhiteSpace(x.Example)).ToList(); - } - catch (Exception ex) - { - Log.Error(ex, "Error retrieving definition data for: {Word}", query); - return ErrorType.Unknown; - } - } - - public async Task ShortenLink(string query) - { - query = query.Trim(); - - if (_cachedShortenedLinks.TryGetValue(query, out var shortLink)) - return shortLink; - - try - { - using var http = _httpFactory.CreateClient(); - using var req = new HttpRequestMessage(HttpMethod.Post, "https://goolnk.com/api/v1/shorten"); - var formData = new MultipartFormDataContent - { - { new StringContent(query), "url" } - }; - req.Content = formData; - - using var res = await http.SendAsync(req); - var content = await res.Content.ReadAsStringAsync(); - var data = JsonConvert.DeserializeObject(content); - - if (!string.IsNullOrWhiteSpace(data?.ResultUrl)) - _cachedShortenedLinks.TryAdd(query, data.ResultUrl); - else - return query; - - shortLink = data.ResultUrl; - } - catch (Exception ex) - { - Log.Error(ex, "Error shortening a link: {Message}", ex.Message); - return null; - } - - return shortLink; - throw new NotImplementedException(); - } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/StreamNotification/StreamNotificationCommands.cs b/src/EllieBot/Modules/Searches/StreamNotification/StreamNotificationCommands.cs index ed260ae..46f9ed6 100644 --- a/src/EllieBot/Modules/Searches/StreamNotification/StreamNotificationCommands.cs +++ b/src/EllieBot/Modules/Searches/StreamNotification/StreamNotificationCommands.cs @@ -1,5 +1,6 @@ #nullable disable using Microsoft.EntityFrameworkCore; +using EllieBot.Db; using EllieBot.Db.Models; using EllieBot.Modules.Searches.Services; @@ -69,7 +70,22 @@ public partial class Searches if (page-- < 1) return; - var allStreams = await _service.GetAllStreamsAsync((SocketGuild)ctx.Guild); + var allStreams = new List(); + await using (var uow = _db.GetDbContext()) + { + var all = uow.GuildConfigsForId(ctx.Guild.Id, set => set.Include(gc => gc.FollowedStreams)) + .FollowedStreams.OrderBy(x => x.Id) + .ToList(); + + for (var index = all.Count - 1; index >= 0; index--) + { + var fs = all[index]; + if (((SocketGuild)ctx.Guild).GetTextChannel(fs.ChannelId) is null) + await _service.UnfollowStreamAsync(fs.GuildId, index); + else + allStreams.Insert(0, fs); + } + } await Response() .Paginated() diff --git a/src/EllieBot/Modules/Searches/StreamNotification/StreamNotificationService.cs b/src/EllieBot/Modules/Searches/StreamNotification/StreamNotificationService.cs index 9870c13..c003366 100644 --- a/src/EllieBot/Modules/Searches/StreamNotification/StreamNotificationService.cs +++ b/src/EllieBot/Modules/Searches/StreamNotification/StreamNotificationService.cs @@ -1,6 +1,7 @@ #nullable disable using Microsoft.EntityFrameworkCore; using EllieBot.Common.ModuleBehaviors; +using EllieBot.Db; using EllieBot.Db.Models; using EllieBot.Modules.Searches.Common; using EllieBot.Modules.Searches.Common.StreamNotifications; @@ -253,7 +254,7 @@ public sealed class StreamNotificationService : IEService, IReadyExecutor { var ch = _client.GetGuild(fs.GuildId) ?.GetTextChannel(fs.ChannelId); - + if (ch is null) return Task.CompletedTask; @@ -492,10 +493,10 @@ public sealed class StreamNotificationService : IEService, IReadyExecutor public EmbedBuilder GetEmbed(ulong guildId, StreamData status, bool showViewers = true) { var embed = _sender.CreateEmbed() - .WithTitle(status.Name) - .WithUrl(status.StreamUrl) - .WithDescription(status.StreamUrl) - .AddField(GetText(guildId, strs.status), status.IsLive ? "🟢 Online" : "🔴 Offline", true); + .WithTitle(status.Name) + .WithUrl(status.StreamUrl) + .WithDescription(status.StreamUrl) + .AddField(GetText(guildId, strs.status), status.IsLive ? "🟢 Online" : "🔴 Offline", true); if (showViewers) { @@ -625,7 +626,7 @@ public sealed class StreamNotificationService : IEService, IReadyExecutor all.ForEach(x => x.Message = message); uow.SaveChanges(); - + lock (_shardLock) { foreach (var fs in all) @@ -647,25 +648,4 @@ public sealed class StreamNotificationService : IEService, IReadyExecutor public StreamDataKey Key { get; init; } public ulong GuildId { get; init; } } - - public async Task> GetAllStreamsAsync(SocketGuild guild) - { - var allStreams = new List(); - await using var uow = _db.GetDbContext(); - var all = uow.GuildConfigsForId(guild.Id, set => set.Include(gc => gc.FollowedStreams)) - .FollowedStreams - .OrderBy(x => x.Id) - .ToList(); - - for (var index = all.Count - 1; index >= 0; index--) - { - var fs = all[index]; - if (guild.GetTextChannel(fs.ChannelId) is null) - await UnfollowStreamAsync(fs.GuildId, index); - else - allStreams.Insert(0, fs); - } - - return allStreams; - } } \ No newline at end of file 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/BibleVerses.cs b/src/EllieBot/Modules/Searches/_common/BibleVerses.cs new file mode 100644 index 0000000..30dd045 --- /dev/null +++ b/src/EllieBot/Modules/Searches/_common/BibleVerses.cs @@ -0,0 +1,20 @@ +#nullable disable +using System.Text.Json.Serialization; + +namespace EllieBot.Modules.Searches.Common; + +public class BibleVerses +{ + public string Error { get; set; } + public BibleVerse[] Verses { get; set; } +} + +public class BibleVerse +{ + [JsonPropertyName("book_name")] + public string BookName { get; set; } + + public int Chapter { get; set; } + public int Verse { get; set; } + public string Text { get; set; } +} \ 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/DefineData.cs b/src/EllieBot/Modules/Searches/_common/DefineData.cs deleted file mode 100644 index 2698d50..0000000 --- a/src/EllieBot/Modules/Searches/_common/DefineData.cs +++ /dev/null @@ -1,10 +0,0 @@ -#nullable disable -namespace EllieBot.Modules.Searches.Services; - -public sealed class DefineData -{ - public required string Definition { get; init; } - public required string Example { get; init; } - public required string WordType { get; init; } - public required string Word { get; init; } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/_common/ErrorType.cs b/src/EllieBot/Modules/Searches/_common/ErrorType.cs deleted file mode 100644 index 0daeea5..0000000 --- a/src/EllieBot/Modules/Searches/_common/ErrorType.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace EllieBot.Modules.Searches.Services; - -public enum ErrorType -{ - InvalidInput, - NotFound, - Unknown, - ApiKeyMissing -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/_common/GatariUserResponse.cs b/src/EllieBot/Modules/Searches/_common/GatariUserResponse.cs index 63114ab..412522a 100644 --- a/src/EllieBot/Modules/Searches/_common/GatariUserResponse.cs +++ b/src/EllieBot/Modules/Searches/_common/GatariUserResponse.cs @@ -3,7 +3,7 @@ using Newtonsoft.Json; namespace EllieBot.Modules.Searches.Common; -public class GatariUserData +public class UserData { [JsonProperty("abbr")] public object Abbr { get; set; } @@ -48,5 +48,5 @@ public class GatariUserResponse public int Code { get; set; } [JsonProperty("users")] - public List Users { get; set; } + public List Users { get; set; } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/_common/GatariUserStatsResponse.cs b/src/EllieBot/Modules/Searches/_common/GatariUserStatsResponse.cs index a2f6f89..97fee69 100644 --- a/src/EllieBot/Modules/Searches/_common/GatariUserStatsResponse.cs +++ b/src/EllieBot/Modules/Searches/_common/GatariUserStatsResponse.cs @@ -3,7 +3,7 @@ using Newtonsoft.Json; namespace EllieBot.Modules.Searches.Common; -public class GatariUserStats +public class UserStats { [JsonProperty("a_count")] public int ACount { get; set; } @@ -39,7 +39,7 @@ public class GatariUserStats public int Pp { get; set; } [JsonProperty("rank")] - public int? Rank { get; set; } + public int Rank { get; set; } [JsonProperty("ranked_score")] public int RankedScore { get; set; } @@ -72,5 +72,5 @@ public class GatariUserStatsResponse public int Code { get; set; } [JsonProperty("stats")] - public GatariUserStats Stats { get; set; } + public UserStats Stats { get; set; } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/_common/OsuUserData.cs b/src/EllieBot/Modules/Searches/_common/OsuUserData.cs index 86f1000..a59bf30 100644 --- a/src/EllieBot/Modules/Searches/_common/OsuUserData.cs +++ b/src/EllieBot/Modules/Searches/_common/OsuUserData.cs @@ -67,7 +67,4 @@ 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 deleted file mode 100644 index 872347e..0000000 --- a/src/EllieBot/Modules/Searches/_common/ShortenData.cs +++ /dev/null @@ -1,10 +0,0 @@ -#nullable disable -using Newtonsoft.Json; - -namespace EllieBot.Modules.Searches.Services; - -public class ShortenData -{ - [JsonProperty("result_url")] - public string ResultUrl { get; set; } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/_common/WikiaResponse.cs b/src/EllieBot/Modules/Searches/_common/WikiaResponse.cs deleted file mode 100644 index d0b3960..0000000 --- a/src/EllieBot/Modules/Searches/_common/WikiaResponse.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace EllieBot.Modules.Searches.Services; - -public sealed class WikiaResponse -{ - public required string Url { get; init; } - public required string Title { get; init; } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Searches/_common/WikipediaReply.cs b/src/EllieBot/Modules/Searches/_common/WikipediaReply.cs deleted file mode 100644 index 3969090..0000000 --- a/src/EllieBot/Modules/Searches/_common/WikipediaReply.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace EllieBot.Modules.Searches.Services; - -public class WikipediaReply -{ - public class Info - { - public required string Url { get; init; } - } - - public required Info Data { get; init; } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Utility/AfkService.cs b/src/EllieBot/Modules/Utility/AfkService.cs deleted file mode 100644 index 7f8ede4..0000000 --- a/src/EllieBot/Modules/Utility/AfkService.cs +++ /dev/null @@ -1,148 +0,0 @@ -using EllieBot.Common.ModuleBehaviors; - -namespace EllieBot.Modules.Utility; - -public sealed class AfkService : IEService, IReadyExecutor -{ - private readonly IBotCache _cache; - private readonly DiscordSocketClient _client; - private readonly MessageSenderService _mss; - - private static readonly TimeSpan _maxAfkDuration = 8.Hours(); - public AfkService(IBotCache cache, DiscordSocketClient client, MessageSenderService mss) - { - _cache = cache; - _client = client; - _mss = mss; - } - - private static TypedKey GetKey(ulong userId) - => new($"afk:msg:{userId}"); - - public async Task SetAfkAsync(ulong userId, string text) - { - var added = await _cache.AddAsync(GetKey(userId), text, _maxAfkDuration, overwrite: true); - - async Task StopAfk(SocketMessage socketMessage) - { - try - { - if (socketMessage.Author?.Id == userId) - { - await _cache.RemoveAsync(GetKey(userId)); - _client.MessageReceived -= StopAfk; - - // write the message saying afk status cleared - - if (socketMessage.Channel is ITextChannel tc) - { - _ = Task.Run(async () => - { - var msg = await _mss.Response(tc).Confirm("AFK message cleared!").SendAsync(); - - msg.DeleteAfter(5); - }); - } - - } - - } - catch (Exception ex) - { - Log.Warning("Unexpected error occurred while trying to stop afk: {Message}", ex.Message); - } - } - - _client.MessageReceived += StopAfk; - - - _ = Task.Run(async () => - { - await Task.Delay(_maxAfkDuration); - _client.MessageReceived -= StopAfk; - }); - - return added; - } - - public Task OnReadyAsync() - { - _client.MessageReceived += TryTriggerAfkMessage; - - return Task.CompletedTask; - } - - private Task TryTriggerAfkMessage(SocketMessage arg) - { - if (arg.Author.IsBot || arg.Author.IsWebhook) - return Task.CompletedTask; - - 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; - - _ = Task.Run(async () => - { - var botUser = await tc.Guild.GetCurrentUserAsync(); - - var perms = botUser.GetPermissions(tc); - - if (!perms.SendMessages) - return; - - ulong mentionedUserId = 0; - - if (arg.MentionedUsers.Count <= 3) - { - foreach (var uid in uMsg.MentionedUserIds) - { - if (uid == arg.Author.Id) - continue; - - if (arg.Content.StartsWith($"<@{uid}>") || arg.Content.StartsWith($"<@!{uid}>")) - { - mentionedUserId = uid; - break; - } - } - } - - if (mentionedUserId == 0) - { - if (uMsg.ReferencedMessage?.Author?.Id is not ulong repliedUserId) - { - return; - } - - mentionedUserId = repliedUserId; - } - - try - { - var result = await _cache.GetAsync(GetKey(mentionedUserId)); - 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) - .Text(st) - .SendAsync(); - - toDelete.DeleteAfter(30); - } - } - catch (HttpException ex) - { - Log.Warning("Error in afk service: {Message}", ex.Message); - } - }); - - return Task.CompletedTask; - } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Utility/Ai/AiAssistantService.cs b/src/EllieBot/Modules/Utility/Ai/AiAssistantService.cs deleted file mode 100644 index 512c2db..0000000 --- a/src/EllieBot/Modules/Utility/Ai/AiAssistantService.cs +++ /dev/null @@ -1,310 +0,0 @@ -using EllieBot.Common.ModuleBehaviors; -using EllieBot.Modules.Administration; -using EllieBot.Modules.Games.Services; -using System.Net; -using System.Net.Http.Json; -using System.Text; -using System.Text.Json; -using JsonSerializer = System.Text.Json.JsonSerializer; - -namespace EllieBot.Modules.Utility; - -public enum GetCommandErrorResult -{ - RateLimitHit, - NotAuthorized, - Disregard, - Unknown -} - -public sealed class AiAssistantService - : IAiAssistantService, IReadyExecutor, - IExecOnMessage, - IEService -{ - private IReadOnlyCollection _commands = []; - - private readonly IBotStrings _strings; - private readonly IHttpClientFactory _httpFactory; - private readonly CommandService _cmds; - private readonly IBotCredsProvider _credsProvider; - private readonly DiscordSocketClient _client; - private readonly ICommandHandler _cmdHandler; - private readonly BotConfigService _bcs; - private readonly IMessageSenderService _sender; - - private readonly JsonSerializerOptions _serializerOptions = new(); - private readonly IPermissionChecker _permChecker; - private readonly IBotCache _botCache; - private readonly ChatterBotService _cbs; - - public AiAssistantService( - DiscordSocketClient client, - IBotStrings strings, - IHttpClientFactory httpFactory, - CommandService cmds, - IBotCredsProvider credsProvider, - ICommandHandler cmdHandler, - BotConfigService bcs, - IPermissionChecker permChecker, - IBotCache botCache, - ChatterBotService cbs, - IMessageSenderService sender) - { - _client = client; - _strings = strings; - _httpFactory = httpFactory; - _cmds = cmds; - _credsProvider = credsProvider; - _cmdHandler = cmdHandler; - _bcs = bcs; - _sender = sender; - _permChecker = permChecker; - _botCache = botCache; - _cbs = cbs; - } - - public async Task> TryGetCommandAsync( - ulong userId, - string prompt, - IReadOnlyCollection commands, - string prefix) - { - using var content = new StringContent( - JsonSerializer.Serialize(new - { - query = prompt, - commands = commands.ToDictionary(x => x.Name, - x => new AiCommandModel() - { - Desc = string.Format(x.Desc ?? "", prefix), - Params = x.Params, - Name = x.Name - }), - }), - Encoding.UTF8, - "application/json" - ); - - 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.Content = content; - - var creds = _credsProvider.GetCreds(); - - request.Headers.TryAddWithoutValidation("x-auth-token", creds.EllieAiToken); - request.Headers.TryAddWithoutValidation("x-auth-userid", userId.ToString()); - - - using var client = _httpFactory.CreateClient(); - - using var response = await client.SendAsync(request); - - if (response.StatusCode == HttpStatusCode.TooManyRequests) - { - return GetCommandErrorResult.RateLimitHit; - } - else if (response.StatusCode == HttpStatusCode.Unauthorized) - { - return GetCommandErrorResult.NotAuthorized; - } - - var funcModel = await response.Content.ReadFromJsonAsync(); - - - if (funcModel?.Name == "disregard") - { - Log.Warning("Disregarding the prompt: {Prompt}", prompt); - return GetCommandErrorResult.Disregard; - } - - if (funcModel is null) - return GetCommandErrorResult.Unknown; - - var comModel = new EllieCommandCallModel() - { - Name = funcModel.Name, - Arguments = funcModel.Arguments - .OrderBy(param => _commands.FirstOrDefault(x => x.Name == funcModel.Name) - ?.Params - .Select((x, i) => (x, i)) - .Where(x => x.x.Name == param.Key) - .Select(x => x.i) - .FirstOrDefault()) - .Select(x => x.Value) - .Where(x => !string.IsNullOrWhiteSpace(x)) - .ToArray(), - Remaining = funcModel.Remaining - }; - - return comModel; - } - - public IReadOnlyCollection GetCommands() - => _commands; - - public Task OnReadyAsync() - { - var cmds = _cmds.Commands - .Select(x => (MethodName: x.Summary, CommandName: x.Aliases[0])) - .Where(x => !x.MethodName.Contains("///")) - .Distinct() - .ToList(); - - var funcs = new List(); - foreach (var (method, cmd) in cmds) - { - var commandStrings = _strings.GetCommandStrings(method); - - if (commandStrings is null) - continue; - - funcs.Add(new() - { - Name = cmd, - Desc = commandStrings?.Desc?.Replace("currency", "flowers") ?? string.Empty, - Params = commandStrings?.Params.FirstOrDefault() - ?.Select(x => new AiCommandParamModel() - { - Desc = x.Value.Desc, - Name = x.Key, - }) - .ToArray() - ?? [] - }); - } - - _commands = funcs; - - return Task.CompletedTask; - } - - public int Priority - => 2; - - public async Task ExecOnMessageAsync(IGuild guild, IUserMessage msg) - { - if (string.IsNullOrWhiteSpace(_credsProvider.GetCreds().EllieAiToken)) - return false; - - if (guild is not SocketGuild sg) - return false; - - var ellieId = _client.CurrentUser.Id; - - var channel = msg.Channel as ITextChannel; - if (channel is null) - return false; - - var normalMention = $"<@{ellieId}> "; - var nickMention = $"<@!{ellieId}> "; - string query; - if (msg.Content.StartsWith(normalMention, StringComparison.InvariantCulture)) - query = msg.Content[normalMention.Length..].Trim(); - else if (msg.Content.StartsWith(nickMention, StringComparison.InvariantCulture)) - query = msg.Content[nickMention.Length..].Trim(); - else - return false; - - var success = await TryExecuteAiCommand(guild, msg, channel, query); - - return success; - } - - public async Task TryExecuteAiCommand( - IGuild guild, - IUserMessage msg, - ITextChannel channel, - string query) - { - // check permissions - var pcResult = await _permChecker.CheckPermsAsync( - guild, - msg.Channel, - msg.Author, - "Utility", - "prompt" - ); - - if (!pcResult.IsAllowed) - return false; - - using var _ = channel.EnterTypingState(); - - var result = await TryGetCommandAsync(msg.Author.Id, query, _commands, _cmdHandler.GetPrefix(guild.Id)); - - if (result.TryPickT0(out var model, out var error)) - { - if (model.Name == ".ai_chat") - { - if (guild is not SocketGuild sg) - return false; - - var sess = _cbs.GetOrCreateSession(guild.Id); - if (sess is null) - return false; - - await _cbs.RunChatterBot(sg, msg, channel, sess, query); - return true; - } - - var commandString = GetCommandString(model); - - var msgTask = _sender.Response(channel) - .Embed(_sender.CreateEmbed() - .WithOkColor() - .WithAuthor(msg.Author.GlobalName, - msg.Author.RealAvatarUrl().ToString()) - .WithDescription(commandString)) - .SendAsync(); - - - await _cmdHandler.TryRunCommand( - (SocketGuild)guild, - (ISocketMessageChannel)channel, - new DoAsUserMessage((SocketUserMessage)msg, msg.Author, commandString)); - - var cmdMsg = await msgTask; - - cmdMsg.DeleteAfter(5); - - return true; - } - - if (error == GetCommandErrorResult.Disregard) - { - // await msg.ErrorAsync(); - return false; - } - - var key = new TypedKey($"sub_error:{msg.Author.Id}:{error}"); - - if (!await _botCache.AddAsync(key, true, TimeSpan.FromDays(1), overwrite: false)) - return false; - - var errorMsg = error switch - { - GetCommandErrorResult.RateLimitHit - => "You've spent your daily requests quota.", - GetCommandErrorResult.NotAuthorized - => "In order to use this command you have to have a 5$ or higher subscription at ", - GetCommandErrorResult.Unknown - => "The service is temporarily unavailable.", - _ => throw new ArgumentOutOfRangeException() - }; - - await _sender.Response(channel) - .Error(errorMsg) - .SendAsync(); - - return true; - } - - private string GetCommandString(EllieCommandCallModel res) - => $"{_bcs.Data.Prefix}{res.Name} {res.Arguments.Select((x, i) => GetParamString(x, i + 1 == res.Arguments.Count)).Join(" ")}"; - - private static string GetParamString(string val, bool isLast) - => isLast ? val : "\"" + val + "\""; -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Utility/Ai/AiCommandModel.cs b/src/EllieBot/Modules/Utility/Ai/AiCommandModel.cs deleted file mode 100644 index eeaf38b..0000000 --- a/src/EllieBot/Modules/Utility/Ai/AiCommandModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Text.Json.Serialization; - -namespace EllieBot.Modules.Utility; - -public sealed class AiCommandModel -{ - [JsonPropertyName("name")] - public required string Name { get; set; } - - [JsonPropertyName("desc")] - public required string Desc { get; set; } - - [JsonPropertyName("params")] - public required IReadOnlyList Params { get; set; } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Utility/Ai/AiCommandParamModel.cs b/src/EllieBot/Modules/Utility/Ai/AiCommandParamModel.cs deleted file mode 100644 index 594d581..0000000 --- a/src/EllieBot/Modules/Utility/Ai/AiCommandParamModel.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Text.Json.Serialization; - -namespace EllieBot.Modules.Utility; - -public sealed class AiCommandParamModel -{ - [JsonPropertyName("name")] - public required string Name { get; set; } - - [JsonPropertyName("desc")] - public required string Desc { get; set; } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Utility/Ai/CommandPromptResultModel.cs b/src/EllieBot/Modules/Utility/Ai/CommandPromptResultModel.cs deleted file mode 100644 index 46b5f94..0000000 --- a/src/EllieBot/Modules/Utility/Ai/CommandPromptResultModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Text.Json.Serialization; - -namespace EllieBot.Modules.Utility; - -public sealed class CommandPromptResultModel -{ - [JsonPropertyName("name")] - public required string Name { get; set; } - - [JsonPropertyName("arguments")] - public Dictionary Arguments { get; set; } = new(); - - [JsonPropertyName("remaining")] - [JsonConverter(typeof(NumberToStringConverter))] - public string Remaining { get; set; } = string.Empty; -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Utility/Ai/EllieCommandCallModel.cs b/src/EllieBot/Modules/Utility/Ai/EllieCommandCallModel.cs deleted file mode 100644 index 4de388e..0000000 --- a/src/EllieBot/Modules/Utility/Ai/EllieCommandCallModel.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace EllieBot.Modules.Utility; - -public sealed class EllieCommandCallModel -{ - public required string Name { get; set; } - public required IReadOnlyList Arguments { get; set; } - public required string Remaining { get; set; } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Utility/Ai/IAiAssistantService.cs b/src/EllieBot/Modules/Utility/Ai/IAiAssistantService.cs deleted file mode 100644 index 0fc17e2..0000000 --- a/src/EllieBot/Modules/Utility/Ai/IAiAssistantService.cs +++ /dev/null @@ -1,20 +0,0 @@ -using OneOf; - -namespace EllieBot.Modules.Utility; - -public interface IAiAssistantService -{ - Task> TryGetCommandAsync( - ulong userId, - string prompt, - IReadOnlyCollection commands, - string prefix); - - IReadOnlyCollection GetCommands(); - - Task TryExecuteAiCommand( - IGuild guild, - IUserMessage msg, - ITextChannel channel, - string query); -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Utility/Ai/UtilityCommands.cs b/src/EllieBot/Modules/Utility/Ai/UtilityCommands.cs deleted file mode 100644 index 1fd6cfd..0000000 --- a/src/EllieBot/Modules/Utility/Ai/UtilityCommands.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace EllieBot.Modules.Utility; - -public partial class Utility -{ - [Group] - public partial class PromptCommands : EllieModule - { - [Cmd] - [RequireContext(ContextType.Guild)] - public async Task Prompt([Leftover] string query) - { - await ctx.Channel.TriggerTypingAsync(); - var res = await _service.TryExecuteAiCommand(ctx.Guild, ctx.Message, (ITextChannel)ctx.Channel, query); - } - - private string GetCommandString(EllieCommandCallModel res) - => $"{_bcs.Data.Prefix}{res.Name} {res.Arguments.Select((x, i) => GetParamString(x, i + 1 == res.Arguments.Count)).Join(" ")}"; - - private static string GetParamString(string val, bool isLast) - => isLast ? val : "\"" + val + "\""; - } -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Utility/Alias/AliasCommands.cs b/src/EllieBot/Modules/Utility/Alias/AliasCommands.cs index 7a4641d..8fd9563 100644 --- a/src/EllieBot/Modules/Utility/Alias/AliasCommands.cs +++ b/src/EllieBot/Modules/Utility/Alias/AliasCommands.cs @@ -1,5 +1,6 @@ #nullable disable using Microsoft.EntityFrameworkCore; +using EllieBot.Db; using EllieBot.Modules.Utility.Services; using EllieBot.Db.Models; @@ -102,7 +103,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/Alias/AliasService.cs b/src/EllieBot/Modules/Utility/Alias/AliasService.cs index 876f155..6d47a23 100644 --- a/src/EllieBot/Modules/Utility/Alias/AliasService.cs +++ b/src/EllieBot/Modules/Utility/Alias/AliasService.cs @@ -1,6 +1,7 @@ #nullable disable using Microsoft.EntityFrameworkCore; using EllieBot.Common.ModuleBehaviors; +using EllieBot.Db; using EllieBot.Db.Models; namespace EllieBot.Modules.Utility.Services; diff --git a/src/EllieBot/Modules/Utility/Calc/CalcCommands.cs b/src/EllieBot/Modules/Utility/Calc/CalcCommand.cs similarity index 100% rename from src/EllieBot/Modules/Utility/Calc/CalcCommands.cs rename to src/EllieBot/Modules/Utility/Calc/CalcCommand.cs diff --git a/src/EllieBot/Modules/Utility/ConfigCommands.cs b/src/EllieBot/Modules/Utility/ConfigCommands.cs index 57b8f4c..28f9772 100644 --- a/src/EllieBot/Modules/Utility/ConfigCommands.cs +++ b/src/EllieBot/Modules/Utility/ConfigCommands.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable namespace EllieBot.Modules.Utility; public partial class Utility @@ -138,12 +138,12 @@ public partial class Utility private string GetPropsAndValuesString(IConfigService config, IReadOnlyCollection names) { var propValues = names.Select(pr => - { - var val = config.GetSetting(pr); - if (pr != "currency.sign") - val = val?.TrimTo(28); - return val?.Replace("\n", "") ?? "-"; - }) + { + var val = config.GetSetting(pr); + if (pr != "currency.sign") + val = val?.TrimTo(28); + return val?.Replace("\n", "") ?? "-"; + }) .ToList(); var strings = names.Zip(propValues, (name, value) => $"{name,-25} = {value}\n"); diff --git a/src/EllieBot/Modules/Utility/Giveaway/GiveawayCommands.cs b/src/EllieBot/Modules/Utility/Giveaway/GiveawayCommands.cs index 2109eef..a2ebf58 100644 --- a/src/EllieBot/Modules/Utility/Giveaway/GiveawayCommands.cs +++ b/src/EllieBot/Modules/Utility/Giveaway/GiveawayCommands.cs @@ -48,30 +48,30 @@ public partial class Utility [UserPerm(GuildPerm.ManageMessages)] public async Task GiveawayEnd(kwum id) { - var success = await _service.EndGiveawayAsync(ctx.Guild.Id, id); + var success = await _service.EndGiveawayAsync(ctx.Guild.Id, id); - if(!success) - { - await Response().Error(strs.giveaway_not_found).SendAsync(); - return; - } + if (!success) + { + await Response().Error(strs.giveaway_not_found).SendAsync(); + return; + } - await ctx.OkAsync(); + await ctx.OkAsync(); _ = ctx.Message.DeleteAfter(5); } [Cmd] [UserPerm(GuildPerm.ManageMessages)] public async Task GiveawayReroll(kwum id) - { + { var success = await _service.RerollGiveawayAsync(ctx.Guild.Id, id); if (!success) { await Response().Error(strs.giveaway_not_found).SendAsync(); return; } - - + + await ctx.OkAsync(); _ = ctx.Message.DeleteAfter(5); } diff --git a/src/EllieBot/Modules/Utility/Giveaway/GiveawayService.cs b/src/EllieBot/Modules/Utility/Giveaway/GiveawayService.cs index 0a0cf51..f43e7bb 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; @@ -19,8 +19,9 @@ public sealed class GiveawayService : IEService, IReadyExecutor private readonly IMemoryCache _cache; private SortedSet _giveawayCache = new SortedSet(); private readonly EllieRandom _rng; + private readonly ConcurrentDictionary _rerolls = new(); - 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/GuildColors.cs b/src/EllieBot/Modules/Utility/GuildColors.cs index 7f787e6..bf50902 100644 --- a/src/EllieBot/Modules/Utility/GuildColors.cs +++ b/src/EllieBot/Modules/Utility/GuildColors.cs @@ -4,7 +4,7 @@ namespace EllieBot.Modules.Utility; public interface IGuildColorsService { - + } public sealed class GuildColorsService : IGuildColorsService, IEService @@ -34,6 +34,6 @@ public partial class Utility { public class GuildColorsCommands : EllieModule { - + } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Utility/Info/InfoCommands.cs b/src/EllieBot/Modules/Utility/Info/InfoCommands.cs index c9ae861..87b8aa1 100644 --- a/src/EllieBot/Modules/Utility/Info/InfoCommands.cs +++ b/src/EllieBot/Modules/Utility/Info/InfoCommands.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable using System.Text; using EllieBot.Modules.Patronage; @@ -34,7 +34,7 @@ public partial class Utility { var guild = (IGuild)_client.GetGuild(guildId) ?? await _client.Rest.GetGuildAsync(guildId); - + if (guild is null) return; @@ -144,9 +144,9 @@ public partial class Utility true) .WithOkColor(); - var mPatron = await _ps.GetPatronAsync(user.Id); + var patron = await _ps.GetPatronAsync(user.Id); - if (mPatron is {} patron && patron.Tier != PatronTier.None) + if (patron.Tier != PatronTier.None) { embed.WithFooter(patron.Tier switch { @@ -176,5 +176,39 @@ public partial class Utility return joinedAt; } + + [Cmd] + [RequireContext(ContextType.Guild)] + [OwnerOnly] + public async Task Activity(int page = 1) + { + const int activityPerPage = 10; + page -= 1; + + if (page < 0) + return; + + var startCount = page * activityPerPage; + + var str = new StringBuilder(); + foreach (var kvp in _cmdHandler.UserMessagesSent.OrderByDescending(kvp => kvp.Value) + .Skip(page * activityPerPage) + .Take(activityPerPage)) + { + str.AppendLine(GetText(strs.activity_line(++startCount, + Format.Bold(kvp.Key.ToString()), + kvp.Value / _stats.GetUptime().TotalSeconds, + kvp.Value))); + } + + await Response() + .Embed(_sender.CreateEmbed() + .WithTitle(GetText(strs.activity_page(page + 1))) + .WithOkColor() + .WithFooter(GetText( + strs.activity_users_total(_cmdHandler.UserMessagesSent.Count))) + .WithDescription(str.ToString())) + .SendAsync(); + } } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Utility/Invite/InviteService.cs b/src/EllieBot/Modules/Utility/Invite/InviteService.cs index d89ec28..aa6946b 100644 --- a/src/EllieBot/Modules/Utility/Invite/InviteService.cs +++ b/src/EllieBot/Modules/Utility/Invite/InviteService.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable using CommandLine; namespace EllieBot.Modules.Utility.Services; @@ -45,4 +45,4 @@ public class InviteService : IEService Expire = 0; } } -} \ No newline at end of file +} diff --git a/src/EllieBot/Modules/Utility/Quote/IQuoteService.cs b/src/EllieBot/Modules/Utility/Quote/IQuoteService.cs index 87f9675..55dc96b 100644 --- a/src/EllieBot/Modules/Utility/Quote/IQuoteService.cs +++ b/src/EllieBot/Modules/Utility/Quote/IQuoteService.cs @@ -1,53 +1,6 @@ -using EllieBot.Db.Models; - -namespace EllieBot.Modules.Utility; +namespace EllieBot.Modules.Utility; public interface IQuoteService { - /// - /// Delete all quotes created by the author in a guild - /// - /// ID of the guild - /// ID of the user - /// Number of deleted qutoes Task DeleteAllAuthorQuotesAsync(ulong guildId, ulong userId); - - /// - /// Delete all quotes in a guild - /// - /// ID of the guild - /// Number of deleted qutoes - Task DeleteAllQuotesAsync(ulong guildId); - - Task> GetAllQuotesAsync(ulong guildId, int page, OrderType order); - Task GetQuoteByKeywordAsync(ulong guildId, string keyword); - - Task> SearchQuoteKeywordTextAsync( - ulong guildId, - 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); - - Task AddQuoteAsync( - ulong guildId, - ulong authorId, - string authorName, - string keyword, - string text); - - Task EditQuoteAsync(ulong authorId, int quoteId, string text); - Task EditQuoteAsync(ulong guildId, int quoteId, string keyword, string text); - - Task DeleteQuoteAsync( - ulong guildId, - ulong authorId, - bool isQuoteManager, - int quoteId); - - Task ImportQuotesAsync(ulong guildId, string input); -} \ No newline at end of file +} diff --git a/src/EllieBot/Modules/Utility/Quote/QuoteCommands.cs b/src/EllieBot/Modules/Utility/Quote/QuoteCommands.cs index a50cd19..cea5914 100644 --- a/src/EllieBot/Modules/Utility/Quote/QuoteCommands.cs +++ b/src/EllieBot/Modules/Utility/Quote/QuoteCommands.cs @@ -1,5 +1,8 @@ -#nullable disable warnings +#nullable disable warnings +using LinqToDB; +using LinqToDB.EntityFrameworkCore; using EllieBot.Common.Yml; +using EllieBot.Db; using EllieBot.Db.Models; using YamlDotNet.Serialization; using YamlDotNet.Serialization.NamingConventions; @@ -46,32 +49,35 @@ public partial class Utility [Cmd] [RequireContext(ContextType.Guild)] [Priority(1)] - public Task QuoteList(OrderType order = OrderType.Keyword) - => QuoteList(1, order); + public Task ListQuotes(OrderType order = OrderType.Keyword) + => ListQuotes(1, order); [Cmd] [RequireContext(ContextType.Guild)] [Priority(0)] - public async Task QuoteList(int page = 1, OrderType order = OrderType.Keyword) + public async Task ListQuotes(int page = 1, OrderType order = OrderType.Keyword) { page -= 1; if (page < 0) return; - var quotes = await _qs.GetAllQuotesAsync(ctx.Guild.Id, page, order); - - if (quotes.Count == 0) + IEnumerable quotes; + await using (var uow = _db.GetDbContext()) { - await Response().Error(strs.quotes_page_none).SendAsync(); - return; + quotes = uow.Set().GetGroup(ctx.Guild.Id, page, order); } - var list = quotes.Select(q => $"`{new kwum(q.Id)}` {Format.Bold(q.Keyword),-20} by {q.AuthorName}") - .Join("\n"); - - await Response() - .Confirm(GetText(strs.quotes_page(page + 1)), list) - .SendAsync(); + if (quotes.Any()) + { + await Response() + .Confirm(GetText(strs.quotes_page(page + 1)), + string.Join("\n", + quotes.Select(q + => $"`{new kwum(q.Id)}` {Format.Bold(q.Keyword.SanitizeAllMentions()),-20} by {q.AuthorName.SanitizeAllMentions()}"))) + .SendAsync(); + } + else + await Response().Error(strs.quotes_page_none).SendAsync(); } [Cmd] @@ -83,7 +89,16 @@ public partial class Utility keyword = keyword.ToUpperInvariant(); - var quote = await _qs.GetQuoteByKeywordAsync(ctx.Guild.Id, keyword); + Quote quote; + await using (var uow = _db.GetDbContext()) + { + quote = await uow.Set().GetRandomQuoteByKeywordAsync(ctx.Guild.Id, keyword); + //if (quote is not null) + //{ + // quote.UseCount += 1; + // uow.Complete(); + //} + } if (quote is null) return; @@ -95,15 +110,21 @@ public partial class Utility await Response() .Text($"`{new kwum(quote.Id)}` 📣 " + text) + .Sanitize() .SendAsync(); } - [Cmd] [RequireContext(ContextType.Guild)] public async Task QuoteShow(kwum quoteId) { - var quote = await _qs.GetQuoteByIdAsync(ctx.Guild.Id, quoteId); + Quote? quote; + await using (var uow = _db.GetDbContext()) + { + quote = uow.Set().GetById(quoteId); + if (quote?.GuildId != ctx.Guild.Id) + quote = null; + } if (quote is null) { @@ -169,30 +190,27 @@ public partial class Utility .SendAsync(); } - private async Task QuoteSearchInternalAsync(string? keyword, string textOrAuthor) + private async Task QuoteSearchinternalAsync(string? keyword, string textOrAuthor) { if (string.IsNullOrWhiteSpace(textOrAuthor)) return; keyword = keyword?.ToUpperInvariant(); - var quotes = await _qs.SearchQuoteKeywordTextAsync(ctx.Guild.Id, keyword, textOrAuthor); + Quote quote; + await using (var uow = _db.GetDbContext()) + { + quote = await uow.Set().SearchQuoteKeywordTextAsync(ctx.Guild.Id, keyword, textOrAuthor); + } + + if (quote is null) + return; await Response() - .Paginated() - .Items(quotes) - .PageSize(1) - .Page((pageQuotes, _) => - { - var quote = pageQuotes[0]; - - var text = quote.Keyword.ToLowerInvariant() + ": " + quote.Text; - - return _sender.CreateEmbed() - .WithOkColor() - .WithTitle($"{new kwum(quote.Id)} 💬 ") - .WithDescription(text); - }) + .Confirm($"`{new kwum(quote.Id)}` 💬 ", + quote.Keyword.ToLowerInvariant() + + ": " + + quote.Text.SanitizeAllMentions()) .SendAsync(); } @@ -200,13 +218,13 @@ public partial class Utility [RequireContext(ContextType.Guild)] [Priority(0)] public Task QuoteSearch(string textOrAuthor) - => QuoteSearchInternalAsync(null, textOrAuthor); + => QuoteSearchinternalAsync(null, textOrAuthor); [Cmd] [RequireContext(ContextType.Guild)] [Priority(1)] public Task QuoteSearch(string keyword, [Leftover] string textOrAuthor) - => QuoteSearchInternalAsync(keyword, textOrAuthor); + => QuoteSearchinternalAsync(keyword, textOrAuthor); [Cmd] [RequireContext(ContextType.Guild)] @@ -215,28 +233,34 @@ public partial class Utility if (quoteId < 0) return; - var quote = await _qs.GetQuoteByIdAsync(ctx.Guild.Id, quoteId); + Quote quote; - if (quote is null) + var repCtx = new ReplacementContext(Context); + + await using (var uow = _db.GetDbContext()) + { + quote = uow.Set().GetById(quoteId); + } + + if (quote is null || quote.GuildId != ctx.Guild.Id) { await Response().Error(strs.quotes_notfound).SendAsync(); return; } - var infoText = $"*`{new kwum(quote.Id)}` added by {quote.AuthorName}* 🗯️ " - + quote.Keyword.ToLowerInvariant() + var infoText = $"*`{new kwum(quote.Id)}` added by {quote.AuthorName.SanitizeAllMentions()}* 🗯️ " + + quote.Keyword.ToLowerInvariant().SanitizeAllMentions() + ":\n"; - var repCtx = new ReplacementContext(Context); var text = SmartText.CreateFrom(quote.Text); text = await repSvc.ReplaceAsync(text, repCtx); await Response() .Text(infoText + text) + .Sanitize() .SendAsync(); } - [Cmd] [RequireContext(ContextType.Guild)] public async Task QuoteAdd(string keyword, [Leftover] string text) @@ -244,14 +268,26 @@ public partial class Utility if (string.IsNullOrWhiteSpace(keyword) || string.IsNullOrWhiteSpace(text)) return; - var quote = await _qs.AddQuoteAsync(ctx.Guild.Id, ctx.User.Id, ctx.User.Username, keyword, text); + keyword = keyword.ToUpperInvariant(); - await Response() - .Confirm(strs.quote_added_new(Format.Code(new kwum(quote.Id).ToString()))) - .SendAsync(); + Quote q; + await using (var uow = _db.GetDbContext()) + { + uow.Set() + .Add(q = new() + { + AuthorId = ctx.Message.Author.Id, + AuthorName = ctx.Message.Author.Username, + GuildId = ctx.Guild.Id, + Keyword = keyword, + Text = text + }); + await uow.SaveChangesAsync(); + } + + await Response().Confirm(strs.quote_added_new(Format.Code(new kwum(q.Id).ToString()))).SendAsync(); } - [Cmd] [RequireContext(ContextType.Guild)] public async Task QuoteEdit(kwum quoteId, [Leftover] string text) @@ -261,7 +297,19 @@ public partial class Utility return; } - var q = await _qs.EditQuoteAsync(ctx.User.Id, quoteId, text); + Quote q; + await using (var uow = _db.GetDbContext()) + { + var intId = (int)quoteId; + var result = await uow.GetTable() + .Where(x => x.Id == intId && x.AuthorId == ctx.User.Id) + .Set(x => x.Text, text) + .UpdateWithOutputAsync((del, ins) => ins); + + q = result.FirstOrDefault(); + + await uow.SaveChangesAsync(); + } if (q is not null) { @@ -281,19 +329,33 @@ public partial class Utility } } - [Cmd] [RequireContext(ContextType.Guild)] public async Task QuoteDelete(kwum quoteId) { var hasManageMessages = ((IGuildUser)ctx.Message.Author).GuildPermissions.ManageMessages; - var success = await _qs.DeleteQuoteAsync(ctx.Guild.Id, ctx.User.Id, hasManageMessages, quoteId); + var success = false; + string response; + await using (var uow = _db.GetDbContext()) + { + var q = uow.Set().GetById(quoteId); + + if (q?.GuildId != ctx.Guild.Id || (!hasManageMessages && q.AuthorId != ctx.Message.Author.Id)) + response = GetText(strs.quotes_remove_none); + else + { + uow.Set().Remove(q); + await uow.SaveChangesAsync(); + success = true; + response = GetText(strs.quote_deleted(new kwum(quoteId))); + } + } if (success) - await Response().Confirm(strs.quote_deleted(quoteId)).SendAsync(); + await Response().Confirm(response).SendAsync(); else - await Response().Error(strs.quotes_remove_none).SendAsync(); + await Response().Error(response).SendAsync(); } [Cmd] @@ -321,14 +383,21 @@ public partial class Utility [Cmd] [RequireContext(ContextType.Guild)] [UserPerm(GuildPerm.ManageMessages)] - public async Task QuotesDeleteAll([Leftover] string keyword) + public async Task DelAllQuotes([Leftover] string keyword) { if (string.IsNullOrWhiteSpace(keyword)) return; - await _qs.RemoveAllByKeyword(ctx.Guild.Id, keyword.ToUpperInvariant()); + keyword = keyword.ToUpperInvariant(); - await Response().Confirm(strs.quotes_deleted(Format.Bold(keyword))).SendAsync(); + await using (var uow = _db.GetDbContext()) + { + uow.Set().RemoveAllByKeyword(ctx.Guild.Id, keyword.ToUpperInvariant()); + + await uow.SaveChangesAsync(); + } + + await Response().Confirm(strs.quotes_deleted(Format.Bold(keyword.SanitizeAllMentions()))).SendAsync(); } [Cmd] @@ -336,7 +405,11 @@ public partial class Utility [UserPerm(GuildPerm.Administrator)] public async Task QuotesExport() { - var quotes = await _qs.GetGuildQuotesAsync(ctx.Guild.Id); + IEnumerable quotes; + await using (var uow = _db.GetDbContext()) + { + quotes = uow.Set().GetForGuild(ctx.Guild.Id).ToList(); + } var exprsDict = quotes.GroupBy(x => x.Keyword) .ToDictionary(x => x.Key, x => x.Select(ExportedQuote.FromModel)); @@ -351,6 +424,9 @@ public partial class Utility [RequireContext(ContextType.Guild)] [UserPerm(GuildPerm.Administrator)] [Ratelimit(300)] +#if GLOBAL_ELLIE + [OwnerOnly] +#endif public async Task QuotesImport([Leftover] string? input = null) { input = input?.Trim(); @@ -376,7 +452,7 @@ public partial class Utility } } - var succ = await _qs.ImportQuotesAsync(ctx.Guild.Id, input); + var succ = await ImportExprsAsync(ctx.Guild.Id, input); if (!succ) { await Response().Error(strs.expr_import_invalid_data).SendAsync(); @@ -385,5 +461,56 @@ public partial class Utility await ctx.OkAsync(); } + + private async Task ImportExprsAsync(ulong guildId, string input) + { + Dictionary> data; + try + { + data = Yaml.Deserializer.Deserialize>>(input); + if (data.Sum(x => x.Value.Count) == 0) + return false; + } + catch + { + return false; + } + + await using var uow = _db.GetDbContext(); + foreach (var entry in data) + { + var keyword = entry.Key; + await uow.Set() + .AddRangeAsync(entry.Value.Where(quote => !string.IsNullOrWhiteSpace(quote.Txt)) + .Select(quote => new Quote + { + GuildId = guildId, + Keyword = keyword, + Text = quote.Txt, + AuthorId = quote.Aid, + AuthorName = quote.An + })); + } + + await uow.SaveChangesAsync(); + return true; + } + + public class ExportedQuote + { + public string Id { get; set; } + public string An { get; set; } + public ulong Aid { get; set; } + public string Txt { get; set; } + + public static ExportedQuote FromModel(Quote quote) + => new() + { + Id = ((kwum)quote.Id).ToString(), + An = quote.AuthorName, + Aid = quote.AuthorId, + Txt = quote.Text + }; + } } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Utility/Quote/QuoteService.cs b/src/EllieBot/Modules/Utility/Quote/QuoteService.cs index 429387a..bebed66 100644 --- a/src/EllieBot/Modules/Utility/Quote/QuoteService.cs +++ b/src/EllieBot/Modules/Utility/Quote/QuoteService.cs @@ -1,8 +1,6 @@ -#nullable disable warnings +#nullable disable warnings using LinqToDB; -using LinqToDB.Data; using LinqToDB.EntityFrameworkCore; -using EllieBot.Common.Yml; using EllieBot.Db.Models; namespace EllieBot.Modules.Utility; @@ -26,234 +24,9 @@ public sealed class QuoteService : IQuoteService, IEService { await using var ctx = _db.GetDbContext(); var deleted = await ctx.GetTable() - .Where(x => x.GuildId == guildId && x.AuthorId == userId) - .DeleteAsync(); + .Where(x => x.GuildId == guildId && x.AuthorId == userId) + .DeleteAsync(); return deleted; } - - /// - /// Delete all quotes in a guild - /// - /// ID of the guild - /// Number of deleted qutoes - public async Task DeleteAllQuotesAsync(ulong guildId) - { - await using var ctx = _db.GetDbContext(); - var deleted = await ctx.GetTable() - .Where(x => x.GuildId == guildId) - .DeleteAsync(); - - return deleted; - } - - public async Task> GetAllQuotesAsync(ulong guildId, int page, OrderType order) - { - await using var uow = _db.GetDbContext(); - var q = uow.Set() - .ToLinqToDBTable() - .Where(x => x.GuildId == guildId); - - if (order == OrderType.Keyword) - q = q.OrderBy(x => x.Keyword); - else - q = q.OrderBy(x => x.Id); - - return await q.Skip(15 * page).Take(15).ToArrayAsyncLinqToDB(); - } - - public async Task GetQuoteByKeywordAsync(ulong guildId, string keyword) - { - await using var uow = _db.GetDbContext(); - var quotes = await uow.GetTable() - .Where(q => q.GuildId == guildId && q.Keyword == keyword) - .ToArrayAsyncLinqToDB(); - - return quotes.RandomOrDefault(); - } - - public async Task> SearchQuoteKeywordTextAsync( - ulong guildId, - string? keyword, - string text) - { - keyword = keyword?.ToUpperInvariant(); - await using var uow = _db.GetDbContext(); - - var quotes = await uow.GetTable() - .Where(q => q.GuildId == guildId - && (keyword == null || q.Keyword == keyword)) - .ToArrayAsync(); - - var toReturn = new List(quotes.Length); - - foreach (var q in quotes) - { - if (q.AuthorName.Contains(text, StringComparison.InvariantCultureIgnoreCase) - || q.Text.Contains(text, StringComparison.InvariantCultureIgnoreCase)) - { - toReturn.Add(q); - } - } - - return toReturn; - } - - public async Task> GetGuildQuotesAsync(ulong guildId) - { - await using var uow = _db.GetDbContext(); - var quotes = await uow.GetTable() - .Where(x => x.GuildId == guildId) - .ToListAsyncLinqToDB(); - return quotes; - } - - public Task RemoveAllByKeyword(ulong guildId, string keyword) - { - keyword = keyword.ToUpperInvariant(); - - using var uow = _db.GetDbContext(); - - var count = uow.GetTable() - .Where(x => x.GuildId == guildId && x.Keyword == keyword) - .DeleteAsync(); - - return count; - } - - public async Task GetQuoteByIdAsync(ulong guildId, int quoteId) - { - await using var uow = _db.GetDbContext(); - - var quote = await uow.GetTable() - .Where(x => x.Id == quoteId && x.GuildId == guildId) - .FirstOrDefaultAsyncLinqToDB(); - - return quote; - } - - public async Task AddQuoteAsync( - ulong guildId, - ulong authorId, - string authorName, - string keyword, - string text) - { - keyword = keyword.ToUpperInvariant(); - - Quote q; - await using var uow = _db.GetDbContext(); - uow.Set() - .Add(q = new() - { - AuthorId = authorId, - AuthorName = authorName, - GuildId = guildId, - Keyword = keyword, - Text = text - }); - await uow.SaveChangesAsync(); - - return q; - } - - public async Task EditQuoteAsync(ulong authorId, int quoteId, string text) - { - await using var uow = _db.GetDbContext(); - var result = await uow.GetTable() - .Where(x => x.Id == quoteId && x.AuthorId == authorId) - .Set(x => x.Text, text) - .UpdateWithOutputAsync((del, ins) => ins); - - var q = result.FirstOrDefault(); - 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, - bool isQuoteManager, - int quoteId) - { - await using var uow = _db.GetDbContext(); - var q = uow.Set().GetById(quoteId); - - - var count = await uow.GetTable() - .Where(x => x.GuildId == guildId && x.Id == quoteId) - .Where(x => isQuoteManager || (x.AuthorId == authorId)) - .DeleteAsync(); - - - return count > 0; - } - - public async Task ImportQuotesAsync(ulong guildId, string input) - { - Dictionary> data; - try - { - data = Yaml.Deserializer.Deserialize>>(input); - } - catch (Exception ex) - { - Log.Warning(ex, "Quote import failed: {Message}", ex.Message); - return false; - } - - - var toImport = data.SelectMany(x => x.Value.Select(v => (Key: x.Key, Value: v))) - .Where(x => !string.IsNullOrWhiteSpace(x.Key) && !string.IsNullOrWhiteSpace(x.Value?.Txt)); - - await using var uow = _db.GetDbContext(); - await uow.GetTable() - .BulkCopyAsync(toImport - .Select(q => new Quote - { - GuildId = guildId, - Keyword = q.Key, - Text = q.Value.Txt, - AuthorId = q.Value.Aid, - AuthorName = q.Value.An - })); - - 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/Quote/_common/ExportedQuote.cs b/src/EllieBot/Modules/Utility/Quote/_common/ExportedQuote.cs deleted file mode 100644 index c0ee68d..0000000 --- a/src/EllieBot/Modules/Utility/Quote/_common/ExportedQuote.cs +++ /dev/null @@ -1,20 +0,0 @@ -using EllieBot.Db.Models; - -namespace EllieBot.Modules.Utility; - -public class ExportedQuote -{ - public required string Id { get; init; } - public required string An { get; init; } - public required ulong Aid { get; init; } - public required string Txt { get; init; } - - public static ExportedQuote FromModel(Quote quote) - => new() - { - Id = ((kwum)quote.Id).ToString(), - An = quote.AuthorName, - Aid = quote.AuthorId, - Txt = quote.Text - }; -} \ No newline at end of file diff --git a/src/EllieBot/Modules/Utility/Remind/RemindCommands.cs b/src/EllieBot/Modules/Utility/Remind/RemindCommands.cs index b568ada..8a414dc 100644 --- a/src/EllieBot/Modules/Utility/Remind/RemindCommands.cs +++ b/src/EllieBot/Modules/Utility/Remind/RemindCommands.cs @@ -1,4 +1,5 @@ #nullable disable +using EllieBot.Db; using EllieBot.Modules.Utility.Services; using EllieBot.Db.Models; @@ -44,14 +45,11 @@ public partial class Utility ulong target; target = meorhere == MeOrHere.Me ? ctx.User.Id : ctx.Channel.Id; - - var success = await RemindInternal(target, - meorhere == MeOrHere.Me || ctx.Guild is null, - remindData.Time, - remindData.What, - ReminderType.User); - - if (!success) + if (!await RemindInternal(target, + meorhere == MeOrHere.Me || ctx.Guild is null, + remindData.Time, + remindData.What, + ReminderType.User)) await Response().Error(strs.remind_too_long).SendAsync(); } @@ -75,8 +73,7 @@ public partial class Utility } - var success = await RemindInternal(channel.Id, false, remindData.Time, remindData.What, ReminderType.User); - if (!success) + if (!await RemindInternal(channel.Id, false, remindData.Time, remindData.What, ReminderType.User)) await Response().Error(strs.remind_too_long).SendAsync(); } @@ -85,56 +82,53 @@ public partial class Utility [UserPerm(GuildPerm.Administrator)] [Priority(0)] public Task RemindList(Server _, int page = 1) - => RemindListInternal(page, ctx.Guild.Id); + => RemindListInternal(page, true); [Cmd] [Priority(1)] public Task RemindList(int page = 1) - => RemindListInternal(page, null); + => RemindListInternal(page, false); - private async Task RemindListInternal(int page, ulong? guildId) + private async Task RemindListInternal(int page, bool isServer) { if (--page < 0) return; var embed = _sender.CreateEmbed() - .WithOkColor() - .WithTitle(GetText(guildId is not null - ? strs.reminder_server_list - : strs.reminder_list)); + .WithOkColor() + .WithTitle(GetText(isServer ? strs.reminder_server_list : strs.reminder_list)); List rems; - if (guildId is { } gid) - rems = await _service.GetServerReminders(page, gid); - else - rems = await _service.GetUserReminders(page, ctx.User.Id); + await using (var uow = _db.GetDbContext()) + { + if (isServer) + rems = uow.Set().RemindersForServer(ctx.Guild.Id, page).ToList(); + else + rems = uow.Set().RemindersFor(ctx.User.Id, page).ToList(); + } - - if (rems.Count > 0) + if (rems.Any()) { var i = 0; foreach (var rem in rems) { var when = rem.When; + var diff = when - DateTime.UtcNow; embed.AddField( - $"#{++i + (page * 10)}", - $""" - `When:` {TimestampTag.FromDateTime(when, TimestampTagStyles.ShortDateTime)} - `Target:` {(rem.IsPrivate ? "DM" : "Channel")} [`{rem.ChannelId}`] - `Message:` {rem.Message?.TrimTo(50)} - """); + $"#{++i + (page * 10)} {rem.When:HH:mm yyyy-MM-dd} UTC " + + $"(in {diff.ToPrettyStringHm()})", + $@"`Target:` {(rem.IsPrivate ? "DM" : "Channel")} +`TargetId:` {rem.ChannelId} +`Message:` {rem.Message?.TrimTo(50)}"); } } else - { embed.WithDescription(GetText(strs.reminders_none)); - } embed.AddPaginatedFooter(page + 1, null); await Response().Embed(embed).SendAsync(); } - [Cmd] [RequireContext(ContextType.Guild)] [UserPerm(GuildPerm.Administrator)] @@ -209,14 +203,21 @@ public partial class Utility await uow.SaveChangesAsync(); } - // var gTime = ctx.Guild is null ? time : TimeZoneInfo.ConvertTime(time, _tz.GetTimeZoneOrUtc(ctx.Guild.Id)); - await Response() - .Confirm($"\u23f0 {GetText(strs.remind2( - Format.Bold(!isPrivate ? $"<#{targetId}>" : ctx.User.Username), - Format.Bold(message), - TimestampTag.FromDateTime(DateTime.UtcNow.Add(ts), TimestampTagStyles.Relative), - TimestampTag.FormatFromDateTime(time, TimestampTagStyles.ShortDateTime)))}") - .SendAsync(); + var gTime = ctx.Guild is null ? time : TimeZoneInfo.ConvertTime(time, _tz.GetTimeZoneOrUtc(ctx.Guild.Id)); + try + { + await Response() + .Confirm($"\u23f0 {GetText(strs.remind( + Format.Bold(!isPrivate ? $"<#{targetId}>" : ctx.User.Username), + Format.Bold(message), + ts.ToPrettyStringHm(), + gTime, + gTime))}") + .SendAsync(); + } + catch + { + } return true; } diff --git a/src/EllieBot/Modules/Utility/Remind/RemindService.cs b/src/EllieBot/Modules/Utility/Remind/RemindService.cs index 0d91498..dad22d2 100644 --- a/src/EllieBot/Modules/Utility/Remind/RemindService.cs +++ b/src/EllieBot/Modules/Utility/Remind/RemindService.cs @@ -11,20 +11,19 @@ namespace EllieBot.Modules.Utility.Services; 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]|.)+)", + 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]|.)+)", 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 +196,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() + 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(); + .Text(r.Message) + .SendAsync(); } } catch (Exception ex) @@ -259,16 +255,4 @@ public class RemindService : IEService, IReadyExecutor, IRemindService .AddAsync(rem); await ctx.SaveChangesAsync(); } - - public async Task> GetServerReminders(int page, ulong guildId) - { - await using var uow = _db.GetDbContext(); - return uow.Set().RemindersForServer(guildId, page).ToList(); - } - - public async Task> GetUserReminders(int page, ulong userId) - { - await using var uow = _db.GetDbContext(); - return uow.Set().RemindersFor(userId, page).ToList(); - } } \ No newline at end of file diff --git a/src/EllieBot/Modules/Utility/Repeater/RepeaterService.cs b/src/EllieBot/Modules/Utility/Repeater/RepeaterService.cs index 7aa9b76..6adb2c0 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; @@ -262,7 +262,7 @@ public sealed class RepeaterService : IReadyExecutor, IEService var repCtx = new ReplacementContext(client: _client, guild: guild, channel: channel, - user: guild.CurrentUser); + users: guild.CurrentUser); try { @@ -273,7 +273,7 @@ public sealed class RepeaterService : IReadyExecutor, IEService .Text(text) .Sanitize(false) .SendAsync(); - + _ = newMsg.AddReactionAsync(new Emoji("🔄")); if (_noRedundant.Contains(repeater.Id)) diff --git a/src/EllieBot/Modules/Utility/Repeater/RunningRepeater.cs b/src/EllieBot/Modules/Utility/Repeater/RunningRepeater.cs index 509347f..52f4072 100644 --- a/src/EllieBot/Modules/Utility/Repeater/RunningRepeater.cs +++ b/src/EllieBot/Modules/Utility/Repeater/RunningRepeater.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable using EllieBot.Db.Models; namespace EllieBot.Modules.Utility.Services; diff --git a/src/EllieBot/Modules/Utility/StreamRole/StreamRoleService.cs b/src/EllieBot/Modules/Utility/StreamRole/StreamRoleService.cs index eee20a1..1b5796a 100644 --- a/src/EllieBot/Modules/Utility/StreamRole/StreamRoleService.cs +++ b/src/EllieBot/Modules/Utility/StreamRole/StreamRoleService.cs @@ -1,4 +1,5 @@ using EllieBot.Common.ModuleBehaviors; +using EllieBot.Db; using EllieBot.Modules.Utility.Common; using EllieBot.Modules.Utility.Common.Exceptions; using EllieBot.Db.Models; @@ -29,7 +30,7 @@ public class StreamRoleService : IReadyExecutor, IEService private Task OnPresenceUpdate(SocketUser user, SocketPresence? oldPresence, SocketPresence? newPresence) { - + _ = Task.Run(async () => { if (oldPresence?.Activities?.Count != newPresence?.Activities?.Count) diff --git a/src/EllieBot/Modules/Utility/Todo/TodoService.cs b/src/EllieBot/Modules/Utility/Todo/TodoService.cs index 38ea848..72a7d13 100644 --- a/src/EllieBot/Modules/Utility/Todo/TodoService.cs +++ b/src/EllieBot/Modules/Utility/Todo/TodoService.cs @@ -140,7 +140,7 @@ public sealed class TodoService : IEService return ArchiveTodoResult.NoTodos; } - + await tr.CommitAsync(); return ArchiveTodoResult.Success; @@ -183,7 +183,7 @@ public sealed class TodoService : IEService public async Task GetTodoAsync(ulong userId, int todoId) { await using var ctx = _db.GetDbContext(); - + return await ctx .GetTable() .Where(x => x.UserId == userId && x.Id == todoId) diff --git a/src/EllieBot/Modules/Utility/UnitConversion/ConverterService.cs b/src/EllieBot/Modules/Utility/UnitConversion/ConverterService.cs index 12d9f8e..85c299d 100644 --- a/src/EllieBot/Modules/Utility/UnitConversion/ConverterService.cs +++ b/src/EllieBot/Modules/Utility/UnitConversion/ConverterService.cs @@ -63,20 +63,20 @@ public class ConverterService : IEService, IReadyExecutor UnitType = unitTypeString }; var units = currencyRates.ConversionRates.Select(u => new ConvertUnit - { - Triggers = [u.Key], - Modifier = u.Value, - UnitType = unitTypeString - }) + { + Triggers = [u.Key], + Modifier = u.Value, + UnitType = unitTypeString + }) .ToList(); - var stream = File.OpenRead("data/units.json"); + var stream = File.OpenRead("data/units.json"); var defaultUnits = await JsonSerializer.DeserializeAsync(stream); - if(defaultUnits is not null) + if (defaultUnits is not null) units.AddRange(defaultUnits); - + units.Add(baseType); - + await _cache.AddAsync(_convertKey, units); } @@ -90,7 +90,7 @@ public class Rates { [JsonPropertyName("base")] public string Base { get; set; } - + [JsonPropertyName("date")] public DateTime Date { get; set; } diff --git a/src/EllieBot/Modules/Utility/Utility.cs b/src/EllieBot/Modules/Utility/Utility.cs index 146a97c..1c53f8c 100644 --- a/src/EllieBot/Modules/Utility/Utility.cs +++ b/src/EllieBot/Modules/Utility/Utility.cs @@ -1,3 +1,4 @@ +#nullable disable using EllieBot.Modules.Utility.Services; using Newtonsoft.Json; using System.Diagnostics; @@ -31,26 +32,25 @@ public partial class Utility : EllieModule PropertyNamingPolicy = LowerCaseNamingPolicy.Default }; + private static SemaphoreSlim sem = new(1, 1); 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; private readonly IServiceProvider _services; - private readonly AfkService _afkService; public Utility( DiscordSocketClient client, ICoordinator coord, IStatsService stats, - IBotCreds creds, + IBotCredentials creds, DownloadTracker tracker, IHttpClientFactory httpFactory, VerboseErrorsService veService, - IServiceProvider services, - AfkService afkService) + IServiceProvider services) { _client = client; _coord = coord; @@ -60,7 +60,6 @@ public partial class Utility : EllieModule _httpFactory = httpFactory; _veService = veService; _services = services; - _afkService = afkService; } [Cmd] @@ -100,7 +99,7 @@ public partial class Utility : EllieModule [Cmd] [RequireContext(ContextType.Guild)] - public async Task WhosPlaying([Leftover] string? game) + public async Task WhosPlaying([Leftover] string game) { game = game?.Trim().ToUpperInvariant(); if (string.IsNullOrWhiteSpace(game)) @@ -112,44 +111,36 @@ public partial class Utility : EllieModule return; } + var rng = new EllieRandom(); + var arr = await Task.Run(() => socketGuild.Users + .Where(u => u.Activities.FirstOrDefault() + ?.Name?.Trim() + .ToUpperInvariant() + == game) + .Select(u => u.Username) + .OrderBy(_ => rng.Next()) + .Take(60) + .ToArray()); - var userNames = new List(socketGuild.Users.Count / 100); - foreach (var user in socketGuild.Users) + var i = 0; + if (arr.Length == 0) + await Response().Error(strs.nobody_playing_game).SendAsync(); + else { - if (user.Activities.Any(x => x.Name is not null && x.Name.ToUpperInvariant() == game)) - { - userNames.Add(user); - } + await Response() + .Confirm("```css\n" + + string.Join("\n", + arr.GroupBy(_ => i++ / 2) + .Select(ig => string.Concat(ig.Select(el => $"• {el,-27}")))) + + "\n```") + .SendAsync(); } - - await Response() - .Sanitize() - .Paginated() - .Items(userNames) - .PageSize(20) - .Page((names, _) => - { - if (names.Count == 0) - { - return _sender.CreateEmbed() - .WithErrorColor() - .WithDescription(GetText(strs.nobody_playing_game)); - } - - var eb = _sender.CreateEmbed() - .WithOkColor(); - - var users = names.Join('\n'); - - return eb.WithDescription(users); - }) - .SendAsync(); } [Cmd] [RequireContext(ContextType.Guild)] [Priority(0)] - public async Task InRole(int page, [Leftover] IRole? role = null) + public async Task InRole(int page, [Leftover] IRole role = null) { if (--page < 0) return; @@ -161,16 +152,9 @@ public partial class Utility : EllieModule CacheMode.CacheOnly ); - users = role is null - ? users - : users.Where(u => u.RoleIds.Contains(role.Id)).ToList(); - - - var roleUsers = new List(users.Count); - foreach (var u in users) - { - roleUsers.Add($"{u.Mention} {Format.Spoiler(Format.Code(u.Username))}"); - } + var roleUsers = users.Where(u => role is null ? u.RoleIds.Count == 1 : u.RoleIds.Contains(role.Id)) + .Select(u => $"{u.Mention} {Format.Spoiler(Format.Code(u.Username))}") + .ToArray(); await Response() .Paginated() @@ -182,11 +166,10 @@ public partial class Utility : EllieModule if (pageUsers.Count == 0) return _sender.CreateEmbed().WithOkColor().WithDescription(GetText(strs.no_user_on_this_page)); - var roleName = Format.Bold(role?.Name ?? "No Role"); - return _sender.CreateEmbed() .WithOkColor() - .WithTitle(GetText(strs.inrole_list(roleName, roleUsers.Count))) + .WithTitle(GetText(strs.inrole_list(Format.Bold(role?.Name ?? "No Role"), + roleUsers.Length))) .WithDescription(string.Join("\n", pageUsers)); }) .SendAsync(); @@ -195,7 +178,7 @@ public partial class Utility : EllieModule [Cmd] [RequireContext(ContextType.Guild)] [Priority(1)] - public Task InRole([Leftover] IRole? role = null) + public Task InRole([Leftover] IRole role = null) => InRole(1, role); [Cmd] @@ -223,9 +206,19 @@ public partial class Utility : EllieModule await Response().Confirm(builder.ToString()).SendAsync(); } + // [Cmd] + // [RequireContext(ContextType.Guild)] + // [RequireUserPermission(GuildPermission.ManageRoles)] + // public async Task CheckPerms(SocketRole role, string perm = null) + // { + // ChannelPermissions. + // var perms = ((ITextChannel)ctx.Channel); + // await SendPerms(perms) + // } + [Cmd] [RequireContext(ContextType.Guild)] - public async Task UserId([Leftover] IGuildUser? target = null) + public async Task UserId([Leftover] IGuildUser target = null) { var usr = target ?? ctx.User; await Response() @@ -255,7 +248,7 @@ public partial class Utility : EllieModule [Cmd] [RequireContext(ContextType.Guild)] - public async Task Roles(IGuildUser? target, int page = 1) + public async Task Roles(IGuildUser target, int page = 1) { var guild = ctx.Guild; @@ -308,7 +301,7 @@ public partial class Utility : EllieModule [Cmd] [RequireContext(ContextType.Guild)] - public async Task ChannelTopic([Leftover] ITextChannel? channel = null) + public async Task ChannelTopic([Leftover] ITextChannel channel = null) { if (channel is null) channel = (ITextChannel)ctx.Channel; @@ -327,33 +320,31 @@ public partial class Utility : EllieModule if (string.IsNullOrWhiteSpace(ownerIds)) ownerIds = "-"; - var eb = _sender.CreateEmbed() - .WithOkColor() - .WithAuthor($"EllieBot v{StatsService.BotVersion}", - "https://cdn.elliebot.net/Ellie.png", - "https://docs.elliebot.net") - .AddField(GetText(strs.author), _stats.Author, true) - .AddField(GetText(strs.botid), _client.CurrentUser.Id.ToString(), true) - .AddField(GetText(strs.shard), - $"#{_client.ShardId} / {_creds.TotalShards}", - true) - .AddField(GetText(strs.commands_ran), _stats.CommandsRan.ToString(), true) - .AddField(GetText(strs.messages), - $"{_stats.MessageCounter} ({_stats.MessagesPerSecond:F2}/sec)", - true) - .AddField(GetText(strs.memory), - FormattableString.Invariant($"{_stats.GetPrivateMemoryMegabytes():F2} MB"), - true) - .AddField(GetText(strs.owner_ids), ownerIds, true) - .AddField(GetText(strs.uptime), _stats.GetUptimeString("\n"), true) - .AddField(GetText(strs.presence), - GetText(strs.presence_txt(_coord.GetGuildCount(), - _stats.TextChannels, - _stats.VoiceChannels)), - true); - await Response() - .Embed(eb) + .Embed(_sender.CreateEmbed() + .WithOkColor() + .WithAuthor($"EllieBot v{StatsService.BotVersion}", + "https://cdn.elliebot.net/Ellie.png", + "https://docs.elliebot.net/") + .AddField(GetText(strs.author), _stats.Author, true) + .AddField(GetText(strs.botid), _client.CurrentUser.Id.ToString(), true) + .AddField(GetText(strs.shard), + $"#{_client.ShardId} / {_creds.TotalShards}", + true) + .AddField(GetText(strs.commands_ran), _stats.CommandsRan.ToString(), true) + .AddField(GetText(strs.messages), + $"{_stats.MessageCounter} ({_stats.MessagesPerSecond:F2}/sec)", + true) + .AddField(GetText(strs.memory), + FormattableString.Invariant($"{_stats.GetPrivateMemoryMegabytes():F2} MB"), + true) + .AddField(GetText(strs.owner_ids), ownerIds, true) + .AddField(GetText(strs.uptime), _stats.GetUptimeString("\n"), true) + .AddField(GetText(strs.presence), + GetText(strs.presence_txt(_coord.GetGuildCount(), + _stats.TextChannels, + _stats.VoiceChannels)), + true)) .SendAsync(); } @@ -391,7 +382,7 @@ public partial class Utility : EllieModule [BotPerm(GuildPerm.ManageEmojisAndStickers)] [UserPerm(GuildPerm.ManageEmojisAndStickers)] [Priority(0)] - public async Task EmojiAdd(string name, string? url = null) + public async Task EmojiAdd(string name, string url = null) { name = name.Trim(':'); @@ -465,85 +456,50 @@ public partial class Utility : EllieModule [RequireContext(ContextType.Guild)] [BotPerm(GuildPerm.ManageEmojisAndStickers)] [UserPerm(GuildPerm.ManageEmojisAndStickers)] - public async Task StickerAdd(string? name = null, string? description = null, params string[] tags) + public async Task StickerAdd(string name = null, string description = null, params string[] tags) { string format; - Stream? stream = null; + Stream stream; + + if (ctx.Message.Stickers.Count is 1 && ctx.Message.Stickers.First() is SocketSticker ss) + { + name ??= ss.Name; + description = ss.Description; + tags = tags is null or { Length: 0 } ? ss.Tags.ToArray() : tags; + format = FormatToExtension(ss.Format); + + using var http = _httpFactory.CreateClient(); + stream = await http.GetStreamAsync(ss.GetStickerUrl()); + } + else + { + await Response().Error(strs.sticker_error).SendAsync(); + return; + } try { - if (ctx.Message.Stickers.Count is 1 && ctx.Message.Stickers.First() is SocketSticker ss) - { - name ??= ss.Name; - description = ss.Description; - tags = tags is null or { Length: 0 } ? ss.Tags.ToArray() : tags; - format = FormatToExtension(ss.Format); + if (tags.Length == 0) + tags = [name]; - using var http = _httpFactory.CreateClient(); - stream = await http.GetStreamAsync(ss.GetStickerUrl()); - } - else if (ctx.Message.Attachments.Count is 1 && name is not null) - { - if (tags.Length == 0) - tags = [name]; + await ctx.Guild.CreateStickerAsync( + name, + stream, + $"{name}.{format}", + tags, + string.IsNullOrWhiteSpace(description) ? "Missing description" : description + ); - if (ctx.Message.Attachments.Count != 1) - { - await Response().Error(strs.sticker_error).SendAsync(); - return; - } - - var attach = ctx.Message.Attachments.First(); - - - if (attach.Size > 512_000 || attach.Width != 300 || attach.Height != 300) - { - await Response().Error(strs.sticker_error).SendAsync(); - return; - } - - format = attach.Filename - .Split('.') - .Last() - .ToLowerInvariant(); - - if (string.IsNullOrWhiteSpace(format) || (format != "png" && format != "apng")) - { - await Response().Error(strs.sticker_error).SendAsync(); - return; - } - - using var http = _httpFactory.CreateClient(); - stream = await http.GetStreamAsync(attach.Url); - } - else - { - await Response().Error(strs.sticker_error).SendAsync(); - return; - } - - try - { - await ctx.Guild.CreateStickerAsync( - name, - stream, - $"{name}.{format}", - tags, - string.IsNullOrWhiteSpace(description) ? "Missing description" : description - ); - - await ctx.OkAsync(); - } - catch - (Exception ex) - { - Log.Warning(ex, "Error occurred while adding a sticker: {Message}", ex.Message); - await Response().Error(strs.error_occured).SendAsync(); - } + await ctx.OkAsync(); + } + catch (Exception ex) + { + Log.Warning(ex, "Error occurred while adding a sticker: {Message}", ex.Message); + await Response().Error(strs.error_occured).SendAsync(); } finally { - await (stream?.DisposeAsync() ?? ValueTask.CompletedTask); + await stream.DisposeAsync(); } } @@ -564,38 +520,29 @@ public partial class Utility : EllieModule [Cmd] [OwnerOnly] - public async Task ServerList(int page = 1) + public async Task ListServers(int page = 1) { page -= 1; if (page < 0) return; - var allGuilds = _client.Guilds - .OrderBy(g => g.Name) - .ToList(); + var guilds = _client.Guilds.OrderBy(g => g.Name) + .Skip(page * 15) + .Take(15) + .ToList(); - await Response() - .Paginated() - .Items(allGuilds) - .PageSize(9) - .Page((guilds, _) => - { - if (!guilds.Any()) - { - return _sender.CreateEmbed() - .WithDescription(GetText(strs.listservers_none)) - .WithErrorColor(); - } + if (!guilds.Any()) + { + await Response().Error(strs.listservers_none).SendAsync(); + return; + } - var embed = _sender.CreateEmbed() - .WithOkColor(); - foreach (var guild in guilds) - embed.AddField(guild.Name, GetText(strs.listservers(guild.Id, guild.MemberCount, guild.OwnerId))); + var embed = _sender.CreateEmbed().WithOkColor(); + foreach (var guild in guilds) + embed.AddField(guild.Name, GetText(strs.listservers(guild.Id, guild.MemberCount, guild.OwnerId))); - return embed; - }) - .SendAsync(); + await Response().Embed(embed).SendAsync(); } [Cmd] @@ -681,17 +628,24 @@ public partial class Utility : EllieModule } [Cmd] - [Ratelimit(3)] public async Task Ping() { - var sw = Stopwatch.StartNew(); - var msg = await Response().Text("🏓").SendAsync(); - sw.Stop(); - msg.DeleteAfter(0); + await sem.WaitAsync(5000); + try + { + var sw = Stopwatch.StartNew(); + var msg = await Response().Text("🏓").SendAsync(); + sw.Stop(); + msg.DeleteAfter(0); - await Response() - .Confirm($"{Format.Bold(ctx.User.ToString())} 🏓 {(int)sw.Elapsed.TotalMilliseconds}ms") - .SendAsync(); + await Response() + .Confirm($"{Format.Bold(ctx.User.ToString())} 🏓 {(int)sw.Elapsed.TotalMilliseconds}ms") + .SendAsync(); + } + finally + { + sem.Release(); + } } [Cmd] @@ -707,19 +661,6 @@ public partial class Utility : EllieModule await Response().Confirm(strs.verbose_errors_disabled).SendAsync(); } - [Cmd] - public async Task Afk([Leftover] string text = "No reason specified.") - { - var succ = await _afkService.SetAfkAsync(ctx.User.Id, text); - - if (succ) - { - await Response() - .Confirm(strs.afk_set) - .SendAsync(); - } - } - [Cmd] [NoPublicBot] [OwnerOnly] @@ -783,28 +724,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/Utility/VerboseErrorsService.cs b/src/EllieBot/Modules/Utility/VerboseErrorsService.cs index e8e8c43..e80f889 100644 --- a/src/EllieBot/Modules/Utility/VerboseErrorsService.cs +++ b/src/EllieBot/Modules/Utility/VerboseErrorsService.cs @@ -1,4 +1,6 @@ #nullable disable +using EllieBot.Db; + namespace EllieBot.Modules.Utility.Services; public class VerboseErrorsService : IEService @@ -56,7 +58,7 @@ public class VerboseErrorsService : IEService if (maybeEnabled is bool isEnabled) // set it gc.VerboseErrors = isEnabled; else // toggle it - isEnabled = gc.VerboseErrors = !gc.VerboseErrors; + isEnabled = gc.VerboseErrors = !gc.VerboseErrors; uow.SaveChanges(); diff --git a/src/EllieBot/Modules/Utility/_common/ConvertUnit.cs b/src/EllieBot/Modules/Utility/_common/ConvertUnit.cs index b65fdea..e38cbe4 100644 --- a/src/EllieBot/Modules/Utility/_common/ConvertUnit.cs +++ b/src/EllieBot/Modules/Utility/_common/ConvertUnit.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable using System.Diagnostics; namespace EllieBot.Modules.Utility.Common; diff --git a/src/EllieBot/Modules/Utility/_common/EvalGlobals.cs b/src/EllieBot/Modules/Utility/_common/EvalGlobals.cs index a31c056..ffe3ecd 100644 --- a/src/EllieBot/Modules/Utility/_common/EvalGlobals.cs +++ b/src/EllieBot/Modules/Utility/_common/EvalGlobals.cs @@ -1,4 +1,4 @@ -// ReSharper disable InconsistentNaming +// ReSharper disable InconsistentNaming #nullable disable namespace EllieBot.Modules.Utility; diff --git a/src/EllieBot/Modules/Utility/_common/Exceptions/StreamRoleNotFoundException.cs b/src/EllieBot/Modules/Utility/_common/Exceptions/StreamRoleNotFoundException.cs index d1880b2..45e007e 100644 --- a/src/EllieBot/Modules/Utility/_common/Exceptions/StreamRoleNotFoundException.cs +++ b/src/EllieBot/Modules/Utility/_common/Exceptions/StreamRoleNotFoundException.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable namespace EllieBot.Modules.Utility.Common.Exceptions; public class StreamRoleNotFoundException : Exception @@ -8,13 +8,13 @@ public class StreamRoleNotFoundException : Exception { } - public StreamRoleNotFoundException(string message) + public StreamRoleNotFoundException(string message) : base(message) { } - public StreamRoleNotFoundException(string message, Exception innerException) + public StreamRoleNotFoundException(string message, Exception innerException) : base(message, innerException) { } -} \ No newline at end of file +} diff --git a/src/EllieBot/Modules/Utility/_common/Exceptions/StreamRolePermissionException.cs b/src/EllieBot/Modules/Utility/_common/Exceptions/StreamRolePermissionException.cs index d75c53c..97fd187 100644 --- a/src/EllieBot/Modules/Utility/_common/Exceptions/StreamRolePermissionException.cs +++ b/src/EllieBot/Modules/Utility/_common/Exceptions/StreamRolePermissionException.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable namespace EllieBot.Modules.Utility.Common.Exceptions; public class StreamRolePermissionException : Exception diff --git a/src/EllieBot/Modules/Utility/_common/StreamRoleListType.cs b/src/EllieBot/Modules/Utility/_common/StreamRoleListType.cs index aca487b..775b346 100644 --- a/src/EllieBot/Modules/Utility/_common/StreamRoleListType.cs +++ b/src/EllieBot/Modules/Utility/_common/StreamRoleListType.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable namespace EllieBot.Modules.Utility.Common; public enum StreamRoleListType diff --git a/src/EllieBot/Modules/Xp/Club/Club.cs b/src/EllieBot/Modules/Xp/Club/Club.cs index 4ce1c57..d584eba 100644 --- a/src/EllieBot/Modules/Xp/Club/Club.cs +++ b/src/EllieBot/Modules/Xp/Club/Club.cs @@ -1,4 +1,5 @@ #nullable disable +using EllieBot.Db; using EllieBot.Db.Models; using EllieBot.Modules.Xp.Services; @@ -122,8 +123,6 @@ public partial class Xp }) .ToList(); - var rank = await _service.GetClubRankAsync(club.Id); - await Response() .Paginated() .Items(allUsers) @@ -136,7 +135,6 @@ public partial class Xp .WithDescription(GetText(strs.level_x(lvl.Level + $" ({club.Xp} xp)"))) .AddField(GetText(strs.desc), string.IsNullOrWhiteSpace(club.Description) ? "-" : club.Description) - .AddField(GetText(strs.rank), $"#{rank}", true) .AddField(GetText(strs.owner), club.Owner.ToString(), true) // .AddField(GetText(strs.level_req), club.MinimumLevelReq.ToString(), true) .AddField(GetText(strs.members), diff --git a/src/EllieBot/Modules/Xp/Club/ClubService.cs b/src/EllieBot/Modules/Xp/Club/ClubService.cs index dad45ba..be89659 100644 --- a/src/EllieBot/Modules/Xp/Club/ClubService.cs +++ b/src/EllieBot/Modules/Xp/Club/ClubService.cs @@ -1,6 +1,8 @@ +#nullable disable using LinqToDB; using LinqToDB.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; +using EllieBot.Db; using EllieBot.Db.Models; using OneOf; @@ -21,22 +23,22 @@ public class ClubService : IEService, IClubService { if (!CheckClubName(clubName)) return ClubCreateResult.NameTooLong; - + //must be lvl 5 and must not be in a club already await using var uow = _db.GetDbContext(); var du = uow.GetOrCreateUser(user); var xp = new LevelStats(du.TotalXp); - - if (xp.Level < 5) + + if (xp.Level < 5) return ClubCreateResult.InsufficientLevel; - + if (du.ClubId is not null) return ClubCreateResult.AlreadyInAClub; if (await uow.Set().AnyAsyncEF(x => x.Name == clubName)) return ClubCreateResult.NameTaken; - + du.IsClubAdmin = true; du.Club = new() { @@ -51,7 +53,7 @@ public class ClubService : IEService, IClubService return ClubCreateResult.Success; } - + public OneOf TransferClub(IUser from, IUser newOwner) { using var uow = _db.GetDbContext(); @@ -60,7 +62,7 @@ public class ClubService : IEService, IClubService if (club is null || club.Owner.UserId != from.Id) return ClubTransferError.NotOwner; - + if (!club.Members.Contains(newOwnerUser)) return ClubTransferError.TargetNotMember; @@ -70,22 +72,22 @@ public class ClubService : IEService, IClubService uow.SaveChanges(); return club; } - + public async Task ToggleAdminAsync(IUser owner, IUser toAdmin) { if (owner.Id == toAdmin.Id) return ToggleAdminResult.CantTargetThyself; - + await using var uow = _db.GetDbContext(); var club = uow.Set().GetByOwner(owner.Id); var adminUser = uow.GetOrCreateUser(toAdmin); if (club is null) return ToggleAdminResult.NotOwner; - - if (!club.Members.Contains(adminUser)) + + if(!club.Members.Contains(adminUser)) return ToggleAdminResult.TargetNotMember; - + var newState = adminUser.IsClubAdmin = !adminUser.IsClubAdmin; await uow.SaveChangesAsync(); return newState ? ToggleAdminResult.AddedAdmin : ToggleAdminResult.RemovedAdmin; @@ -97,17 +99,17 @@ public class ClubService : IEService, IClubService var member = uow.Set().GetByMember(user.Id); return member; } - - public async Task SetClubIconAsync(ulong ownerUserId, string? url) + + public async Task SetClubIconAsync(ulong ownerUserId, string url) { - if (!string.IsNullOrWhiteSpace(url)) + if (url is not null) { using var http = _httpFactory.CreateClient(); using var temp = await http.GetAsync(url, HttpCompletionOption.ResponseHeadersRead); - - if (!temp.IsImage()) + + if (!temp.IsImage()) return SetClubIconResult.InvalidFileType; - + if (temp.GetContentLength() > 5.Megabytes()) return SetClubIconResult.TooLarge; } @@ -132,18 +134,6 @@ public class ClubService : IEService, IClubService return club is not null; } - public async Task GetClubRankAsync(int clubId) - { - await using var uow = _db.GetDbContext(); - - var rank = await uow.Clubs - .ToLinqToDBTable() - .Where(x => x.Xp > (uow.Clubs.First(c => c.Id == clubId).Xp)) - .CountAsyncLinqToDB(); - - return rank + 1; - } - public ClubApplyResult ApplyToClub(IUser user, ClubInfo club) { using var uow = _db.GetDbContext(); @@ -154,10 +144,10 @@ public class ClubService : IEService, IClubService // or doesn't min minumum level requirement, can't apply if (du.ClubId is not null) return ClubApplyResult.AlreadyInAClub; - + if (club.Bans.Any(x => x.UserId == du.Id)) return ClubApplyResult.Banned; - + if (club.Applicants.Any(x => x.UserId == du.Id)) return ClubApplyResult.AlreadyApplied; @@ -172,8 +162,8 @@ public class ClubService : IEService, IClubService return ClubApplyResult.Success; } - - 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(); @@ -198,8 +188,8 @@ public class ClubService : IEService, IClubService uow.SaveChanges(); return ClubAcceptResult.Accepted; } - - public ClubDenyResult RejectApplication(ulong clubOwnerUserId, string userName, out DiscordUser? discordUser) + + public ClubDenyResult RejectApplication(ulong clubOwnerUserId, string userName, out DiscordUser discordUser) { discordUser = null; using var uow = _db.GetDbContext(); @@ -211,9 +201,9 @@ public class ClubService : IEService, IClubService club.Applicants.FirstOrDefault(x => x.User.ToString().ToUpperInvariant() == userName.ToUpperInvariant()); if (applicant is null) return ClubDenyResult.NoSuchApplicant; - + club.Applicants.Remove(applicant); - + discordUser = applicant.User; uow.SaveChanges(); return ClubDenyResult.Rejected; @@ -230,7 +220,7 @@ public class ClubService : IEService, IClubService using var uow = _db.GetDbContext(); var du = uow.GetOrCreateUser(user, x => x.Include(u => u.Club)); if (du.Club is null) - return ClubLeaveResult.NotInAClub; + return ClubLeaveResult.NotInAClub; if (du.Club.OwnerId == du.Id) return ClubLeaveResult.OwnerCantLeave; @@ -240,7 +230,7 @@ public class ClubService : IEService, IClubService return ClubLeaveResult.Success; } - public bool SetDescription(ulong userId, string? desc) + public bool SetDescription(ulong userId, string desc) { using var uow = _db.GetDbContext(); var club = uow.Set().GetByOwner(userId); @@ -316,7 +306,7 @@ public class ClubService : IEService, IClubService return ClubUnbanResult.Success; } - + public ClubKickResult Kick(ulong kickerId, string userName, out ClubInfo club) { using var uow = _db.GetDbContext(); @@ -352,14 +342,14 @@ public class ClubService : IEService, IClubService { if (!CheckClubName(clubName)) return ClubRenameResult.NameTooLong; - + await using var uow = _db.GetDbContext(); - + var club = uow.Set().GetByOwnerOrAdmin(userId); - + if (club is null) return ClubRenameResult.NotOwnerOrAdmin; - + if (await uow.Set().AnyAsyncEF(x => x.Name == clubName)) return ClubRenameResult.NameTaken; diff --git a/src/EllieBot/Modules/Xp/Club/IClubService.cs b/src/EllieBot/Modules/Xp/Club/IClubService.cs index ea23436..7e9bbf0 100644 --- a/src/EllieBot/Modules/Xp/Club/IClubService.cs +++ b/src/EllieBot/Modules/Xp/Club/IClubService.cs @@ -12,8 +12,8 @@ public interface IClubService Task SetClubIconAsync(ulong ownerUserId, string? url); bool GetClubByName(string clubName, out ClubInfo club); ClubApplyResult ApplyToClub(IUser user, ClubInfo club); - ClubAcceptResult AcceptApplication(ulong clubOwnerUserId, string userName, out DiscordUser? discordUser); - ClubDenyResult RejectApplication(ulong clubOwnerUserId, string userName, out DiscordUser? discordUser); + ClubAcceptResult AcceptApplication(ulong clubOwnerUserId, string userName, out DiscordUser discordUser); + ClubDenyResult RejectApplication(ulong clubOwnerUserId, string userName, out DiscordUser discordUser); ClubInfo? GetClubWithBansAndApplications(ulong ownerUserId); ClubLeaveResult LeaveClub(IUser user); bool SetDescription(ulong userId, string? desc); @@ -23,7 +23,6 @@ public interface IClubService ClubKickResult Kick(ulong kickerId, string userName, out ClubInfo club); List GetClubLeaderboardPage(int page); Task RenameClubAsync(ulong userId, string clubName); - Task GetClubRankAsync(int clubId); } public enum ClubApplyResult diff --git a/src/EllieBot/Modules/Xp/Xp.cs b/src/EllieBot/Modules/Xp/Xp.cs index 16e9a2f..2bf8fcb 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) @@ -499,8 +479,7 @@ public partial class Xp : EllieModule ctx.User.Id, button, OnShopUse, - (key, itemType), - clearAfter: false); + (key, itemType)); return inter; } @@ -514,9 +493,7 @@ public partial class Xp : EllieModule ctx.User.Id, button, OnShopBuy, - (key, itemType), - singleUse: true, - clearAfter: false); + (key, itemType)); return inter; } @@ -599,10 +576,6 @@ public partial class Xp : EllieModule { await Response().Error(strs.not_enough(_gss.GetCurrencySign())).SendAsync(); } - else if (result == BuyResult.Success) - { - await _service.UseShopItemAsync(ctx.User.Id, type, key); - } } private string GetNotifLocationString(XpNotificationLocation loc) diff --git a/src/EllieBot/Modules/Xp/XpService.cs b/src/EllieBot/Modules/Xp/XpService.cs index 808b79a..97d349a 100644 --- a/src/EllieBot/Modules/Xp/XpService.cs +++ b/src/EllieBot/Modules/Xp/XpService.cs @@ -2,6 +2,7 @@ using LinqToDB; using Microsoft.EntityFrameworkCore; using EllieBot.Common.ModuleBehaviors; +using EllieBot.Db; using EllieBot.Db.Models; using Newtonsoft.Json; using SixLabors.Fonts; @@ -12,7 +13,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 +20,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 +56,7 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand IImageCache images, IBotCache c, FontProvider fonts, - IBotCreds creds, + IBotCredentials creds, ICurrencyService cs, IHttpClientFactory http, XpConfigService xpConfig, @@ -204,9 +179,8 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand { foreach (var user in globalToAdd) { - var amount = (long)(user.Value.XpAmount * conf.CurrencyPerXp); - if (amount > 0) - await _cs.AddAsync(user.Key, amount, null); + var amount = user.Value.XpAmount * conf.CurrencyPerXp; + await _cs.AddAsync(user.Key, (long)(amount), null); } } @@ -217,9 +191,9 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand var items = await ctx.Set() .Where(x => group.Contains(x.UserId)) .UpdateWithOutputAsync(old => new() - { - TotalXp = old.TotalXp + group.Key - }, + { + TotalXp = old.TotalXp + group.Key + }, (_, n) => n); await ctx.Set() @@ -242,9 +216,9 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand .Where(x => x.GuildId == guildId) .Where(x => group.Contains(x.UserId)) .UpdateWithOutputAsync(old => new() - { - Xp = old.Xp + group.Key - }, + { + Xp = old.Xp + group.Key + }, (_, n) => n); gxps.AddRange(items); @@ -256,14 +230,14 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand .Set() .ToLinqToDBTable() .InsertOrUpdateAsync(() => new UserXpStats() - { - UserId = userId, - GuildId = guildId, - Xp = group.Key, - DateAdded = DateTime.UtcNow, - AwardedXp = 0, - NotifyOnLevelUp = XpNotificationLocation.None - }, + { + UserId = userId, + GuildId = guildId, + Xp = group.Key, + DateAdded = DateTime.UtcNow, + AwardedXp = 0, + NotifyOnLevelUp = XpNotificationLocation.None + }, _ => new() { }, @@ -449,8 +423,8 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand await _sender.Response(chan) .Confirm(_strings.GetText(strs.level_up_global(user.Mention, - Format.Bold(newLevel.ToString())), - guild.Id)) + Format.Bold(newLevel.ToString())), + guild.Id)) .SendAsync(); } } @@ -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) @@ -721,7 +668,7 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand /// private async Task ScanUserForVoiceXp(SocketGuildUser user, SocketVoiceChannel channel) { - if (UserParticipatingInVoiceChannel(user) && ShouldTrackXp(user, channel)) + if (UserParticipatingInVoiceChannel(user) && ShouldTrackXp(user, channel.Id)) await UserJoinedVoiceChannel(user); else await UserLeftVoiceChannel(user, channel); @@ -820,13 +767,9 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand } */ - private bool ShouldTrackXp(SocketGuildUser user, IMessageChannel channel) + private bool ShouldTrackXp(SocketGuildUser user, ulong channelId) { - var channelId = channel.Id; - - if (_excludedChannels.TryGetValue(user.Guild.Id, out var chans) - && (chans.Contains(channelId) - || (channel is SocketThreadChannel tc && chans.Contains(tc.ParentChannel.Id)))) + if (_excludedChannels.TryGetValue(user.Guild.Id, out var chans) && chans.Contains(channelId)) return false; if (_excludedServers.Contains(user.Guild.Id)) @@ -845,7 +788,7 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand _ = Task.Run(async () => { - if (!ShouldTrackXp(user, arg.Channel)) + if (!ShouldTrackXp(user, arg.Channel.Id)) return; var xpConf = _xpConfig.Data; @@ -1047,29 +990,29 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand throw new ArgumentNullException(nameof(bgBytes)); } - var outlinePen = new SolidPen(Color.Black, 1f); + var outlinePen = new Pen(Color.Black, 1f); - using var img = Image.Load(bgBytes); + using var img = Image.Load(bgBytes, out var imageFormat); if (template.User.Name.Show) { var fontSize = (int)(template.User.Name.FontSize * 0.9); var username = stats.User.ToString(); var usernameFont = _fonts.NotoSans.CreateFont(fontSize, FontStyle.Bold); - var size = TextMeasurer.MeasureSize($"@{username}", new(usernameFont)); + var size = TextMeasurer.Measure($"@{username}", new(usernameFont)); var scale = 400f / size.Width; if (scale < 1) usernameFont = _fonts.NotoSans.CreateFont(template.User.Name.FontSize * scale, FontStyle.Bold); img.Mutate(x => { - x.DrawText(new RichTextOptions(usernameFont) - { - HorizontalAlignment = HorizontalAlignment.Left, - VerticalAlignment = VerticalAlignment.Center, - FallbackFontFamilies = _fonts.FallBackFonts, - Origin = new(template.User.Name.Pos.X, template.User.Name.Pos.Y + 8) - }, + x.DrawText(new TextOptions(usernameFont) + { + HorizontalAlignment = HorizontalAlignment.Left, + VerticalAlignment = VerticalAlignment.Center, + FallbackFontFamilies = _fonts.FallBackFonts, + Origin = new(template.User.Name.Pos.X, template.User.Name.Pos.Y + 8) + }, "@" + username, Brushes.Solid(template.User.Name.Color), outlinePen); @@ -1084,13 +1027,13 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand var clubFont = _fonts.NotoSans.CreateFont(template.Club.Name.FontSize, FontStyle.Regular); - img.Mutate(x => x.DrawText(new RichTextOptions(clubFont) - { - HorizontalAlignment = HorizontalAlignment.Right, - VerticalAlignment = VerticalAlignment.Top, - FallbackFontFamilies = _fonts.FallBackFonts, - Origin = new(template.Club.Name.Pos.X + 50, template.Club.Name.Pos.Y - 8) - }, + img.Mutate(x => x.DrawText(new TextOptions(clubFont) + { + HorizontalAlignment = HorizontalAlignment.Right, + VerticalAlignment = VerticalAlignment.Top, + FallbackFontFamilies = _fonts.FallBackFonts, + Origin = new(template.Club.Name.Pos.X + 50, template.Club.Name.Pos.Y - 8) + }, clubName, Brushes.Solid(template.Club.Name.Color), outlinePen)); @@ -1104,7 +1047,7 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand int maxSize) { var font = fontFamily.CreateFont(fontSize, style); - var size = TextMeasurer.MeasureSize(text, new(font)); + var size = TextMeasurer.Measure(text, new(font)); var scale = maxSize / size.Width; if (scale < 1) font = fontFamily.CreateFont(fontSize * scale, style); @@ -1167,7 +1110,7 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand if (template.User.Xp.Global.Show) { img.Mutate(x => x.DrawText( - new RichTextOptions(_fonts.NotoSans.CreateFont(template.User.Xp.Global.FontSize, FontStyle.Bold)) + new TextOptions(_fonts.NotoSans.CreateFont(template.User.Xp.Global.FontSize, FontStyle.Bold)) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, @@ -1181,7 +1124,7 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand if (template.User.Xp.Guild.Show) { img.Mutate(x => x.DrawText( - new RichTextOptions(_fonts.NotoSans.CreateFont(template.User.Xp.Guild.FontSize, FontStyle.Bold)) + new TextOptions(_fonts.NotoSans.CreateFont(template.User.Xp.Guild.FontSize, FontStyle.Bold)) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, @@ -1205,7 +1148,7 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand new(awX, awY))); } - var rankPen = new SolidPen(Color.White, 1); + var rankPen = new Pen(Color.White, 1); //ranking if (template.User.GlobalRank.Show) { @@ -1219,7 +1162,7 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand 68); img.Mutate(x => x.DrawText( - new RichTextOptions(globalRankFont) + new TextOptions(globalRankFont) { Origin = new(template.User.GlobalRank.Pos.X, template.User.GlobalRank.Pos.Y) }, @@ -1241,7 +1184,7 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand 43); img.Mutate(x => x.DrawText( - new RichTextOptions(guildRankFont) + new TextOptions(guildRankFont) { Origin = new(template.User.GuildRank.Pos.X, template.User.GuildRank.Pos.Y) }, @@ -1284,7 +1227,7 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand } using var toDraw = Image.Load(data); - if (toDraw.Size != new Size(template.User.Icon.Size.X, template.User.Icon.Size.Y)) + if (toDraw.Size() != new Size(template.User.Icon.Size.X, template.User.Icon.Size.Y)) toDraw.Mutate(x => x.Resize(template.User.Icon.Size.X, template.User.Icon.Size.Y)); img.Mutate(x => x.DrawImage(toDraw, @@ -1302,15 +1245,14 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand if (template.Club.Icon.Show) await DrawClubImage(img, stats); - // #if GLOBAL_ELLIE +// #if GLOBAL_ELLIE await DrawFrame(img, stats.User.UserId); - // #endif +// #endif var outputSize = template.OutputSize; if (outputSize.X != img.Width || outputSize.Y != img.Height) img.Mutate(x => x.Resize(template.OutputSize.X, template.OutputSize.Y)); - var imageFormat = img.Metadata.DecodedImageFormat; var output = ((Stream)await img.ToStreamAsync(imageFormat), imageFormat); return output; @@ -1344,9 +1286,9 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand Image? frame = null; if (item is null) { - if (patron?.Tier == PatronTier.V) + if (patron.Tier == PatronTier.V) frame = Image.Load(File.OpenRead("data/images/frame_silver.png")); - else if (patron?.Tier >= PatronTier.X || _creds.IsOwner(userId)) + else if (patron.Tier >= PatronTier.X || _creds.IsOwner(userId)) frame = Image.Load(File.OpenRead("data/images/frame_gold.png")); } else @@ -1362,7 +1304,7 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand if (frame is not null) img.Mutate(x => x.DrawImage(frame, new Point(0, 0), new GraphicsOptions())); } - // #endif +// #endif private void DrawXpBar(float percent, XpBar info, Image img) { @@ -1447,7 +1389,7 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand } using var toDraw = Image.Load(data); - if (toDraw.Size != new Size(template.Club.Icon.Size.X, template.Club.Icon.Size.Y)) + if (toDraw.Size() != new Size(template.Club.Icon.Size.X, template.Club.Icon.Size.Y)) toDraw.Mutate(x => x.Resize(template.Club.Icon.Size.X, template.Club.Icon.Size.Y)); img.Mutate(x => x.DrawImage( @@ -1462,11 +1404,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) @@ -1523,7 +1465,7 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand { var patron = await _ps.GetPatronAsync(userId); - if (patron is null || (int)patron.Value.Tier < (int)req) + if ((int)patron.Tier < (int)req) return BuyResult.InsufficientPatronTier; } @@ -1662,15 +1604,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/Modules/Xp/_common/FullUserStats.cs b/src/EllieBot/Modules/Xp/_common/FullUserStats.cs index d56a62e..de8b8da 100644 --- a/src/EllieBot/Modules/Xp/_common/FullUserStats.cs +++ b/src/EllieBot/Modules/Xp/_common/FullUserStats.cs @@ -1,4 +1,5 @@ #nullable disable +using EllieBot.Db; using EllieBot.Db.Models; namespace EllieBot.Modules.Xp; diff --git a/src/EllieBot/Modules/Xp/_common/db/XpShopOwnedItem.cs b/src/EllieBot/Modules/Xp/_common/db/XpShopOwnedItem.cs index 955e17d..29b491e 100644 --- a/src/EllieBot/Modules/Xp/_common/db/XpShopOwnedItem.cs +++ b/src/EllieBot/Modules/Xp/_common/db/XpShopOwnedItem.cs @@ -1,4 +1,4 @@ -#nullable disable warnings +#nullable disable warnings namespace EllieBot.Db.Models; public class XpShopOwnedItem : DbEntity 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 60% rename from src/EllieBot/_common/Impl/BotCredsProvider.cs rename to src/EllieBot/Services/Impl/BotCredsProvider.cs index 915e813..3d2638e 100644 --- a/src/EllieBot/_common/Impl/BotCredsProvider.cs +++ b/src/EllieBot/Services/Impl/BotCredsProvider.cs @@ -1,6 +1,8 @@ #nullable disable using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Primitives; using EllieBot.Common.Yml; +using Newtonsoft.Json; namespace EllieBot.Services; @@ -21,6 +23,7 @@ public sealed class BotCredsProvider : IBotCredsProvider private readonly object _reloadLock = new(); + private readonly IDisposable _changeToken; public BotCredsProvider(int? totalShards = null, string credPath = null) { @@ -47,19 +50,18 @@ public sealed class BotCredsProvider : IBotCredsProvider // this can fail in docker containers } + MigrateCredentials(); + + if (!File.Exists(CredsPath)) + { + Log.Warning( + "{CredsPath} is missing. Attempting to load creds from environment variables prefixed with 'EllieBot_'. Example is in {CredsExamplePath}", + CredsPath, + CredsExamplePath); + } try { - MigrateCredentials(); - - if (!File.Exists(CredsPath)) - { - Log.Warning( - "{CredsPath} is missing. Attempting to load creds from environment variables prefixed with 'EllieBot_'. Example is in {CredsExamplePath}", - CredsPath, - CredsExamplePath); - } - _config = new ConfigurationBuilder().AddYamlFile(CredsPath, false, true) .AddEnvironmentVariables("EllieBot_") .Build(); @@ -69,6 +71,7 @@ public sealed class BotCredsProvider : IBotCredsProvider Console.WriteLine(ex.ToString()); } + _changeToken = ChangeToken.OnChange(() => _config.GetReloadToken(), Reload); Reload(); } @@ -119,7 +122,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); @@ -130,25 +133,68 @@ public sealed class BotCredsProvider : IBotCredsProvider File.WriteAllText(CREDS_FILE_NAME, ymlData); } + private string OldCredsJsonPath + => Path.Combine(Directory.GetCurrentDirectory(), "credentials.json"); + + private string OldCredsJsonBackupPath + => Path.Combine(Directory.GetCurrentDirectory(), "credentials.json.bak"); + private void MigrateCredentials() { + if (File.Exists(OldCredsJsonPath)) + { + Log.Information("Migrating old creds..."); + var jsonCredentialsFileText = File.ReadAllText(OldCredsJsonPath); + var oldCreds = JsonConvert.DeserializeObject(jsonCredentialsFileText); + + if (oldCreds is null) + { + Log.Error("Error while reading old credentials file. Make sure that the file is formatted correctly"); + return; + } + + var creds = new Creds + { + Version = 1, + Token = oldCreds.Token, + OwnerIds = oldCreds.OwnerIds.Distinct().ToHashSet(), + GoogleApiKey = oldCreds.GoogleApiKey, + RapidApiKey = oldCreds.MashapeKey, + OsuApiKey = oldCreds.OsuApiKey, + CleverbotApiKey = oldCreds.CleverbotApiKey, + TotalShards = oldCreds.TotalShards <= 1 ? 1 : oldCreds.TotalShards, + Patreon = new Creds.PatreonSettings(oldCreds.PatreonAccessToken, null, null, oldCreds.PatreonCampaignId), + Votes = new Creds.VotesSettings(oldCreds.VotesUrl, oldCreds.VotesToken, string.Empty, string.Empty), + BotListToken = oldCreds.BotListToken, + RedisOptions = oldCreds.RedisOptions, + LocationIqApiKey = oldCreds.LocationIqApiKey, + TimezoneDbApiKey = oldCreds.TimezoneDbApiKey, + CoinmarketcapApiKey = oldCreds.CoinmarketcapApiKey + }; + + File.Move(OldCredsJsonPath, OldCredsJsonBackupPath, true); + File.WriteAllText(CredsPath, Yaml.Serializer.Serialize(creds)); + + Log.Warning( + "Data from credentials.json has been moved to creds.yml\nPlease inspect your creds.yml for correctness"); + } + if (File.Exists(CREDS_FILE_NAME)) { 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)); } } } - 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 84% rename from src/EllieBot/_common/Impl/ImageCache.cs rename to src/EllieBot/Services/Impl/ImageCache.cs index cf18590..12ec051 100644 --- a/src/EllieBot/_common/Impl/ImageCache.cs +++ b/src/EllieBot/Services/Impl/ImageCache.cs @@ -60,6 +60,12 @@ public sealed class ImageCache : IImageCache, IEService public Task GetXpBackgroundImageAsync() => GetImageDataAsync(_ic.Data.Xp.Bg); + public Task GetRategirlBgAsync() + => GetImageDataAsync(_ic.Data.Rategirl.Matrix); + + public Task GetRategirlDotAsync() + => GetImageDataAsync(_ic.Data.Rategirl.Dot); + public Task GetDiceAsync(int num) => GetImageDataAsync(_ic.Data.Dice[num]); @@ -68,4 +74,10 @@ public sealed class ImageCache : IImageCache, IEService public Task GetSlotBgAsync() => GetImageDataAsync(_ic.Data.Slots.Bg); + + public Task GetRipBgAsync() + => GetImageDataAsync(_ic.Data.Rip.Bg); + + public Task GetRipOverlayAsync() + => GetImageDataAsync(_ic.Data.Rip.Overlay); } \ No newline at end of file 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 99% rename from src/EllieBot/_common/Impl/Localization.cs rename to src/EllieBot/Services/Impl/Localization.cs index a1ff55d..3c2cb5b 100644 --- a/src/EllieBot/_common/Impl/Localization.cs +++ b/src/EllieBot/Services/Impl/Localization.cs @@ -1,4 +1,5 @@ #nullable disable +using EllieBot.Db; using Newtonsoft.Json; using System.Globalization; diff --git a/src/EllieBot/_common/Impl/PubSub/JsonSeria.cs b/src/EllieBot/Services/Impl/PubSub/JsonSeria.cs similarity index 95% rename from src/EllieBot/_common/Impl/PubSub/JsonSeria.cs rename to src/EllieBot/Services/Impl/PubSub/JsonSeria.cs index 25c6b96..413b8f8 100644 --- a/src/EllieBot/_common/Impl/PubSub/JsonSeria.cs +++ b/src/EllieBot/Services/Impl/PubSub/JsonSeria.cs @@ -7,7 +7,6 @@ public class JsonSeria : ISeria { private readonly JsonSerializerOptions _serializerOptions = new() { - IncludeFields = true, Converters = { new Rgba32Converter(), 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..fffc727 100644 --- a/src/EllieBot/_common/Impl/RedisBotCache.cs +++ b/src/EllieBot/Services/Impl/RedisBotCache.cs @@ -47,7 +47,6 @@ public sealed class RedisBotCache : IBotCache var success = await db.StringSetAsync(key.Key, val, expiry: expiry, - keepTtl: true, when: overwrite ? When.Always : When.NotExists); return success; 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/Cache/BotCacheExtensions.cs b/src/EllieBot/_common/Abstractions/Cache/BotCacheExtensions.cs index 2c6ea67..39d5e82 100644 --- a/src/EllieBot/_common/Abstractions/Cache/BotCacheExtensions.cs +++ b/src/EllieBot/_common/Abstractions/Cache/BotCacheExtensions.cs @@ -1,4 +1,4 @@ -using OneOf; +using OneOf; using OneOf.Types; namespace Ellie.Common; @@ -13,7 +13,7 @@ public static class BotCacheExtensions return default; } - + private static TypedKey GetImgKey(Uri uri) => new($"image:{uri}"); diff --git a/src/EllieBot/_common/Abstractions/Cache/IBotCache.cs b/src/EllieBot/_common/Abstractions/Cache/IBotCache.cs index 15f9e3f..5622c5f 100644 --- a/src/EllieBot/_common/Abstractions/Cache/IBotCache.cs +++ b/src/EllieBot/_common/Abstractions/Cache/IBotCache.cs @@ -15,7 +15,7 @@ public interface IBotCache /// Type of the value /// Returns whether add was sucessful. Always true unless ovewrite = false ValueTask AddAsync(TypedKey key, T value, TimeSpan? expiry = null, bool overwrite = true); - + /// /// Get an element from the cache /// @@ -23,7 +23,7 @@ public interface IBotCache /// Type of the value /// Either a value or ValueTask> GetAsync(TypedKey key); - + /// /// Remove a key from the cache /// diff --git a/src/EllieBot/_common/Abstractions/Cache/MemoryBotCache.cs b/src/EllieBot/_common/Abstractions/Cache/MemoryBotCache.cs index 2368ac2..caac44f 100644 --- a/src/EllieBot/_common/Abstractions/Cache/MemoryBotCache.cs +++ b/src/EllieBot/_common/Abstractions/Cache/MemoryBotCache.cs @@ -26,12 +26,12 @@ public sealed class MemoryBotCache : IBotCache item.AbsoluteExpirationRelativeToNow = expiry; return new(true); } - + lock (_cacheLock) { if (_cache.TryGetValue(key.Key, out var old) && old is not null) return new(false); - + using var item = _cache.CreateEntry(key.Key); item.Value = value; item.AbsoluteExpirationRelativeToNow = expiry; @@ -63,7 +63,7 @@ public sealed class MemoryBotCache : IBotCache { lock (_cacheLock) { - var toReturn = _cache.TryGetValue(key.Key, out var old ) && old is not null; + var toReturn = _cache.TryGetValue(key.Key, out var old) && old is not null; _cache.Remove(key.Key); return new(toReturn); } diff --git a/src/EllieBot/_common/Abstractions/Collections/ConcurrentHashSet.cs b/src/EllieBot/_common/Abstractions/Collections/ConcurrentHashSet.cs index 7d5bbc1..19986be 100644 --- a/src/EllieBot/_common/Abstractions/Collections/ConcurrentHashSet.cs +++ b/src/EllieBot/_common/Abstractions/Collections/ConcurrentHashSet.cs @@ -1,4 +1,4 @@ -using System.Diagnostics; +using System.Diagnostics; namespace System.Collections.Generic; @@ -6,7 +6,7 @@ namespace System.Collections.Generic; public sealed class ConcurrentHashSet : IReadOnlyCollection, ICollection where T : notnull { private readonly ConcurrentDictionary _backingStore; - + public ConcurrentHashSet() => _backingStore = new(); @@ -46,8 +46,12 @@ public sealed class ConcurrentHashSet : IReadOnlyCollection, ICollection= array.Length) + throw new ArgumentOutOfRangeException(nameof(arrayIndex)); CopyToInternal(array, arrayIndex); } @@ -59,7 +63,7 @@ public sealed class ConcurrentHashSet : IReadOnlyCollection, ICollection= len) throw new IndexOutOfRangeException(nameof(arrayIndex)); - + array[arrayIndex++] = k; } } diff --git a/src/EllieBot/_common/Abstractions/Collections/IndexedCollection.cs b/src/EllieBot/_common/Abstractions/Collections/IndexedCollections.cs similarity index 98% rename from src/EllieBot/_common/Abstractions/Collections/IndexedCollection.cs rename to src/EllieBot/_common/Abstractions/Collections/IndexedCollections.cs index dce86a0..fe8e2c1 100644 --- a/src/EllieBot/_common/Abstractions/Collections/IndexedCollection.cs +++ b/src/EllieBot/_common/Abstractions/Collections/IndexedCollections.cs @@ -1,4 +1,4 @@ -using System.Collections; +using System.Collections; namespace Ellie.Common; diff --git a/src/EllieBot/_common/Abstractions/EllieRandom.cs b/src/EllieBot/_common/Abstractions/EllieRandom.cs index df2d073..0ece259 100644 --- a/src/EllieBot/_common/Abstractions/EllieRandom.cs +++ b/src/EllieBot/_common/Abstractions/EllieRandom.cs @@ -16,7 +16,7 @@ public sealed class EllieRandom : Random _rng.GetBytes(bytes); return Math.Abs(BitConverter.ToInt32(bytes, 0)); } - + /// /// Generates a random integer between 0 (inclusive) and /// a specified exclusive upper bound using a cryptographically strong random number generator. diff --git a/src/EllieBot/_common/Abstractions/Extensions/ArrayExtensions.cs b/src/EllieBot/_common/Abstractions/Extensions/ArrayExtensions.cs index f3e8ae3..dbe2d93 100644 --- a/src/EllieBot/_common/Abstractions/Extensions/ArrayExtensions.cs +++ b/src/EllieBot/_common/Abstractions/Extensions/ArrayExtensions.cs @@ -1,4 +1,4 @@ -using System.Security.Cryptography; +using System.Security.Cryptography; namespace Ellie.Common; @@ -43,7 +43,7 @@ public static class ArrayExtensions public static TOut[] Map(this IReadOnlyCollection col, Func f) { var toReturn = new TOut[col.Count]; - + var i = 0; foreach (var item in col) toReturn[i++] = f(item); diff --git a/src/EllieBot/_common/Abstractions/Extensions/EnumerableExtensions.cs b/src/EllieBot/_common/Abstractions/Extensions/EnumerableExtensions.cs index 1ebec24..4e4c786 100644 --- a/src/EllieBot/_common/Abstractions/Extensions/EnumerableExtensions.cs +++ b/src/EllieBot/_common/Abstractions/Extensions/EnumerableExtensions.cs @@ -1,4 +1,4 @@ -using System.Security.Cryptography; +using System.Security.Cryptography; namespace Ellie.Common; @@ -37,7 +37,7 @@ public static class EnumerableExtensions /// public static string Join(this IEnumerable data, string separator, Func? func = null) => string.Join(separator, data.Select(func ?? (x => x?.ToString() ?? string.Empty))); - + /// /// Randomize element order by performing the Fisher-Yates shuffle /// @@ -71,22 +71,6 @@ 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 - /// has the default concurrency level, has the default initial capacity, - /// and uses the default comparer for the key type. - /// - /// - /// The whose elements are copied to the new - /// . - /// - /// A new instance of the class - public static ConcurrentHashSet ToConcurrentSet( - this IReadOnlyCollection dict) - where TValue : notnull - => new(dict); public static IndexedCollection ToIndexed(this IEnumerable enumerable) where T : class, IIndexed diff --git a/src/EllieBot/_common/Abstractions/Extensions/Extensions.cs b/src/EllieBot/_common/Abstractions/Extensions/Extensions.cs index 8abf5d6..487afe7 100644 --- a/src/EllieBot/_common/Abstractions/Extensions/Extensions.cs +++ b/src/EllieBot/_common/Abstractions/Extensions/Extensions.cs @@ -1,4 +1,4 @@ -namespace Ellie.Common; +namespace Ellie.Common; public static class Extensions { diff --git a/src/EllieBot/_common/Abstractions/Extensions/PipeExtensions.cs b/src/EllieBot/_common/Abstractions/Extensions/PipeExtensions.cs index 65b5bb2..215a829 100644 --- a/src/EllieBot/_common/Abstractions/Extensions/PipeExtensions.cs +++ b/src/EllieBot/_common/Abstractions/Extensions/PipeExtensions.cs @@ -7,16 +7,16 @@ public static class PipeExtensions { public static TOut Pipe(this TIn a, Func fn) => fn(a); - + public static TOut Pipe(this TIn a, PipeFunc fn) => fn(a); - + public static TOut Pipe(this (TIn1, TIn2) a, PipeFunc fn) => fn(a.Item1, a.Item2); public static (TIn, TExtra) With(this TIn a, TExtra b) => (a, b); - + public static async Task Pipe(this Task a, Func fn) => fn(await a); } \ No newline at end of file diff --git a/src/EllieBot/_common/Abstractions/Extensions/StringExtensions.cs b/src/EllieBot/_common/Abstractions/Extensions/StringExtensions.cs index 2515e45..95baadb 100644 --- a/src/EllieBot/_common/Abstractions/Extensions/StringExtensions.cs +++ b/src/EllieBot/_common/Abstractions/Extensions/StringExtensions.cs @@ -1,4 +1,4 @@ -using EllieBot.Common.Yml; +using EllieBot.Common.Yml; using System.Text; using System.Text.RegularExpressions; @@ -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,4 @@ 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/Helpers/StandardConversions.cs b/src/EllieBot/_common/Abstractions/Helpers/StandardConversions.cs index d277b7e..143c149 100644 --- a/src/EllieBot/_common/Abstractions/Helpers/StandardConversions.cs +++ b/src/EllieBot/_common/Abstractions/Helpers/StandardConversions.cs @@ -1,4 +1,4 @@ -namespace Ellie.Common; +namespace Ellie.Common; public static class StandardConversions { 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/PubSub/EventPubSub.cs b/src/EllieBot/_common/Abstractions/PubSub/EventPubSub.cs index 87ce07f..a3d753a 100644 --- a/src/EllieBot/_common/Abstractions/PubSub/EventPubSub.cs +++ b/src/EllieBot/_common/Abstractions/PubSub/EventPubSub.cs @@ -50,9 +50,9 @@ public class EventPubSub : IPubSub { // get subscriptions for this action if (_actions.TryGetValue(key.Key, out var actions)) - // get subscriptions which have the same action hash code - // note: having this as a list allows for multiple subscriptions of - // the same insance's/static method + // get subscriptions which have the same action hash code + // note: having this as a list allows for multiple subscriptions of + // the same insance's/static method { if (actions.TryGetValue(action, out var sameActions)) { diff --git a/src/EllieBot/_common/Abstractions/PubSub/IPubSub.cs b/src/EllieBot/_common/Abstractions/PubSub/IPubSub.cs index 7c092cb..ea84b6b 100644 --- a/src/EllieBot/_common/Abstractions/PubSub/IPubSub.cs +++ b/src/EllieBot/_common/Abstractions/PubSub/IPubSub.cs @@ -1,4 +1,4 @@ -namespace Ellie.Common; +namespace Ellie.Common; public interface IPubSub { diff --git a/src/EllieBot/_common/Abstractions/PubSub/ISeria.cs b/src/EllieBot/_common/Abstractions/PubSub/ISeria.cs index 57217c2..76094f4 100644 --- a/src/EllieBot/_common/Abstractions/PubSub/ISeria.cs +++ b/src/EllieBot/_common/Abstractions/PubSub/ISeria.cs @@ -1,4 +1,4 @@ -namespace Ellie.Common; +namespace Ellie.Common; public interface ISeria { diff --git a/src/EllieBot/_common/Abstractions/QueueRunner.cs b/src/EllieBot/_common/Abstractions/QueueRunner.cs index 7bba829..6e582cc 100644 --- a/src/EllieBot/_common/Abstractions/QueueRunner.cs +++ b/src/EllieBot/_common/Abstractions/QueueRunner.cs @@ -37,7 +37,7 @@ public sealed class QueueRunner while (true) { var func = await _channel.Reader.ReadAsync(cancel); - + try { await func(); @@ -55,7 +55,7 @@ public sealed class QueueRunner } } } - + public ValueTask EnqueueAsync(Func action) => _channel.Writer.WriteAsync(action); } \ No newline at end of file diff --git a/src/EllieBot/_common/Abstractions/TypedKey.cs b/src/EllieBot/_common/Abstractions/TypedKey.cs index 0ca2554..ea3103c 100644 --- a/src/EllieBot/_common/Abstractions/TypedKey.cs +++ b/src/EllieBot/_common/Abstractions/TypedKey.cs @@ -1,4 +1,4 @@ -namespace Ellie.Common; +namespace Ellie.Common; public readonly struct TypedKey { diff --git a/src/EllieBot/_common/Abstractions/creds/IBotCreds.cs b/src/EllieBot/_common/Abstractions/creds/IBotCredentials.cs similarity index 92% rename from src/EllieBot/_common/Abstractions/creds/IBotCreds.cs rename to src/EllieBot/_common/Abstractions/creds/IBotCredentials.cs index 83d19b2..87db412 100644 --- a/src/EllieBot/_common/Abstractions/creds/IBotCreds.cs +++ b/src/EllieBot/_common/Abstractions/creds/IBotCredentials.cs @@ -1,12 +1,11 @@ -#nullable disable +#nullable disable namespace EllieBot; -public interface IBotCreds +public interface IBotCredentials { string Token { get; } - string EllieAiToken { get; } - ICollection OwnerIds { get; set; } string GoogleApiKey { get; } + ICollection OwnerIds { get; set; } bool UsePrivilegedIntents { get; } string RapidApiKey { get; } @@ -29,8 +28,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..6f72ab0 100644 --- a/src/EllieBot/_common/Abstractions/strings/CommandStrings.cs +++ b/src/EllieBot/_common/Abstractions/strings/CommandStrings.cs @@ -20,7 +20,7 @@ public sealed record class CommandStrings [YamlMember(Alias = "ex")] public string[] Examples { get; set; } - + [YamlMember(Alias = "params")] public Dictionary[] Params { get; set; } } @@ -29,7 +29,7 @@ public sealed record class CommandStringParam { // [YamlMember(Alias = "type", ScalarStyle = ScalarStyle.DoubleQuoted)] // 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/Abstractions/strings/IBotStrings.cs b/src/EllieBot/_common/Abstractions/strings/IBotStrings.cs index 5c43755..2ded833 100644 --- a/src/EllieBot/_common/Abstractions/strings/IBotStrings.cs +++ b/src/EllieBot/_common/Abstractions/strings/IBotStrings.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable using System.Globalization; namespace EllieBot.Common; diff --git a/src/EllieBot/_common/Abstractions/strings/IBotStringsExtensions.cs b/src/EllieBot/_common/Abstractions/strings/IBotStringsExtensions.cs index a635b4b..17f9377 100644 --- a/src/EllieBot/_common/Abstractions/strings/IBotStringsExtensions.cs +++ b/src/EllieBot/_common/Abstractions/strings/IBotStringsExtensions.cs @@ -8,7 +8,7 @@ public static class BotStringsExtensions // this one is for pipe fun, see PipeExtensions.cs public static string GetText(this IBotStrings strings, in LocStr str, in ulong guildId) => strings.GetText(str.Key, guildId, str.Params); - + public static string GetText(this IBotStrings strings, in LocStr str, ulong? guildId = null) => strings.GetText(str.Key, guildId, str.Params); diff --git a/src/EllieBot/_common/Abstractions/strings/IBotStringsProvider.cs b/src/EllieBot/_common/Abstractions/strings/IBotStringsProvider.cs index ef98051..87cab9f 100644 --- a/src/EllieBot/_common/Abstractions/strings/IBotStringsProvider.cs +++ b/src/EllieBot/_common/Abstractions/strings/IBotStringsProvider.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable namespace EllieBot.Services; /// diff --git a/src/EllieBot/_common/Abstractions/strings/IStringsSource.cs b/src/EllieBot/_common/Abstractions/strings/IStringsSource.cs index 08ad986..a2715f0 100644 --- a/src/EllieBot/_common/Abstractions/strings/IStringsSource.cs +++ b/src/EllieBot/_common/Abstractions/strings/IStringsSource.cs @@ -1,4 +1,5 @@ #nullable disable + namespace EllieBot.Services; /// diff --git a/src/EllieBot/_common/AddRemove.cs b/src/EllieBot/_common/AddRemove.cs index cccd892..bb3862e 100644 --- a/src/EllieBot/_common/AddRemove.cs +++ b/src/EllieBot/_common/AddRemove.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable namespace EllieBot.Common; public enum AddRemove diff --git a/src/EllieBot/_common/Attributes/CmdAttribute.cs b/src/EllieBot/_common/Attributes/CmdAttribute.cs index b778c7d..a02fd1e 100644 --- a/src/EllieBot/_common/Attributes/CmdAttribute.cs +++ b/src/EllieBot/_common/Attributes/CmdAttribute.cs @@ -1,4 +1,4 @@ -using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; namespace EllieBot.Common.Attributes; @@ -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/DIIgnoreAttribute.cs b/src/EllieBot/_common/Attributes/DIIgnoreAttribute.cs index 608e079..7be799a 100644 --- a/src/EllieBot/_common/Attributes/DIIgnoreAttribute.cs +++ b/src/EllieBot/_common/Attributes/DIIgnoreAttribute.cs @@ -7,5 +7,5 @@ namespace EllieBot.Common; [AttributeUsage(AttributeTargets.Class)] public class DIIgnoreAttribute : Attribute { - + } \ No newline at end of file diff --git a/src/EllieBot/_common/Attributes/EllieOptionsAttribute.cs b/src/EllieBot/_common/Attributes/EllieOptionsAttribute.cs index 7db4315..c94b109 100644 --- a/src/EllieBot/_common/Attributes/EllieOptionsAttribute.cs +++ b/src/EllieBot/_common/Attributes/EllieOptionsAttribute.cs @@ -1,4 +1,4 @@ -namespace EllieBot.Common.Attributes; +namespace EllieBot.Common.Attributes; [AttributeUsage(AttributeTargets.Method)] public sealed class EllieOptionsAttribute : Attribute diff --git a/src/EllieBot/_common/Attributes/NoPublicBotAttribute.cs b/src/EllieBot/_common/Attributes/NoPublicBotAttribute.cs index 183fee5..2ce8ccc 100644 --- a/src/EllieBot/_common/Attributes/NoPublicBotAttribute.cs +++ b/src/EllieBot/_common/Attributes/NoPublicBotAttribute.cs @@ -1,4 +1,6 @@ #nullable disable +using System.Diagnostics.CodeAnalysis; + namespace EllieBot.Common; [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)] @@ -10,7 +12,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/Attributes/OnlyPublicBotAttribute.cs b/src/EllieBot/_common/Attributes/OnlyPublicBotAttribute.cs index 2ee7958..6ae9408 100644 --- a/src/EllieBot/_common/Attributes/OnlyPublicBotAttribute.cs +++ b/src/EllieBot/_common/Attributes/OnlyPublicBotAttribute.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable using System.Diagnostics.CodeAnalysis; namespace EllieBot.Common; diff --git a/src/EllieBot/_common/Attributes/OwnerOnlyAttribute.cs b/src/EllieBot/_common/Attributes/OwnerOnlyAttribute.cs index c1baa53..7aa9317 100644 --- a/src/EllieBot/_common/Attributes/OwnerOnlyAttribute.cs +++ b/src/EllieBot/_common/Attributes/OwnerOnlyAttribute.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; namespace EllieBot.Common.Attributes; @@ -16,4 +16,4 @@ public sealed class OwnerOnlyAttribute : PreconditionAttribute ? PreconditionResult.FromSuccess() : PreconditionResult.FromError("Not owner")); } -} \ No newline at end of file +} diff --git a/src/EllieBot/_common/Attributes/RatelimitAttribute.cs b/src/EllieBot/_common/Attributes/RatelimitAttribute.cs index 54402d9..7fcf9c8 100644 --- a/src/EllieBot/_common/Attributes/RatelimitAttribute.cs +++ b/src/EllieBot/_common/Attributes/RatelimitAttribute.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; namespace EllieBot.Common.Attributes; diff --git a/src/EllieBot/_common/Attributes/UserPermAttribute.cs b/src/EllieBot/_common/Attributes/UserPermAttribute.cs index 2e0af03..1b4ee75 100644 --- a/src/EllieBot/_common/Attributes/UserPermAttribute.cs +++ b/src/EllieBot/_common/Attributes/UserPermAttribute.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; namespace Discord; diff --git a/src/EllieBot/_common/CleverBotResponseStr.cs b/src/EllieBot/_common/CleverBotResponseStr.cs index 2f06a67..6675a41 100644 --- a/src/EllieBot/_common/CleverBotResponseStr.cs +++ b/src/EllieBot/_common/CleverBotResponseStr.cs @@ -6,5 +6,5 @@ namespace EllieBot.Modules.Permissions; [StructLayout(LayoutKind.Sequential, Size = 1)] public readonly struct CleverBotResponseStr { - public const string CLEVERBOT_RESPONSE = "CLEVERBOT:RESPONSE"; + public const string CLEVERBOT_RESPONSE = "cleverbot:response"; } \ No newline at end of file diff --git a/src/EllieBot/_common/CommandNameLoadHelper.cs b/src/EllieBot/_common/CommandNameLoadHelper.cs index 0a811e2..3d69f2e 100644 --- a/src/EllieBot/_common/CommandNameLoadHelper.cs +++ b/src/EllieBot/_common/CommandNameLoadHelper.cs @@ -1,4 +1,4 @@ -using EllieBot.Common.Yml; +using EllieBot.Common.Yml; using YamlDotNet.Serialization; namespace EllieBot.Common.Attributes; diff --git a/src/EllieBot/_common/Configs/BotConfig.cs b/src/EllieBot/_common/Configs/BotConfig.cs index 1f691ed..0715701 100644 --- a/src/EllieBot/_common/Configs/BotConfig.cs +++ b/src/EllieBot/_common/Configs/BotConfig.cs @@ -12,7 +12,7 @@ namespace EllieBot.Common.Configs; public sealed partial class BotConfig : ICloneable { [Comment("""DO NOT CHANGE""")] - public int Version { get; set; } = 8; + public int Version { get; set; } = 7; [Comment(""" Most commands, when executed, have a small colored line @@ -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; } @@ -44,13 +44,13 @@ public sealed partial class BotConfig : ICloneable or all owners? (this might cause the bot to lag if there's a lot of owners specified) """)] public bool ForwardToAllOwners { get; set; } - + [Comment(""" Any messages sent by users in Bot's DM to be forwarded to the specified channel. This option will only work when ForwardToAllOwners is set to false """)] public ulong? ForwardToChannel { get; set; } - + [Comment(""" Should the bot ignore messages from other bots? Settings this to false might get your bot banned if it gets into a spam loop with another bot. @@ -84,6 +84,19 @@ public sealed partial class BotConfig : ICloneable [Comment("""Which string will be used to recognize the commands""")] public string Prefix { get; set; } + [Comment(""" + Toggles whether your bot will group greet/bye messages into a single message every 5 seconds. + 1st user who joins will get greeted immediately + If more users join within the next 5 seconds, they will be greeted in groups of 5. + This will cause %user.mention% and other placeholders to be replaced with multiple users. + Keep in mind this might break some of your embeds - for example if you have %user.avatar% in the thumbnail, + it will become invalid, as it will resolve to a list of avatars of grouped users. + note: This setting is primarily used if you're afraid of raids, or you're running medium/large bots where some + servers might get hundreds of people join at once. This is used to prevent the bot from getting ratelimited, + and (slightly) reduce the greet spam in those servers. + """)] + public bool GroupGreets { get; set; } + [Comment(""" Whether the bot will rotate through all specified statuses. This setting can be changed via .ropl command. @@ -116,7 +129,7 @@ public sealed partial class BotConfig : ICloneable }, { "name": "List of all Commands", - "value": "https://commands.elliebot.net", + "value": "https://commands.elliebot.net/", "inline": false }, { @@ -131,6 +144,7 @@ public sealed partial class BotConfig : ICloneable Blocked = blocked; Prefix = "."; RotateStatuses = false; + GroupGreets = false; DmHelpTextKeywords = [ "help", @@ -141,11 +155,11 @@ public sealed partial class BotConfig : ICloneable ]; } -// [Comment(@"Whether the prefix will be a suffix, or prefix. -// For example, if your prefix is ! you will run a command called 'cash' by typing either -// '!cash @Someone' if your prefixIsSuffix: false or -// 'cash @Someone!' if your prefixIsSuffix: true")] -// public bool PrefixIsSuffix { get; set; } + // [Comment(@"Whether the prefix will be a suffix, or prefix. + // For example, if your prefix is ! you will run a command called 'cash' by typing either + // '!cash @Someone' if your prefixIsSuffix: false or + // 'cash @Someone!' if your prefixIsSuffix: true")] + // public bool PrefixIsSuffix { get; set; } // public string Prefixed(string text) => PrefixIsSuffix // ? text + Prefix @@ -193,4 +207,4 @@ public enum ConsoleOutputType Normal = 0, Simple = 1, None = 2 -} +} \ No newline at end of file diff --git a/src/EllieBot/_common/Configs/IConfigSeria.cs b/src/EllieBot/_common/Configs/IConfigSeria.cs index a5d3a10..1f96850 100644 --- a/src/EllieBot/_common/Configs/IConfigSeria.cs +++ b/src/EllieBot/_common/Configs/IConfigSeria.cs @@ -1,4 +1,4 @@ -namespace EllieBot.Common.Configs; +namespace EllieBot.Common.Configs; /// /// Base interface for available config serializers diff --git a/src/EllieBot/_common/Creds.cs b/src/EllieBot/_common/Creds.cs index deaf3fd..f6aef5d 100644 --- a/src/EllieBot/_common/Creds.cs +++ b/src/EllieBot/_common/Creds.cs @@ -1,72 +1,61 @@ #nullable disable using EllieBot.Common.Yml; -namespace EllieBot.Common; +namespace Ellie.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(""" - Pledge 5$ or more on https://patreon.com/elliebot and connect your discord account to Patreon. - Go to https://dashy.elliebot.net/me and login with your discord account - 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( """ - 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( """ - 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.""")] @@ -75,29 +64,29 @@ public sealed class Creds : IBotCreds [Comment("""Official cleverbot api key.""")] public string CleverbotApiKey { get; set; } - [Comment(@"OpenAi api key.")] + [Comment(@"Official GPT-3 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,21 +94,21 @@ 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. @@ -130,9 +119,9 @@ public sealed class Creds : IBotCreds 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 +131,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 = 7; Token = string.Empty; UsePrivilegedIntents = true; OwnerIds = new List(); @@ -193,27 +170,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 +222,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 +263,10 @@ 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..cdff91f 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; @@ -12,5 +11,5 @@ public abstract class DbService public abstract Task SetupAsync(); public abstract DbContext CreateRawDbContext(string dbType, string connString); - public abstract EllieContext GetDbContext(); + public abstract DbContext GetDbContext(); } \ No newline at end of file diff --git a/src/EllieBot/_common/DoAsUserMessage.cs b/src/EllieBot/_common/DoAsUserMessage.cs index 68a9188..f8fba27 100644 --- a/src/EllieBot/_common/DoAsUserMessage.cs +++ b/src/EllieBot/_common/DoAsUserMessage.cs @@ -1,4 +1,4 @@ -using MessageType = Discord.MessageType; +using MessageType = Discord.MessageType; namespace EllieBot.Modules.Administration; @@ -15,11 +15,9 @@ public sealed class DoAsUserMessage : IUserMessage _message = message; } - public ulong Id - => _msg.Id; + public ulong Id => _msg.Id; - public DateTimeOffset CreatedAt - => _msg.CreatedAt; + public DateTimeOffset CreatedAt => _msg.CreatedAt; public Task DeleteAsync(RequestOptions? options = null) { @@ -58,104 +56,67 @@ public sealed class DoAsUserMessage : IUserMessage ReactionType type = ReactionType.Normal) => _msg.GetReactionUsersAsync(emoji, limit, options, type); - public IAsyncEnumerable> GetReactionUsersAsync( - IEmote emoji, - int limit, + public IAsyncEnumerable> GetReactionUsersAsync(IEmote emoji, int limit, RequestOptions? options = null) { return _msg.GetReactionUsersAsync(emoji, limit, options); } - public MessageType Type - => _msg.Type; + public MessageType Type => _msg.Type; - public MessageSource Source - => _msg.Source; + public MessageSource Source => _msg.Source; - public bool IsTTS - => _msg.IsTTS; + public bool IsTTS => _msg.IsTTS; - public bool IsPinned - => _msg.IsPinned; + public bool IsPinned => _msg.IsPinned; - public bool IsSuppressed - => _msg.IsSuppressed; + public bool IsSuppressed => _msg.IsSuppressed; - public bool MentionedEveryone - => _msg.MentionedEveryone; + public bool MentionedEveryone => _msg.MentionedEveryone; - public string Content - => _message; + public string Content => _message; - public string CleanContent - => _msg.CleanContent; + public string CleanContent => _msg.CleanContent; - public DateTimeOffset Timestamp - => _msg.Timestamp; + public DateTimeOffset Timestamp => _msg.Timestamp; - public DateTimeOffset? EditedTimestamp - => _msg.EditedTimestamp; + public DateTimeOffset? EditedTimestamp => _msg.EditedTimestamp; - public IMessageChannel Channel - => _msg.Channel; + public IMessageChannel Channel => _msg.Channel; - public IUser Author - => _user; + public IUser Author => _user; - public IThreadChannel Thread - => _msg.Thread; + public IThreadChannel Thread => _msg.Thread; - public IReadOnlyCollection Attachments - => _msg.Attachments; + public IReadOnlyCollection Attachments => _msg.Attachments; - public IReadOnlyCollection Embeds - => _msg.Embeds; + public IReadOnlyCollection Embeds => _msg.Embeds; - public IReadOnlyCollection Tags - => _msg.Tags; + public IReadOnlyCollection Tags => _msg.Tags; - public IReadOnlyCollection MentionedChannelIds - => _msg.MentionedChannelIds; + public IReadOnlyCollection MentionedChannelIds => _msg.MentionedChannelIds; - public IReadOnlyCollection MentionedRoleIds - => _msg.MentionedRoleIds; + public IReadOnlyCollection MentionedRoleIds => _msg.MentionedRoleIds; - public IReadOnlyCollection MentionedUserIds - => _msg.MentionedUserIds; + public IReadOnlyCollection MentionedUserIds => _msg.MentionedUserIds; - public MessageActivity Activity - => _msg.Activity; + public MessageActivity Activity => _msg.Activity; - public MessageApplication Application - => _msg.Application; + public MessageApplication Application => _msg.Application; - public MessageReference Reference - => _msg.Reference; + public MessageReference Reference => _msg.Reference; - public IReadOnlyDictionary Reactions - => _msg.Reactions; + public IReadOnlyDictionary Reactions => _msg.Reactions; - public IReadOnlyCollection Components - => _msg.Components; + public IReadOnlyCollection Components => _msg.Components; - public IReadOnlyCollection Stickers - => _msg.Stickers; + public IReadOnlyCollection Stickers => _msg.Stickers; - public MessageFlags? Flags - => _msg.Flags; + public MessageFlags? Flags => _msg.Flags; [Obsolete("Obsolete in favor of InteractionMetadata")] - public IMessageInteraction Interaction - => _msg.Interaction; - - public MessageRoleSubscriptionData RoleSubscriptionData - => _msg.RoleSubscriptionData; - - public PurchaseNotification PurchaseNotification - => _msg.PurchaseNotification; - - public MessageCallData? CallData - => _msg.CallData; + public IMessageInteraction Interaction => _msg.Interaction; + public MessageRoleSubscriptionData RoleSubscriptionData => _msg.RoleSubscriptionData; public Task ModifyAsync(Action func, RequestOptions? options = null) { @@ -177,39 +138,17 @@ public sealed class DoAsUserMessage : IUserMessage return _msg.CrosspostAsync(options); } - public string Resolve( - TagHandling userHandling = TagHandling.Name, - TagHandling channelHandling = TagHandling.Name, + public string Resolve(TagHandling userHandling = TagHandling.Name, TagHandling channelHandling = TagHandling.Name, TagHandling roleHandling = TagHandling.Name, - TagHandling everyoneHandling = TagHandling.Ignore, - TagHandling emojiHandling = TagHandling.Name) + TagHandling everyoneHandling = TagHandling.Ignore, TagHandling emojiHandling = TagHandling.Name) { return _msg.Resolve(userHandling, channelHandling, roleHandling, everyoneHandling, emojiHandling); } - public Task EndPollAsync(RequestOptions options) - => _msg.EndPollAsync(options); + public MessageResolvedData ResolvedData => _msg.ResolvedData; - public IAsyncEnumerable> GetPollAnswerVotersAsync( - uint answerId, - int? limit = null, - ulong? afterId = null, - RequestOptions? options = null) - => _msg.GetPollAnswerVotersAsync( - answerId, - limit, - afterId, - options); - - public MessageResolvedData ResolvedData - => _msg.ResolvedData; - - public IUserMessage ReferencedMessage - => _msg.ReferencedMessage; + public IUserMessage ReferencedMessage => _msg.ReferencedMessage; public IMessageInteractionMetadata InteractionMetadata => _msg.InteractionMetadata; - - public Poll? Poll - => _msg.Poll; } \ No newline at end of file diff --git a/src/EllieBot/_common/DownloadTracker.cs b/src/EllieBot/_common/DownloadTracker.cs index e780fb6..51d7cc6 100644 --- a/src/EllieBot/_common/DownloadTracker.cs +++ b/src/EllieBot/_common/DownloadTracker.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable namespace EllieBot.Common; public class DownloadTracker : IEService @@ -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/EllieModule.cs b/src/EllieBot/_common/EllieModule.cs index d8867c1..ba52708 100644 --- a/src/EllieBot/_common/EllieModule.cs +++ b/src/EllieBot/_common/EllieModule.cs @@ -91,7 +91,7 @@ public abstract class EllieModule : ModuleBase if (validate is not null && !validate(arg.Content)) return Task.CompletedTask; - + if (userInputTask.TrySetResult(arg.Content)) userMsg.DeleteAfter(1); 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/ILogCommandService.cs b/src/EllieBot/_common/ILogCommandService.cs index 7e5bcd5..344be96 100644 --- a/src/EllieBot/_common/ILogCommandService.cs +++ b/src/EllieBot/_common/ILogCommandService.cs @@ -28,7 +28,7 @@ public enum LogType VoicePresence, UserMuted, UserWarned, - + ThreadDeleted, ThreadCreated } \ No newline at end of file diff --git a/src/EllieBot/_common/IPermissionChecker.cs b/src/EllieBot/_common/IPermissionChecker.cs index 5b4bc48..81aaa64 100644 --- a/src/EllieBot/_common/IPermissionChecker.cs +++ b/src/EllieBot/_common/IPermissionChecker.cs @@ -17,14 +17,14 @@ public partial class PermCheckResult { public bool IsAllowed => IsT0; - - public bool IsCooldown + + public bool IsCooldown => IsT1; - - public bool IsGlobalBlock + + public bool IsGlobalBlock => IsT2; - - public bool IsDisallowed + + public bool IsDisallowed => IsT3; } diff --git a/src/EllieBot/_common/IPlaceholderProvider.cs b/src/EllieBot/_common/IPlaceholderProvider.cs index 20fcc12..1766577 100644 --- a/src/EllieBot/_common/IPlaceholderProvider.cs +++ b/src/EllieBot/_common/IPlaceholderProvider.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable namespace EllieBot.Common; public interface IPlaceholderProvider diff --git a/src/EllieBot/_common/ImageUrls.cs b/src/EllieBot/_common/ImageUrls.cs index 401803a..7274e60 100644 --- a/src/EllieBot/_common/ImageUrls.cs +++ b/src/EllieBot/_common/ImageUrls.cs @@ -5,18 +5,27 @@ using Cloneable; namespace EllieBot.Common; [Cloneable] -public partial class ImageUrls : ICloneable +public partial class ImageUrls : ICloneable { [Comment("DO NOT CHANGE")] - public int Version { get; set; } = 6; + public int Version { get; set; } = 3; public CoinData Coins { get; set; } public Uri[] Currency { get; set; } public Uri[] Dice { get; set; } + public RategirlData Rategirl { get; set; } public XpData Xp { get; set; } + //new + public RipData Rip { get; set; } public SlotData Slots { get; set; } + public class RipData + { + public Uri Bg { get; set; } + public Uri Overlay { get; set; } + } + public class SlotData { public Uri[] Emojis { get; set; } @@ -29,6 +38,12 @@ public partial class ImageUrls : ICloneable public Uri[] Tails { get; set; } } + public class RategirlData + { + public Uri Matrix { get; set; } + public Uri Dot { get; set; } + } + public class XpData { public Uri Bg { get; set; } diff --git a/src/EllieBot/_common/Interaction/EllieInteraction.cs b/src/EllieBot/_common/Interaction/EllieInteraction.cs index 0206599..89e2103 100644 --- a/src/EllieBot/_common/Interaction/EllieInteraction.cs +++ b/src/EllieBot/_common/Interaction/EllieInteraction.cs @@ -1,4 +1,4 @@ -namespace EllieBot; +namespace EllieBot; public abstract class EllieInteractionBase { @@ -12,7 +12,6 @@ public abstract class EllieInteractionBase private IUserMessage message = null!; private readonly string _customId; private readonly bool _singleUse; - private readonly bool _clearAfter; public EllieInteractionBase( DiscordSocketClient client, @@ -20,16 +19,13 @@ public abstract class EllieInteractionBase string customId, Func onAction, bool onlyAuthor, - bool singleUse = true, - bool clearAfter = true) + bool singleUse = true) { _authorId = authorId; _customId = customId; _onAction = onAction; _onlyAuthor = onlyAuthor; _singleUse = singleUse; - _clearAfter = clearAfter; - _interactionCompletedSource = new(TaskCreationOptions.RunContinuationsAsynchronously); Client = client; @@ -40,11 +36,13 @@ public abstract class EllieInteractionBase message = msg; Client.InteractionCreated += OnInteraction; - await Task.WhenAny(Task.Delay(30_000), _interactionCompletedSource.Task); + if (_singleUse) + await Task.WhenAny(Task.Delay(30_000), _interactionCompletedSource.Task); + else + await Task.Delay(30_000); Client.InteractionCreated -= OnInteraction; - if (_clearAfter) - await msg.ModifyAsync(m => m.Components = new ComponentBuilder().Build()); + await msg.ModifyAsync(m => m.Components = new ComponentBuilder().Build()); } private Task OnInteraction(SocketInteraction arg) @@ -61,16 +59,11 @@ public abstract class EllieInteractionBase if (smc.Data.CustomId != _customId) return Task.CompletedTask; - if (_interactionCompletedSource.Task.IsCompleted) - return Task.CompletedTask; - _ = Task.Run(async () => { try { - if (_singleUse) - _interactionCompletedSource.TrySetResult(true); - + _interactionCompletedSource.TrySetResult(true); await ExecuteOnActionAsync(smc); if (!smc.HasResponded) @@ -92,9 +85,6 @@ public abstract class EllieInteractionBase public Task ExecuteOnActionAsync(SocketMessageComponent smc) => _onAction(smc); - - public void SetCompleted() - => _interactionCompletedSource.TrySetResult(true); } public sealed class EllieModalSubmitHandler diff --git a/src/EllieBot/_common/Interaction/EllieInteractionService.cs b/src/EllieBot/_common/Interaction/EllieInteractionService.cs index 813ba1f..115c417 100644 --- a/src/EllieBot/_common/Interaction/EllieInteractionService.cs +++ b/src/EllieBot/_common/Interaction/EllieInteractionService.cs @@ -13,30 +13,25 @@ public class EllieInteractionService : IEllieInteractionService, IEService ulong userId, ButtonBuilder button, Func onTrigger, - bool singleUse = true, - bool clearAfter = true) + bool singleUse = true) => new EllieButtonInteractionHandler(_client, userId, button, onTrigger, onlyAuthor: true, - singleUse: singleUse, - clearAfter: clearAfter); + singleUse: singleUse); public EllieInteractionBase Create( ulong userId, ButtonBuilder button, Func onTrigger, in T state, - bool singleUse = true, - bool clearAfter = true - ) + bool singleUse = true) => Create(userId, button, ((Func>)((data) => smc => onTrigger(smc, data)))(state), - singleUse, - clearAfter); + singleUse); public EllieInteractionBase Create( ulong userId, diff --git a/src/EllieBot/_common/Interaction/IEllieInteractionService.cs b/src/EllieBot/_common/Interaction/IEllieInteractionService.cs index 26adc74..967e91d 100644 --- a/src/EllieBot/_common/Interaction/IEllieInteractionService.cs +++ b/src/EllieBot/_common/Interaction/IEllieInteractionService.cs @@ -6,28 +6,25 @@ public interface IEllieInteractionService ulong userId, ButtonBuilder button, Func onTrigger, - bool singleUse = true, - bool clearAfter = true); + bool singleUse = true); public EllieInteractionBase Create( ulong userId, ButtonBuilder button, Func onTrigger, in T state, - bool singleUse = true, - bool clearAfter = true); + bool singleUse = true); EllieInteractionBase Create( ulong userId, SelectMenuBuilder menu, Func onTrigger, bool singleUse = true); - + EllieInteractionBase Create( - ulong userId, + ulong userId, ButtonBuilder button, 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..3e65c1c 100644 --- a/src/EllieBot/_common/Interaction/Models/EllieButtonInteraction.cs +++ b/src/EllieBot/_common/Interaction/Models/EllieButtonInteraction.cs @@ -1,4 +1,4 @@ -namespace EllieBot; +namespace EllieBot; public sealed class EllieButtonInteractionHandler : EllieInteractionBase { @@ -8,16 +8,14 @@ public sealed class EllieButtonInteractionHandler : EllieInteractionBase ButtonBuilder button, Func onAction, bool onlyAuthor, - bool singleUse = true, - bool clearAfter = true) - : base(client, authorId, button.CustomId, onAction, onlyAuthor, singleUse, clearAfter) + bool singleUse = true) + : base(client, authorId, button.CustomId, onAction, onlyAuthor, singleUse) { Button = button; } public ButtonBuilder Button { get; } - public override void AddTo(ComponentBuilder cb) + 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..28167d6 100644 --- a/src/EllieBot/_common/JsonConverters/CultureInfoConverter.cs +++ b/src/EllieBot/_common/JsonConverters/CultureInfoConverter.cs @@ -7,8 +7,8 @@ namespace EllieBot.Common.JsonConverters; public class CultureInfoConverter : JsonConverter { public override CultureInfo Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - => new(reader.GetString() ?? "en-US"); + => new(reader.GetString() ?? "en_US"); - public override void Write(Utf8JsonWriter writer, CultureInfo value, JsonSerializerOptions options) + 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/JsonConverters/NumberToStringConverter.cs b/src/EllieBot/_common/JsonConverters/NumberToStringConverter.cs deleted file mode 100644 index bc20b10..0000000 --- a/src/EllieBot/_common/JsonConverters/NumberToStringConverter.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Globalization; -using System.Text.Json; -using System.Text.Json.Serialization; - -public class NumberToStringConverter : JsonConverter -{ - public override bool CanConvert(Type typeToConvert) - => typeof(string) == typeToConvert; - - public override object Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - switch (reader.TokenType) - { - case JsonTokenType.Number: - return reader.TryGetInt64(out var l) - ? l.ToString() - : reader.GetDouble().ToString(CultureInfo.InvariantCulture); - case JsonTokenType.String: - return reader.GetString() ?? string.Empty; - default: - { - using var document = JsonDocument.ParseValue(ref reader); - return document.RootElement.Clone().ToString(); - } - } - } - - public override void Write(Utf8JsonWriter writer, object value, JsonSerializerOptions options) - => writer.WriteStringValue(value.ToString()); -} \ No newline at end of file diff --git a/src/EllieBot/_common/JsonConverters/Rgba32Converter.cs b/src/EllieBot/_common/JsonConverters/Rgba32Converter.cs index 4b2a313..ef619a6 100644 --- a/src/EllieBot/_common/JsonConverters/Rgba32Converter.cs +++ b/src/EllieBot/_common/JsonConverters/Rgba32Converter.cs @@ -1,4 +1,4 @@ -using SixLabors.ImageSharp.PixelFormats; +using SixLabors.ImageSharp.PixelFormats; using System.Text.Json; using System.Text.Json.Serialization; @@ -7,7 +7,7 @@ namespace EllieBot.Common.JsonConverters; public class Rgba32Converter : JsonConverter { public override Rgba32 Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - => Rgba32.ParseHex(reader.GetString()!); + => Rgba32.ParseHex(reader.GetString()); public override void Write(Utf8JsonWriter writer, Rgba32 value, JsonSerializerOptions options) => writer.WriteStringValue(value.ToHex()); diff --git a/src/EllieBot/_common/Linq2DbExpressions.cs b/src/EllieBot/_common/Linq2DbExpressions.cs index baa1f74..a724652 100644 --- a/src/EllieBot/_common/Linq2DbExpressions.cs +++ b/src/EllieBot/_common/Linq2DbExpressions.cs @@ -1,6 +1,5 @@ #nullable disable using LinqToDB; -using Microsoft.EntityFrameworkCore; using System.Linq.Expressions; namespace EllieBot.Common; @@ -10,7 +9,7 @@ public static class Linq2DbExpressions [ExpressionMethod(nameof(GuildOnShardExpression))] public static bool GuildOnShard(ulong guildId, int totalShards, int shardId) => throw new NotSupportedException(); - + private static Expression> GuildOnShardExpression() => (guildId, totalShards, shardId) => guildId / 4194304 % (ulong)totalShards == (ulong)shardId; diff --git a/src/EllieBot/_common/Marmalade/Common/Adapters/FilterAdapter.cs b/src/EllieBot/_common/Marmalade/Common/Adapters/FilterAdapter.cs index 69aec21..a23ceec 100644 --- a/src/EllieBot/_common/Marmalade/Common/Adapters/FilterAdapter.cs +++ b/src/EllieBot/_common/Marmalade/Common/Adapters/FilterAdapter.cs @@ -19,11 +19,11 @@ public class FilterAdapter : PreconditionAttribute CommandInfo command, IServiceProvider services) { - var marmaladeContext = ContextAdapterFactory.CreateNew(context, + var medusaContext = ContextAdapterFactory.CreateNew(context, _strings, services); - var result = await _filterAttribute.CheckAsync(marmaladeContext); + var result = await _filterAttribute.CheckAsync(medusaContext); if (!result) return PreconditionResult.FromError($"Precondition '{_filterAttribute.GetType().Name}' failed."); diff --git a/src/EllieBot/_common/Marmalade/Common/MarmaladeIoCKernelModule.cs b/src/EllieBot/_common/Marmalade/Common/MarmaladeIoCKernelModule.cs index 3b9c450..e55ddff 100644 --- a/src/EllieBot/_common/Marmalade/Common/MarmaladeIoCKernelModule.cs +++ b/src/EllieBot/_common/Marmalade/Common/MarmaladeIoCKernelModule.cs @@ -34,7 +34,7 @@ public sealed class MarmaladeNinjectIocModule : IIocModule, IDisposable if (isLoaded) return; - foreach (var (type, _) in _types) + foreach (var (type, data) in _types) { var attribute = type.GetCustomAttribute()!; 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/Marmalade/Common/Models/CanaryCommandData.cs b/src/EllieBot/_common/Marmalade/Common/Models/CanaryCommandData.cs index cc5ab35..8244576 100644 --- a/src/EllieBot/_common/Marmalade/Common/Models/CanaryCommandData.cs +++ b/src/EllieBot/_common/Marmalade/Common/Models/CanaryCommandData.cs @@ -1,4 +1,5 @@ -using System.Reflection; +using EllieBot.Marmalade; +using System.Reflection; namespace EllieBot.Marmalade; diff --git a/src/EllieBot/_common/ModuleBehaviors/IExecNoCommand.cs b/src/EllieBot/_common/ModuleBehaviors/IExecNoCommand.cs index f23d085..4ceeaaf 100644 --- a/src/EllieBot/_common/ModuleBehaviors/IExecNoCommand.cs +++ b/src/EllieBot/_common/ModuleBehaviors/IExecNoCommand.cs @@ -1,4 +1,4 @@ -namespace EllieBot.Common.ModuleBehaviors; +namespace EllieBot.Common.ModuleBehaviors; /// /// Executed if no command was found for this message diff --git a/src/EllieBot/_common/ModuleBehaviors/IExecOnMessage.cs b/src/EllieBot/_common/ModuleBehaviors/IExecOnMessage.cs index 3e39152..7b37a24 100644 --- a/src/EllieBot/_common/ModuleBehaviors/IExecOnMessage.cs +++ b/src/EllieBot/_common/ModuleBehaviors/IExecOnMessage.cs @@ -1,4 +1,4 @@ -namespace EllieBot.Common.ModuleBehaviors; +namespace EllieBot.Common.ModuleBehaviors; /// /// Implemented by modules to handle non-bot messages received diff --git a/src/EllieBot/_common/ModuleBehaviors/IExecPostCommand.cs b/src/EllieBot/_common/ModuleBehaviors/IExecPostCommand.cs index bad88f8..ccb949c 100644 --- a/src/EllieBot/_common/ModuleBehaviors/IExecPostCommand.cs +++ b/src/EllieBot/_common/ModuleBehaviors/IExecPostCommand.cs @@ -1,9 +1,9 @@ -namespace EllieBot.Common.ModuleBehaviors; +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/ModuleBehaviors/IExecPreCommand.cs b/src/EllieBot/_common/ModuleBehaviors/IExecPreCommand.cs index 4320d8f..438cbd0 100644 --- a/src/EllieBot/_common/ModuleBehaviors/IExecPreCommand.cs +++ b/src/EllieBot/_common/ModuleBehaviors/IExecPreCommand.cs @@ -1,4 +1,4 @@ -namespace EllieBot.Common.ModuleBehaviors; +namespace EllieBot.Common.ModuleBehaviors; /// /// This interface's method is executed after a command was found but before it was executed. diff --git a/src/EllieBot/_common/ModuleBehaviors/IInputTransformer.cs b/src/EllieBot/_common/ModuleBehaviors/IInputTransformer.cs index 7039989..957e659 100644 --- a/src/EllieBot/_common/ModuleBehaviors/IInputTransformer.cs +++ b/src/EllieBot/_common/ModuleBehaviors/IInputTransformer.cs @@ -1,4 +1,4 @@ -namespace EllieBot.Common.ModuleBehaviors; +namespace EllieBot.Common.ModuleBehaviors; /// /// Implemented by services which may transform input before a command is searched for diff --git a/src/EllieBot/_common/ModuleBehaviors/IReadyExecutor.cs b/src/EllieBot/_common/ModuleBehaviors/IReadyExecutor.cs index 9364286..f0a200b 100644 --- a/src/EllieBot/_common/ModuleBehaviors/IReadyExecutor.cs +++ b/src/EllieBot/_common/ModuleBehaviors/IReadyExecutor.cs @@ -1,4 +1,4 @@ -namespace EllieBot.Common.ModuleBehaviors; +namespace EllieBot.Common.ModuleBehaviors; /// /// All services which need to execute something after diff --git a/src/EllieBot/_common/DryIocExtensions.cs b/src/EllieBot/_common/NinjectKernelExtensions.cs similarity index 79% rename from src/EllieBot/_common/DryIocExtensions.cs rename to src/EllieBot/_common/NinjectKernelExtensions.cs index c7d8c2a..36b4fa8 100644 --- a/src/EllieBot/_common/DryIocExtensions.cs +++ b/src/EllieBot/_common/NinjectKernelExtensions.cs @@ -1,4 +1,4 @@ -using DryIoc; +using DryIoc; namespace EllieBot.Extensions; @@ -11,7 +11,7 @@ public static class DryIocExtensions return container; } - + public static IContainer AddSingleton(this IContainer container, TImpl obj) where TImpl : TSvc { @@ -20,6 +20,14 @@ public static class DryIocExtensions return container; } + public static IContainer AddSingleton(this IContainer container, Func factory) + where TImpl : TSvc + { + container.RegisterDelegate(factory, Reuse.Singleton); + + return container; + } + public static IContainer AddSingleton(this IContainer container) { container.Register(Reuse.Singleton); @@ -33,7 +41,7 @@ public static class DryIocExtensions return container; } - + public static IContainer AddSingleton(this IContainer container, Func factory) { container.RegisterDelegate(factory); diff --git a/src/EllieBot/_common/OldCreds.cs b/src/EllieBot/_common/OldCreds.cs new file mode 100644 index 0000000..b06e15a --- /dev/null +++ b/src/EllieBot/_common/OldCreds.cs @@ -0,0 +1,45 @@ +#nullable disable +namespace EllieBot.Common; + +public class OldCreds +{ + public string Token { get; set; } = string.Empty; + public ulong[] OwnerIds { get; set; } = new ulong[1]; + public string LoLApiKey { get; set; } = string.Empty; + public string GoogleApiKey { get; set; } = string.Empty; + public string MashapeKey { get; set; } = string.Empty; + public string OsuApiKey { get; set; } = string.Empty; + public string CleverbotApiKey { get; set; } = string.Empty; + public string CarbonKey { get; set; } = string.Empty; + public int TotalShards { get; set; } = 1; + public string PatreonAccessToken { get; set; } = string.Empty; + public string PatreonCampaignId { get; set; } = "334038"; + public RestartConfig RestartCommand { get; set; } + + public string ShardRunCommand { get; set; } = string.Empty; + public string ShardRunArguments { get; set; } = string.Empty; + public int? ShardRunPort { get; set; } + public string MiningProxyUrl { get; set; } = string.Empty; + public string MiningProxyCreds { get; set; } = string.Empty; + + public string BotListToken { get; set; } = string.Empty; + public string TwitchClientId { get; set; } = string.Empty; + public string VotesToken { get; set; } = string.Empty; + public string VotesUrl { get; set; } = string.Empty; + public string RedisOptions { get; set; } = string.Empty; + public string LocationIqApiKey { get; set; } = string.Empty; + public string TimezoneDbApiKey { get; set; } = string.Empty; + public string CoinmarketcapApiKey { get; set; } = string.Empty; + + public class RestartConfig + { + public string Cmd { get; set; } + public string Args { get; set; } + + public RestartConfig(string cmd, string args) + { + Cmd = cmd; + Args = args; + } + } +} \ No newline at end of file diff --git a/src/EllieBot/_common/Patronage/FeatureLimitKey.cs b/src/EllieBot/_common/Patronage/FeatureLimitKey.cs index 10278e1..9aa8a46 100644 --- a/src/EllieBot/_common/Patronage/FeatureLimitKey.cs +++ b/src/EllieBot/_common/Patronage/FeatureLimitKey.cs @@ -1,12 +1,5 @@ namespace EllieBot.Modules.Patronage; -public enum LimitedFeatureName -{ - ChatBot, - ReactionRole, - Prune, - -} public readonly struct FeatureLimitKey { public string PrettyName { get; init; } diff --git a/src/EllieBot/_common/Patronage/FeatureQuotaStats.cs b/src/EllieBot/_common/Patronage/FeatureQuotaStats.cs new file mode 100644 index 0000000..02db5d3 --- /dev/null +++ b/src/EllieBot/_common/Patronage/FeatureQuotaStats.cs @@ -0,0 +1,8 @@ +namespace EllieBot.Modules.Patronage; + +public readonly struct FeatureQuotaStats +{ + public (uint Cur, uint Max) Hourly { get; init; } + public (uint Cur, uint Max) Daily { get; init; } + public (uint Cur, uint Max) Monthly { get; init; } +} \ No newline at end of file diff --git a/src/EllieBot/_common/Patronage/IPatronageService.cs b/src/EllieBot/_common/Patronage/IPatronageService.cs index 379de6b..77fed4b 100644 --- a/src/EllieBot/_common/Patronage/IPatronageService.cs +++ b/src/EllieBot/_common/Patronage/IPatronageService.cs @@ -1,4 +1,7 @@ -namespace EllieBot.Modules.Patronage; +using EllieBot.Db.Models; +using OneOf; + +namespace EllieBot.Modules.Patronage; /// /// Manages patrons and provides access to their data @@ -28,15 +31,26 @@ public interface IPatronageService /// /// UserId for which to get the patron data for. /// A patron with the specifeid userId - public Task GetPatronAsync(ulong userId); + public Task GetPatronAsync(ulong userId); - Task LimitHitAsync(LimitedFeatureName key, ulong userId, int amount = 1); - Task LimitForceHit(LimitedFeatureName key, ulong userId, int amount); - Task GetUserLimit(LimitedFeatureName name, ulong userId); + /// + /// Gets the quota statistic for the user/patron specified by the userId + /// + /// UserId of the user for which to get the quota statistic for + /// Quota stats for the specified user + Task GetUserQuotaStatistic(ulong userId); + - Task> LimitStats(ulong userId); + Task TryGetFeatureLimitAsync(FeatureLimitKey key, ulong userId, int? defaultValue); + + ValueTask> TryIncrementQuotaCounterAsync( + ulong userId, + bool isSelf, + FeatureType featureType, + string featureName, + uint? maybeHourly, + uint? maybeDaily, + uint? maybeMonthly); PatronConfigData GetConfig(); - int PercentBonus(Patron? user); - int PercentBonus(long amount); } \ No newline at end of file diff --git a/src/EllieBot/_common/Patronage/Patron.cs b/src/EllieBot/_common/Patronage/Patron.cs index 93a7575..a7c9d97 100644 --- a/src/EllieBot/_common/Patronage/Patron.cs +++ b/src/EllieBot/_common/Patronage/Patron.cs @@ -13,7 +13,7 @@ public readonly struct Patron public ulong UserId { get; init; } /// - /// Amount the Patron is currently pledging or paid in cents + /// Amount the Patron is currently pledging or paid /// public int Amount { get; init; } diff --git a/src/EllieBot/_common/Patronage/PatronConfigData.cs b/src/EllieBot/_common/Patronage/PatronConfigData.cs index 9becae0..09ed100 100644 --- a/src/EllieBot/_common/Patronage/PatronConfigData.cs +++ b/src/EllieBot/_common/Patronage/PatronConfigData.cs @@ -7,11 +7,31 @@ namespace EllieBot.Modules.Patronage; public partial class PatronConfigData : ICloneable { [Comment("DO NOT CHANGE")] - public int Version { get; set; } = 3; - + public int Version { get; set; } = 2; + [Comment("Whether the patronage feature is enabled")] public bool IsEnabled { get; set; } - [Comment("Who can do how much of what")] - public Dictionary> Limits { get; set; } = new(); + [Comment("List of patron only features and relevant quota data")] + public FeatureQuotas Quotas { get; set; } + + public PatronConfigData() + { + Quotas = new(); + } + + public class FeatureQuotas + { + [Comment("Dictionary of feature names with their respective limits. Set to null for unlimited")] + public Dictionary> Features { get; set; } = new(); + + [Comment("Dictionary of commands with their respective quota data")] + public Dictionary?>> Commands { get; set; } = new(); + + [Comment("Dictionary of groups with their respective quota data")] + public Dictionary?>> Groups { get; set; } = new(); + + [Comment("Dictionary of modules with their respective quota data")] + public Dictionary?>> Modules { get; set; } = new(); + } } \ No newline at end of file diff --git a/src/EllieBot/_common/Patronage/PatronExtensions.cs b/src/EllieBot/_common/Patronage/PatronExtensions.cs index 1686a4c..b422b73 100644 --- a/src/EllieBot/_common/Patronage/PatronExtensions.cs +++ b/src/EllieBot/_common/Patronage/PatronExtensions.cs @@ -8,6 +8,15 @@ public static class PatronExtensions _ => $"Patron Tier {tier}", }; + public static string ToFullName(this QuotaPer per) + => per switch + { + QuotaPer.PerDay => "per day", + QuotaPer.PerHour => "per hour", + QuotaPer.PerMonth => "per month", + _ => "Unknown", + }; + public static DateTime DayOfNextMonth(this DateTime date, int day) { var nextMonth = date.AddMonths(1); diff --git a/src/EllieBot/_common/Patronage/QuotaLimit.cs b/src/EllieBot/_common/Patronage/QuotaLimit.cs index 5669c0c..b40017c 100644 --- a/src/EllieBot/_common/Patronage/QuotaLimit.cs +++ b/src/EllieBot/_common/Patronage/QuotaLimit.cs @@ -1,4 +1,6 @@ -namespace EllieBot.Modules.Patronage; +using EllieBot.Db.Models; + +namespace EllieBot.Modules.Patronage; /// /// Represents information about why the user has triggered a quota limit @@ -8,16 +10,57 @@ public readonly struct QuotaLimit /// /// Amount of usages reached, which is the limit /// - public int Quota { get; init; } + public uint Quota { get; init; } /// /// Which period is this quota limit for (hourly, daily, monthly, etc...) /// public QuotaPer QuotaPeriod { get; init; } - public QuotaLimit(int quota, QuotaPer quotaPeriod) + /// + /// When does this quota limit reset + /// + public DateTime ResetsAt { get; init; } + + /// + /// Type of the feature this quota limit is for + /// + public FeatureType FeatureType { get; init; } + + /// + /// Name of the feature this quota limit is for + /// + public string Feature { get; init; } + + /// + /// Whether it is the user's own quota (true), or server owners (false) + /// + public bool IsOwnQuota { get; init; } +} + + +/// +/// Respresent information about the feature limit +/// +public readonly struct FeatureLimit +{ + + /// + /// Whether this limit comes from the patronage system + /// + public bool IsPatronLimit { get; init; } = false; + + /// + /// Maximum limit allowed + /// + public int? Quota { get; init; } = null; + + /// + /// Name of the limit + /// + public string Name { get; init; } = string.Empty; + + public FeatureLimit() { - Quota = quota; - QuotaPeriod = quotaPeriod; } } \ No newline at end of file diff --git a/src/EllieBot/_common/Patronage/QuotaPer.cs b/src/EllieBot/_common/Patronage/QuotaPer.cs index 9f67a40..c6080ac 100644 --- a/src/EllieBot/_common/Patronage/QuotaPer.cs +++ b/src/EllieBot/_common/Patronage/QuotaPer.cs @@ -5,5 +5,4 @@ public enum QuotaPer PerHour, PerDay, PerMonth, - Total, } \ No newline at end of file diff --git a/src/EllieBot/_common/Patronage/UserQuotaStats.cs b/src/EllieBot/_common/Patronage/UserQuotaStats.cs new file mode 100644 index 0000000..a9e33e4 --- /dev/null +++ b/src/EllieBot/_common/Patronage/UserQuotaStats.cs @@ -0,0 +1,25 @@ +namespace EllieBot.Modules.Patronage; + +public readonly struct UserQuotaStats +{ + private static readonly IReadOnlyDictionary _emptyDictionary + = new Dictionary(); + public PatronTier Tier { get; init; } + = PatronTier.None; + + public IReadOnlyDictionary Features { get; init; } + = _emptyDictionary; + + public IReadOnlyDictionary Commands { get; init; } + = _emptyDictionary; + + public IReadOnlyDictionary Groups { get; init; } + = _emptyDictionary; + + public IReadOnlyDictionary Modules { get; init; } + = _emptyDictionary; + + public UserQuotaStats() + { + } +} \ No newline at end of file diff --git a/src/EllieBot/_common/Pokemon/SearchPokemonAbility.cs b/src/EllieBot/_common/Pokemon/SearchPokemonAbility.cs index f401284..c3f8f36 100644 --- a/src/EllieBot/_common/Pokemon/SearchPokemonAbility.cs +++ b/src/EllieBot/_common/Pokemon/SearchPokemonAbility.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable namespace EllieBot.Common.Pokemon; public class SearchPokemonAbility diff --git a/src/EllieBot/_common/Replacements/Impl/ReplacementContext.cs b/src/EllieBot/_common/Replacements/Impl/ReplacementContext.cs index 4e87ce9..b321941 100644 --- a/src/EllieBot/_common/Replacements/Impl/ReplacementContext.cs +++ b/src/EllieBot/_common/Replacements/Impl/ReplacementContext.cs @@ -7,7 +7,7 @@ public sealed class ReplacementContext public DiscordSocketClient? Client { get; } public IGuild? Guild { get; } public IMessageChannel? Channel { get; } - public IUser? User { get; } + public IUser[]? Users { get; } private readonly List _overrides = new(); private readonly HashSet _tokens = new(); @@ -21,11 +21,10 @@ public sealed class ReplacementContext public IReadOnlyList RegexOverrides => _regexOverrides.AsReadOnly(); - public ReplacementContext(ICommandContext cmdContext) - : this(cmdContext.Client as DiscordSocketClient, - cmdContext.Guild, - cmdContext.Channel, - cmdContext.User) + public ReplacementContext(ICommandContext cmdContext) : this(cmdContext.Client as DiscordSocketClient, + cmdContext.Guild, + cmdContext.Channel, + cmdContext.User) { } @@ -33,12 +32,12 @@ public sealed class ReplacementContext DiscordSocketClient? client = null, IGuild? guild = null, IMessageChannel? channel = null, - IUser? user = null) + params IUser[]? users) { Client = client; Guild = guild; Channel = channel; - User = user; + Users = users; } public ReplacementContext WithOverride(string key, Func> repFactory) @@ -54,6 +53,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..d42bba6 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() @@ -65,20 +61,6 @@ public sealed partial class ReplacementPatternStore private void WithUsers() { - Register("%user%", static (IUser user) => user.Mention); - 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%", static (IUser[] users) => string.Join(" ", users.Select(user => user.Mention))); Register("%user.mention%", diff --git a/src/EllieBot/_common/Replacements/Impl/ReplacementService.cs b/src/EllieBot/_common/Replacements/Impl/ReplacementService.cs index 18712d8..4d17213 100644 --- a/src/EllieBot/_common/Replacements/Impl/ReplacementService.cs +++ b/src/EllieBot/_common/Replacements/Impl/ReplacementService.cs @@ -40,8 +40,8 @@ public sealed class ReplacementService : IReplacementService, IEService if (repCtx.Guild is not null) obj.Add(repCtx.Guild); - if (repCtx.User is not null) - obj.Add(repCtx.User); + if (repCtx.Users is not null) + obj.Add(repCtx.Users); if (repCtx.Channel is not null) obj.Add(repCtx.Channel); @@ -86,9 +86,9 @@ public sealed class ReplacementService : IReplacementService, IEService objs.Add(repCtx.Channel); } - if (repCtx.User is not null) + if (repCtx.Users is not null) { - objs.Add(repCtx.User); + objs.Add(repCtx.Users); } if (repCtx.Guild is not null) @@ -117,9 +117,9 @@ public sealed class ReplacementService : IReplacementService, IEService objs.Add(repCtx.Channel); } - if (repCtx.User is not null) + if (repCtx.Users is not null) { - objs.Add(repCtx.User); + objs.Add(repCtx.Users); } if (repCtx.Guild is not null) diff --git a/src/EllieBot/_common/Replacements/Impl/Replacer.cs b/src/EllieBot/_common/Replacements/Impl/Replacer.cs index adc5e4d..9b43331 100644 --- a/src/EllieBot/_common/Replacements/Impl/Replacer.cs +++ b/src/EllieBot/_common/Replacements/Impl/Replacer.cs @@ -9,8 +9,8 @@ public sealed partial class Replacer private readonly IEnumerable _regexReps; private readonly object[] _inputData; - // [GeneratedRegex(@"\%[\p{L}\p{N}\._]*[\p{L}\p{N}]+[\p{L}\p{N}\._]*\%")] - // private static partial Regex TokenExtractionRegex(); + [GeneratedRegex(@"\%[\p{L}\p{N}\._]*[\p{L}\p{N}]+[\p{L}\p{N}\._]*\%")] + private static partial Regex TokenExtractionRegex(); public Replacer(IEnumerable reps, IEnumerable regexReps, object[] inputData) { @@ -24,19 +24,19 @@ public sealed partial class Replacer if (string.IsNullOrWhiteSpace(input)) return input; - // var matches = TokenExtractionRegex().IsMatch(input); + var matches = TokenExtractionRegex().IsMatch(input); - // if (matches) - // { - foreach (var rep in _reps) + if (matches) { - if (input.Contains(rep.Token, StringComparison.InvariantCulture)) + foreach (var rep in _reps) { - var objs = GetParams(rep.InputTypes); - input = input.Replace(rep.Token, await rep.GetValueAsync(objs), StringComparison.InvariantCulture); + if (input.Contains(rep.Token, StringComparison.InvariantCulture)) + { + var objs = GetParams(rep.InputTypes); + input = input.Replace(rep.Token, await rep.GetValueAsync(objs), StringComparison.InvariantCulture); + } } } - // } foreach (var rep in _regexReps) { @@ -47,7 +47,7 @@ public sealed partial class Replacer if (match.Success) { sb.Append(input, 0, match.Index) - .Append(await rep.GetValueAsync(match, objs)); + .Append(await rep.GetValueAsync(match, objs)); var lastIndex = match.Index + match.Length; sb.Append(input, lastIndex, input.Length - lastIndex); @@ -91,18 +91,16 @@ public sealed partial class Replacer => new() { Embeds = await embedArr.Embeds.Map(async e => await ReplaceAsync(e) with - { - Color = e.Color - }) - .WhenAll(), + { + Color = e.Color + }).WhenAll(), Content = await ReplaceAsync(embedArr.Content) }; private async ValueTask ReplaceAsync(SmartPlainText plain) => await ReplaceAsync(plain.Text); - private async Task ReplaceAsync(T embedData) - where T : SmartEmbedTextBase, new() + private async Task ReplaceAsync(T embedData) where T : SmartEmbedTextBase, new() { var newEmbedData = new T { @@ -119,14 +117,13 @@ public sealed partial class Replacer IconUrl = await ReplaceAsync(embedData.Author.IconUrl) }, Fields = await Task.WhenAll(embedData - .Fields? - .Map(async f => new SmartTextEmbedField - { - Name = await ReplaceAsync(f.Name), - Value = await ReplaceAsync(f.Value), - Inline = f.Inline - }) - ?? []), + .Fields? + .Map(async f => new SmartTextEmbedField + { + Name = await ReplaceAsync(f.Name), + Value = await ReplaceAsync(f.Value), + Inline = f.Inline + }) ?? []), Footer = embedData.Footer is null ? null : new() diff --git a/src/EllieBot/_common/Sender/MessageSenderService.cs b/src/EllieBot/_common/Sender/MessageSenderService.cs index 88f1c40..f91f1ab 100644 --- a/src/EllieBot/_common/Sender/MessageSenderService.cs +++ b/src/EllieBot/_common/Sender/MessageSenderService.cs @@ -1,4 +1,5 @@ using EllieBot.Common.Configs; +using System.Diagnostics.CodeAnalysis; namespace EllieBot.Extensions; diff --git a/src/EllieBot/_common/Sender/ResponseBuilder.PaginationSender.cs b/src/EllieBot/_common/Sender/ResponseBuilder.PaginationSender.cs index 92d871a..a1dee4d 100644 --- a/src/EllieBot/_common/Sender/ResponseBuilder.PaginationSender.cs +++ b/src/EllieBot/_common/Sender/ResponseBuilder.PaginationSender.cs @@ -11,10 +11,6 @@ public partial class ResponseBuilder private readonly ResponseBuilder _builder; private readonly DiscordSocketClient _client; private int currentPage; - - private EllieButtonInteractionHandler? left; - private EllieButtonInteractionHandler? right; - private EllieInteractionBase? extra; public PaginationSender( SourcedPaginatedResponseBuilder paginationBuilder, @@ -71,8 +67,7 @@ public partial class ResponseBuilder return Task.CompletedTask; }, true, - singleUse: false, - clearAfter: false); + singleUse: false); if (_paginationBuilder.InteractionFunc is not null) { @@ -107,13 +102,10 @@ public partial class ResponseBuilder return Task.CompletedTask; }, true, - singleUse: false, - clearAfter: false); + singleUse: false); return (leftBtnInter, maybeInter, rightBtnInter); } - - (left, extra, right) = await GetInteractions(); async Task UpdatePageAsync(SocketMessageComponent smc) { @@ -122,25 +114,21 @@ public partial class ResponseBuilder if (_paginationBuilder.AddPaginatedFooter) toSend.AddPaginatedFooter(currentPage, lastPage); - left?.SetCompleted(); - right?.SetCompleted(); - extra?.SetCompleted(); - (left, extra, right) = (await GetInteractions()); + var (left, extra, right) = (await GetInteractions()); var cb = new ComponentBuilder(); left.AddTo(cb); right.AddTo(cb); extra?.AddTo(cb); - + await smc.ModifyOriginalResponseAsync(x => { x.Embed = toSend.Build(); x.Components = cb.Build(); }); - - await Task.WhenAll(left.RunAsync(smc.Message), extra?.RunAsync(smc.Message) ?? Task.CompletedTask, right.RunAsync(smc.Message)); } + var (left, extra, right) = await GetInteractions(); var cb = new ComponentBuilder(); left.AddTo(cb); @@ -156,11 +144,9 @@ public partial class ResponseBuilder if (lastPage == 0 && _paginationBuilder.InteractionFunc is null) return; - + await Task.WhenAll(left.RunAsync(msg), extra?.RunAsync(msg) ?? Task.CompletedTask, right.RunAsync(msg)); - await Task.Delay(30_000); - await msg.ModifyAsync(mp => mp.Components = new ComponentBuilder().Build()); } } diff --git a/src/EllieBot/_common/Sender/ResponseBuilder.cs b/src/EllieBot/_common/Sender/ResponseBuilder.cs index f209770..60783de 100644 --- a/src/EllieBot/_common/Sender/ResponseBuilder.cs +++ b/src/EllieBot/_common/Sender/ResponseBuilder.cs @@ -1,4 +1,6 @@ -using System.Collections.ObjectModel; +using EllieBot.Common.Configs; +using EllieBot.Db.Models; +using System.Collections.ObjectModel; namespace EllieBot.Extensions; @@ -287,9 +289,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..4b468d2 100644 --- a/src/EllieBot/_common/ServiceCollectionExtensions.cs +++ b/src/EllieBot/_common/ServiceCollectionExtensions.cs @@ -1,4 +1,4 @@ -using DryIoc; +using DryIoc; using LinqToDB.Extensions; using Microsoft.Extensions.DependencyInjection; using EllieBot.Modules.Music; @@ -33,7 +33,7 @@ public static class ServiceCollectionExtensions public static IContainer AddConfigServices(this IContainer svcs, Assembly a) { - + foreach (var type in a.GetTypes() .Where(x => !x.IsAbstract && x.IsAssignableToGenericType(typeof(ConfigServiceBase<>)))) { @@ -41,7 +41,7 @@ public static class ServiceCollectionExtensions getServiceTypes: type => type.GetImplementedTypes(ReflectionTools.AsImplementedType.SourceType), getImplFactory: type => ReflectionFactory.Of(type, Reuse.Singleton)); } - + return svcs; } @@ -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) { @@ -97,7 +95,7 @@ public static class ServiceCollectionExtensions }); var prov = proxySvcs.BuildServiceProvider(); - + svcs.RegisterDelegate(_ => prov.GetRequiredService()); svcs.RegisterDelegate(_ => prov.GetRequiredService()); @@ -115,7 +113,7 @@ public static class ServiceCollectionExtensions typeof(IInputTransformer), typeof(IEService) ]; - + foreach (var svc in a.GetTypes() .Where(type => type.IsClass && types.Any(t => type.IsAssignableTo(t)) && !type.HasAttribute() #if GLOBAL_ELLIE diff --git a/src/EllieBot/_common/Services/CommandHandler.cs b/src/EllieBot/_common/Services/CommandHandler.cs index a9c81a1..c058887 100644 --- a/src/EllieBot/_common/Services/CommandHandler.cs +++ b/src/EllieBot/_common/Services/CommandHandler.cs @@ -1,6 +1,7 @@ #nullable disable using EllieBot.Common.Configs; using EllieBot.Common.ModuleBehaviors; +using EllieBot.Db; using ExecuteResult = Discord.Commands.ExecuteResult; using PreconditionResult = Discord.Commands.PreconditionResult; @@ -8,7 +9,7 @@ namespace EllieBot.Services; public class CommandHandler : IEService, IReadyExecutor, ICommandHandler { - private const int GLOBAL_COMMANDS_COOLDOWN = 200; + private const int GLOBAL_COMMANDS_COOLDOWN = 750; private const float ONE_THOUSANDTH = 1.0f / 1000; @@ -165,7 +166,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)); } @@ -261,7 +262,7 @@ public class CommandHandler : IEService, IReadyExecutor, ICommandHandler var blockTime = Environment.TickCount - startTime; var messageContent = await _behaviorHandler.RunInputTransformersAsync(guild, usrMsg); - + var prefix = GetPrefix(guild?.Id); var isPrefixCommand = messageContent.StartsWith(".prefix", StringComparison.InvariantCultureIgnoreCase); // execute the command and measure the time it took diff --git a/src/EllieBot/_common/Services/Currency/CurrencyService.cs b/src/EllieBot/_common/Services/Currency/CurrencyService.cs index 974febd..9cb4037 100644 --- a/src/EllieBot/_common/Services/Currency/CurrencyService.cs +++ b/src/EllieBot/_common/Services/Currency/CurrencyService.cs @@ -1,6 +1,7 @@ #nullable disable using LinqToDB; using LinqToDB.EntityFrameworkCore; +using EllieBot.Db; using EllieBot.Db.Models; using EllieBot.Services.Currency; @@ -55,14 +56,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 +78,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 +98,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 +113,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/IBehaviourHandler.cs b/src/EllieBot/_common/Services/IBehaviourHandler.cs index 2f75074..79e8e5a 100644 --- a/src/EllieBot/_common/Services/IBehaviourHandler.cs +++ b/src/EllieBot/_common/Services/IBehaviourHandler.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable namespace EllieBot.Services; public interface IBehaviorHandler @@ -7,7 +7,7 @@ public interface IBehaviorHandler Task AddRangeAsync(IEnumerable behavior); Task RemoveAsync(ICustomBehavior behavior); Task RemoveRangeAsync(IEnumerable behs); - + Task RunExecOnMessageAsync(SocketGuild guild, IUserMessage usrMsg); Task RunInputTransformersAsync(SocketGuild guild, IUserMessage usrMsg); Task RunPreCommandAsync(ICommandContext context, CommandInfo cmd); 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/ILocalization.cs b/src/EllieBot/_common/Services/ILocalization.cs index ab37be5..3fa7c5e 100644 --- a/src/EllieBot/_common/Services/ILocalization.cs +++ b/src/EllieBot/_common/Services/ILocalization.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable using System.Globalization; namespace EllieBot.Services; 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/ITimezoneService.cs b/src/EllieBot/_common/Services/ITimezoneService.cs index e70b985..aa8cbff 100644 --- a/src/EllieBot/_common/Services/ITimezoneService.cs +++ b/src/EllieBot/_common/Services/ITimezoneService.cs @@ -1,4 +1,4 @@ -namespace EllieBot.Common; +namespace EllieBot.Common; public interface ITimezoneService { 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/FontProvider.cs b/src/EllieBot/_common/Services/Impl/FontProvider.cs index 2bead90..543f23c 100644 --- a/src/EllieBot/_common/Services/Impl/FontProvider.cs +++ b/src/EllieBot/_common/Services/Impl/FontProvider.cs @@ -12,6 +12,11 @@ public class FontProvider : IEService public FontFamily NotoSans { get; } //public FontFamily Emojis { get; } + /// + /// Font used for .rip command + /// + public Font RipFont { get; } + public List FallBackFonts { get; } private readonly FontCollection _fonts; @@ -49,6 +54,7 @@ public class FontProvider : IEService FallBackFonts.AddRange(_fonts.AddCollection(font)); } + RipFont = NotoSans.CreateFont(20, FontStyle.Bold); DottyFont = FallBackFonts.First(x => x.Name == "dotty"); } } \ No newline at end of file diff --git a/src/EllieBot/_common/Services/Impl/IImageCache.cs b/src/EllieBot/_common/Services/Impl/IImageCache.cs index 5a7e01c..8c8ff32 100644 --- a/src/EllieBot/_common/Services/Impl/IImageCache.cs +++ b/src/EllieBot/_common/Services/Impl/IImageCache.cs @@ -6,8 +6,12 @@ public interface IImageCache Task GetTailsImageAsync(); Task GetCurrencyImageAsync(); Task GetXpBackgroundImageAsync(); + Task GetRategirlBgAsync(); + Task GetRategirlDotAsync(); Task GetDiceAsync(int num); Task GetSlotEmojiAsync(int number); Task GetSlotBgAsync(); + Task GetRipBgAsync(); + Task GetRipOverlayAsync(); Task GetImageDataAsync(Uri url); } \ 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..821d717 100644 --- a/src/EllieBot/_common/Services/Impl/ImagesConfig.cs +++ b/src/EllieBot/_common/Services/Impl/ImagesConfig.cs @@ -15,34 +15,5 @@ public sealed class ImagesConfig : ConfigServiceBase public ImagesConfig(IConfigSeria serializer, IPubSub pubSub) : base(PATH, serializer, pubSub, _changeKey) { - Migrate(); - } - - private void Migrate() - { - if (data.Version < 5) - { - ModifyConfig(c => - { - 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..ef7ea80 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; @@ -55,60 +55,76 @@ public sealed class StatsService : IStatsService, IReadyExecutor, IEService _client.ChannelCreated += c => { - if (c is IVoiceChannel) - Interlocked.Increment(ref voiceChannels); - else if (c is ITextChannel) - Interlocked.Increment(ref textChannels); + _ = Task.Run(() => + { + if (c is ITextChannel) + Interlocked.Increment(ref textChannels); + else if (c is IVoiceChannel) + Interlocked.Increment(ref voiceChannels); + }); return Task.CompletedTask; }; _client.ChannelDestroyed += c => { - if (c is IVoiceChannel) - Interlocked.Decrement(ref voiceChannels); - else if (c is ITextChannel) - Interlocked.Decrement(ref textChannels); + _ = Task.Run(() => + { + if (c is ITextChannel) + Interlocked.Decrement(ref textChannels); + else if (c is IVoiceChannel) + Interlocked.Decrement(ref voiceChannels); + }); return Task.CompletedTask; }; _client.GuildAvailable += g => { - var tc = g.Channels.Count(cx => cx is ITextChannel and not IVoiceChannel); - var vc = g.Channels.Count(cx => cx is IVoiceChannel); - Interlocked.Add(ref textChannels, tc); - Interlocked.Add(ref voiceChannels, vc); - + _ = Task.Run(() => + { + var tc = g.Channels.Count(cx => cx is ITextChannel); + var vc = g.Channels.Count - tc; + Interlocked.Add(ref textChannels, tc); + Interlocked.Add(ref voiceChannels, vc); + }); return Task.CompletedTask; }; _client.JoinedGuild += g => { - var tc = g.Channels.Count(cx => cx is ITextChannel and not IVoiceChannel); - var vc = g.Channels.Count(cx => cx is IVoiceChannel); - Interlocked.Add(ref textChannels, tc); - Interlocked.Add(ref voiceChannels, vc); - + _ = Task.Run(() => + { + var tc = g.Channels.Count(cx => cx is ITextChannel); + var vc = g.Channels.Count - tc; + Interlocked.Add(ref textChannels, tc); + Interlocked.Add(ref voiceChannels, vc); + }); return Task.CompletedTask; }; _client.GuildUnavailable += g => { - var tc = g.Channels.Count(cx => cx is ITextChannel and not IVoiceChannel); - var vc = g.Channels.Count(cx => cx is IVoiceChannel); - Interlocked.Add(ref textChannels, -tc); - Interlocked.Add(ref voiceChannels, -vc); + _ = Task.Run(() => + { + var tc = g.Channels.Count(cx => cx is ITextChannel); + var vc = g.Channels.Count - tc; + Interlocked.Add(ref textChannels, -tc); + Interlocked.Add(ref voiceChannels, -vc); + }); return Task.CompletedTask; }; _client.LeftGuild += g => { - var tc = g.Channels.Count(cx => cx is ITextChannel and not IVoiceChannel); - var vc = g.Channels.Count(cx => cx is IVoiceChannel); - Interlocked.Add(ref textChannels, -tc); - Interlocked.Add(ref voiceChannels, -vc); + _ = Task.Run(() => + { + var tc = g.Channels.Count(cx => cx is ITextChannel); + var vc = g.Channels.Count - tc; + Interlocked.Add(ref textChannels, -tc); + Interlocked.Add(ref voiceChannels, -vc); + }); return Task.CompletedTask; }; @@ -117,7 +133,7 @@ public sealed class StatsService : IStatsService, IReadyExecutor, IEService private void InitializeChannelCount() { var guilds = _client.Guilds; - textChannels = guilds.Sum(static g => g.Channels.Count(static cx => cx is ITextChannel and not IVoiceChannel)); + textChannels = guilds.Sum(static g => g.Channels.Count(static cx => cx is ITextChannel)); voiceChannels = guilds.Sum(static g => g.Channels.Count(static cx => cx is IVoiceChannel)); } @@ -161,39 +177,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 +219,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..f302ab7 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..952f402 100644 --- a/src/EllieBot/_common/Settings/BotConfigService.cs +++ b/src/EllieBot/_common/Settings/BotConfigService.cs @@ -49,31 +49,25 @@ public sealed class BotConfigService : ConfigServiceBase .ToHashSet(); }); } - + if (data.Version < 4) ModifyConfig(c => { c.Version = 4; c.CheckForUpdates = true; }); - - if(data.Version < 5) + + if (data.Version < 5) ModifyConfig(c => { c.Version = 5; }); - - if(data.Version < 7) + + if (data.Version < 7) ModifyConfig(c => { c.Version = 7; c.IgnoreOtherBots = true; }); - - if(data.Version < 8) - ModifyConfig(c => - { - c.Version = 8; - }); } } \ No newline at end of file diff --git a/src/EllieBot/_common/Settings/ConfigParsers.cs b/src/EllieBot/_common/Settings/ConfigParsers.cs index 8eda144..c32b7ca 100644 --- a/src/EllieBot/_common/Settings/ConfigParsers.cs +++ b/src/EllieBot/_common/Settings/ConfigParsers.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable using SixLabors.ImageSharp.PixelFormats; using System.Globalization; @@ -33,7 +33,7 @@ public static class ConfigParsers } public static bool InsensitiveEnum(string input, out T output) - where T: struct + where T : struct => Enum.TryParse(input, true, out output); } diff --git a/src/EllieBot/_common/Settings/ConfigServiceBase.cs b/src/EllieBot/_common/Settings/ConfigServiceBase.cs index df6a0b9..bdf76d8 100644 --- a/src/EllieBot/_common/Settings/ConfigServiceBase.cs +++ b/src/EllieBot/_common/Settings/ConfigServiceBase.cs @@ -1,4 +1,4 @@ -using EllieBot.Common.Configs; +using EllieBot.Common.Configs; using EllieBot.Common.Yml; using System.Linq.Expressions; using System.Reflection; diff --git a/src/EllieBot/_common/Settings/IConfigService.cs b/src/EllieBot/_common/Settings/IConfigService.cs index ae97198..69ac966 100644 --- a/src/EllieBot/_common/Settings/IConfigService.cs +++ b/src/EllieBot/_common/Settings/IConfigService.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable namespace EllieBot.Services; /// diff --git a/src/EllieBot/_common/Settings/SettingParser.cs b/src/EllieBot/_common/Settings/SettingParser.cs index 1437591..06a8e75 100644 --- a/src/EllieBot/_common/Settings/SettingParser.cs +++ b/src/EllieBot/_common/Settings/SettingParser.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable namespace EllieBot.Services; /// 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/Yml/CommentAttribute.cs b/src/EllieBot/_common/Yml/CommentAttribute.cs index 1c1ad89..7c04bea 100644 --- a/src/EllieBot/_common/Yml/CommentAttribute.cs +++ b/src/EllieBot/_common/Yml/CommentAttribute.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable disable namespace EllieBot.Common.Yml; [AttributeUsage(AttributeTargets.Property)] diff --git a/src/EllieBot/_common/Yml/MultilineScalarFlowStyleEmitter.cs b/src/EllieBot/_common/Yml/MultilineScalarFlowStyleEmitter.cs index c63dcab..e2cfd97 100644 --- a/src/EllieBot/_common/Yml/MultilineScalarFlowStyleEmitter.cs +++ b/src/EllieBot/_common/Yml/MultilineScalarFlowStyleEmitter.cs @@ -5,6 +5,7 @@ using YamlDotNet.Serialization.EventEmitters; namespace EllieBot.Common.Yml; + public class MultilineScalarFlowStyleEmitter : ChainedEventEmitter { public MultilineScalarFlowStyleEmitter(IEventEmitter nextEmitter) 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/CommandContextExtensions.cs b/src/EllieBot/_common/_Extensions/CommandContextExtensions.cs index ebb019b..7f90d78 100644 --- a/src/EllieBot/_common/_Extensions/CommandContextExtensions.cs +++ b/src/EllieBot/_common/_Extensions/CommandContextExtensions.cs @@ -27,14 +27,4 @@ public static class CommandContextExtensions public static Task WarningAsync(this ICommandContext ctx) => ctx.ReactAsync(MsgType.Pending); - - - public static Task OkAsync(this IUserMessage msg) - => msg.AddReactionAsync(_okEmoji); - - public static Task ErrorAsync(this IUserMessage msg) - => msg.AddReactionAsync(_errorEmoji); - - public static Task WarningAsync(this IUserMessage msg) - => msg.AddReactionAsync(_warnEmoji); } \ No newline at end of file diff --git a/src/EllieBot/_common/_Extensions/DbExtensions.cs b/src/EllieBot/_common/_Extensions/DbExtensions.cs index 0975a1f..58a9abd 100644 --- a/src/EllieBot/_common/_Extensions/DbExtensions.cs +++ b/src/EllieBot/_common/_Extensions/DbExtensions.cs @@ -1,4 +1,5 @@ using Microsoft.EntityFrameworkCore; +using EllieBot.Db; using EllieBot.Db.Models; namespace EllieBot.Extensions; diff --git a/src/EllieBot/_common/_Extensions/Extensions.cs b/src/EllieBot/_common/_Extensions/Extensions.cs index 5a21861..27341ad 100644 --- a/src/EllieBot/_common/_Extensions/Extensions.cs +++ b/src/EllieBot/_common/_Extensions/Extensions.cs @@ -1,3 +1,4 @@ +using System.Diagnostics; using System.Globalization; using System.Text.Json; using System.Text.RegularExpressions; @@ -103,7 +104,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) @@ -228,4 +229,9 @@ public static class Extensions public static IEnumerable GetRoles(this IGuildUser user) => user.RoleIds.Select(r => user.Guild.GetRole(r)).Where(r => r is not null); + public static void Lap(this Stopwatch sw, string checkpoint) + { + Log.Information("Checkpoint {CheckPoint}: {Time}ms", checkpoint, sw.Elapsed.TotalMilliseconds); + sw.Restart(); + } } \ No newline at end of file diff --git a/src/EllieBot/_common/_Extensions/NumberExtensions.cs b/src/EllieBot/_common/_Extensions/NumberExtensions.cs index 3e28588..3e0f703 100644 --- a/src/EllieBot/_common/_Extensions/NumberExtensions.cs +++ b/src/EllieBot/_common/_Extensions/NumberExtensions.cs @@ -1,30 +1,7 @@ -using System.Globalization; - namespace EllieBot.Extensions; public static class NumberExtensions { public static DateTimeOffset ToUnixTimestamp(this double number) => new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero).AddSeconds(number); - - public static string ToShortString(this decimal value) - { - if (value <= 1_000) - return Math.Round(value, 2).ToString(CultureInfo.InvariantCulture); - if (value <= 1_000_000) - return Math.Round(value, 1).ToString(CultureInfo.InvariantCulture); - var tokens = " MBtq"; - var i = 2; - while (true) - { - var num = (decimal)Math.Pow(1000, i); - if (num > value) - { - var num2 = (decimal)Math.Pow(1000, i - 1); - return $"{Math.Round((value / num2), 1)}{tokens[i - 1]}".Trim(); - } - - i++; - } - } } \ No newline at end of file diff --git a/src/EllieBot/_common/_Extensions/Rgba32Extensions.cs b/src/EllieBot/_common/_Extensions/Rgba32Extensions.cs index 6fb4c7c..a0cd408 100644 --- a/src/EllieBot/_common/_Extensions/Rgba32Extensions.cs +++ b/src/EllieBot/_common/_Extensions/Rgba32Extensions.cs @@ -24,7 +24,7 @@ public static class Rgba32Extensions using var frame = imgArray[i].Frames.CloneFrame(frameNumber % imgArray[i].Frames.Count); var offset = xOffset; imgFrame.Mutate(x => x.DrawImage(frame, new Point(offset, 0), new GraphicsOptions())); - xOffset += imgArray[i].Bounds.Width; + xOffset += imgArray[i].Bounds().Width; } } 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/creds_example.yml b/src/EllieBot/creds_example.yml index 977b597..e13379b 100644 --- a/src/EllieBot/creds_example.yml +++ b/src/EllieBot/creds_example.yml @@ -1,5 +1,5 @@ -# DO NOT CHANGE -version: 9 +# DO NOT CHANGE +version: 7 # Bot token. Do not share with anyone ever -> https://discordapp.com/developers/applications/ token: "" # List of Ids of the users who have bot owner permissions @@ -13,13 +13,6 @@ usePrivilegedIntents: true # 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. totalShards: 1 -# Pledge 5$ or more on https://patreon.com/elliebot and connect your discord account to Patreon. -# Go to https://dashy.elliebot.net/me and login with your discord account -# 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. -ellieAiToken: # 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). @@ -31,9 +24,9 @@ googleApiKey: "" # Copy the 'Search Engine ID' to the SearchId field # # Do all steps again but enable image search for the ImageSearchId -google: - searchId: - imageSearchId: +google: + searchId: + imageSearchId: # Settings for voting system for discordbots. Meant for use on global Ellie. votes: # top.gg votes service url @@ -53,7 +46,7 @@ votes: # Patreon auto reward system settings. # go to https://www.patreon.com/portal -> my clients -> create client patreon: - clientId: + clientId: accessToken: "" refreshToken: "" clientSecret: "" @@ -63,7 +56,7 @@ patreon: botListToken: "" # Official cleverbot api key. cleverbotApiKey: "" -# OpenAi api key. +# Official GPT-3 api key. gpt3ApiKey: "" # 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. @@ -80,31 +73,32 @@ db: # 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;" connectionString: Data Source=data/EllieBot.db # Address and port of the coordinator endpoint. Leave empty for default. # Change only if you've changed the coordinator address or port. coordinatorUrl: http://localhost:3442 # Api key obtained on https://rapidapi.com (go to MyApps -> Add New App -> Enter Name -> Application key) -rapidApiKey: +rapidApiKey: # https://locationiq.com api key (register and you will receive the token in the email). # Used only for .time command. -locationIqApiKey: +locationIqApiKey: # https://timezonedb.com api key (register and you will receive the token in the email). # Used only for .time command -timezoneDbApiKey: +timezoneDbApiKey: # https://pro.coinmarketcap.com/account/ api key. There is a free plan for personal use. # Used for cryptocurrency related commands. -coinmarketcapApiKey: +coinmarketcapApiKey: # Api key used for Osu related commands. Obtain this key at https://osu.ppy.sh/p/api -osuApiKey: +osuApiKey: # Optional Trovo client id. # You should use this if Trovo stream notifications stopped working or you're getting ratelimit errors. -trovoClientId: +trovoClientId: # Obtain by creating an application at https://dev.twitch.tv/console/apps -twitchClientId: +twitchClientId: # Obtain by creating an application at https://dev.twitch.tv/console/apps -twitchClientSecret: +twitchClientSecret: # Command and args which will be used to restart the bot. # Only used if bot is executed directly (NOT through the coordinator) # placeholders: @@ -117,5 +111,5 @@ twitchClientSecret: # cmd: EllieBot.exe # args: "{0}" restartCommand: - cmd: - args: + cmd: + args: diff --git a/src/EllieBot/data/aliases.yml b/src/EllieBot/data/aliases.yml index 8589812..8d83875 100644 --- a/src/EllieBot/data/aliases.yml +++ b/src/EllieBot/data/aliases.yml @@ -30,8 +30,6 @@ greettest: - greettest greetdmtest: - greetdmtest -boosttest: - - boosttest byetest: - byetest boost: @@ -208,8 +206,7 @@ setavatar: - setav setbanner: - setbanner -setactivity: - - setactivity +setgame: - setgame send: - send @@ -343,56 +340,28 @@ allcmdcooldowns: - cmdcds quoteadd: - quoteadd - - qa - - qadd - - quadd - . quoteedit: - quoteedit - - qe - - que - qedit quoteprint: - quoteprint - - qp - - qup - .. - - qprint quoteshow: - quoteshow - - qsh - qshow - - qushow quotesearch: - quotesearch - - qse - qsearch quoteid: - quoteid - qid quotedelete: - quotedelete - - qd - qdel - - qdelete quotedeleteauthor: - quotedeleteauthor - - qda - qdelauth -quotesexport: - - quotesexport - - qex - - qexport -quotesimport: - - quotesimport - - qim - - qimp - - qimport -quotelist: - - quotelist - - qli - - quli - - qulist draw: - draw drawnew: @@ -616,6 +585,10 @@ pokemon: pokemonability: - pokemonability - pokeab +memelist: + - memelist +memegen: + - memegen weather: - weather - we @@ -699,10 +672,10 @@ guide: - readme calcops: - calcops -quotesdeleteall: - - quotesdeleteall - - qdall - - qdeleteall +delallquotes: + - delallquotes + - daq + - delallq greetdmmsg: - greetdmmsg cash: @@ -789,15 +762,17 @@ autotranslate: - autotranslate - at - autotrans +listquotes: + - listquotes + - liqu typedel: - typedel typelist: - typelist -serverlist: - - serverlist +listservers: + - listservers cleverbot: - cleverbot - - chatbot - chatgpt shorten: - shorten @@ -826,6 +801,8 @@ autodisconnect: define: - define - def +activity: + - activity setstatus: - setstatus invitecreate: @@ -848,10 +825,6 @@ eventstart: - eventstart betstats: - betstats - - bs -gamblestats: - - gamblestats - - gs bettest: - bettest slot: @@ -863,11 +836,6 @@ affinity: waifuclaim: - waifuclaim - claim - - wc -waifuclaims: - - waifuclaims - - claims - - wcs waifureset: - waifureset waifutransfer: @@ -884,6 +852,8 @@ divorce: waifuinfo: - waifuinfo - waifustats +mal: + - mal setmusicchannel: - setmusicchannel - smch @@ -974,10 +944,6 @@ warnexpire: warnclear: - warnclear - warnc -warndelete: - - warndelete - - warnrm - - warnd warnpunishlist: - warnpunishlist - warnpl @@ -1175,6 +1141,10 @@ discordpermoverridelist: - dpoli discordpermoverridereset: - dpor +rafflecur: + - rafflecur +rip: + - rip timelyset: - timelyset timely: @@ -1191,6 +1161,17 @@ massban: - massban masskill: - masskill +pathofexile: + - pathofexile + - poe +pathofexileleagues: + - pathofexileleagues + - poel +pathofexilecurrency: + - pathofexilecurrency + - poec +rollduel: + - rollduel reroadd: - reroadd - reroa @@ -1219,8 +1200,6 @@ xpreset: - xpreset bible: - bible -quran: - - quran edit: - edit delete: @@ -1232,6 +1211,8 @@ roleid: agerestricttoggle: - nsfwtoggle - artoggle +economy: + - economy purgeuser: - purgeuser imageonlychannel: @@ -1244,6 +1225,12 @@ linkonlychannel: - linkssonly coordreload: - coordreload +quotesexport: + - quotesexport + - qexport +quotesimport: + - quotesimport + - qimport showembed: - showembed # EllieExpressions @@ -1419,57 +1406,4 @@ todoshow: stickyroles: - stickyroles cleanupguilddata: - - cleanupguilddata -prompt: - - prompt -honeypot: - - honeypot -coins: - - coins - - crypto - - cryptos -afk: - - 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 + - cleanupguilddata \ No newline at end of file diff --git a/src/EllieBot/data/bot.yml b/src/EllieBot/data/bot.yml index e15bbc1..55a1d51 100644 --- a/src/EllieBot/data/bot.yml +++ b/src/EllieBot/data/bot.yml @@ -1,5 +1,5 @@ # DO NOT CHANGE -version: 8 +version: 7 # Most commands, when executed, have a small colored line # next to the response. The color depends whether the command # is completed, errored or in progress (pending) @@ -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 @@ -80,6 +80,16 @@ blocked: modules: [] # Which string will be used to recognize the commands prefix: . +# Toggles whether your bot will group greet/bye messages into a single message every 5 seconds. +# 1st user who joins will get greeted immediately +# If more users join within the next 5 seconds, they will be greeted in groups of 5. +# This will cause %user.mention% and other placeholders to be replaced with multiple users. +# Keep in mind this might break some of your embeds - for example if you have %user.avatar% in the thumbnail, +# it will become invalid, as it will resolve to a list of avatars of grouped users. +# note: This setting is primarily used if you're afraid of raids, or you're running medium/large bots where some +# servers might get hundreds of people join at once. This is used to prevent the bot from getting ratelimited, +# and (slightly) reduce the greet spam in those servers. +groupGreets: false # Whether the bot will rotate through all specified statuses. # This setting can be changed via .ropl command. # See RotatingStatuses submodule in Administration. diff --git a/src/EllieBot/data/commandlist.json b/src/EllieBot/data/commandlist.json deleted file mode 100644 index 216bee4..0000000 --- a/src/EllieBot/data/commandlist.json +++ /dev/null @@ -1,8031 +0,0 @@ -{ - "Administration": [ - { - "Aliases": [ - ".imageonlychannel", - ".imageonly", - ".imagesonly" - ], - "Description": "Toggles whether the channel only allows images.\nUsers who send more than a few non-image messages will be banned from using the channel. ", - "Usage": [ - ".imageonlychannel" - ], - "Submodule": "Administration", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".linkonlychannel", - ".linkonly", - ".linkssonly" - ], - "Description": "Toggles whether the channel only allows links.\nUsers who send more than a few non-link messages will be banned from using the channel. ", - "Usage": [ - ".linkonlychannel" - ], - "Submodule": "Administration", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".slowmode" - ], - "Description": "Toggles slowmode on the current channel with the specified amount of time. Provide no parameters to disable.", - "Usage": [ - ".slowmode", - ".slowmode 27s", - ".slowmode 3h15m5s" - ], - "Submodule": "Administration", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageChannels Channel Permission" - ] - }, - { - "Aliases": [ - ".delmsgoncmd", - ".dmc" - ], - "Description": "Toggles the automatic deletion of the user's successful command message to prevent chat flood. You can use it either as a server toggle, channel whitelist, or channel blacklist, as channel option has 3 settings: Enable (always do it on this channel), Disable (never do it on this channel), and Inherit (respect server setting). Use `list` parameter to see the current states.", - "Usage": [ - ".delmsgoncmd", - ".delmsgoncmd channel enable", - ".delmsgoncmd ch inherit", - ".delmsgoncmd list" - ], - "Submodule": "Administration", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".deafen", - ".deaf" - ], - "Description": "Deafens mentioned user or users.", - "Usage": [ - ".deafen \"@Someguy\"", - ".deafen \"@Someguy\" \"@Someguy\"" - ], - "Submodule": "Administration", - "Module": "Administration", - "Options": null, - "Requirements": [ - "DeafenMembers Server Permission" - ] - }, - { - "Aliases": [ - ".undeafen", - ".undef" - ], - "Description": "Undeafens mentioned user or users.", - "Usage": [ - ".undeafen \"@Someguy\"", - ".undeafen \"@Someguy\" \"@Someguy\"" - ], - "Submodule": "Administration", - "Module": "Administration", - "Options": null, - "Requirements": [ - "DeafenMembers Server Permission" - ] - }, - { - "Aliases": [ - ".delvoichanl", - ".dvch" - ], - "Description": "Deletes a voice channel with a given name.", - "Usage": [ - ".delvoichanl VoiceChannelName" - ], - "Submodule": "Administration", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageChannels Server Permission" - ] - }, - { - "Aliases": [ - ".creatvoichanl", - ".cvch" - ], - "Description": "Creates a new voice channel with a given name.", - "Usage": [ - ".creatvoichanl VoiceChannelName" - ], - "Submodule": "Administration", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageChannels Server Permission" - ] - }, - { - "Aliases": [ - ".deltxtchanl", - ".dtch" - ], - "Description": "Deletes a text channel with a given name.", - "Usage": [ - ".deltxtchanl TextChannelName" - ], - "Submodule": "Administration", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageChannels Server Permission" - ] - }, - { - "Aliases": [ - ".creatxtchanl", - ".ctch" - ], - "Description": "Creates a new text channel with a given name.", - "Usage": [ - ".creatxtchanl TextChannelName" - ], - "Submodule": "Administration", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageChannels Server Permission" - ] - }, - { - "Aliases": [ - ".settopic", - ".st" - ], - "Description": "Sets a topic on the current channel.", - "Usage": [ - ".settopic My new topic" - ], - "Submodule": "Administration", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageChannels Server Permission" - ] - }, - { - "Aliases": [ - ".setchanlname", - ".schn" - ], - "Description": "Changes the name of the current channel.", - "Usage": [ - ".setchanlname NewName" - ], - "Submodule": "Administration", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageChannels Server Permission" - ] - }, - { - "Aliases": [ - ".nsfwtoggle", - ".artoggle" - ], - "Description": "Toggles whether the current channel is age-restricted.", - "Usage": [ - ".nsfwtoggle" - ], - "Submodule": "Administration", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageChannels Server Permission" - ] - }, - { - "Aliases": [ - ".edit" - ], - "Description": "Edits bot's message, you have to specify message ID and new text. You can optionally specify target channel.\nSupports [embeds](https://eb.elliebot.net/)", - "Usage": [ - ".edit 7479498384 Hi :^)", - ".edit #other-channel 771562360594628608 New message!", - ".edit #other-channel 771562360594628608 {\"description\":\"hello\"}" - ], - "Submodule": "Administration", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageMessages Channel Permission" - ] - }, - { - "Aliases": [ - ".delete", - ".del" - ], - "Description": "Deletes a single message given the channel and message ID. If channel is ommited, message will be searched for in the current channel. You can also specify time parameter after which the message will be deleted (up to 7 days). This timer won't persist through bot restarts.", - "Usage": [ - ".delete #chat 771562360594628608", - ".delete 771562360594628608", - ".delete 771562360594628608 5m" - ], - "Submodule": "Administration", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageMessages Channel Permission" - ] - }, - { - "Aliases": [ - ".threadcreate", - ".thcr" - ], - "Description": "Create a public thread with the specified title. You may optionally reply to a message to have it as a starting point.", - "Usage": [ - ".threadcreate Q&A" - ], - "Submodule": "Administration", - "Module": "Administration", - "Options": null, - "Requirements": [ - "CreatePublicThreads Channel Permission" - ] - }, - { - "Aliases": [ - ".threaddelete", - ".thdel", - ".thrm" - ], - "Description": "Delete a thread with the specified name in this channel. Case insensitive.", - "Usage": [ - ".threaddelete Q&A" - ], - "Submodule": "Administration", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageThreads Channel Permission" - ] - }, - { - "Aliases": [ - ".autopublish" - ], - "Description": "Make the bot automatically publish all messages posted in the news channel this command was executed in.", - "Usage": [ - ".autopublish" - ], - "Submodule": "Administration", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageMessages Channel Permission" - ] - }, - { - "Aliases": [ - ".setnick" - ], - "Description": "Changes the nickname of the bot on this server. You can also target other users to change their nickname.", - "Usage": [ - ".setnick BotNickname", - ".setnick @SomeUser New Nickname" - ], - "Submodule": "Administration", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageNicknames Server Permission" - ] - }, - { - "Aliases": [ - ".setserverbanner", - ".serverbanner" - ], - "Description": "Sets a new banner image for the current server. Parameter is a direct link to an image.", - "Usage": [ - ".setserverbanner https://cdn.elliebot.net/Ellie.png" - ], - "Submodule": "Administration", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageServer Server Permission" - ] - }, - { - "Aliases": [ - ".setservericon", - ".servericon" - ], - "Description": "Sets a new icon image for the current server. Parameter is a direct link to an image.", - "Usage": [ - ".setservericon https://cdn.elliebot.net/Ellie.png" - ], - "Submodule": "Administration", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageServer Server Permission" - ] - }, - { - "Aliases": [ - ".autoassignrole", - ".aar" - ], - "Description": "Toggles the role which will be assigned to every user who joins the server.\nYou can run this command multiple times to add multiple roles (up to 3).\nSpecifying the role that is already added will remove that role from the list.\nProvide no parameters to list current roles.", - "Usage": [ - ".autoassignrole", - ".autoassignrole RoleName" - ], - "Submodule": "AutoAssignRoleCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".cleanupguilddata" - ], - "Description": "Deletes data for all servers bot is no longer a member of from the database.\nThis is a highly destructive and irreversible command.", - "Usage": [ - ".cleanupguilddata" - ], - "Submodule": "CleanupCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".keep" - ], - "Description": "The current server, won't be deleted from Ellie's database during the purge.", - "Usage": [ - ".keep" - ], - "Submodule": "CleanupCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "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" - ], - "Description": "Executes provided sql query and returns the results. Dangerous.", - "Usage": [ - ".sqlselect SELECT * FROM DiscordUser LIMIT 5" - ], - "Submodule": "DangerousCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "No Public Bot" - ] - }, - { - "Aliases": [ - ".sqlselectcsv" - ], - "Description": "Executes provided sql query and returns the results in a csv file. Dangerous.", - "Usage": [ - ".sqlselectcsv SELECT * FROM DiscordUser LIMIT 5" - ], - "Submodule": "DangerousCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "No Public Bot" - ] - }, - { - "Aliases": [ - ".sqlexec" - ], - "Description": "Executes provided sql command and returns the number of affected rows. Dangerous.", - "Usage": [ - ".sqlexec UPDATE DiscordUser SET CurrencyAmount=CurrencyAmount+1234" - ], - "Submodule": "DangerousCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "No Public Bot" - ] - }, - { - "Aliases": [ - ".purgeuser" - ], - "Description": "Purge user from the database completely. This includes currency, xp, clubs that user owns, waifu info", - "Usage": [ - ".purgeuser @Oblivion" - ], - "Submodule": "DangerousCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "No Public Bot" - ] - }, - { - "Aliases": [ - ".deletexp" - ], - "Description": "Deletes everything from UserXpStats, Clubs and sets users' TotalXP to 0.", - "Usage": [ - ".deletexp" - ], - "Submodule": "DangerousCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "No Public Bot" - ] - }, - { - "Aliases": [ - ".deletewaifus" - ], - "Description": "Deletes everything from WaifuUpdates, WaifuItem and WaifuInfo tables.", - "Usage": [ - ".deletewaifus" - ], - "Submodule": "DangerousCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "No Public Bot" - ] - }, - { - "Aliases": [ - ".deletewaifu" - ], - "Description": "Deletes everything from WaifuUpdates, WaifuItem and WaifuInfo tables for the specified user. Also makes specified user's waifus free.", - "Usage": [ - ".deletewaifu" - ], - "Submodule": "DangerousCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "No Public Bot" - ] - }, - { - "Aliases": [ - ".deletecurrency" - ], - "Description": "Deletes everything from Currency and CurrencyTransactions.", - "Usage": [ - ".deletecurrency" - ], - "Submodule": "DangerousCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "No Public Bot" - ] - }, - { - "Aliases": [ - ".gamevoicechannel", - ".gvc" - ], - "Description": "Toggles game voice channel feature in the voice channel you're currently in. Users who join the game voice channel will get automatically redirected to the voice channel with the name of their current game, if it exists. Can't move users to channels that the bot has no connect permission for. One per server.", - "Usage": [ - ".gamevoicechannel" - ], - "Submodule": "GameVoiceChannelCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".boost" - ], - "Description": "Toggles announcements on the current channel when someone boosts the server.", - "Usage": [ - ".boost" - ], - "Submodule": "GreetCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageServer Server Permission" - ] - }, - { - "Aliases": [ - ".boostdel" - ], - "Description": "Sets the time it takes (in seconds) for boost messages to be auto-deleted. Set it to `0` to disable automatic deletion.", - "Usage": [ - ".boostdel 0", - ".boostdel 30" - ], - "Submodule": "GreetCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageServer Server Permission" - ] - }, - { - "Aliases": [ - ".boostmsg" - ], - "Description": "Sets a new boost announcement message which will be shown in the current channel. \nUsing this command with no message will show the current boost message. \nSupports [placeholders](https://docs.elliebot.net/ellie/features/placeholders/) and [embeds](https://eb.elliebot.net/)", - "Usage": [ - ".boostmsg %user.mention% has boosted the server!!!" - ], - "Submodule": "GreetCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageServer Server Permission" - ] - }, - { - "Aliases": [ - ".greet" - ], - "Description": "Toggles announcements on the current channel when someone joins the server.", - "Usage": [ - ".greet" - ], - "Submodule": "GreetCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageServer Server Permission" - ] - }, - { - "Aliases": [ - ".greetdel", - ".grdel" - ], - "Description": "Sets the time it takes (in seconds) for greet messages to be auto-deleted. Set it to `0` to disable automatic deletion.", - "Usage": [ - ".greetdel 0", - ".greetdel 30" - ], - "Submodule": "GreetCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageServer Server Permission" - ] - }, - { - "Aliases": [ - ".greetmsg" - ], - "Description": "Sets a new join announcement message which will be shown in the current channel.\nUsing this command with no message will show the current greet message. \nSupports [placeholders](https://docs.elliebot.net/ellie/features/placeholders/) and [embeds](https://eb.elliebot.net/)", - "Usage": [ - ".greetmsg Welcome, %user.mention%." - ], - "Submodule": "GreetCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageServer Server Permission" - ] - }, - { - "Aliases": [ - ".greetdm" - ], - "Description": "Toggles whether greet messages will be sent in a DM (This is separate from `.greet` - you can have both, one or neither enabled).", - "Usage": [ - ".greetdm" - ], - "Submodule": "GreetCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageServer Server Permission" - ] - }, - { - "Aliases": [ - ".greetdmmsg" - ], - "Description": "Sets a new join announcement message which will be sent to the user who joined. Type `%user.mention%` if you want to mention the new member. Using it with no message will show the current DM greet message. You can use embed json from instead of a regular text, if you want the message to be embedded.", - "Usage": [ - ".greetdmmsg Welcome to the server, %user.mention%" - ], - "Submodule": "GreetCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageServer Server Permission" - ] - }, - { - "Aliases": [ - ".bye" - ], - "Description": "Toggles announcements on the current channel when someone leaves the server.", - "Usage": [ - ".bye" - ], - "Submodule": "GreetCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageServer Server Permission" - ] - }, - { - "Aliases": [ - ".byedel" - ], - "Description": "Sets the time it takes (in seconds) for bye messages to be auto-deleted. Set it to `0` to disable automatic deletion.", - "Usage": [ - ".byedel 0", - ".byedel 30" - ], - "Submodule": "GreetCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "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": [ - ".greettest" - ], - "Description": "Sends the greet message in the current channel as if you just joined the server. You can optionally specify a different user.", - "Usage": [ - ".greettest", - ".greettest @SomeoneElse" - ], - "Submodule": "GreetCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageServer Server Permission" - ] - }, - { - "Aliases": [ - ".greetdmtest" - ], - "Description": "Sends the greet direct message to you as if you just joined the server. You can optionally specify a different user.", - "Usage": [ - ".greetdmtest", - ".greetdmtest @SomeoneElse" - ], - "Submodule": "GreetCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "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" - ], - "Description": "Sends the boost message in the current channel as if you just boosted the server.\nYou can optionally specify a different user.", - "Usage": [ - ".boosttest", - ".boosttest @SomeoneElse" - ], - "Submodule": "GreetCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageServer Server Permission" - ] - }, - { - "Aliases": [ - ".honeypot" - ], - "Description": "Toggles honeypot on the current channel.\nAnyone sending a message in this channel will be soft banned. (Banned and then unbanned)\nThis is useful for automatically getting rid of spam bots.", - "Usage": [ - ".honeypot" - ], - "Submodule": "HoneypotCommands", - "Module": "Administration", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".languageset", - ".langset" - ], - "Description": "Sets this server's response language. If bot's response strings have been translated to that language, bot will use that language in this server. Reset by using `default` as the locale name. Provide no parameters to see currently set language.", - "Usage": [ - ".languageset de-DE", - ".languageset default" - ], - "Submodule": "LocalizationCommands", - "Module": "Administration", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".langsetdefault", - ".langsetd" - ], - "Description": "Sets the bot's default response language. All servers which use a default locale will use this one. Setting to `default` will use the host's current culture. Provide no parameters to see currently set language.", - "Usage": [ - ".langsetdefault en-US", - ".langsetdefault default" - ], - "Submodule": "LocalizationCommands", - "Module": "Administration", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".languageslist", - ".langli" - ], - "Description": "List of languages for which translation (or part of it) exist atm.", - "Usage": [ - ".languageslist" - ], - "Submodule": "LocalizationCommands", - "Module": "Administration", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".muterole", - ".setmuterole" - ], - "Description": "Sets a name of the role which will be assigned to people who should be muted. Provide no arguments to see currently set mute role. Default is ellie-mute.", - "Usage": [ - ".muterole", - ".muterole Silenced" - ], - "Submodule": "MuteCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".mute" - ], - "Description": "Mutes a mentioned user both from speaking and chatting. You can also specify time string for how long the user should be muted. You can optionally specify a reason.", - "Usage": [ - ".mute @Someone", - ".mute @Someone too noisy", - ".mute 1h30m @Someone", - ".mute 1h30m @Someone too noisy" - ], - "Submodule": "MuteCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "MuteMembers, ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".unmute" - ], - "Description": "Unmutes a mentioned user previously muted with `.mute` command.", - "Usage": [ - ".unmute @Someone" - ], - "Submodule": "MuteCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "MuteMembers, ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".chatmute" - ], - "Description": "Prevents a mentioned user from chatting in text channels. You can also specify time string for how long the user should be muted. You can optionally specify a reason.", - "Usage": [ - ".chatmute @Someone", - ".chatmute @Someone stop writing", - ".chatmute 15m @Someone", - ".chatmute 1h30m @Someone", - ".chatmute 1h @Someone chill" - ], - "Submodule": "MuteCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".chatunmute" - ], - "Description": "Removes a mute role previously set on a mentioned user with `.chatmute` which prevented him from chatting in text channels.", - "Usage": [ - ".chatunmute @Someone" - ], - "Submodule": "MuteCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".voicemute" - ], - "Description": "Prevents a mentioned user from speaking in voice channels. User has to be in a voice channel in order for the command to have an effect. You can also specify time string for how long the user should be muted. You can optionally specify a reason.", - "Usage": [ - ".voicemute @Someone", - ".voicemute @Someone stop talking", - ".voicemute 15m @Someone", - ".voicemute 1h30m @Someone", - ".voicemute 1h @Someone silence" - ], - "Submodule": "MuteCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "MuteMembers Server Permission" - ] - }, - { - "Aliases": [ - ".voiceunmute" - ], - "Description": "Gives a previously voice-muted user a permission to speak.", - "Usage": [ - ".voiceunmute @Someguy" - ], - "Submodule": "MuteCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "MuteMembers Server Permission" - ] - }, - { - "Aliases": [ - ".dpo" - ], - "Description": "Overrides required user permissions that the command has with the specified ones. You can only use server-level permissions. This action will make the bot ignore user permission requirements which command has by default. Provide no permissions to reset to default.", - "Usage": [ - ".dpo .prune ManageMessages BanMembers", - ".dpo .prune" - ], - "Submodule": "DiscordPermOverrideCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".dpor" - ], - "Description": "Resets ALL currently set discord permission overrides on this server. This will make all commands have default discord permission requirements.", - "Usage": [ - ".dpor" - ], - "Submodule": "DiscordPermOverrideCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".dpol", - ".dpoli" - ], - "Description": "Lists all discord permission overrides on this server.", - "Usage": [ - ".dpol" - ], - "Submodule": "DiscordPermOverrideCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".rotateplaying", - ".ropl" - ], - "Description": "Toggles rotation of playing status of the dynamic strings you previously specified.", - "Usage": [ - ".rotateplaying" - ], - "Submodule": "PlayingRotateCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".addplaying", - ".adpl" - ], - "Description": "Adds a specified string to the list of playing strings to rotate. You have to pick either `Playing`, `Watching` or `Listening` as the first parameter.", - "Usage": [ - ".addplaying Playing with you", - ".addplaying Watching you sleep" - ], - "Submodule": "PlayingRotateCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".listplaying", - ".lipl" - ], - "Description": "Lists all playing statuses and their indexes.", - "Usage": [ - ".listplaying" - ], - "Submodule": "PlayingRotateCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".removeplaying", - ".rmpl" - ], - "Description": "Removes a playing status by index. Use `.lipl` to see indexes.", - "Usage": [ - ".removeplaying" - ], - "Submodule": "PlayingRotateCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".prefix" - ], - "Description": "Sets this server's prefix for all bot commands. Provide no parameters to see the current server prefix. **Setting prefix requires Administrator server permission.**", - "Usage": [ - ".prefix +" - ], - "Submodule": "PrefixCommands", - "Module": "Administration", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".defprefix" - ], - "Description": "Sets bot's default prefix for all bot commands. Provide no parameters to see the current default prefix. This will not change this server's current prefix.", - "Usage": [ - ".defprefix +" - ], - "Submodule": "PrefixCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "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.", - "Usage": [ - ".antialt 1h Ban", - ".antialt 3d Mute 1h" - ], - "Submodule": "ProtectionCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "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.", - "Usage": [ - ".antiraid 5 20 Kick", - ".antiraid 7 9 Ban", - ".antiraid 10 10 Ban 6h30m", - ".antiraid" - ], - "Submodule": "ProtectionCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "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.", - "Usage": [ - ".antispam 3 Mute", - ".antispam 5 Ban", - ".antispam 5 Ban 3h30m", - ".antispam" - ], - "Submodule": "ProtectionCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".antispamignore" - ], - "Description": "Toggles whether antispam ignores current channel. Antispam must be enabled.", - "Usage": [ - ".antispamignore" - ], - "Submodule": "ProtectionCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".antilist", - ".antilst" - ], - "Description": "Shows currently enabled protection features.", - "Usage": [ - ".antilist" - ], - "Submodule": "ProtectionCommands", - "Module": "Administration", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".prune", - ".clear" - ], - "Description": "`.prune` removes all Ellie's messages in the last 100 messages. `.prune X` removes last `X` number of messages from the channel (up to 100). `.prune @Someone` removes all Someone's messages in the last 100 messages. `.prune @Someone X` removes last `X` number of 'Someone's' messages in the channel.", - "Usage": [ - ".prune", - ".prune -s", - ".prune 5", - ".prune 5 --safe", - ".prune @Someone", - ".prune @Someone --safe", - ".prune @Someone X", - ".prune @Someone X -s" - ], - "Submodule": "PruneCommands", - "Module": "Administration", - "Options": [ - "`--safe` (`-s`) Whether pinned messages should be deleted. ", - "`--after` (`-a`) Prune only messages after the specified message ID. " - ], - "Requirements": [] - }, - { - "Aliases": [ - ".prunecancel", - ".prunec" - ], - "Description": "Cancels an active prune if there is any.", - "Usage": [ - ".prunecancel" - ], - "Submodule": "PruneCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageMessages Channel Permission" - ] - }, - { - "Aliases": [ - ".reroadd", - ".reroa" - ], - "Description": "Specify a message id, emote and a role name to have the bot assign the specified role to the user who reacts to the specified message (in this channel) with the specified emoji.\nYou can optionally specify an exclusivity group. Default is group 0 which is non-exclusive. Other groups are exclusive. Exclusive groups will let the user only have one of the roles specified in that group.\nYou can optionally specify a level requirement after a group. Users who don't meet the level requirement will not receive the role.\nYou can have up to 50 reaction roles per server in total.", - "Usage": [ - ".reroadd 971276352684691466 😊 gamer", - ".reroadd 971276352684691466 😢 emo 1", - ".reroadd 971276352684691466 🤔 philosopher 5 20", - ".reroadd 971276352684691466 👨 normie 5 20" - ], - "Submodule": "ReactionRoleCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".rerolist", - ".reroli" - ], - "Description": "Lists all ReactionRole messages on this server with their message ids. Clicking/Tapping message ids will send you to that message.", - "Usage": [ - ".rerolist" - ], - "Submodule": "ReactionRoleCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".reroremove", - ".rerorm" - ], - "Description": "Remove all reaction roles from message specified by the id", - "Usage": [ - ".reroremove 971276352684691466" - ], - "Submodule": "ReactionRoleCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".rerodeleteall", - ".rerodela" - ], - "Description": "Deletes all reaction roles on the server. This action is irreversible.", - "Usage": [ - ".rerodeleteall" - ], - "Submodule": "ReactionRoleCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".rerotransfer", - ".rerot" - ], - "Description": "Transfers reaction roles from one message to another by specifying their ids. If the target message has reaction roles specified already, the reaction roles will be MERGED, not overwritten.", - "Usage": [ - ".rerotransfer 971276352684691466 971427748448964628" - ], - "Submodule": "ReactionRoleCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".setrole", - ".sr", - ".giverole" - ], - "Description": "Gives a role to a user. The role you specify has to be lower in the role hierarchy than your highest role.", - "Usage": [ - ".setrole @User Guest" - ], - "Submodule": "RoleCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".removerole", - ".rr" - ], - "Description": "Removes a role from a user. The role you specify has to be lower in the role hierarchy than your highest role.", - "Usage": [ - ".removerole @User Admin" - ], - "Submodule": "RoleCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".renamerole", - ".renr" - ], - "Description": "Renames a role. The role you specify has to be lower in the role hierarchy than your highest role.", - "Usage": [ - ".renamerole \"First role\" SecondRole" - ], - "Submodule": "RoleCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".removeallroles", - ".rar" - ], - "Description": "Removes all roles which are lower than your highest role in the role hierarchy from the user you specify.", - "Usage": [ - ".removeallroles @User" - ], - "Submodule": "RoleCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".createrole", - ".cr" - ], - "Description": "Creates a role with a given name.", - "Usage": [ - ".createrole Awesome Role" - ], - "Submodule": "RoleCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".deleterole", - ".dr" - ], - "Description": "Deletes a role with a given name.", - "Usage": [ - ".deleterole Awesome Role" - ], - "Submodule": "RoleCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".rolehoist", - ".rh" - ], - "Description": "Toggles whether this role is displayed in the sidebar or not. The role you specify has to be lower in the role hierarchy than your highest role.", - "Usage": [ - ".rolehoist Guests", - ".rolehoist Space Wizards" - ], - "Submodule": "RoleCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".rolecolor", - ".roleclr" - ], - "Description": "Set a role's color using its hex value. Provide no color in order to see the hex value of the color of the specified role. The role you specify has to be lower in the role hierarchy than your highest role.", - "Usage": [ - ".rolecolor Admin", - ".rolecolor ffba55 Admin" - ], - "Submodule": "RoleCommands", - "Module": "Administration", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".stickyroles" - ], - "Description": "Toggles whether the bot will save the leaving users' roles, and reapply them once they re-join. The roles will be stored for up to 30 days.", - "Usage": [ - ".stickyroles" - ], - "Submodule": "RoleCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".adsarm" - ], - "Description": "Toggles the automatic deletion of the user's message and Ellie's confirmations for `.iam` and `.iamn` commands.", - "Usage": [ - ".adsarm" - ], - "Submodule": "SelfAssignedRolesCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".asar" - ], - "Description": "Adds a role to the list of self-assignable roles. You can also specify a group. If 'Exclusive self-assignable roles' feature is enabled (`.tesar`), users will be able to pick one role per group.", - "Usage": [ - ".asar Gamer", - ".asar 1 Alliance", - ".asar 1 Horde" - ], - "Submodule": "SelfAssignedRolesCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".sargn" - ], - "Description": "Sets a self assignable role group name. Provide no name to remove.", - "Usage": [ - ".sargn 1 Faction", - ".sargn 2" - ], - "Submodule": "SelfAssignedRolesCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".rsar" - ], - "Description": "Removes a specified role from the list of self-assignable roles.", - "Usage": [ - ".rsar Gamer", - ".rsar Alliance", - ".rsar Horde" - ], - "Submodule": "SelfAssignedRolesCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".lsar" - ], - "Description": "Lists self-assignable roles. Shows 20 roles per page.", - "Usage": [ - ".lsar", - ".lsar 2" - ], - "Submodule": "SelfAssignedRolesCommands", - "Module": "Administration", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".togglexclsar", - ".tesar" - ], - "Description": "Toggles whether self-assigned roles are exclusive. While enabled, users can only have one self-assignable role per group.", - "Usage": [ - ".togglexclsar" - ], - "Submodule": "SelfAssignedRolesCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".rolelevelreq", - ".rlr" - ], - "Description": "Set a level requirement on a self-assignable role.", - "Usage": [ - ".rolelevelreq 5 SomeRole" - ], - "Submodule": "SelfAssignedRolesCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".iam" - ], - "Description": "Adds a role to you that you choose. Role must be on the list of self-assignable roles.", - "Usage": [ - ".iam Gamer" - ], - "Submodule": "SelfAssignedRolesCommands", - "Module": "Administration", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".iamnot", - ".iamn" - ], - "Description": "Removes a specified role from you. Role must be on the list of self-assignable roles.", - "Usage": [ - ".iamnot Gamer" - ], - "Submodule": "SelfAssignedRolesCommands", - "Module": "Administration", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".cacheusers" - ], - "Description": "Caches users of a Discord server and saves them to the database.", - "Usage": [ - ".cacheusers", - ".cacheusers serverId" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".doas", - ".execas" - ], - "Description": "Execute the command as if you were the target user. Requires bot ownership and server administrator permission.", - "Usage": [ - ".doas @Thief .give all @Admin" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".scadd", - ".startcmdadd" - ], - "Description": "Adds a command to the list of commands which will be executed automatically in the current channel, in the order they were added in, by the bot when it startups up.", - "Usage": [ - ".scadd .stats" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".acadd", - ".autocmdadd" - ], - "Description": "Adds a command to the list of commands which will be executed automatically every X seconds.", - "Usage": [ - ".acadd 60 .prune 1000" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".sclist", - ".startcmdlist" - ], - "Description": "Lists all startup commands in the order they will be executed in.", - "Usage": [ - ".sclist" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".aclist", - ".autolist", - ".autocommands", - ".autocmdlist" - ], - "Description": "Lists all auto commands and the intervals in which they execute.", - "Usage": [ - ".aclist" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".wait" - ], - "Description": "Used only as a startup command. Waits a certain number of milliseconds before continuing the execution of the following startup commands.", - "Usage": [ - ".wait 3000" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".acrm", - ".autocmdrm" - ], - "Description": "Removes an auto command on the specified index.", - "Usage": [ - ".acrm 3" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".scrm", - ".startcmdrm" - ], - "Description": "Removes a startup command on the specified index.", - "Usage": [ - ".scrm 3" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".scclear", - ".scclr" - ], - "Description": "Removes all startup commands.", - "Usage": [ - ".scclear" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".forwardmessages", - ".fwmsgs" - ], - "Description": "Toggles forwarding of non-command messages sent to bot's DM to the bot owners", - "Usage": [ - ".forwardmessages" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".forwardtoall", - ".fwtoall" - ], - "Description": "Toggles whether messages will be forwarded to all bot owners or only to the first one specified in the creds.yml file", - "Usage": [ - ".forwardtoall" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".forwardtochannel", - ".fwtoch", - ".fwtochannel" - ], - "Description": "Toggles forwarding of non-command messages sent to bot's DM to the current channel", - "Usage": [ - ".forwardtochannel" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".shardstats" - ], - "Description": "Stats for shards. Paginated with 25 shards per page.\nFormat: `[status] | # [shard_id] | [last_heartbeat] | [server_count]`", - "Usage": [ - ".shardstats", - ".shardstats 2" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".restartshard" - ], - "Description": "Try (re)connecting a shard with a certain shardid when it dies. No one knows will it work. Keep an eye on the console for errors.", - "Usage": [ - ".restartshard 2" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".leave" - ], - "Description": "Makes Ellie leave the server. Either server name or server ID is required.", - "Usage": [ - ".leave 123123123331" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".deleteemptyservers" - ], - "Description": "Deletes all servers in which the bot is the only member.", - "Usage": [ - ".deleteemptyservers" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".die" - ], - "Description": "Shuts the bot down.", - "Usage": [ - ".die" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".restart" - ], - "Description": "Restarts the bot. Might not work.", - "Usage": [ - ".restart" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".setname", - ".newnm" - ], - "Description": "Gives the bot a new name.", - "Usage": [ - ".setname BotName" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".setstatus" - ], - "Description": "Sets the bot's status. (Online/Idle/Dnd/Invisible)", - "Usage": [ - ".setstatus Idle" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".setavatar", - ".setav" - ], - "Description": "Sets a new avatar image for the EllieBot. Parameter is a direct link to an image.", - "Usage": [ - ".setavatar https://cdn.elliebot.net/Ellie.png" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".setbanner" - ], - "Description": "Sets a new banner image for the EllieBot. Parameter is a direct link to an image. Supports gifs.", - "Usage": [ - ".setbanner https://cdn.elliebot.net/Ellie.png" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".setactivity", - ".setgame" - ], - "Description": "Sets the bots game status to a Custom, Playing, Listening, or Watching status.", - "Usage": [ - ".setactivity Just chilling", - ".setactivity Playing with canaries", - ".setactivity Listening music" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".setstream" - ], - "Description": "Sets the bots stream. First parameter is the twitch link, second parameter is stream name.", - "Usage": [ - ".setstream TWITCHLINK Hello" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".send" - ], - "Description": "Sends a message to a channel or user.\nYou can write \"channel\" (literally word 'channel') first followed by the channel id or channel mention, or\nYou can write \"user\" (literally word 'user') first followed by the user id or user mention.\nAfter either one of those, specify the message to be sent.\nThis command can only be used by the Bot Owner.", - "Usage": [ - ".send channel 123123123132312 Stop spamming commands plz", - ".send user 1231231232132 I can see in the console what you're doing." - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".stringsreload" - ], - "Description": "Reloads localized bot strings.", - "Usage": [ - ".stringsreload" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".coordreload" - ], - "Description": "Reloads coordinator config", - "Usage": [ - ".coordreload" - ], - "Submodule": "SelfCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".logserver" - ], - "Description": "Enables or Disables ALL log events. If enabled, all log events will log to this channel.", - "Usage": [ - ".logserver enable", - ".logserver disable" - ], - "Submodule": "LogCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "No Public Bot", - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".logignore" - ], - "Description": "Toggles whether the `.log` and `.logserver` commands ignore the specified channel or user. Provide no arguments to see the list of currently ignored users and channels.", - "Usage": [ - ".logignore", - ".logignore @SomeUser", - ".logignore #some-channel" - ], - "Submodule": "LogCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "No Public Bot", - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".logevents" - ], - "Description": "Shows a list of all events you can subscribe to with `.log`", - "Usage": [ - ".logevents" - ], - "Submodule": "LogCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "No Public Bot", - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".log" - ], - "Description": "Toggles logging event. Disables it if it is active anywhere on the server. Enables if it isn't active. Use `.logevents` to see a list of all events you can subscribe to.", - "Usage": [ - ".log userpresence", - ".log userbanned" - ], - "Submodule": "LogCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "No Public Bot", - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".timezones" - ], - "Description": "Lists all timezones available on the system to be used with `.timezone`.", - "Usage": [ - ".timezones" - ], - "Submodule": "TimeZoneCommands", - "Module": "Administration", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".timezone" - ], - "Description": "Sets this guilds timezone. This affects bot's time output in this server (logs, etc..) **Setting timezone requires Administrator server permission.**", - "Usage": [ - ".timezone", - ".timezone GMT Standard Time" - ], - "Submodule": "TimeZoneCommands", - "Module": "Administration", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".warn" - ], - "Description": "Warns a user with an optional reason.\nYou can specify a warning weight integer before the user. For example, 3 would mean that this warning counts as 3 warnings.", - "Usage": [ - ".warn @Someone Very rude person", - ".warn 3 @Someone Very rude person" - ], - "Submodule": "UserPunishCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "BanMembers Server Permission" - ] - }, - { - "Aliases": [ - ".warnexpire", - ".warne" - ], - "Description": "Gets or sets the number of days after which the warnings will be cleared automatically. This setting works retroactively. If you want to delete the warnings instead of clearing them, you can set the `--delete` optional parameter. Provide no parameter to see currently set expiry", - "Usage": [ - ".warnexpire", - ".warnexpire 3", - ".warnexpire 6 --delete" - ], - "Submodule": "UserPunishCommands", - "Module": "Administration", - "Options": [ - "`--delete` (`-d`) Delete warnings instead of clearing them. " - ], - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".warnlog" - ], - "Description": "See a list of warnings of a certain user.", - "Usage": [ - ".warnlog @Someone" - ], - "Submodule": "UserPunishCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "BanMembers Server Permission" - ] - }, - { - "Aliases": [ - ".warnlogall" - ], - "Description": "See a list of all warnings on the server. 15 users per page.", - "Usage": [ - ".warnlogall", - ".warnlogall 2" - ], - "Submodule": "UserPunishCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "BanMembers Server Permission" - ] - }, - { - "Aliases": [ - ".warndelete", - ".warnrm", - ".warnd" - ], - "Description": "Deletes a warning from a user by its index.", - "Usage": [ - ".warndelete 3" - ], - "Submodule": "UserPunishCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".warnclear", - ".warnc" - ], - "Description": "Clears all warnings from a certain user. You can specify a number to clear a specific one.", - "Usage": [ - ".warnclear @PoorDude 3", - ".warnclear @PoorDude" - ], - "Submodule": "UserPunishCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "BanMembers Server Permission" - ] - }, - { - "Aliases": [ - ".warnpunish", - ".warnp" - ], - "Description": "Sets a punishment for a certain number of warnings. You can specify a time string after 'Ban' or *'Mute' punishments to make it a temporary mute/ban. Provide no punishment to remove. Available punishments: Ban, Kick, Softban, Mute, VoiceMute, ChatMute, AddRole, RemoveRoles", - "Usage": [ - ".warnpunish 3", - ".warnpunish 5 Ban", - ".warnpunish 5 Mute 2d12h", - ".warnpunish 4 AddRole toxic 1h" - ], - "Submodule": "UserPunishCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "BanMembers Server Permission" - ] - }, - { - "Aliases": [ - ".warnpunishlist", - ".warnpl" - ], - "Description": "Lists punishments for warnings.", - "Usage": [ - ".warnpunishlist" - ], - "Submodule": "UserPunishCommands", - "Module": "Administration", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".ban", - ".b" - ], - "Description": "Bans a user by ID or name with an optional message. You can specify a time string before the user name to ban the user temporarily.", - "Usage": [ - ".ban @Someone Get out!", - ".ban \"Some Guy#1234\" Your behaviour is toxic.", - ".ban 1d12h @Someone Come back when u chill" - ], - "Submodule": "UserPunishCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "BanMembers Server Permission" - ] - }, - { - "Aliases": [ - ".banprune" - ], - "Description": "Sets how many days of messages will be deleted when a user is banned.\nOnly works if the user is banned via the .ban command or punishment.\nAllowed values: 0 - 7", - "Usage": [ - ".banprune 3" - ], - "Submodule": "UserPunishCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "BanMembers Server Permission" - ] - }, - { - "Aliases": [ - ".banmessage", - ".banmsg", - ".bantemplate", - ".bantemp" - ], - "Description": "Sets a ban message template which will be used when a user is banned from this server. You can use embed strings and ban-specific placeholders: %ban.mod%, %ban.user%, %ban.duration% and %ban.reason%. You can disable ban message with `.banmsg -`", - "Usage": [ - ".banmessage %ban.user%, you've been banned from %server.name%. Reason: %ban.reason%", - ".banmessage { \"description\": \"%ban.user% you have been banned from %server.name% by %ban.mod%\" }" - ], - "Submodule": "UserPunishCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "BanMembers Server Permission" - ] - }, - { - "Aliases": [ - ".banmsgreset" - ], - "Description": "Resets ban message to default. If you want to completely disable ban messages, use `.banmsg -`", - "Usage": [ - ".banmsgreset" - ], - "Submodule": "UserPunishCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "BanMembers Server Permission" - ] - }, - { - "Aliases": [ - ".banmsgtest" - ], - "Description": "If ban message is not disabled, bot will send you the message as if you were banned by yourself. Used for testing the ban message.", - "Usage": [ - ".banmsgtest No reason", - ".banmsgtest 1h Test 1 hour ban message" - ], - "Submodule": "UserPunishCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "BanMembers Server Permission" - ] - }, - { - "Aliases": [ - ".unban" - ], - "Description": "Unbans a user with the provided user#discrim or id.", - "Usage": [ - ".unban toastie_t0ast", - ".unban 123123123" - ], - "Submodule": "UserPunishCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "BanMembers Server Permission" - ] - }, - { - "Aliases": [ - ".softban", - ".sb" - ], - "Description": "Bans and then unbans a user by ID or name with an optional message.", - "Usage": [ - ".softban @Someone Get out!", - ".softban \"Some Guy#1234\" Your behaviour is toxic." - ], - "Submodule": "UserPunishCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "KickMembers, ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".kick", - ".k" - ], - "Description": "Kicks a mentioned user.", - "Usage": [ - ".kick @Someone Get out!", - ".kick \"Some Guy#1234\" Your behaviour is toxic." - ], - "Submodule": "UserPunishCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "KickMembers Server Permission" - ] - }, - { - "Aliases": [ - ".timeout" - ], - "Description": "Times the user out for the specified amount of time. You may optionally specify a reason, which will be sent to the user.", - "Usage": [ - ".timeout @Someone 3h Shut up!", - ".timeout @Someone 1h30m" - ], - "Submodule": "UserPunishCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ModerateMembers Server Permission" - ] - }, - { - "Aliases": [ - ".massban" - ], - "Description": "Bans multiple users at once. Specify a space separated list of IDs of users who you wish to ban.", - "Usage": [ - ".massban 123123123 3333333333 444444444" - ], - "Submodule": "UserPunishCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "BanMembers Server Permission" - ] - }, - { - "Aliases": [ - ".masskill" - ], - "Description": "Specify a new-line separated list of `userid reason`. You can use Username#discrim instead of UserId. Specified users will be banned from the current server, blacklisted from the bot, and have all of their currency taken away.", - "Usage": [ - ".masskill BadPerson#1234 Toxic person" - ], - "Submodule": "UserPunishCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "BanMembers Server Permission" - ] - }, - { - "Aliases": [ - ".vcrolerm" - ], - "Description": "Removes any `.vcrole` associated with the specified channel ID. This is useful if your vcrole has been enabled on a VC which has been deleted.", - "Usage": [ - ".vcrolerm 123123123123123" - ], - "Submodule": "VcRoleCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".vcrole" - ], - "Description": "Sets or resets a role which will be given to users who join the voice channel you're in when you run this command. Provide no role name to disable. You must be in a voice channel to run this command.", - "Usage": [ - ".vcrole SomeRole", - ".vcrole" - ], - "Submodule": "VcRoleCommands", - "Module": "Administration", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".vcrolelist" - ], - "Description": "Shows a list of currently set voice channel roles.", - "Usage": [ - ".vcrolelist" - ], - "Submodule": "VcRoleCommands", - "Module": "Administration", - "Options": null, - "Requirements": [] - } - ], - "Expressions": [ - { - "Aliases": [ - ".exprtoggleglobal", - ".extg" - ], - "Description": "Toggles whether global expressions are usable on this server.", - "Usage": [ - ".exprtoggleglobal" - ], - "Submodule": "Expressions", - "Module": "Expressions", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".expradds", - ".exadds", - ".exas", - ".expraddserver" - ], - "Description": "Add an expression with a trigger and a response in this server. Bot will post a response whenever someone types the trigger word. This command is useful if you want to lower the permission requirement for managing expressions by using `.dpo`. Guide [here]().", - "Usage": [ - ".expradds \"hello\" Hi there %user.mention%" - ], - "Submodule": "Expressions", - "Module": "Expressions", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".expradd", - ".exadd", - ".exa", - ".acr" - ], - "Description": "Add an expression with a trigger and a response. Bot will post a response whenever someone types the trigger word. Running this command in a server requires the Administrator permission. Running this command in DM is Bot Owner only and adds a new global expression. Guide [here]()", - "Usage": [ - ".expradd \"hello\" Hi there %user.mention%" - ], - "Submodule": "Expressions", - "Module": "Expressions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".expredit", - ".exe", - ".exedit", - ".ecr" - ], - "Description": "Edits the expression's response given its ID.", - "Usage": [ - ".expredit 123 I'm a magical girl" - ], - "Submodule": "Expressions", - "Module": "Expressions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".exprlist", - ".exl", - ".exprli", - ".exlist", - ".exli", - ".lcr" - ], - "Description": "Lists global or server expressions (20 expressions per page).\nRunning the command in DM will list global expressions, while running it in a server will list server expressions.\nShows enabled settings, followed by id, followed by the trigger.\n**Settings:** \n• 🗯️ Triggered if trigger matches any phrase (`.h exca`)\n• ✉️ Response will be DMed (`.h exdm`)\n• ❌ Trigger message will be deleted (`.h exad`)", - "Usage": [ - ".exprlist 1" - ], - "Submodule": "Expressions", - "Module": "Expressions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".exprshow", - ".exs", - ".exshow", - ".scr" - ], - "Description": "Shows an expression's response on a given ID.", - "Usage": [ - ".exprshow 1" - ], - "Submodule": "Expressions", - "Module": "Expressions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".exprdelserv", - ".exds", - ".exdelserv" - ], - "Description": "Deletes an expression on a specific index on this server. This command is useful if you want to lower the permission requirement for managing expressions by using `.dpo`.", - "Usage": [ - ".exprdelserv 5c" - ], - "Submodule": "Expressions", - "Module": "Expressions", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".exprdel", - ".exd", - ".exdel", - ".dcr" - ], - "Description": "Deletes an expression by index. If ran in DM, it is bot owner only and deletes a global expression. Running this command in a server requires the Administrator permission and deletes a server expression.", - "Usage": [ - ".exprdel 5" - ], - "Submodule": "Expressions", - "Module": "Expressions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".exreact", - ".exr" - ], - "Description": "Sets or resets reactions (up to 3) which will be added to the response message of the Expression with the specified ID. Provide no emojis to reset.", - "Usage": [ - ".exreact 59 👍 👎", - ".exreact 59 ", - ".exreact 59" - ], - "Submodule": "Expressions", - "Module": "Expressions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".exprca", - ".exca" - ], - "Description": "Toggles whether the expression will trigger if the triggering message contains the keyword (instead of only starting with it).", - "Usage": [ - ".exprca 44" - ], - "Submodule": "Expressions", - "Module": "Expressions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".exprdm", - ".exdm" - ], - "Description": "Toggles whether the response message of the expression will be sent as a direct message.", - "Usage": [ - ".exprdm 44" - ], - "Submodule": "Expressions", - "Module": "Expressions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".exprad", - ".exad" - ], - "Description": "Toggles whether the message triggering the expression will be automatically deleted.", - "Usage": [ - ".exprad 59" - ], - "Submodule": "Expressions", - "Module": "Expressions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".exprat", - ".exat" - ], - "Description": "Toggles whether the expression will allow extra input after the trigger. For example, with this feature enabled, expression with trigger 'hi' will also be invoked when a user types 'hi there'. This feature is automatically enabled on expressions which have '%target%' in their response.", - "Usage": [ - ".exprat 59" - ], - "Submodule": "Expressions", - "Module": "Expressions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".expreload", - ".exrel" - ], - "Description": "Reloads all expressions on all shards. Use this if you've made changes to the database while the bot is running, or used `.deleteunusedcrnq`", - "Usage": [ - ".expreload" - ], - "Submodule": "Expressions", - "Module": "Expressions", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".exprclear", - ".exc", - ".exclear" - ], - "Description": "Deletes all expression on this server.", - "Usage": [ - ".exprclear" - ], - "Submodule": "Expressions", - "Module": "Expressions", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".exexport" - ], - "Description": "Exports expressions from the current server (or global expressions in DMs) into a .yml file", - "Usage": [ - ".exexport" - ], - "Submodule": "Expressions", - "Module": "Expressions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".eximport" - ], - "Description": "Upload the file or send the raw .yml data with this command to import all expressions from the specified string or file into the current server (or as global expressions in dm)", - "Usage": [ - ".eximport " - ], - "Submodule": "Expressions", - "Module": "Expressions", - "Options": null, - "Requirements": [] - } - ], - "Gambling": [ - { - "Aliases": [ - ".timely" - ], - "Description": "Use to claim your timely currency.\nThis is usually set by the bot owners to be daily, hourly or once every 12 hours.\nBot owner has to specify the amount and the period on how often you can claim your currency.", - "Usage": [ - ".timely" - ], - "Submodule": "Gambling", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".timelyreset" - ], - "Description": "Resets all user timeouts on `.timely` command.", - "Usage": [ - ".timelyreset" - ], - "Submodule": "Gambling", - "Module": "Gambling", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".timelyset" - ], - "Description": "Sets the 'timely' currency allowance amount for users. Second parameter is period in hours, default is 24 hours.", - "Usage": [ - ".timelyset 100", - ".timelyset 50 12" - ], - "Submodule": "Gambling", - "Module": "Gambling", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".raffle" - ], - "Description": "Prints a name and ID of a random online user from the server, or from the online user in the specified role.", - "Usage": [ - ".raffle", - ".raffle RoleName" - ], - "Submodule": "Gambling", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".raffleany" - ], - "Description": "Prints a name and ID of a random user from the server, or from the specified role.", - "Usage": [ - ".raffleany", - ".raffleany RoleName" - ], - "Submodule": "Gambling", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".curtrs" - ], - "Description": "Shows your currency transactions on the specified page. Bot owner can see other people's transactions too.", - "Usage": [ - ".curtrs 2", - ".curtrs @SomeUser 2" - ], - "Submodule": "Gambling", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".curtr" - ], - "Description": "Shows full details about a currency transaction with the specified ID. You can only check your own transactions.", - "Usage": [ - ".curtr 3yvd" - ], - "Submodule": "Gambling", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".cash", - ".$", - ".currency", - ".$$", - ".$$$", - ".cur" - ], - "Description": "Check how much currency a person has.\nIf no argument is provided it will check your own balance.", - "Usage": [ - ".cash", - ".cash @Someone" - ], - "Submodule": "Gambling", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".give" - ], - "Description": "Give someone a certain amount of currency. You can specify the reason after the mention.", - "Usage": [ - ".give 1 @Someone", - ".give 5 @CootGurl Ur so pwetty" - ], - "Submodule": "Gambling", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".award" - ], - "Description": "Awards someone a certain amount of currency. You can specify the reason after the Username. You can also specify a role name to award currency to all users in a role.", - "Usage": [ - ".award 100 @person", - ".award 5 Role Of Gamblers" - ], - "Submodule": "Gambling", - "Module": "Gambling", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".take", - ".seize" - ], - "Description": "Takes the specified amount of currency from someone. You can specify a role instead to take the specified amount of currency from all users in the role.", - "Usage": [ - ".take 1 @Someone", - ".take 50 SomeRole" - ], - "Submodule": "Gambling", - "Module": "Gambling", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".betroll", - ".br" - ], - "Description": "Bets the specified amount of currency and rolls a dice.\nRolling over 66 yields x2 of your currency, over 90 - x4 and 100 x10.\nYou can specify 'all', 'half' or 'X%' instead of the amount to bet that part of your current balance.", - "Usage": [ - ".betroll 5" - ], - "Submodule": "Gambling", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".leaderboard", - ".lb" - ], - "Description": "Displays the bot's currency leaderboard, or in other words, the richest users.\nSpecifying -c flag will show only users who are in this server.\nPaginated with 10 users per page.", - "Usage": [ - ".leaderboard", - ".leaderboard -c" - ], - "Submodule": "Gambling", - "Module": "Gambling", - "Options": [ - "`--clean` (`-c`) Only show users who are on the server. " - ], - "Requirements": [] - }, - { - "Aliases": [ - ".rps" - ], - "Description": "Play a game of Rocket-Paperclip-Scissors with Ellie.\nYou can bet on it. Winning awards you 1.95x of the bet.\nYou can specify 'all', 'half' or 'X%' instead of the amount to bet that part of your current balance.", - "Usage": [ - ".rps r 100", - ".rps scissors" - ], - "Submodule": "Gambling", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".luckyladder", - ".lula", - ".wheel", - ".wof" - ], - "Description": "Bets the specified amount of currency on the lucky ladder. You can stop on one of many different multipliers. The won amount is rounded down to the nearest whole number. You can specify 'all', 'half' or 'X%' instead of the amount to bet that part of your current balance.", - "Usage": [ - ".luckyladder 10" - ], - "Submodule": "Gambling", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".bettest" - ], - "Description": "Tests a betting command by specifying the name followed by the number of tests. Some have multiple variations.\nSee the list of all tests by specifying no parameters.", - "Usage": [ - ".bettest", - ".bettest betflip 1000", - ".bettest slot 2000" - ], - "Submodule": "Gambling", - "Module": "Gambling", - "Options": null, - "Requirements": [ - "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" - ], - "Description": "Starts a new animal race.", - "Usage": [ - ".race" - ], - "Submodule": "AnimalRacingCommands", - "Module": "Gambling", - "Options": [ - "`--start-time` (`-s`) " - ], - "Requirements": [] - }, - { - "Aliases": [ - ".joinrace", - ".jr" - ], - "Description": "Joins a new race. You can specify an amount of currency for betting (optional). You will get YourBet*(participants-1) back if you win.", - "Usage": [ - ".joinrace", - ".joinrace 5" - ], - "Submodule": "AnimalRacingCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".bank deposit", - ".bank d", - ".bank dep" - ], - "Description": "Deposits the specified amount of currency into the bank for later use.", - "Usage": [ - ".bank deposit 50" - ], - "Submodule": "Bank", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".bank withdraw", - ".bank w", - ".bank with" - ], - "Description": "Withdraws the specified amount of currency from the bank if available.", - "Usage": [ - ".bank withdraw 49" - ], - "Submodule": "Bank", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".bank balance", - ".bank b", - ".bank bal" - ], - "Description": "Shows how much currency is in your bank account.\nThis differs from your cash amount, as the cash amount is publicly available, but only you have access to your bank balance.\nHowever, you have to withdraw it first in order to use it.\nBot Owner can also check another user's bank balance.", - "Usage": [ - ".bank balance", - ".bank balance @User" - ], - "Submodule": "Bank", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".bank take", - ".bank seize" - ], - "Description": "Takes the specified amount of currency from a user's bank", - "Usage": [ - ".bank take 500 @MoniLaunder" - ], - "Submodule": "Bank", - "Module": "Gambling", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".bank award" - ], - "Description": "Award the specified amount of currency to a user's bank", - "Usage": [ - ".bank award 99999 @Bestie" - ], - "Submodule": "Bank", - "Module": "Gambling", - "Options": null, - "Requirements": [ - "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", - ".bj" - ], - "Description": "Start or join a blackjack game by specifying the amount you're betting. \nYou must specify the amount you're betting. \nUse `.hit`, `.stand` and `.double` commands to play. \nGame is played with 4 decks. \nDealer hits on soft 17 and wins draws.", - "Usage": [ - ".blackjack 50" - ], - "Submodule": "BlackJackCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".hit" - ], - "Description": "In the blackjack game, ask the dealer for an extra card.", - "Usage": [ - ".hit" - ], - "Submodule": "BlackJackCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".stand" - ], - "Description": "Finish your turn in the blackjack game.", - "Usage": [ - ".stand" - ], - "Submodule": "BlackJackCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".double" - ], - "Description": "In the blackjack game, double your bet in order to receive exactly one more card, and your turn ends.", - "Usage": [ - ".double" - ], - "Submodule": "BlackJackCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".connect4", - ".con4" - ], - "Description": "Creates or joins an existing connect4 game. 2 players are required for the game. Objective of the game is to get 4 of your pieces next to each other in a vertical, horizontal or diagonal line. You can specify a bet when you create a game and only users who bet the same amount will be able to join your game.", - "Usage": [ - ".connect4" - ], - "Submodule": "Connect4Commands", - "Module": "Gambling", - "Options": [ - "`--turn-timer` (`-t`) Turn time in seconds. It has to be between 5 and 60. Default 15. " - ], - "Requirements": [] - }, - { - "Aliases": [ - ".roll" - ], - "Description": "Rolls 0-100. If you supply a number `X` it rolls up to 30 normal dice. If you split 2 numbers with letter `d` (`xdy`) it will roll `X` dice from 1 to `y`. `Y` can be a letter 'F' if you want to roll fate dice instead of dnd.", - "Usage": [ - ".roll", - ".roll 7", - ".roll 3d5", - ".roll 5dF" - ], - "Submodule": "DiceRollCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".rolluo" - ], - "Description": "Rolls `X` normal dice (up to 30) unordered. If you split 2 numbers with letter `d` (`xdy`) it will roll `X` dice from 1 to `y`.", - "Usage": [ - ".rolluo", - ".rolluo 7", - ".rolluo 3d5" - ], - "Submodule": "DiceRollCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".nroll" - ], - "Description": "Rolls in a given range. If you specify just one number instead of the range, it will roll from 0 to that number.", - "Usage": [ - ".nroll 5", - ".nroll 5-15" - ], - "Submodule": "DiceRollCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".draw" - ], - "Description": "Draws a card from this server's deck. You can draw up to 10 cards by supplying a number of cards to draw.", - "Usage": [ - ".draw", - ".draw 5" - ], - "Submodule": "DrawCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".drawnew" - ], - "Description": "Draws a card from the NEW deck of cards. You can draw up to 10 cards by supplying a number of cards to draw.", - "Usage": [ - ".drawnew", - ".drawnew 5" - ], - "Submodule": "DrawCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".deckshuffle", - ".dsh" - ], - "Description": "Reshuffles all cards back into the deck.", - "Usage": [ - ".deckshuffle" - ], - "Submodule": "DrawCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".betdraw", - ".bd" - ], - "Description": "Bet on the card value and/or color. Specify the amount followed by your guess. \nYou can specify `r` or `b` for red or black, and `h` or `l` for high or low.\nYou can specify only h/l or only r/b or both.\nReturns are high but **7 always loses**.\nYou can specify 'all', 'half' or 'X%' instead of the amount to bet that part of your current balance.", - "Usage": [ - ".betdraw 50 r", - ".betdraw 200 b l", - ".betdraw 1000 h", - ".betdraw 38 hi black" - ], - "Submodule": "DrawCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".eventstart" - ], - "Description": "Starts one of the events seen on public Ellie.\nEvents: `reaction`, `gamestatus`", - "Usage": [ - ".eventstart reaction", - ".eventstart reaction -d 1 -a 50 --pot-size 1500" - ], - "Submodule": "CurrencyEventsCommands", - "Module": "Gambling", - "Options": [ - "`--amount` (`-a`) Amount of currency each user receives. ", - "`--pot-size` (`-p`) The maximum amount of currency that can be rewarded. 0 means no limit. ", - "`--duration` (`-d`) Number of hours the event should run for. Default 24. " - ], - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".flip" - ], - "Description": "Flips coin(s) - heads or tails, and shows an image.", - "Usage": [ - ".flip", - ".flip 3" - ], - "Submodule": "FlipCoinCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".betflip", - ".bf" - ], - "Description": "Bet on the coin flip.\nThe result can be heads or tails.\nGuessing correctly rewards you with 1.95x of the currency you've bet (rounded up).\nMultiplier can be changed by the bot owner.\nYou can specify 'all', 'half' or 'X%' instead of the amount to bet that part of your current balance.", - "Usage": [ - ".betflip 5 heads", - ".betflip 3 t" - ], - "Submodule": "FlipCoinCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".pick" - ], - "Description": "Picks the currency planted in this channel. If the plant has a password, you need to specify it.", - "Usage": [ - ".pick", - ".pick passwd" - ], - "Submodule": "PlantPickCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".plant" - ], - "Description": "Spend an amount of currency to plant it in this channel. Default is 1. You can specify the password after the amount. Password has to be alphanumeric and it will be trimmed down to 10 characters if it's longer.", - "Usage": [ - ".plant 5", - ".plant 10 meow" - ], - "Submodule": "PlantPickCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".gencurrency", - ".gc" - ], - "Description": "Toggles currency generation on this channel. Every posted message will have chance to spawn currency. Chance is specified by the Bot Owner. (default is 2%)", - "Usage": [ - ".gencurrency" - ], - "Submodule": "PlantPickCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".gencurlist", - ".gclist" - ], - "Description": "Shows the list of server and channel ids where gc is enabled. Paginated with 9 per page.", - "Usage": [ - ".gencurlist" - ], - "Submodule": "PlantPickCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".shop" - ], - "Description": "Lists this server's administrators' shop. Paginated.", - "Usage": [ - ".shop", - ".shop 2" - ], - "Submodule": "ShopCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".shopbuy", - ".buy" - ], - "Description": "Buys an item from the shop on a given index. If buying items, make sure that the bot can DM you.", - "Usage": [ - ".shopbuy 2" - ], - "Submodule": "ShopCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".shopadd" - ], - "Description": "Adds an item to the shop.\nFirst you begin by specifying the type of the item you wish to add.\nAvailable types are role, list and command.\nIf the item is a role, specify a role id or a role name.\nIn case you're selling a command, and you need user's name, id etc, you can use the following placeholders:\n- `%you%` - Buyer mention\n- `%you.id%` - Buyer's user ID\n- `%you.username%` - Buyer's username\n- `%you.name%` - Buyer's global name\n- `%you.nick%` - Buyer's display name\n90% of currency from each purchase will be received by the user who added the item to the shop. This is configurable by the bot owner", - "Usage": [ - ".shopadd role 1000 Rich", - ".shopadd cmd 1000 .setrole %user% Rich" - ], - "Submodule": "ShopCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".shoplistadd" - ], - "Description": "Adds an item to the list of items for sale in the shop entry given the index. You usually want to run this command in the secret channel, so that the unique items are not leaked.", - "Usage": [ - ".shoplistadd 1 Uni-que-Steam-Key" - ], - "Submodule": "ShopCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".shopremove", - ".shoprm" - ], - "Description": "Removes an item from the shop by its ID.", - "Usage": [ - ".shopremove 1" - ], - "Submodule": "ShopCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".shopchangeprice", - ".shopprice" - ], - "Description": "Change the price of a shop entry at the specified index. Specify the index of the entry, followed by the price", - "Usage": [ - ".shopchangeprice 1 500" - ], - "Submodule": "ShopCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".shopchangename", - ".shopname" - ], - "Description": "Change the name of a shop entry at the specified index. Only works for non-role items", - "Usage": [ - ".shopchangename 3 Cool stuff" - ], - "Submodule": "ShopCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".shopswap" - ], - "Description": "Swap the index of two shop entries", - "Usage": [ - ".shopswap 1 5" - ], - "Submodule": "ShopCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".shopmove" - ], - "Description": "Moves the shop entry from the current index to a new one", - "Usage": [ - ".shopmove 2 4" - ], - "Submodule": "ShopCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".shopreq" - ], - "Description": "Sets a role which will be required to buy the item on the specified index. Specify only index to remove the requirement.", - "Usage": [ - ".shopreq 2 Gamers", - ".shopreq 2" - ], - "Submodule": "ShopCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".slot", - ".slots" - ], - "Description": "Play Ellie slots by placing your bet.\nYou can specify 'all', 'half' or 'X%' instead of the amount to bet that part of your current balance.", - "Usage": [ - ".slot 5", - ".slot all" - ], - "Submodule": "SlotCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".waifureset" - ], - "Description": "Resets your waifu stats, except current waifus.", - "Usage": [ - ".waifureset" - ], - "Submodule": "WaifuClaimCommands", - "Module": "Gambling", - "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" - ], - "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": [ - ".waifuclaim 50 @Himesama" - ], - "Submodule": "WaifuClaimCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".waifutransfer" - ], - "Description": "Transfer the ownership of one of your waifus to another user. You must pay 10% of your waifu's value unless that waifu has affinity towards you, in which case you must pay 60% fee. Transferred waifu's price will be reduced by the fee amount.", - "Usage": [ - ".waifutransfer @ExWaifu @NewOwner" - ], - "Submodule": "WaifuClaimCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".divorce" - ], - "Description": "Releases your claim on a specific waifu. You will get 50% of that waifu's value back, unless that waifu has an affinity towards you, in which case they will be reimbursed instead. 6 hours cooldown.", - "Usage": [ - ".divorce @CheatingSloot" - ], - "Submodule": "WaifuClaimCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".affinity", - ".waifuaff" - ], - "Description": "Sets your affinity towards someone you want to be claimed by. Setting affinity will reduce their `.claim` on you by 20%. Provide no parameters to clear your affinity. 30 minutes cooldown.", - "Usage": [ - ".affinity @MyHusband", - ".affinity" - ], - "Submodule": "WaifuClaimCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".waifulb", - ".waifus" - ], - "Description": "Shows top 9 waifus. You can specify another page to show other waifus.", - "Usage": [ - ".waifulb", - ".waifulb 3" - ], - "Submodule": "WaifuClaimCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".waifuinfo", - ".waifustats" - ], - "Description": "Shows waifu stats for a target person. Defaults to you if no user is provided.", - "Usage": [ - ".waifuinfo @MyCrush", - ".waifuinfo" - ], - "Submodule": "WaifuClaimCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".waifugift", - ".gift", - ".gifts" - ], - "Description": "Gift an item to a waifu user.\nThe waifu's value will be increased by the percentage of the gift's value.\nYou can optionally prefix the gift with a multiplier to gift the item that many times.\nFor example, 3xRose will give the waifu 3 roses, 10xBread will give the waifu 10 breads. Do not use plural forms.\nNegative gifts will not show up in waifuinfo. \nProvide no parameters to see a list of items that you can gift.", - "Usage": [ - ".waifugift", - ".waifugift Rose @Himesama" - ], - "Submodule": "WaifuClaimCommands", - "Module": "Gambling", - "Options": null, - "Requirements": [] - } - ], - "Games": [ - { - "Aliases": [ - ".choose" - ], - "Description": "Chooses a thing from a list of things. Separate items with a semicolon ;", - "Usage": [ - ".choose Get up;Sleep;Sleep more" - ], - "Submodule": "Games", - "Module": "Games", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".eightball", - ".8ball" - ], - "Description": "Ask the 8ball a yes/no question.", - "Usage": [ - ".eightball Is b1nzy a nice guy?" - ], - "Submodule": "Games", - "Module": "Games", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".acrophobia", - ".acro" - ], - "Description": "Starts an Acrophobia game.", - "Usage": [ - ".acrophobia", - ".acrophobia -s 30" - ], - "Submodule": "AcropobiaCommands", - "Module": "Games", - "Options": [ - "`--submission-time` (`-s`) Time after which the submissions are closed and voting starts. ", - "`--vote-time` (`-v`) Time after which the voting is closed and the winner is declared. " - ], - "Requirements": [] - }, - { - "Aliases": [ - ".cleverbot", - ".chatbot", - ".chatgpt" - ], - "Description": "Toggles cleverbot/chatgpt session.\nWhen enabled, the bot will reply to messages starting with bot mention in the server.\nExpressions starting with %bot.mention% won't work if cleverbot/chatgpt is enabled.", - "Usage": [ - ".cleverbot" - ], - "Submodule": "ChatterBotCommands", - "Module": "Games", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".hangmanlist" - ], - "Description": "Shows a list of hangman question categories.", - "Usage": [ - ".hangmanlist" - ], - "Submodule": "HangmanCommands", - "Module": "Games", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".hangman" - ], - "Description": "Starts a game of hangman in the channel. You can optionally select a category `.hangmanlist` to see a list of available categories.", - "Usage": [ - ".hangman", - ".hangman movies" - ], - "Submodule": "HangmanCommands", - "Module": "Games", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".hangmanstop" - ], - "Description": "Stops the active hangman game on this channel if it exists.", - "Usage": [ - ".hangmanstop" - ], - "Submodule": "HangmanCommands", - "Module": "Games", - "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" - ], - "Description": "Creates or joins an existing nunchi game. Users have to count up by 1 from the starting number shown by the bot. If someone makes a mistake (types an incorrect number, or repeats the same number) they are out of the game and a new round starts without them. Minimum 3 users required.", - "Usage": [ - ".nunchi" - ], - "Submodule": "NunchiCommands", - "Module": "Games", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".typestart" - ], - "Description": "Starts a typing contest.", - "Usage": [ - ".typestart" - ], - "Submodule": "SpeedTypingCommands", - "Module": "Games", - "Options": [ - "`--start-time` (`-s`) How long does it take for the race to start. Default 5. " - ], - "Requirements": [] - }, - { - "Aliases": [ - ".typestop" - ], - "Description": "Stops a typing contest on the current channel.", - "Usage": [ - ".typestop" - ], - "Submodule": "SpeedTypingCommands", - "Module": "Games", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".typeadd" - ], - "Description": "Adds a new article to the typing contest.", - "Usage": [ - ".typeadd wordswords" - ], - "Submodule": "SpeedTypingCommands", - "Module": "Games", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".typelist" - ], - "Description": "Lists added typing articles with their IDs. 15 per page.", - "Usage": [ - ".typelist", - ".typelist 3" - ], - "Submodule": "SpeedTypingCommands", - "Module": "Games", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".typedel" - ], - "Description": "Deletes a typing article given the ID.", - "Usage": [ - ".typedel 3" - ], - "Submodule": "SpeedTypingCommands", - "Module": "Games", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".tictactoe", - ".ttt" - ], - "Description": "Starts a game of tic tac toe.\nAnother user must run the command in the same channel in order to accept the challenge.\nUse numbers 1-9 to play.", - "Usage": [ - ".tictactoe" - ], - "Submodule": "TicTacToeCommands", - "Module": "Games", - "Options": [ - "`--turn-timer` (`-t`) Turn time in seconds. Default 15. " - ], - "Requirements": [] - }, - { - "Aliases": [ - ".trivia", - ".t" - ], - "Description": "Starts a game of trivia.\nFirst player to get to 10 points wins by default.\n30 seconds per question.", - "Usage": [ - ".trivia", - ".trivia --timeout 5 -p -w 3 -q 10" - ], - "Submodule": "TriviaCommands", - "Module": "Games", - "Options": [ - "`--pokemon` (`-p`) Whether it's 'Who's that pokemon?' trivia. ", - "`--nohint` Don't show any hints. ", - "`--win-req` (`-w`) Winning requirement. Set 0 for an infinite game. Default 10. ", - "`--question-timer` (`-q`) How long until the question ends. Default 30. ", - "`--timeout` (`-t`) Number of questions of inactivity in order stop. Set 0 for never. Default 10. " - ], - "Requirements": [] - }, - { - "Aliases": [ - ".tl" - ], - "Description": "Shows a current trivia leaderboard.", - "Usage": [ - ".tl" - ], - "Submodule": "TriviaCommands", - "Module": "Games", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".tq" - ], - "Description": "Quits current trivia after current question.", - "Usage": [ - ".tq" - ], - "Submodule": "TriviaCommands", - "Module": "Games", - "Options": null, - "Requirements": [] - } - ], - "Help": [ - { - "Aliases": [ - ".modules", - ".mdls" - ], - "Description": "List all of the bot's modules.\nEach module contains commands that you can use.", - "Usage": [ - ".modules" - ], - "Submodule": "Help", - "Module": "Help", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".commands", - ".cmds" - ], - "Description": "List all of the bot's commands in the specified module.\nYou can either specify the full name or only the first few letters of the module name.\nSpecifying no module will show the list of modules instead.", - "Usage": [ - ".commands Admin", - ".commands Admin --view 1", - ".commands" - ], - "Submodule": "Help", - "Module": "Help", - "Options": [ - "`--view` (`-v`) Specifies how to output the list of commands. 0 - Hide commands which you can't use, 1 - Cross out commands which you can't use, 2 - Show all. " - ], - "Requirements": [] - }, - { - "Aliases": [ - ".h", - ".help" - ], - "Description": "Shows help for a single command.\nCommand help contains instructions on how to use the command with examples and a list of parameters.\nDMs you helpful links if no parameters are specified.", - "Usage": [ - ".h .cmds", - ".h" - ], - "Submodule": "Help", - "Module": "Help", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".gencmdlist" - ], - "Description": "Generates a json of the commands list and sends it to the chat.", - "Usage": [ - ".gencmdlist" - ], - "Submodule": "Help", - "Module": "Help", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".guide", - ".readme" - ], - "Description": "Sends a readme and a guide links to the channel.", - "Usage": [ - ".guide" - ], - "Submodule": "Help", - "Module": "Help", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".donate" - ], - "Description": "Provides instructions for helping the project financially.", - "Usage": [ - ".donate" - ], - "Submodule": "Help", - "Module": "Help", - "Options": null, - "Requirements": [ - "Only Public Bot" - ] - }, - { - "Aliases": [ - ".patron" - ], - "Description": "Check your patronage status and command usage quota. Bot owners can check targeted user's patronage status.", - "Usage": [ - ".patron" - ], - "Submodule": "Patronage", - "Module": "Help", - "Options": null, - "Requirements": [ - "Only Public Bot" - ] - }, - { - "Aliases": [ - ".patronmessage", - ".patronmsg" - ], - "Description": "Sends a message to all patrons of the specified tier and higher.\nSupports [embeds](https://eb.elliebot.net/)", - "Usage": [ - ".patronmessage x hello" - ], - "Submodule": "Patronage", - "Module": "Help", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "Only Public Bot" - ] - } - ], - "Marmalade": [ - { - "Aliases": [ - ".marmaladeload", - ".maload" - ], - "Description": "Loads a marmalade with the specified name from the data/marmalades/ folder.\nProvide no name to see the list of loadable marmalades.\nRead about the marmalade system [here](https://docs.elliebot.net/ellie/marmalade/creating-a-marmalade/)", - "Usage": [ - ".marmaladeload mycoolmarmalade", - ".marmaladeload" - ], - "Submodule": "Marmalade", - "Module": "Marmalade", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "No Public Bot" - ] - }, - { - "Aliases": [ - ".marmaladeunload", - ".maunload" - ], - "Description": "Unloads the previously loaded marmalade.\nProvide no name to see the list of unloadable marmalades. \nRead about the marmalade system [here](https://docs.elliebot.net/ellie/marmalade/creating-a-marmalade/)", - "Usage": [ - ".marmaladeunload mycoolmarmalade", - ".marmaladeunload" - ], - "Submodule": "Marmalade", - "Module": "Marmalade", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "No Public Bot" - ] - }, - { - "Aliases": [ - ".marmaladelist", - ".malist" - ], - "Description": "Lists all loaded and unloaded marmalades.\nRead about the marmalade system [here](https://docs.elliebot.net/ellie/marmalade/creating-a-marmalade/)", - "Usage": [ - ".marmaladelist" - ], - "Submodule": "Marmalade", - "Module": "Marmalade", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "No Public Bot" - ] - }, - { - "Aliases": [ - ".marmaladeinfo", - ".mainfo" - ], - "Description": "Shows information about the specified marmalade such as the author, name, description, list of canaries, number of commands etc.\nProvide no name to see the basic information about all loaded marmalades. \nRead about the marmalade system [here](https://docs.elliebot.net/ellie/marmalade/creating-a-marmalade/)", - "Usage": [ - ".marmaladeinfo mycoolmarmalade", - ".marmaladeinfo" - ], - "Submodule": "Marmalade", - "Module": "Marmalade", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "No Public Bot" - ] - }, - { - "Aliases": [ - ".marmaladesearch", - ".masearchw" - ], - "Description": "Searches for marmalades online given the search term", - "Usage": [ - ".marmaladesearch shrine" - ], - "Submodule": "Marmalade", - "Module": "Marmalade", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "No Public Bot" - ] - } - ], - "Music": [ - { - "Aliases": [ - ".join", - ".j", - ".move", - ".mv" - ], - "Description": "Makes the bot join your voice channel.", - "Usage": [ - ".join" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".destroy", - ".d" - ], - "Description": "Completely stops the music and unbinds the bot from the channel. (may cause weird behaviour)", - "Usage": [ - ".destroy" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".play", - ".p", - ".start" - ], - "Description": "Queues up and plays a song or video based on a search query, song name, artist name or youtube link.\nIf no parameters are specified, it will skip the current song.\nIf you specify a song number, it will jump to that song.\nIf you specify a search query, acts as a `.q` command\n**You must be in a voice channel**.", - "Usage": [ - ".play", - ".play 5", - ".play Dream Of Venice" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".queue", - ".q", - ".yq", - ".enqueue" - ], - "Description": "Queues up and plays a song or video based on a search query, song name, artist name, search query or youtube link.\nBot will join your voice channel. \n**You must be in a voice channel**.", - "Usage": [ - ".queue Dream Of Venice" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".queuenext", - ".qn" - ], - "Description": "Works the same as `.queue` command, except it enqueues the new song after the current one. **You must be in a voice channel**.", - "Usage": [ - ".queuenext Dream Of Venice" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".volume", - ".vol", - ".defvol" - ], - "Description": "Sets the music playback volume (0-100%). Persistent server setting. Default 100", - "Usage": [ - ".volume 50" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".next", - ".n" - ], - "Description": "Goes to the next song in the queue. You have to be in the same voice channel as the bot", - "Usage": [ - ".next" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".listqueue", - ".lq" - ], - "Description": "Lists 10 currently queued songs per page. Default page is 1.", - "Usage": [ - ".listqueue", - ".listqueue 2" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".queuesearch", - ".qs", - ".yqs" - ], - "Description": "Search for top 5 youtube song result using keywords, and type the index of the song to play that song. Bot will join your voice channel. **You must be in a voice channel**.", - "Usage": [ - ".queuesearch Dream Of Venice" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".songremove", - ".srm", - ".trackremove", - ".trm" - ], - "Description": "Remove a song by its # in the queue, or 'all' (or provide no parameter) to remove all songs from the queue.", - "Usage": [ - ".songremove 5", - ".songremove all", - ".songremove" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".stop", - ".s" - ], - "Description": "Stops the music and preserves the current song index. Stays in the channel.", - "Usage": [ - ".stop" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".queuerepeat", - ".qrp", - ".rpl" - ], - "Description": "Sets music player repeat strategy for this server.\n- `n` / `no` - player will stop once it reaches the end of the queue\n- `s` / `song` - player will repeat current song\n- `q` / `queue` or empty - player will repeat entire music queue", - "Usage": [ - ".queuerepeat", - ".queuerepeat n", - ".queuerepeat song" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".pause" - ], - "Description": "Pauses or Unpauses the song.", - "Usage": [ - ".pause" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".radio", - ".ra" - ], - "Description": "Queues a radio stream from a link. It can be a direct mp3 radio stream, .m3u, .pls .asx or .xspf (Usage Video: )", - "Usage": [ - ".radio radio link here" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".local", - ".lo" - ], - "Description": "Queues a local file by specifying a full path.", - "Usage": [ - ".local C:/music/mysong.mp3" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "No Public Bot" - ] - }, - { - "Aliases": [ - ".localplaylist", - ".lopl" - ], - "Description": "Queues all songs from a directory.", - "Usage": [ - ".localplaylist C:/music/classical" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "No Public Bot" - ] - }, - { - "Aliases": [ - ".trackmove", - ".tm", - ".movesong", - ".ms" - ], - "Description": "Moves a song from one position to another.", - "Usage": [ - ".trackmove 5 3" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".playlist", - ".pl" - ], - "Description": "Queues up to 500 songs from a youtube playlist specified by a link, or keywords.", - "Usage": [ - ".playlist " - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".nowplaying", - ".np" - ], - "Description": "Shows the song that the bot is currently playing.", - "Usage": [ - ".nowplaying" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".playlistshuffle", - ".shuffle", - ".sh", - ".plsh" - ], - "Description": "Shuffles the current playlist.", - "Usage": [ - ".playlistshuffle" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".setmusicchannel", - ".smch" - ], - "Description": "Sets the current channel as the default music output channel. This will output playing, finished, paused and removed songs to that channel instead of the channel where the first song was queued in. Persistent server setting.", - "Usage": [ - ".setmusicchannel" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot", - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".unsetmusicchannel", - ".usmch" - ], - "Description": "Bot will output playing, finished, paused and removed songs to the channel where the first song was queued in. Persistent server setting.", - "Usage": [ - ".unsetmusicchannel" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot", - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".autodisconnect", - ".autodc" - ], - "Description": "Toggles whether the bot should disconnect from the voice channel once it's done playing all of the songs and queue repeat option is set to `none`.", - "Usage": [ - ".autodisconnect" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".musicquality", - ".mquality" - ], - "Description": "Gets or sets the default music player quality. Available settings: Highest, High, Medium, Low. Default is **Highest**. Provide no argument to see current setting.", - "Usage": [ - ".musicquality", - ".musicquality High", - ".musicquality Low" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot", - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".queueautoplay", - ".qap" - ], - "Description": "Toggles autoplay - When the song is finished, automatically queue a related Youtube song. (Works only for Youtube songs)", - "Usage": [ - ".queueautoplay" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".qfp" - ], - "Description": "Triggers fairplay. The song queue will be re-ordered in a fair manner. No effect on newly added songs.", - "Usage": [ - ".qfp" - ], - "Submodule": "Music", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".playlists", - ".pls" - ], - "Description": "Lists all playlists. Paginated, 20 per page.", - "Usage": [ - ".playlists 1" - ], - "Submodule": "PlaylistCommands", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".deleteplaylist", - ".delpls" - ], - "Description": "Deletes a saved playlist using its id. Works only if you made it or if you are the bot owner.", - "Usage": [ - ".deleteplaylist 5" - ], - "Submodule": "PlaylistCommands", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".playlistshow", - ".plshow" - ], - "Description": "Lists all songs in a playlist specified by its id. Paginated, 20 per page.", - "Usage": [ - ".playlistshow 1" - ], - "Submodule": "PlaylistCommands", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".save" - ], - "Description": "Saves a playlist under a certain name. Playlist name must be no longer than 20 characters and must not contain dashes.", - "Usage": [ - ".save classical1" - ], - "Submodule": "PlaylistCommands", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".load" - ], - "Description": "Loads a saved playlist using its ID. Use `.pls` to list all saved playlists and `.save` to save new ones.", - "Usage": [ - ".load 5" - ], - "Submodule": "PlaylistCommands", - "Module": "Music", - "Options": null, - "Requirements": [ - "No Public Bot" - ] - }, - { - "Aliases": [ - ".deleteplaylists" - ], - "Description": "Deletes everything from MusicPlaylists.", - "Usage": [ - ".deleteplaylists" - ], - "Submodule": "PlaylistCommands", - "Module": "Music", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "No Public Bot" - ] - } - ], - "Permissions": [ - { - "Aliases": [ - ".verbose", - ".v" - ], - "Description": "Toggles or sets whether to show when a command/module is blocked.", - "Usage": [ - ".verbose", - ".verbose true" - ], - "Submodule": "Permissions", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".permrole", - ".pr" - ], - "Description": "Sets a role which can change permissions. Supply no parameters to see the current one. Type 'reset' instead of the role name to reset the currently set permission role. Users with the Administrator server permissions can use permission commands regardless of whether they have the specified role. There is no default permission role.", - "Usage": [ - ".permrole Some Role", - ".permrole reset" - ], - "Submodule": "Permissions", - "Module": "Permissions", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".listperms", - ".lp" - ], - "Description": "Lists whole permission chain with their indexes. You can specify an optional page number if there are a lot of permissions.", - "Usage": [ - ".listperms", - ".listperms 3" - ], - "Submodule": "Permissions", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".removeperm", - ".rp" - ], - "Description": "Removes a permission from a given position in the Permissions list.", - "Usage": [ - ".removeperm 1" - ], - "Submodule": "Permissions", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".moveperm", - ".mp" - ], - "Description": "Moves permission from one position to another in the Permissions list.", - "Usage": [ - ".moveperm 2 4" - ], - "Submodule": "Permissions", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".srvrcmd", - ".sc" - ], - "Description": "Sets a command's permission at the server level.", - "Usage": [ - ".srvrcmd \"command name\" disable" - ], - "Submodule": "Permissions", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".srvrmdl", - ".sm" - ], - "Description": "Sets a module's permission at the server level.", - "Usage": [ - ".srvrmdl ModuleName enable" - ], - "Submodule": "Permissions", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".usrcmd", - ".uc" - ], - "Description": "Sets a command's permission at the user level.", - "Usage": [ - ".usrcmd \"command name\" enable SomeUsername" - ], - "Submodule": "Permissions", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".usrmdl", - ".um" - ], - "Description": "Sets a module's permission at the user level.", - "Usage": [ - ".usrmdl ModuleName enable SomeUsername" - ], - "Submodule": "Permissions", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".rolecmd", - ".rc" - ], - "Description": "Sets a command's permission at the role level.", - "Usage": [ - ".rolecmd \"command name\" disable MyRole" - ], - "Submodule": "Permissions", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".rolemdl", - ".rm" - ], - "Description": "Sets a module's permission at the role level.", - "Usage": [ - ".rolemdl ModuleName enable MyRole" - ], - "Submodule": "Permissions", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".chnlcmd", - ".cc" - ], - "Description": "Sets a command's permission at the channel level.", - "Usage": [ - ".chnlcmd \"command name\" enable SomeChannel" - ], - "Submodule": "Permissions", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".chnlmdl", - ".cm" - ], - "Description": "Sets a module's permission at the channel level.", - "Usage": [ - ".chnlmdl ModuleName enable SomeChannel" - ], - "Submodule": "Permissions", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".allchnlmdls", - ".acm" - ], - "Description": "Enable or disable all modules in a specified channel.", - "Usage": [ - ".allchnlmdls enable #SomeChannel" - ], - "Submodule": "Permissions", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".allrolemdls", - ".arm" - ], - "Description": "Enable or disable all modules for a specific role.", - "Usage": [ - ".allrolemdls [enable/disable] MyRole" - ], - "Submodule": "Permissions", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".allusrmdls", - ".aum" - ], - "Description": "Enable or disable all modules for a specific user.", - "Usage": [ - ".allusrmdls enable @Someone" - ], - "Submodule": "Permissions", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".allsrvrmdls", - ".asm" - ], - "Description": "Enable or disable all modules for your server.", - "Usage": [ - ".allsrvrmdls [enable/disable]" - ], - "Submodule": "Permissions", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".userblacklist", - ".ubl" - ], - "Description": "Either [add]s or [rem]oves a user or users specified by a Mention or an ID from a blacklist.\nSpecify no argument or a page number to list blacklisted users.", - "Usage": [ - ".userblacklist add @SomeUser @SomeUser2 @SomeUser3", - ".userblacklist rem 12312312313", - ".userblacklist", - ".userblacklist 4" - ], - "Submodule": "BlacklistCommands", - "Module": "Permissions", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".channelblacklist", - ".cbl" - ], - "Description": "Either [add]s or [rem]oves a channel or channels specified an ID from a blacklist.\nSpecify no argument or a page number to list blacklisted channels.", - "Usage": [ - ".channelblacklist add 12312312312 66666666666", - ".channelblacklist rem 12312312312", - ".channelblacklist", - ".channelblacklist 3" - ], - "Submodule": "BlacklistCommands", - "Module": "Permissions", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".serverblacklist", - ".sbl" - ], - "Description": "Either [add]s or [rem]oves a server, or servers specified by an ID from a blacklist.\nSpecify no argument or a page number to list blacklisted servers.", - "Usage": [ - ".serverblacklist add 12312321312", - ".serverblacklist rem 12312321312", - ".serverblacklist", - ".serverblacklist 2" - ], - "Submodule": "BlacklistCommands", - "Module": "Permissions", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".cmdcooldown", - ".cmdcd" - ], - "Description": "Sets a cooldown, in seconds, for a command or an expression which will be applied per user. Set it to 0 to remove the cooldown. Supports a special command `cleverbot:response` which can be used limit how often users can talk to cleverbot", - "Usage": [ - ".cmdcooldown .h 5", - ".cmdcooldown .pat 30" - ], - "Submodule": "CmdCdsCommands", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".allcmdcooldowns", - ".cmdcds" - ], - "Description": "Shows a list of all commands and their respective cooldowns.", - "Usage": [ - ".allcmdcooldowns" - ], - "Submodule": "CmdCdsCommands", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".fwclear" - ], - "Description": "Deletes all filtered words on this server.", - "Usage": [ - ".fwclear" - ], - "Submodule": "FilterCommands", - "Module": "Permissions", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".filterlist", - ".fl" - ], - "Description": "Lists invite and link filter channels and status.", - "Usage": [ - ".filterlist" - ], - "Submodule": "FilterCommands", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".srvrfilterinv", - ".sfi" - ], - "Description": "Toggles automatic deletion of invites posted in the server. Does not affect users with the Administrator permission.", - "Usage": [ - ".srvrfilterinv" - ], - "Submodule": "FilterCommands", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".chnlfilterinv", - ".cfi" - ], - "Description": "Toggles automatic deletion of invites posted in the channel. Does not negate the `.srvrfilterinv` enabled setting. Does not affect users with the Administrator permission.", - "Usage": [ - ".chnlfilterinv" - ], - "Submodule": "FilterCommands", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".srvrfilterlin", - ".sfl" - ], - "Description": "Toggles automatic deletion of links posted in the server. Does not affect users with the Administrator permission.", - "Usage": [ - ".srvrfilterlin" - ], - "Submodule": "FilterCommands", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".chnlfilterlin", - ".cfl" - ], - "Description": "Toggles automatic deletion of links posted in the channel. Does not negate the `.srvrfilterlin` enabled setting. Does not affect users with the Administrator permission.", - "Usage": [ - ".chnlfilterlin" - ], - "Submodule": "FilterCommands", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".srvrfilterwords", - ".sfw" - ], - "Description": "Toggles automatic deletion of messages containing filtered words on the server. Does not affect users with the Administrator permission.", - "Usage": [ - ".srvrfilterwords" - ], - "Submodule": "FilterCommands", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".chnlfilterwords", - ".cfw" - ], - "Description": "Toggles automatic deletion of messages containing filtered words on the channel. Does not negate the `.srvrfilterwords` enabled setting. Does not affect users with the Administrator permission.", - "Usage": [ - ".chnlfilterwords" - ], - "Submodule": "FilterCommands", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".filterword", - ".fw" - ], - "Description": "Adds or removes (if it exists) a word from the list of filtered words. Use`.sfw` or `.cfw` to toggle filtering.", - "Usage": [ - ".filterword poop" - ], - "Submodule": "FilterCommands", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".lstfilterwords", - ".lfw" - ], - "Description": "Shows a list of filtered words.", - "Usage": [ - ".lstfilterwords" - ], - "Submodule": "FilterCommands", - "Module": "Permissions", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".globalpermlist", - ".gpl", - ".lgp", - ".globalperms", - ".listglobalperms" - ], - "Description": "Lists global permissions set by the bot owner.", - "Usage": [ - ".globalpermlist" - ], - "Submodule": "GlobalPermissionCommands", - "Module": "Permissions", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".globalmodule", - ".gmod" - ], - "Description": "Toggles whether a module can be used on any server.", - "Usage": [ - ".globalmodule Gambling" - ], - "Submodule": "GlobalPermissionCommands", - "Module": "Permissions", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".globalcommand", - ".gcmd" - ], - "Description": "Toggles whether a command can be used on any server.", - "Usage": [ - ".globalcommand .stats" - ], - "Submodule": "GlobalPermissionCommands", - "Module": "Permissions", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".resetperms" - ], - "Description": "Resets the bot's permissions module on this server to the default value.", - "Usage": [ - ".resetperms" - ], - "Submodule": "ResetPermissionsCommands", - "Module": "Permissions", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".resetglobalperms" - ], - "Description": "Resets global permissions set by bot owner.", - "Usage": [ - ".resetglobalperms" - ], - "Submodule": "ResetPermissionsCommands", - "Module": "Permissions", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - } - ], - "Searches": [ - { - "Aliases": [ - ".weather", - ".we" - ], - "Description": "Shows current weather data for the specified city.", - "Usage": [ - ".weather Auckland, NZ" - ], - "Submodule": "Searches", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".time" - ], - "Description": "Shows the current time and timezone in the specified location.", - "Usage": [ - ".time London, UK" - ], - "Submodule": "Searches", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".movie", - ".omdb", - ".imdb" - ], - "Description": "Queries omdb for movies or series, show first result.", - "Usage": [ - ".movie Batman vs Superman" - ], - "Submodule": "Searches", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".randomcat", - ".meow" - ], - "Description": "Shows a random cat image.", - "Usage": [ - ".randomcat" - ], - "Submodule": "Searches", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".randomdog", - ".woof" - ], - "Description": "Shows a random dog image.", - "Usage": [ - ".randomdog" - ], - "Submodule": "Searches", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".randomfood", - ".yum" - ], - "Description": "Shows a random food image.", - "Usage": [ - ".randomfood" - ], - "Submodule": "Searches", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".randombird", - ".birb", - ".bird" - ], - "Description": "Shows a random bird image.", - "Usage": [ - ".randombird" - ], - "Submodule": "Searches", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".lmgtfy" - ], - "Description": "Google something for a baka.", - "Usage": [ - ".lmgtfy How to eat a banana" - ], - "Submodule": "Searches", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".shorten" - ], - "Description": "Attempts to shorten an URL, if it fails, returns the input URL.", - "Usage": [ - ".shorten https://google.com" - ], - "Submodule": "Searches", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".magicthegathering", - ".mtg" - ], - "Description": "Searches for a Magic The Gathering card.", - "Usage": [ - ".magicthegathering about face" - ], - "Submodule": "Searches", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".hearthstone", - ".hs" - ], - "Description": "Searches for a Hearthstone card and shows its image. Takes a while to complete.", - "Usage": [ - ".hearthstone Ysera" - ], - "Submodule": "Searches", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".urbandict", - ".ud" - ], - "Description": "Searches Urban Dictionary for a word.", - "Usage": [ - ".urbandict Pineapple" - ], - "Submodule": "Searches", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".define", - ".def" - ], - "Description": "Finds a definition of a word.", - "Usage": [ - ".define heresy" - ], - "Submodule": "Searches", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".catfact" - ], - "Description": "Shows a random fact about cats.", - "Usage": [ - ".catfact" - ], - "Submodule": "Searches", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".wiki", - ".wikipedia" - ], - "Description": "Gives you back a wikipedia link", - "Usage": [ - ".wiki query" - ], - "Submodule": "Searches", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".color", - ".clr" - ], - "Description": "Shows you pictures of colors which correspond to the inputted hex values. Max 10.", - "Usage": [ - ".color 00ff00", - ".color f00 0f0 00f" - ], - "Submodule": "Searches", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".avatar", - ".av" - ], - "Description": "Shows a mentioned person's avatar.", - "Usage": [ - ".avatar @Someone" - ], - "Submodule": "Searches", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".wikia", - ".fandom" - ], - "Description": "Gives you back a fandom link", - "Usage": [ - ".wikia mtg Vigilance", - ".wikia mlp Dashy" - ], - "Submodule": "Searches", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".steam" - ], - "Description": "Returns a store link for a steam game with the specified name. It doesn't work very well because bundles.", - "Usage": [ - ".steam Sakura Agent" - ], - "Submodule": "Searches", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".anime", - ".ani", - ".aq" - ], - "Description": "Queries anilist for an anime and shows the first result.", - "Usage": [ - ".anime aquarion evol" - ], - "Submodule": "AnimeSearchCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".manga", - ".mang", - ".mq" - ], - "Description": "Queries anilist for a manga and shows the first result.", - "Usage": [ - ".manga Shingeki no kyojin" - ], - "Submodule": "AnimeSearchCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".stock" - ], - "Description": "Shows basic information about a stock. You can use a symbol or company name", - "Usage": [ - ".stock tsla", - ".stock advanced micro devices", - ".stock amd" - ], - "Submodule": "FinanceCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".crypto", - ".c" - ], - "Description": "Shows basic stats about a cryptocurrency from coinmarketcap.com. You can use either a name or an abbreviation of the currency.", - "Usage": [ - ".crypto btc", - ".crypto bitcoin" - ], - "Submodule": "FinanceCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".coins", - ".crypto", - ".cryptos" - ], - "Description": "Shows a list of 10 crypto currencies ordered by market cap.\nShows their price, change in the last24h, market cap and circulating and total supply.\nPaginated with 10 per page.", - "Usage": [ - ".coins", - ".coins 2" - ], - "Submodule": "FinanceCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".ytuploadnotif", - ".yun" - ], - "Description": "Subscribe to a youtube channel's upload rss feed.\nYou can optionally specify a message which will be posted with an update.\nThis is just a shortcut for `.feed` with a url of the youtube channel's rss feed.", - "Usage": [ - ".ytuploadnotif https://www.youtube.com/channel/UCSJ4gkVC6NrvII8umztf0Ow", - ".ytuploadnotif https://www.youtube.com/channel/UCSJ4gkVC6NrvII8umztf0Ow New video is posted" - ], - "Submodule": "FeedCommands", - "Module": "Searches", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".feed", - ".feedadd" - ], - "Description": "Subscribes to a feed.\nBot will post an update up to once every 10 seconds.\nYou can have up to 10 feeds on one server.\nAll feeds must have unique URLs.\nSet a channel as a second optional parameter to specify where to send the updates.\nYou can optionally specify a message after the channel name which will be posted with an update.", - "Usage": [ - ".feed https://blog.playstation.com/feed/", - ".feed https://blog.playstation.com/feed/ #updates", - ".feed https://blog.playstation.com/feed/ #updates New playstation rss feed post!" - ], - "Submodule": "FeedCommands", - "Module": "Searches", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".feedremove", - ".feedrm", - ".feeddel" - ], - "Description": "Stops tracking a feed on the given index. Use `.feeds` command to see a list of feeds and their indexes.", - "Usage": [ - ".feedremove 3" - ], - "Submodule": "FeedCommands", - "Module": "Searches", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".feedlist", - ".feeds" - ], - "Description": "Shows the list of feeds you've subscribed to on this server.", - "Usage": [ - ".feedlist" - ], - "Submodule": "FeedCommands", - "Module": "Searches", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".yomama", - ".ym" - ], - "Description": "Shows a random yomama joke.", - "Usage": [ - ".yomama" - ], - "Submodule": "JokeCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".randjoke", - ".rj" - ], - "Description": "Shows a random joke.", - "Usage": [ - ".randjoke" - ], - "Submodule": "JokeCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".chucknorris", - ".cn" - ], - "Description": "Shows a random Chuck Norris joke.", - "Usage": [ - ".chucknorris" - ], - "Submodule": "JokeCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".wowjoke" - ], - "Description": "Get one of penultimate WoW jokes.", - "Usage": [ - ".wowjoke" - ], - "Submodule": "JokeCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".magicitem", - ".mi" - ], - "Description": "Shows a random magic item with its description.", - "Usage": [ - ".magicitem" - ], - "Submodule": "JokeCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".osu" - ], - "Description": "Shows osu! stats for a player.", - "Usage": [ - ".osu Name", - ".osu Name taiko" - ], - "Submodule": "OsuCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".gatari" - ], - "Description": "Shows osu!gatari stats for a player.", - "Usage": [ - ".gatari Name", - ".gatari Name ctb" - ], - "Submodule": "OsuCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".osu5" - ], - "Description": "Displays a user's top 5 plays.", - "Usage": [ - ".osu5 Name" - ], - "Submodule": "OsuCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".pokemon", - ".poke" - ], - "Description": "Searches for a pokemon.", - "Usage": [ - ".pokemon Sylveon" - ], - "Submodule": "PokemonSearchCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".pokemonability", - ".pokeab" - ], - "Description": "Searches for a pokemon ability.", - "Usage": [ - ".pokemonability overgrow" - ], - "Submodule": "PokemonSearchCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".bible" - ], - "Description": "Shows bible verse. You need to supply book name and chapter:verse", - "Usage": [ - ".bible genesis 3:19" - ], - "Submodule": "ReligiousCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".quran" - ], - "Description": "Shows the text of an ayah of the Quran, as well as the recitation by Alafasy.\nSupply surah:ayah, or ayah number. For instance, 262 or 2:255 will both get you Ayat Al Kursi", - "Usage": [ - ".quran 2:255", - ".quran 262" - ], - "Submodule": "ReligiousCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".google", - ".search", - ".g", - ".s" - ], - "Description": "Get a Google search link for some terms.", - "Usage": [ - ".google query" - ], - "Submodule": "SearchCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".image", - ".img", - ".rimg" - ], - "Description": "Pulls a random image using a search parameter.", - "Usage": [ - ".image cute kitten" - ], - "Submodule": "SearchCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".youtube", - ".yt" - ], - "Description": "Searches youtubes and shows the first result", - "Usage": [ - ".youtube query" - ], - "Submodule": "SearchCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".streamadd", - ".sta", - ".stadd" - ], - "Description": "Notifies this channel when the stream on the specified URL goes online or offline. Offline notifications will only show if you enable `.streamoff`. Maximum 10 per server.", - "Usage": [ - ".streamadd twitch.tv/someguy" - ], - "Submodule": "StreamNotificationCommands", - "Module": "Searches", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".streamremove", - ".strm" - ], - "Description": "Stops following the stream on the specified index. (use `.stl` to see indexes)", - "Usage": [ - ".streamremove 2" - ], - "Submodule": "StreamNotificationCommands", - "Module": "Searches", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".streamsclear", - ".stclear" - ], - "Description": "Removes all followed streams on this server.", - "Usage": [ - ".streamsclear" - ], - "Submodule": "StreamNotificationCommands", - "Module": "Searches", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".streamlist", - ".stl", - ".streamslist" - ], - "Description": "Lists all streams you are following on this server and their respective indexes.", - "Usage": [ - ".streamlist" - ], - "Submodule": "StreamNotificationCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".streamoffline", - ".sto", - ".stoff" - ], - "Description": "Toggles whether the bot will also notify when added streams go offline.", - "Usage": [ - ".streamoffline" - ], - "Submodule": "StreamNotificationCommands", - "Module": "Searches", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".streamonlinedelete", - ".stondel" - ], - "Description": "Toggles whether the bot will delete stream online message when the stream goes offline.", - "Usage": [ - ".streamonlinedelete" - ], - "Submodule": "StreamNotificationCommands", - "Module": "Searches", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".streammsg", - ".stm", - ".stmsg" - ], - "Description": "Sets the message which will show when the stream on the specified index comes online. You can use %user% and %platform% placeholders.", - "Usage": [ - ".streammsg 1 Hey @erryone %user% is back online on %platform%!1!!" - ], - "Submodule": "StreamNotificationCommands", - "Module": "Searches", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".streammsgall", - ".stma", - ".stmsga" - ], - "Description": "Sets the message which will show when any of the currently followed streams comes online. This does not apply to the streams which get added afterwards. You can use %user% and %platform% placeholders.", - "Usage": [ - ".streammsgall Hey @erryone %user% is back online!1!!" - ], - "Submodule": "StreamNotificationCommands", - "Module": "Searches", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".streamcheck", - ".stc" - ], - "Description": "Retrieves information about a stream.", - "Usage": [ - ".streamcheck https://twitch.tv/somedude" - ], - "Submodule": "StreamNotificationCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".translate", - ".trans" - ], - "Description": "Translates text from the given language to the destination language.", - "Usage": [ - ".translate en fr Hello" - ], - "Submodule": "TranslateCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".autotranslate", - ".at", - ".autotrans" - ], - "Description": "Starts automatic translation of all messages by users who set their `.atl` in this channel. You can set \"del\" parameter to automatically delete all translated user messages.", - "Usage": [ - ".autotranslate", - ".autotranslate del" - ], - "Submodule": "TranslateCommands", - "Module": "Searches", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".autotranslang", - ".atl" - ], - "Description": "Sets your source and target language to be used with `.at`. Specify no parameters to remove previously set value.", - "Usage": [ - ".autotranslang en fr" - ], - "Submodule": "TranslateCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".translangs" - ], - "Description": "Lists the valid languages for translation.", - "Usage": [ - ".translangs" - ], - "Submodule": "TranslateCommands", - "Module": "Searches", - "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" - ], - "Description": "Shows a XKCD comic. Specify no parameters to retrieve a random one. Number parameter will retrieve a specific comic, and \"latest\" will get the latest one.", - "Usage": [ - ".xkcd", - ".xkcd 1400", - ".xkcd latest" - ], - "Submodule": "XkcdCommands", - "Module": "Searches", - "Options": null, - "Requirements": [] - } - ], - "Utility": [ - { - "Aliases": [ - ".say" - ], - "Description": "Make the bot say something, or in other words, make the bot send the message.\nYou can optionally specify the channel where the bot will send the message.\nIf you omit the channel name, it will send the message in the current channel.\nSupports [embeds](https://eb.elliebot.net/)", - "Usage": [ - ".say hi", - ".say #chat hi" - ], - "Submodule": "Utility", - "Module": "Utility", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".whosplaying", - ".whpl" - ], - "Description": "Shows a list of users who are playing the specified game.", - "Usage": [ - ".whosplaying Overwatch" - ], - "Submodule": "Utility", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".inrole" - ], - "Description": "Lists every person from the specified role on this server. You can specify a page before the role to jump to that page. Provide no role to list users who have no roles", - "Usage": [ - ".inrole RoleName", - ".inrole 5 RoleName", - ".inrole" - ], - "Submodule": "Utility", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".checkperms" - ], - "Description": "Checks yours or bot's user-specific permissions on this channel.", - "Usage": [ - ".checkperms me", - ".checkperms bot" - ], - "Submodule": "Utility", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".userid", - ".uid" - ], - "Description": "Shows user ID.", - "Usage": [ - ".userid", - ".userid @Someone" - ], - "Submodule": "Utility", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".roleid", - ".rid" - ], - "Description": "Shows the id of the specified role.", - "Usage": [ - ".roleid Some Role" - ], - "Submodule": "Utility", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".channelid", - ".cid" - ], - "Description": "Shows current channel ID.", - "Usage": [ - ".channelid" - ], - "Submodule": "Utility", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".serverid", - ".sid" - ], - "Description": "Shows current server ID.", - "Usage": [ - ".serverid" - ], - "Submodule": "Utility", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".roles" - ], - "Description": "List roles on this server or roles of a user if specified. Paginated, 20 roles per page.", - "Usage": [ - ".roles 2", - ".roles @Someone" - ], - "Submodule": "Utility", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".channeltopic", - ".ct" - ], - "Description": "Sends current channel's topic as a message.", - "Usage": [ - ".channeltopic" - ], - "Submodule": "Utility", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".stats" - ], - "Description": "Shows some basic stats for Ellie.", - "Usage": [ - ".stats" - ], - "Submodule": "Utility", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".showemojis", - ".se" - ], - "Description": "Shows a name and a link to every SPECIAL emoji in the message.", - "Usage": [ - ".showemojis A message full of SPECIAL emojis" - ], - "Submodule": "Utility", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".emojiadd", - ".ea" - ], - "Description": "Adds the specified emoji to this server.\nYou can specify a name before the emoji to add it under a different name.\nYou can specify a name followed by an image link to add a new emoji from an image.\nYou can omit imageUrl and instead upload the image as an attachment. \nImage size has to be below 256KB.", - "Usage": [ - ".emojiadd :someonesCustomEmoji:", - ".emojiadd MyEmojiName :someonesCustomEmoji:", - ".emojiadd owoNice https://cdn.discordapp.com/emojis/587930873811173386.png?size=128" - ], - "Submodule": "Utility", - "Module": "Utility", - "Options": null, - "Requirements": [ - "ManageEmojisAndStickers Server Permission" - ] - }, - { - "Aliases": [ - ".emojiremove", - ".emojirm", - ".er", - ".ed", - ".emojidel", - ".emojidelete" - ], - "Description": "Removes the specified emoji or emojis from this server.", - "Usage": [ - ".emojiremove :eagleWarrior: :plumedArcher:" - ], - "Submodule": "Utility", - "Module": "Utility", - "Options": null, - "Requirements": [ - "ManageEmojisAndStickers Server Permission" - ] - }, - { - "Aliases": [ - ".stickeradd", - ".sa" - ], - "Description": "Adds the sticker from your message to this server.\nSend the sticker along with this command (in the same message).\nAlternatively you can upload an image along with this command but you have to specify the name.\nThe image must be 300x300 in .png or .apng format and up to 512KB in size.", - "Usage": [ - ".stickeradd", - ".stickeradd name \"description\" tag1 tag2 tagN" - ], - "Submodule": "Utility", - "Module": "Utility", - "Options": null, - "Requirements": [ - "ManageEmojisAndStickers Server Permission" - ] - }, - { - "Aliases": [ - ".serverlist" - ], - "Description": "Lists servers the bot is on with some basic info. 15 per page.", - "Usage": [ - ".serverlist 3" - ], - "Submodule": "Utility", - "Module": "Utility", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".showembed" - ], - "Description": "Prints the json equivalent of the embed of the message specified by its Id.", - "Usage": [ - ".showembed 820022733172121600", - ".showembed #some-channel 820022733172121600" - ], - "Submodule": "Utility", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".savechat" - ], - "Description": "Saves a number of messages to a text file and sends it to you.", - "Usage": [ - ".savechat 150" - ], - "Submodule": "Utility", - "Module": "Utility", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".ping" - ], - "Description": "Ping the bot to see if there are latency issues.", - "Usage": [ - ".ping" - ], - "Submodule": "Utility", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".verboseerror", - ".ve" - ], - "Description": "Toggles or sets whether the bot should print command errors when a command is incorrectly used.", - "Usage": [ - ".verboseerror", - ".verboseerror false" - ], - "Submodule": "Utility", - "Module": "Utility", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".afk" - ], - "Description": "Toggles AFK status for yourself with the specified message. \nIf you don't provide a message it default to a generic one.\nAnyone @ mentioning you in any server will receive the afk message.\nThis will only work if the other user's message starts with the mention.", - "Usage": [ - ".afk" - ], - "Submodule": "Utility", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".eval" - ], - "Description": "Execute arbitrary C# code and (optionally) return a result. Several namespaces are included by default.\nSpecial variables available: \n`self` - Instance of the command group executing the command (this)\n`guild` - Server in which the command is executed\n`channel` - Channel in which the command is executed\n`user` - User executing the command\n`ctx` - Discord.Net command context\n`services` - Ellie's IServiceProvider", - "Usage": [ - ".eval 123 / 4.5f", - ".eval await ctx.OkAsync();", - ".eval await ctx.Response().Confirm(\"uwu\").SendAsync();" - ], - "Submodule": "Utility", - "Module": "Utility", - "Options": null, - "Requirements": [ - "Bot Owner Only", - "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" - ], - "Description": "Ask the bot to do something for you.\nThis will fall back to the chatbot service in case of an error.", - "Usage": [ - ".prompt What's the weather like today?" - ], - "Submodule": "PromptCommands", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".aliasesclear", - ".aliasclear" - ], - "Description": "Deletes all aliases on this server.", - "Usage": [ - ".aliasesclear" - ], - "Submodule": "CommandMapCommands", - "Module": "Utility", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".alias", - ".cmdmap" - ], - "Description": "Create a custom alias for a certain Ellie command. Provide no alias to remove the existing one.", - "Usage": [ - ".alias allin .bf all h" - ], - "Submodule": "CommandMapCommands", - "Module": "Utility", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".aliaslist", - ".cmdmaplist", - ".aliases" - ], - "Description": "Shows the list of currently set aliases. Paginated.", - "Usage": [ - ".aliaslist", - ".aliaslist 3" - ], - "Submodule": "CommandMapCommands", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".calculate", - ".calc" - ], - "Description": "Evaluate a mathematical expression.", - "Usage": [ - ".calculate 1+1" - ], - "Submodule": "CalcCommands", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".calcops" - ], - "Description": "Shows all available operations in the `.calc` command", - "Usage": [ - ".calcops" - ], - "Submodule": "CalcCommands", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".configreload", - ".creload", - ".confreload", - ".crel" - ], - "Description": "Reloads specified configuration", - "Usage": [ - ".configreload bot", - ".configreload gambling" - ], - "Submodule": "ConfigCommands", - "Module": "Utility", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".config", - ".conf" - ], - "Description": "Gets or sets configuration values.\nProvide no arguments to see the list of configs you can edit/view.\nProvide config name to see all properties in that configuration and their values.\nProvide config name and property name to see that property's description and value.\nProvide config name, property name and value to set that property to the new value.", - "Usage": [ - ".config", - ".config bot", - ".config bot color.ok", - ".config bot color.ok ff0000" - ], - "Submodule": "ConfigCommands", - "Module": "Utility", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".ga start" - ], - "Description": "Starts a giveaway. Specify the duration (between 1 minute and 30 days) followed by the prize.", - "Usage": [ - ".ga start 12h We are giving away one copy of our latest album!", - ".ga start 15m Quick giveaway for a free course!", - ".ga start 1d Join to win 1000$!" - ], - "Submodule": "Giveaways", - "Module": "Utility", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".ga end" - ], - "Description": "Prematurely ends a giveaway and selects a winner. Specify the ID of the giveaway to end.", - "Usage": [ - ".ga end ab3" - ], - "Submodule": "Giveaways", - "Module": "Utility", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".ga reroll" - ], - "Description": "Rerolls a giveaway. Specify the ID of the giveaway to reroll. This is only active within 24h after the giveaway has ended or until the bot restarts.", - "Usage": [ - ".ga reroll cd3" - ], - "Submodule": "Giveaways", - "Module": "Utility", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".ga cancel" - ], - "Description": "Cancels a giveaway. Specify the ID of the giveaway to cancel. The winner will not be chosen.", - "Usage": [ - ".ga cancel ab3" - ], - "Submodule": "Giveaways", - "Module": "Utility", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".ga list" - ], - "Description": "Lists all active giveaways.", - "Usage": [ - ".ga list" - ], - "Submodule": "Giveaways", - "Module": "Utility", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".serverinfo", - ".sinfo" - ], - "Description": "Shows info about the server with the specified ID. The bot has to be on that server. If no server is supplied, it defaults to current one.", - "Usage": [ - ".serverinfo 123123132233" - ], - "Submodule": "InfoCommands", - "Module": "Utility", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".channelinfo", - ".cinfo" - ], - "Description": "Shows info about the channel. If no channel is supplied, it defaults to current one.", - "Usage": [ - ".channelinfo #some-channel" - ], - "Submodule": "InfoCommands", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".roleinfo", - ".rinfo" - ], - "Description": "Shows info about the specified role.", - "Usage": [ - ".roleinfo Gamers" - ], - "Submodule": "InfoCommands", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".userinfo", - ".uinfo" - ], - "Description": "Shows info about the user. If no user is supplied, it defaults a user running the command.", - "Usage": [ - ".userinfo @SomeUser" - ], - "Submodule": "InfoCommands", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".invitecreate", - ".invcr" - ], - "Description": "Creates a new invite which has infinite max uses and never expires.", - "Usage": [ - ".invitecreate" - ], - "Submodule": "InviteCommands", - "Module": "Utility", - "Options": [ - "`--max-uses` (`-m`) Maximum number of times the invite can be used. Default 0 (never). ", - "`--unique` (`-u`) Not setting this flag will result in bot getting the existing invite with the same settings if it exists, instead of creating a new one. ", - "`--temporary` (`-t`) If this flag is set, the user will be kicked from the guild once they close their client. ", - "`--expire` (`-e`) Time in seconds to expire the invite. Default 0 (no expiry). " - ], - "Requirements": [ - "CreateInstantInvite Channel Permission" - ] - }, - { - "Aliases": [ - ".invitelist", - ".invlist", - ".invlst" - ], - "Description": "Lists all invites for this channel. Paginated with 9 per page.", - "Usage": [ - ".invitelist", - ".invitelist 3" - ], - "Submodule": "InviteCommands", - "Module": "Utility", - "Options": null, - "Requirements": [ - "ManageChannels Channel Permission" - ] - }, - { - "Aliases": [ - ".invitedelete", - ".invrm", - ".invdel" - ], - "Description": "Deletes an invite on the specified index. Use `.invitelist` to see the list of invites.", - "Usage": [ - ".invitedelete 2" - ], - "Submodule": "InviteCommands", - "Module": "Utility", - "Options": null, - "Requirements": [ - "ManageChannels Channel Permission" - ] - }, - { - "Aliases": [ - ".quotelist", - ".qli", - ".quli", - ".qulist" - ], - "Description": "Lists all quotes on the server ordered alphabetically or by ID. 15 Per page.", - "Usage": [ - ".quotelist 3", - ".quotelist 3 id" - ], - "Submodule": "QuoteCommands", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".quoteprint", - ".qp", - ".qup", - "...", - ".qprint" - ], - "Description": "Prints a random quote with a specified name.", - "Usage": [ - ".quoteprint abc" - ], - "Submodule": "QuoteCommands", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".quoteshow", - ".qsh", - ".qshow", - ".qushow" - ], - "Description": "Shows information about a quote with the specified ID.", - "Usage": [ - ".quoteshow 123" - ], - "Submodule": "QuoteCommands", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "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", - "Usage": [ - ".quotesearch \"find this long text\"", - ".quotesearch AuthorName", - ".quotesearch keyword some text", - ".quotesearch keyword AuthorName" - ], - "Submodule": "QuoteCommands", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".quoteid", - ".qid" - ], - "Description": "-| Displays the quote with the specified ID number.", - "Usage": [ - ".quoteid 123456" - ], - "Submodule": "QuoteCommands", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".quoteadd", - ".qa", - ".qadd", - ".quadd", - ".." - ], - "Description": "Adds a new quote with the specified name and message.", - "Usage": [ - ".quoteadd sayhi Hi" - ], - "Submodule": "QuoteCommands", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".quoteedit", - ".qe", - ".que", - ".qedit" - ], - "Description": "Edits a quote with the specified ID.", - "Usage": [ - ".quoteedit 55 This is the new response." - ], - "Submodule": "QuoteCommands", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".quotedelete", - ".qd", - ".qdel", - ".qdelete" - ], - "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": [ - ".quotedelete 123456" - ], - "Submodule": "QuoteCommands", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".quotedeleteauthor", - ".qda", - ".qdelauth" - ], - "Description": "Deletes all quotes by the specified author. If the author is not you, then ManageMessage server permission is required.", - "Usage": [ - ".quotedeleteauthor @QuoteSpammer" - ], - "Submodule": "QuoteCommands", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".quotesdeleteall", - ".qdall", - ".qdeleteall" - ], - "Description": "Deletes all quotes with the specified keyword.", - "Usage": [ - ".quotesdeleteall kek" - ], - "Submodule": "QuoteCommands", - "Module": "Utility", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".quotesexport", - ".qex", - ".qexport" - ], - "Description": "Exports quotes from the current server into a .yml file", - "Usage": [ - ".quotesexport" - ], - "Submodule": "QuoteCommands", - "Module": "Utility", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "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.", - "Usage": [ - ".quotesimport " - ], - "Submodule": "QuoteCommands", - "Module": "Utility", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".remind" - ], - "Description": "Sets a reminder which will be sent to you or to the targeted channel after certain amount of time (max 2 months).\nFirst parameter is `me` / `here` / 'channelname'\nSecond parameter is time in a descending order (mo>w>d>h>m) example: 1w5d3h10m.\nThird parameter is a (multiword) message.\nRequires ManageMessages server permission if you're targeting a different channel.", - "Usage": [ - ".remind me 1d5h Do something", - ".remind #general 1m Start now!" - ], - "Submodule": "RemindCommands", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".remindlist", - ".remindl", - ".remindlst" - ], - "Description": "Lists all reminders you created. You can specify 'server' option if you're an Administrator to list all reminders created on this server. Paginated.", - "Usage": [ - ".remindlist 1", - ".remindlist server 2" - ], - "Submodule": "RemindCommands", - "Module": "Utility", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".reminddelete", - ".remindrm", - ".reminddel" - ], - "Description": "Deletes a reminder on the specified index. You can specify 'server' option if you're an Administrator, and you want to delete a reminder on this server created by someone else. ", - "Usage": [ - ".reminddelete 3", - ".reminddelete server 2" - ], - "Submodule": "RemindCommands", - "Module": "Utility", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".repeatskip", - ".repski" - ], - "Description": "Specify a repeater's ID to toggle whether the next trigger of the repeater will be skipped.\nThis setting is not stored in the database and will get reset if the bot is restarted.", - "Usage": [ - ".repeatskip 3" - ], - "Submodule": "RepeatCommands", - "Module": "Utility", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".repeatinvoke", - ".repinv" - ], - "Description": "Immediately post the repeat message on a certain index and restarts its timer.", - "Usage": [ - ".repeatinvoke 1" - ], - "Submodule": "RepeatCommands", - "Module": "Utility", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".repeatremove", - ".reprm" - ], - "Description": "Removes a repeating message by index. Use `.replst` to see indexes.", - "Usage": [ - ".repeatremove 2" - ], - "Submodule": "RepeatCommands", - "Module": "Utility", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".repeatredun", - ".repred" - ], - "Description": "Specify repeater's index (Use `.replst` to see indexes) to toggle whether the message should be reposted if the last message in the channel is the same repeater's message.\nThis is useful if you want to remind everyone to be nice every so often, but don't want to have the bot spam the channel. This is NOT useful if you want to periodically ping someone.", - "Usage": [ - ".repeatredun 1" - ], - "Submodule": "RepeatCommands", - "Module": "Utility", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".repeat" - ], - "Description": "Repeat a message once per specified time increment in the current channel. \nYou can specify a different channel as the first argument instead.\nYou can also specify time of day for the message to be repeated daily (make sure you've set your server's `.timezone`). \nIf you specify time of day, you can still override the default daily interval with your own interval. \nYou can have up to 5 repeating messages on one server in total.", - "Usage": [ - ".repeat Hello there", - ".repeat #other-channel hello there", - ".repeat 1h5m Hello @erryone", - ".repeat 10:00 Daily have a nice day! This will execute once every 24h.", - ".repeat #other-channel 10:00 Daily have a nice day! This will execute once every 24h.", - ".repeat 21:00 30m Starting at 21 and every 30 minutes after that i will send this message!" - ], - "Submodule": "RepeatCommands", - "Module": "Utility", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".repeatlist", - ".replst", - ".replist", - ".repli" - ], - "Description": "Lists currently repeating messages and their indexes.", - "Usage": [ - ".repeatlist" - ], - "Submodule": "RepeatCommands", - "Module": "Utility", - "Options": null, - "Requirements": [ - "ManageMessages Server Permission" - ] - }, - { - "Aliases": [ - ".streamrole" - ], - "Description": "Sets a role which is monitored for streamers (FromRole), and a role to add if a user from 'FromRole' is streaming (AddRole). When a user from 'FromRole' starts streaming, they will receive an 'AddRole'. You can only have 1 Stream Role per server. Provide no parameters to disable", - "Usage": [ - ".streamrole \"Eligible Streamers\" \"Featured Streams\"" - ], - "Submodule": "StreamRoleCommands", - "Module": "Utility", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".streamrolekeyword", - ".srkw" - ], - "Description": "Sets keyword which is required in the stream's title in order for the streamrole to apply. Provide no keyword in order to reset.", - "Usage": [ - ".streamrolekeyword", - ".streamrolekeyword PUBG" - ], - "Submodule": "StreamRoleCommands", - "Module": "Utility", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".streamroleblacklist", - ".srbl" - ], - "Description": "Adds or removes a blacklisted user. Blacklisted users will never receive the stream role.", - "Usage": [ - ".streamroleblacklist add @Someone#1234", - ".streamroleblacklist rem @Someone#1234" - ], - "Submodule": "StreamRoleCommands", - "Module": "Utility", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".streamrolewhitelist", - ".srwl" - ], - "Description": "Adds or removes a whitelisted user. Whitelisted users will receive the stream role even if they don't have the specified keyword in their stream title.", - "Usage": [ - ".streamrolewhitelist add @Someone#1234", - ".streamrolewhitelist rem @Someone#1234" - ], - "Submodule": "StreamRoleCommands", - "Module": "Utility", - "Options": null, - "Requirements": [ - "ManageRoles Server Permission" - ] - }, - { - "Aliases": [ - ".todo add", - ".todo a" - ], - "Description": "Adds a new todo.", - "Usage": [ - ".todo add I need to do this" - ], - "Submodule": "todo", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".todo edit", - ".todo change" - ], - "Description": "Edits a todo with the specified ID.", - "Usage": [ - ".todo edit abc This is an updated entry" - ], - "Submodule": "todo", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".todo list", - ".todo ls" - ], - "Description": "Lists all todos.", - "Usage": [ - ".todo list" - ], - "Submodule": "todo", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".todo show", - ".todo sh", - ".todo see" - ], - "Description": "Shows the text of the todo with the specified ID.", - "Usage": [ - ".todo show 4a" - ], - "Submodule": "todo", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".todo complete", - ".todo done", - ".todo finish" - ], - "Description": "Marks a todo with the specified ID as done.", - "Usage": [ - ".todo complete 4a" - ], - "Submodule": "todo", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".todo delete", - ".todo del", - ".todo remove", - ".todo rm" - ], - "Description": "Deletes a todo with the specified ID.", - "Usage": [ - ".todo delete abc" - ], - "Submodule": "todo", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".todo clear", - ".todo clr", - ".todo cls" - ], - "Description": "Deletes all unarchived todos.", - "Usage": [ - ".todo clear" - ], - "Submodule": "todo", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".todo archive add", - ".todo archive create", - ".todo archive new" - ], - "Description": "Creates a new archive with the specified name using current todos.", - "Usage": [ - ".todo archive add Day 1" - ], - "Submodule": "archive", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".todo archive list", - ".todo archive ls" - ], - "Description": "Lists all archived todo lists.", - "Usage": [ - ".todo archive list" - ], - "Submodule": "archive", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".todo archive show" - ], - "Description": "Shows the archived todo list with the specified ID.", - "Usage": [ - ".todo archive show 3c" - ], - "Submodule": "archive", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".todo archive delete", - ".todo archive del", - ".todo archive remove", - ".todo archive rm" - ], - "Description": "Deletes the archived todo list with the specified ID.", - "Usage": [ - ".todo archive delete 99" - ], - "Submodule": "archive", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".convertlist" - ], - "Description": "List of the convertible dimensions and currencies.", - "Usage": [ - ".convertlist" - ], - "Submodule": "UnitConverterCommands", - "Module": "Utility", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".convert" - ], - "Description": "Convert quantities. Use `.convertlist` to see supported dimensions and currencies.", - "Usage": [ - ".convert m km 1000" - ], - "Submodule": "UnitConverterCommands", - "Module": "Utility", - "Options": null, - "Requirements": [] - } - ], - "Xp": [ - { - "Aliases": [ - ".experience", - ".xp" - ], - "Description": "Shows your xp stats. Specify the user to show that user's stats instead.", - "Usage": [ - ".experience", - ".experience @someguy" - ], - "Submodule": "Xp", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".xpnotify", - ".xpn" - ], - "Description": "Sets how the bot should notify you when you get a `server` or `global` level. This is a personal setting and affects only how you receive Global or Server level-up notifications. You can set `dm` (for the bot to send you a direct message), `channel` (to get notified in the channel you sent the last message in) or `none` to disable.", - "Usage": [ - ".xpnotify global dm", - ".xpnotify server channel" - ], - "Submodule": "Xp", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".xpexclude", - ".xpex" - ], - "Description": "Exclude a channel, role or current server from the xp system.", - "Usage": [ - ".xpexclude Role Excluded-Role", - ".xpexclude Server" - ], - "Submodule": "Xp", - "Module": "Xp", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".xpexclusionlist", - ".xpexl" - ], - "Description": "Shows the roles and channels excluded from the XP system on this server, as well as whether the whole server is excluded.", - "Usage": [ - ".xpexclusionlist" - ], - "Submodule": "Xp", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".xpleaderboard", - ".xplb" - ], - "Description": "Shows current server's xp leaderboard.", - "Usage": [ - ".xpleaderboard" - ], - "Submodule": "Xp", - "Module": "Xp", - "Options": [ - "`--clean` (`-c`) Only show users who are on the server. " - ], - "Requirements": [] - }, - { - "Aliases": [ - ".xpgleaderboard", - ".xpglb" - ], - "Description": "Shows the global xp leaderboard.", - "Usage": [ - ".xpgleaderboard" - ], - "Submodule": "Xp", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".xpadd" - ], - "Description": "Adds server XP to a single user or all users role on this server. This does not affect their global ranking. You can use negative values.", - "Usage": [ - ".xpadd 100 @Someone", - ".xpadd 500 SomeRoleName" - ], - "Submodule": "Xp", - "Module": "Xp", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".xptempreload", - ".xptr" - ], - "Description": "Reloads the xp template file. Xp template file allows you to customize the position and color of elements on the `.xp` card.", - "Usage": [ - ".xptempreload" - ], - "Submodule": "Xp", - "Module": "Xp", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - }, - { - "Aliases": [ - ".xpreset" - ], - "Description": "Resets specified user's XP, or the XP of all users in the server. You can't reverse this action.", - "Usage": [ - ".xpreset @Someone", - ".xpreset" - ], - "Submodule": "Xp", - "Module": "Xp", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".xpshop" - ], - "Description": "Access the xp shop (if enabled). You can purchase either xp card frames or backgrounds. You can optionally provide a page number", - "Usage": [ - ".xpshop bgs", - ".xpshop frames", - ".xpshop bgs 3" - ], - "Submodule": "Xp", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".xpshopbuy" - ], - "Description": "Buy an item from the xp shop by specifying the type and the key of the item.", - "Usage": [ - ".xpshopbuy bg open_sea", - ".xpshopbuy fr gold" - ], - "Submodule": "Xp", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".xpshopuse" - ], - "Description": "Use a previously purchased item from the xp shop by specifying the type and the key of the item.", - "Usage": [ - ".xpshopuse bg synth", - ".xpshopuse fr default" - ], - "Submodule": "Xp", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".clubtransfer" - ], - "Description": "Transfers the ownership of the club to another member of the club.", - "Usage": [ - ".clubtransfer @Someone" - ], - "Submodule": "Club", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".clubadmin" - ], - "Description": "Assigns (or unassigns) staff role to the member of the club. Admins can ban, kick and accept applications.", - "Usage": [ - ".clubadmin @Someone" - ], - "Submodule": "Club", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".clubcreate" - ], - "Description": "Creates a club. You must be at least level 5 and not be in the club already.", - "Usage": [ - ".clubcreate My Brand New Club" - ], - "Submodule": "Club", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".clubicon" - ], - "Description": "Sets the club icon.", - "Usage": [ - ".clubicon https://i.imgur.com/htfDMfU.png" - ], - "Submodule": "Club", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".clubinfo" - ], - "Description": "Shows information about the club.", - "Usage": [ - ".clubinfo My Brand New Club#23" - ], - "Submodule": "Club", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".clubbans" - ], - "Description": "Shows the list of users who have banned from your club. Paginated. You must be club owner to use this command.", - "Usage": [ - ".clubbans 2" - ], - "Submodule": "Club", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".clubapps" - ], - "Description": "Shows the list of users who have applied to your club. Paginated. You must be club owner to use this command.", - "Usage": [ - ".clubapps 2" - ], - "Submodule": "Club", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".clubapply" - ], - "Description": "Apply to join a club. You must meet that club's minimum level requirement, and not be on its ban list.", - "Usage": [ - ".clubapply My Brand New Club#23" - ], - "Submodule": "Club", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".clubaccept" - ], - "Description": "Accept a user who applied to your club.", - "Usage": [ - ".clubaccept user#1337" - ], - "Submodule": "Club", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".clubreject" - ], - "Description": "Reject a user who applied to your club.", - "Usage": [ - ".clubreject user#1337" - ], - "Submodule": "Club", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".clubleave" - ], - "Description": "Leaves the club you're currently in.", - "Usage": [ - ".clubleave" - ], - "Submodule": "Club", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".clubkick" - ], - "Description": "Kicks the user from the club. You must be the club owner. They will be able to apply again.", - "Usage": [ - ".clubkick user#1337" - ], - "Submodule": "Club", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".clubban" - ], - "Description": "Bans the user from the club. You must be the club owner. They will not be able to apply again.", - "Usage": [ - ".clubban user#1337" - ], - "Submodule": "Club", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".clubunban" - ], - "Description": "Unbans the previously banned user from the club. You must be the club owner.", - "Usage": [ - ".clubunban user#1337" - ], - "Submodule": "Club", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".clubdesc" - ], - "Description": "Sets the club description. Maximum 150 characters. Club owner only.", - "Usage": [ - ".clubdesc This is the best club please join." - ], - "Submodule": "Club", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".clubdisband" - ], - "Description": "Disbands the club you're the owner of. This action is irreversible.", - "Usage": [ - ".clubdisband" - ], - "Submodule": "Club", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".clublb", - ".clubs" - ], - "Description": "Shows club rankings on the specified page.", - "Usage": [ - ".clublb 2" - ], - "Submodule": "Club", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".clubrename" - ], - "Description": "Renames your club. Requires you club ownership or club-admin status.", - "Usage": [ - ".clubrename New cool club name" - ], - "Submodule": "Club", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".xprewsreset" - ], - "Description": "Resets all currently set xp level up rewards.", - "Usage": [ - ".xprewsreset" - ], - "Submodule": "XpRewards", - "Module": "Xp", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".xplvluprewards", - ".xprews", - ".xpcrs", - ".xprrs", - ".xprolerewards", - ".xpcurrewards" - ], - "Description": "Shows currently set level up rewards.", - "Usage": [ - ".xplvluprewards" - ], - "Submodule": "XpRewards", - "Module": "Xp", - "Options": null, - "Requirements": [] - }, - { - "Aliases": [ - ".xprolereward", - ".xprr" - ], - "Description": "Add or remove a role from the user who reaches the specified level.\nProvide no action and role name in order to remove the role reward.", - "Usage": [ - ".xprolereward 1 rm Newbie", - ".xprolereward 3 add Social", - ".xprolereward 5 add Member", - ".xprolereward 5" - ], - "Submodule": "XpRewards", - "Module": "Xp", - "Options": null, - "Requirements": [ - "Administrator Server Permission" - ] - }, - { - "Aliases": [ - ".xpcurreward", - ".xpcr" - ], - "Description": "Sets a currency reward on a specified level. Provide no amount in order to remove the reward.", - "Usage": [ - ".xpcurreward 3 50" - ], - "Submodule": "XpRewards", - "Module": "Xp", - "Options": null, - "Requirements": [ - "Bot Owner Only" - ] - } - ] -} \ No newline at end of file diff --git a/src/EllieBot/data/gambling.yml b/src/EllieBot/data/gambling.yml index 2444340..fbcbdc4 100644 --- a/src/EllieBot/data/gambling.yml +++ b/src/EllieBot/data/gambling.yml @@ -1,5 +1,5 @@ # DO NOT CHANGE -version: 12 +version: 7 # 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,14 +125,10 @@ 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 + percent: 0 # How often to decay waifu values, in hours hourInterval: 24 # Minimum waifu price required for the decay to be applied. @@ -274,9 +267,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/games.yml b/src/EllieBot/data/games.yml deleted file mode 100644 index 01f0261..0000000 --- a/src/EllieBot/data/games.yml +++ /dev/null @@ -1,82 +0,0 @@ -# DO NOT CHANGE -version: 5 -# Hangman related settings (.hangman command) -hangman: - # The amount of currency awarded to the winner of a hangman game - currencyReward: 0 -# Trivia related settings (.t command) -trivia: - # The amount of currency awarded to the winner of the trivia game. - currencyReward: 0 - # Users won't be able to start trivia games which have - # a smaller win requirement than the one specified by this setting. - minimumWinReq: 1 -# List of responses for the .8ball command. A random one will be selected every time -eightBallResponses: - - Most definitely yes. - - For sure. - - Totally! - - Of course! - - As I see it, yes. - - My sources say yes. - - Yes. - - Most likely. - - Perhaps... - - Maybe... - - Hm, not sure. - - It is uncertain. - - Ask me again later. - - Don't count on it. - - Probably not. - - Very doubtful. - - Most likely no. - - Nope. - - No. - - My sources say no. - - Don't even think about it. - - Definitely no. - - NO - It may cause disease contraction! -# List of animals which will be used for the animal race game (.race) -raceAnimals: - - icon: "🐼" - name: Panda - - icon: "🐻" - name: Bear - - icon: "🐧" - name: Pengu - - icon: "🐨" - name: Koala - - icon: "🐬" - name: Dolphin - - icon: "🐞" - name: Ladybird - - icon: "🦀" - name: Crab - - icon: "🦄" - name: Unicorn -# Which chatbot API should bot use. -# 'cleverbot' - bot will use Cleverbot API. -# 'openai' - bot will use OpenAi API -chatBot: OpenAi -chatGpt: - # Url to any openai api compatible url. - # Make sure to modify the modelName appropriately - # DO NOT add /v1/chat/completions suffix to the url - apiUrl: https://api.openai.com - # Which GPT Model should bot use. - # gpt-3.5-turbo - cheapest - # gpt-4o - more expensive, higher quality - # - # If you are using another openai compatible api, you may use any of the models supported by that api - modelName: gpt-3.5-turbo - # How should the chatbot behave, what's its personality? - # This will be sent as a system message. - # Usage of this counts towards the max tokens. - personalityPrompt: You are a chat bot willing to have a conversation with anyone about anything. - # The maximum number of messages in a conversation that can be remembered. - # This will increase the number of tokens used. - chatHistory: 5 - # The maximum number of tokens to use per OpenAi API call - maxTokens: 100 - # The minimum number of tokens to use per GPT API call, such that chat history is removed to make room. - minTokens: 30 diff --git a/src/EllieBot/data/hangman/countries.yml b/src/EllieBot/data/hangman/countries.yml index 249408d..5899c5d 100644 --- a/src/EllieBot/data/hangman/countries.yml +++ b/src/EllieBot/data/hangman/countries.yml @@ -140,13 +140,13 @@ imageUrl: https://cdn.nadeko.bot/flags/gt-flag.gif - word: Guinea imageUrl: https://cdn.nadeko.bot/flags/gv-flag.gif -- word: Guinea Bissau +- word: Guinea-Bissau imageUrl: https://cdn.nadeko.bot/flags/pu-flag.gif - word: Guyana imageUrl: https://cdn.nadeko.bot/flags/gy-flag.gif - word: Haiti imageUrl: https://cdn.nadeko.bot/flags/ha-flag.gif -- word: Vatican +- word: Holy See imageUrl: https://cdn.nadeko.bot/flags/vt-flag.gif - word: Honduras imageUrl: https://cdn.nadeko.bot/flags/ho-flag.gif @@ -184,7 +184,7 @@ imageUrl: https://cdn.nadeko.bot/flags/ku-flag.gif - word: Kyrgyzstan imageUrl: https://cdn.nadeko.bot/flags/kg-flag.gif -- word: Lao People's Democratic Republic +- word: Laos imageUrl: https://cdn.nadeko.bot/flags/la-flag.gif - word: Latvia imageUrl: https://cdn.nadeko.bot/flags/lg-flag.gif @@ -282,7 +282,7 @@ imageUrl: https://cdn.nadeko.bot/flags/qa-flag.gif - word: Romania imageUrl: https://cdn.nadeko.bot/flags/ro-flag.gif -- word: Russian Federation +- word: Russia imageUrl: https://cdn.nadeko.bot/flags/rs-flag.gif - word: Rwanda imageUrl: https://cdn.nadeko.bot/flags/rw-flag.gif @@ -318,7 +318,7 @@ imageUrl: https://cdn.nadeko.bot/flags/so-flag.gif - word: South Africa imageUrl: https://cdn.nadeko.bot/flags/sf-flag.gif -- word: Republic of Korea +- word: South Korea imageUrl: https://cdn.nadeko.bot/flags/ks-flag.gif - word: South Sudan imageUrl: https://cdn.nadeko.bot/flags/od-flag.gif @@ -326,9 +326,9 @@ imageUrl: https://cdn.nadeko.bot/flags/sp-flag.gif - word: Sri Lanka imageUrl: https://cdn.nadeko.bot/flags/ce-flag.gif -- word: Saint Vincent and the Grenadines +- word: St. Vincent Grenadines imageUrl: https://cdn.nadeko.bot/flags/vc-flag.gif -- word: Palestine +- word: State of Palestine imageUrl: https://cdn.nadeko.bot/flags/palestine-flag.gif - word: Sudan imageUrl: https://cdn.nadeko.bot/flags/su-flag.gif @@ -338,11 +338,11 @@ imageUrl: https://cdn.nadeko.bot/flags/sw-flag.gif - word: Switzerland imageUrl: https://cdn.nadeko.bot/flags/sz-flag.gif -- word: Syrian Arab Republic +- word: Syria imageUrl: https://cdn.nadeko.bot/flags/sy-flag.gif - word: Tajikistan imageUrl: https://cdn.nadeko.bot/flags/ti-flag.gif -- word: United Republic of Tanzania +- word: Tanzania imageUrl: https://cdn.nadeko.bot/flags/tz-flag.gif - word: Thailand imageUrl: https://cdn.nadeko.bot/flags/th-flag.gif @@ -380,7 +380,7 @@ imageUrl: https://cdn.nadeko.bot/flags/nh-flag.gif - word: Venezuela imageUrl: https://cdn.nadeko.bot/flags/ve-flag.gif -- word: Viet Nam +- word: Vietnam imageUrl: https://cdn.nadeko.bot/flags/vm-flag.gif - word: Yemen imageUrl: https://cdn.nadeko.bot/flags/ym-flag.gif diff --git a/src/EllieBot/data/images.yml b/src/EllieBot/data/images.yml index d3f3d77..73ea5e6 100644 --- a/src/EllieBot/data/images.yml +++ b/src/EllieBot/data/images.yml @@ -1,5 +1,5 @@ # DO NOT CHANGE -version: 6 +version: 4 coins: heads: - https://cdn.nadeko.bot/coins/heads3.png @@ -20,15 +20,20 @@ dice: - https://cdn.nadeko.bot/other/dice/7.png - https://cdn.nadeko.bot/other/dice/8.png - https://cdn.nadeko.bot/other/dice/9.png +rategirl: + matrix: https://cdn.nadeko.bot/other/rategirl/matrix.png + dot: https://cdn.nadeko.bot/other/rategirl/dot.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 deleted file mode 100644 index fe3258f..0000000 --- a/src/EllieBot/data/marmalades/marmalade.yml +++ /dev/null @@ -1,4 +0,0 @@ -# DO NOT CHANGE -version: 1 -# List of marmalades automatically loaded at startup -loaded: [] diff --git a/src/EllieBot/data/patron.yml b/src/EllieBot/data/patron.yml index 632a3e6..6485e1c 100644 --- a/src/EllieBot/data/patron.yml +++ b/src/EllieBot/data/patron.yml @@ -1,56 +1,69 @@ # DO NOT CHANGE -version: 3 +version: 2 # Whether the patronage feature is enabled isEnabled: false -# Who can do how much of what -limits: - 100: - ChatBot: - quota: 50000000 - quotaPeriod: PerMonth - ReactionRole: - quota: -1 - quotaPeriod: Total - Prune: - quota: -1 - quotaPeriod: PerDay - 50: - ChatBot: - quota: 20000000 - quotaPeriod: PerMonth - ReactionRole: - quota: -1 - quotaPeriod: Total - Prune: - quota: -1 - quotaPeriod: PerDay - 20: - ChatBot: - quota: 6500000 - quotaPeriod: PerMonth - ReactionRole: - quota: -1 - quotaPeriod: Total - Prune: - quota: 20 - quotaPeriod: PerDay - 10: - ChatBot: - quota: 2500000 - quotaPeriod: PerMonth - ReactionRole: - quota: 50 - quotaPeriod: Total - Prune: - quota: 5 - quotaPeriod: PerDay - 5: - ChatBot: - quota: 1000000 - quotaPeriod: PerMonth - ReactionRole: - quota: 25 - quotaPeriod: Total - Prune: - quota: 2 - quotaPeriod: PerDay +# List of patron only features and relevant quota data +quotas: +# Dictionary of feature names with their respective limits. Set to null for unlimited + features: + timely:extra_percent: + V: 10 + X: 22 + XX: 50 + L: 150 + C: 350 + rero:max_count: + V: 25 + X: 50 + cleverbot:response: + V: -20 + X: 5000 + XX: 12000 + L: 35000 + C: 100000 + # Dictionary of commands with their respective quota data + commands: + cleverbot: + V: + prune: + X: + PerHour: 1 + XX: + PerHour: 3 + google: + V: + PerDay: 15 + X: + PerDay: 30 + XX: + PerDay: 60 + L: + PerDay: 150 + C: + PerDay: 300 + image: + V: + PerDay: 15 + X: + PerDay: 30 + XX: + PerDay: 60 + L: + PerDay: 150 + C: + PerDay: 300 + youtube: + V: + PerDay: 25 + X: + PerDay: 50 + XX: + PerDay: 100 + L: + PerDay: 250 + C: + PerDay: 500 + # Dictionary of groups with their respective quota data + groups: {} + # Dictionary of modules with their respective quota data + modules: {} 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..d64534e 100644 --- a/src/EllieBot/data/strings/commands/commands.en-US.yml +++ b/src/EllieBot/data/strings/commands/commands.en-US.yml @@ -1,70 +1,64 @@ h: - desc: |- - Shows help for a single command. - Command help contains instructions on how to use the command with examples and a list of parameters. - DMs you helpful links if no parameters are specified. + desc: Either shows a help for a single command, or DMs you help link if no parameters are specified. ex: - '{0}cmds' - '' params: - - com: - desc: "The command that help is being requested for." - fail: desc: "Fallback parameter if the command is not found." + - com: + desc: "The command information that the help is being requested for." gencmdlist: - desc: Generates a json of the commands list and sends it to the chat. + desc: Generates the command list and sends it to the chat. Optionally also uploads it to DO spaces (not supported). ex: - '' params: - - { } + - {} donate: - desc: Provides instructions for helping the project financially. + desc: Instructions for helping the project financially. ex: - '' params: - - { } + - {} modules: - desc: |- - List all of the bot's modules. - Each module contains commands that you can use. + desc: Lists all bot modules. ex: - '' params: - page: - desc: "The page number to display in the list of modules." + desc: "The number of the page to display in the list of bot modules." commands: - desc: |- - List all of the bot's commands in the specified module. - You can either specify the full name or only the first few letters of the module name. - Specifying no module will show the list of modules instead. + desc: List all of the bot's commands from the specified module. You can either specify the full name or only the first few letters of the module name. Specifying no module will show the list of modules instead. ex: - Admin - Admin --view 1 - '' params: - module: - desc: "The name of the module to retrieve commands from." + desc: "The name of a module to retrieve command information for." params: - desc: "How to display the list of commands." + desc: "The names of one or more modules to retrieve commands from, allowing for partial matching and optional omission." greetdel: - desc: Sets the time it takes (in seconds) for greet messages to be auto-deleted. Set it to `0` to disable automatic deletion. + desc: Sets the time it takes (in seconds) for greet messages to be auto-deleted. Set it to 0 to disable automatic deletion. ex: - 0 - 30 params: - timer: - desc: "The amount of seconds before greeting messages are automatically deleted." + desc: "The amount of time before greeting messages are automatically deleted from the chat." greet: desc: Toggles announcements on the current channel when someone joins the server. ex: - '' params: - - { } + - {} greetmsg: desc: |- - Sets a new join announcement message which will be shown in the current channel. - Using this command with no message will show the current greet message. - Supports [placeholders](https://docs.elliebot.net/ellie/features/placeholders/) and [embeds](https://eb.elliebot.net/) + Sets a new join announcement message which will be shown in the server's channel. + Type `%user.mention%` if you want to mention the new member. + Full list of placeholders can be found here + Using it with no message will show the current greet message. + You can use embed json from instead of a regular text, if you want the message to be embedded. ex: - Welcome, %user.mention%. params: @@ -75,17 +69,19 @@ bye: ex: - '' params: - - { } + - {} byemsg: desc: |- - Sets a new leave announcement message which will be shown in the current channel. + Sets a new leave announcement message. + Type `%user.mention%` if you want to show the name the user who left. + Full list of placeholders can be found here Using this command with no message will show the current bye message. - Supports [placeholders](https://docs.elliebot.net/ellie/features/placeholders/) and [embeds](https://eb.elliebot.net/) + You can use embed json from instead of a regular text, if you want the message to be embedded. ex: - - '%user.name% has left.' + - '%user.mention% has left.' params: - text: - desc: "The new announcement message to be displayed when a user leaves the server." + desc: "The user's farewell message to display when they leave the chat." byedel: desc: Sets the time it takes (in seconds) for bye messages to be auto-deleted. Set it to `0` to disable automatic deletion. ex: @@ -93,13 +89,13 @@ byedel: - 30 params: - timer: - desc: "The amount of seconds before goodbye messages are automatically deleted." + desc: "The amount of time before a bye message is automatically deleted." greetdm: - desc: Toggles whether greet messages will be sent in a DM (This is separate from `{0}greet` - you can have both, one or neither enabled). + desc: Toggles whether the greet messages will be sent in a DM (This is separate from greet - you can have both, any or neither enabled). ex: - '' params: - - { } + - {} greettest: desc: Sends the greet message in the current channel as if you just joined the server. You can optionally specify a different user. ex: @@ -107,17 +103,7 @@ greettest: - '@SomeoneElse' params: - user: - desc: "The user to impersonate when sending the greeting, defaulting to yourself if not specified." -boosttest: - desc: |- - Sends the boost message in the current channel as if you just boosted the server. - You can optionally specify a different user. - ex: - - '' - - '@SomeoneElse' - params: - - user: - desc: "The user to impersonate when sending the boost message, defaulting to yourself if not specified." + desc: "The user to impersonate when sending the greeting, or null for the bot's own account." greetdmtest: desc: Sends the greet direct message to you as if you just joined the server. You can optionally specify a different user. ex: @@ -125,7 +111,7 @@ greetdmtest: - '@SomeoneElse' params: - user: - desc: "The recipient of the greeting, defaulting to yourself if not specified." + desc: "The recipient of the greeting, which defaults to the caller if not specified." byetest: desc: Sends the bye message in the current channel as if you just left the server. You can optionally specify a different user. ex: @@ -133,23 +119,25 @@ byetest: - '@SomeoneElse' params: - user: - desc: "The user to impersonate when sending the farewell, defaulting to yourself if not specified." + desc: "The user who is leaving the channel, or whose account is being represented as leaving the channel." boost: desc: Toggles announcements on the current channel when someone boosts the server. ex: - '' params: - - { } + - {} boostmsg: desc: |- - Sets a new boost announcement message which will be shown in the current channel. + Sets a new boost announcement message. + Type `%user.mention%` if you want to show the name the user who left. + Full list of placeholders can be found here Using this command with no message will show the current boost message. - Supports [placeholders](https://docs.elliebot.net/ellie/features/placeholders/) and [embeds](https://eb.elliebot.net/) + You can use embed json from instead of a regular text, if you want the message to be embedded. ex: - '%user.mention% has boosted the server!!!' params: - text: - desc: "The new announcement message to be displayed when a user boosts the server." + desc: "The text to set as the new announcement message." boostdel: desc: Sets the time it takes (in seconds) for boost messages to be auto-deleted. Set it to `0` to disable automatic deletion. ex: @@ -157,7 +145,7 @@ boostdel: - 30 params: - timer: - desc: "The amount of seconds before boost messages are automatically deleted." + desc: "The amount of time before boost messages are automatically deleted." logserver: desc: Enables or Disables ALL log events. If enabled, all log events will log to this channel. ex: @@ -165,46 +153,46 @@ logserver: - disable params: - action: - desc: "The type of action to take." + desc: "The type of action to take on the log event." logignore: - desc: Toggles whether the `{0}log` and `{0}logserver` commands ignore the specified channel or user. Provide no arguments to see the list of currently ignored users and channels. + desc: Toggles whether the `{0}logserver` command ignores the specified channel or user. Provide no arguments to see the list of currently ignored users and channels ex: - '' - '@SomeUser' - '#some-channel' params: - - { } + - {} - target: - desc: "The channel to ignore." + desc: "The channel to ignore or show the list of ignored channels for." - target: - desc: "The user to ignore." + desc: "The user or channel being targeted for logging ignore or inclusion." repeatlist: - desc: Lists currently repeating messages and their indexes. + desc: Shows currently repeating messages and their indexes. ex: - '' params: - - { } + - {} repeatremove: - desc: Removes a repeating message by index. Use `{0}replst` to see indexes. + desc: Removes a repeating message on a specified index. Use `{0}repeatlist` to see indexes. ex: - 2 params: - index: - desc: "The index of the repeating message to be removed." + desc: "The index at which the repeating message should be removed." repeatinvoke: - desc: Immediately post the repeat message on a certain index and restarts its timer. + desc: Immediately shows the repeat message on a certain index and restarts its timer. ex: - 1 params: - index: - desc: "The index of the repeating message to post." + desc: "The index at which to display the repeat message." repeat: desc: |- - Repeat a message once per specified time increment in the current channel. - You can specify a different channel as the first argument instead. - You can also specify time of day for the message to be repeated daily (make sure you've set your server's `{0}timezone`). - If you specify time of day, you can still override the default daily interval with your own interval. - You can have up to 5 repeating messages on one server in total. + Repeat a message once every specified amount of time in the current channel. + You can specify a different channel as the first argument. + You can instead specify time of day for the message to be repeated daily (make sure you've set your server's timezone). + If you've specified time of day, you can still override the default daily interval with your own interval. + You can have up to 5 repeating messages on the server in total. ex: - Hello there - '#other-channel hello there' @@ -214,100 +202,94 @@ repeat: - '21:00 30m Starting at 21 and every 30 minutes after that i will send this message!' params: - message: - desc: "The text to be repeated." + desc: "The text to be repeated at the specified intervals or times." - channel: desc: "The channel where the message will be repeated." message: - desc: "The text to be repeated." + desc: "The text to be repeated at the specified intervals or times." - interval: desc: "The amount of time between each repetition." message: - desc: "The text to be repeated." + desc: "The text to be repeated at the specified intervals or times." - channel: desc: "The channel where the message will be sent." interval: desc: "The amount of time between each repetition." message: - desc: "The text to be repeated." + desc: "The text to be repeated at the specified intervals or times." - timeOfDay: - desc: "The time at which the message should begin being repeated." + desc: "The time at which the message should be repeated, either once every specified amount of time or at a specific time of day." message: - desc: "The text to be repeated." + desc: "The text to be repeated at the specified intervals or times." - channel: desc: "The channel where the message will be repeated." timeOfDay: - desc: "The time at which the message should begin being repeated." + desc: "The time at which the message should be repeated, either once every specified amount of time or at a specific time of day." message: - desc: "The text to be repeated." + desc: "The text to be repeated at the specified intervals or times." - timeOfDay: - desc: "The time at which the message should begin being repeated." + desc: "The time at which the message should be repeated, either once every specified amount of time or at a specific time of day." interval: desc: "The amount of time between each repetition." message: - desc: "The text to be repeated." + desc: "The text to be repeated at the specified intervals or times." - channel: desc: "The channel where the message will be repeated." timeOfDay: - desc: "The time at which the message should begin being repeated." + desc: "The time at which the message should be repeated, either once every specified amount of time or at a specific time of day." interval: desc: "The amount of time between each repetition." message: - desc: "The text to be repeated." + desc: "The text to be repeated at the specified intervals or times." repeatredundant: - desc: |- - Specify repeater's index (Use `{0}replst` to see indexes) to toggle whether the message should be reposted if the last message in the channel is the same repeater's message. - This is useful if you want to remind everyone to be nice every so often, but don't want to have the bot spam the channel. This is NOT useful if you want to periodically ping someone. + desc: Specify repeater's index (use `{0}repli` to find it) to toggle whether that repeater's message should be reposted if the last message in the channel is the same repeater's message. This is useful if you want to remind everyone to be nice in the channel every so often, but don't want to have the bot spam the channel. This is NOT useful if you want to periodically ping someone. ex: - 1 params: - index: - desc: "The index of the repeating message to modify." + desc: "The number of times a message should be repeated before reposting." repeatskip: - desc: |- - Specify a repeater's ID to toggle whether the next trigger of the repeater will be skipped. - This setting is not stored in the database and will get reset if the bot is restarted. + desc: Specify a repeater's ID to toggle whether the next trigger of the repeater will be skipped. This setting is not stored in the database and will get reset if the bot is restarted. ex: - 3 params: - index: - desc: "The index of the repeating message to skip." + desc: "The number of times to skip before triggering again." rotateplaying: desc: Toggles rotation of playing status of the dynamic strings you previously specified. ex: - '' params: - - { } + - {} addplaying: - desc: Adds a specified string to the list of playing strings to rotate. You have to pick either `Playing`, `Watching` or `Listening` as the first parameter. + desc: Adds a specified string to the list of playing strings to rotate. You have to pick either 'Playing', 'Watching' or 'Listening' as the first parameter. ex: - Playing with you - Watching you sleep params: - - statusType: - desc: "The type of status, allowed values are `Playing`, `Watching`, or `Listening`." + - t: + desc: "The type of status, allowed values are 'Playing', 'Watching', or 'Listening'." status: desc: "The status text." - - status: - desc: "The status text." listplaying: - desc: Lists all playing statuses and their indexes. + desc: Lists all playing statuses with their corresponding number. ex: - '' params: - - { } + - {} removeplaying: - desc: Removes a playing status by index. Use `{0}lipl` to see indexes. + desc: Removes a playing string on a given number. ex: - '' params: - index: - desc: "The index of the playing string to be removed." + desc: "The position in the list where the playing string should be removed." vcrolelist: desc: Shows a list of currently set voice channel roles. ex: - '' params: - - { } + - {} vcrole: desc: Sets or resets a role which will be given to users who join the voice channel you're in when you run this command. Provide no role name to disable. You must be in a voice channel to run this command. ex: @@ -315,16 +297,16 @@ vcrole: - '' params: - role: - desc: "The role to assign to users who join the voice channel." + desc: "The role that is assigned to new members of the voice channel." vcrolerm: - desc: Removes any `{0}vcrole` associated with the specified channel ID. This is useful if your vcrole has been enabled on a VC which has been deleted. + desc: Removes vcrole associated with the specified voice channel ID. This is useful if your vcrole has been enabled on a VC which has been deleted. ex: - 123123123123123 params: - vcId: - desc: "The voice channel ID to remove the vcrole from." + desc: "The unique identifier of the voice channel to remove the vcrole from." asar: - desc: Adds a role to the list of self-assignable roles. You can also specify a group. If 'Exclusive self-assignable roles' feature is enabled (`{0}tesar`), users will be able to pick one role per group. + desc: Adds a role to the list of self-assignable roles. You can also specify a group. If 'Exclusive self-assignable roles' feature is enabled, users will be able to pick one role per group. ex: - Gamer - 1 Alliance @@ -333,7 +315,7 @@ asar: - role: desc: "The role that can be assigned by the user." - group: - desc: "The ID of a group that the designated role should belong to." + desc: "The ID of a group that the new role should belong to." role: desc: "The role that can be assigned by the user." rsar: @@ -344,7 +326,7 @@ rsar: - Horde params: - role: - desc: "The role to remove from the list of self-assignable roles." + desc: "The role being removed from the list of self-assignable roles." lsar: desc: Lists self-assignable roles. Shows 20 roles per page. ex: @@ -352,7 +334,7 @@ lsar: - 2 params: - page: - desc: "The page number to show." + desc: "The current page number for the list of roles." sargn: desc: Sets a self assignable role group name. Provide no name to remove. ex: @@ -360,58 +342,59 @@ sargn: - 2 params: - group: - desc: "The ID of the group to name." + desc: "The ID of the group to set as self-assignable." name: - desc: "The name to assign." + desc: "The name of the new or existing role group to set." togglexclsar: - desc: Toggles whether self-assigned roles are exclusive. While enabled, users can only have one self-assignable role per group. + desc: Toggles whether the self-assigned roles are exclusive. While enabled, users can only have one self-assignable role per group. ex: - '' params: - - { } + - {} iam: - desc: Adds a role to you that you choose. Role must be on the list of self-assignable roles. + desc: Adds a role to you that you choose. Role must be on a list of self-assignable roles. ex: - Gamer params: - role: - desc: "The role to assign." + desc: "The type of access or permission granted to the user." iamnot: - desc: Removes a specified role from you. Role must be on the list of self-assignable roles. + desc: Removes a specified role from you. Role must be on a list of self-assignable roles. ex: - Gamer params: - role: - desc: "The role to remove." + desc: "The role being removed from the user's assignment." expradd: - desc: 'Add an expression with a trigger and a response. Bot will post a response whenever someone types the trigger word. Running this command in a server requires the Administrator permission. Running this command in DM is Bot Owner only and adds a new global expression. Guide [here]()' + desc: 'Add an expression with a trigger and a response. Bot will post a response whenever someone types the trigger word. Running this command in server requires the Administration permission. Running this command in DM is Bot Owner only and adds a new global expression. Guide here: ' ex: - '"hello" Hi there %user.mention%' params: - trigger: - desc: "The trigger word or phrase (phrase must be in quotes)." + desc: "The trigger word that sets off the response when typed by a user." response: - desc: "The text of the message that shows up when a user types the trigger word or phrase." + desc: "The text of the message that shows up when a user types the trigger word." expraddserver: - desc: 'Add an expression with a trigger and a response in this server. Bot will post a response whenever someone types the trigger word. This command is useful if you want to lower the permission requirement for managing expressions by using `{0}dpo`. Guide [here]().' + desc: 'Add an expression with a trigger and a response in this server. Bot will post a response whenever someone types the trigger word. Guide here: ' ex: - '"hello" Hi there %user.mention%' params: - - trigger: - desc: "The trigger word or phrase (phrase must be in quotes)." - response: - desc: "The text of the message that shows up when a user types the trigger word or phrase." + - key: + desc: "The unique identifier for the expression to be added in this server." + message: + desc: "The text of the message that triggers the bot's response." exprlist: desc: |- - Lists global or server expressions (20 expressions per page). + Lists global or server expressions (20 commands per page). Running the command in DM will list global expressions, while running it in a server will list server expressions. Shows enabled settings, followed by id, followed by the trigger. **Settings:** - • 🗯️ Triggered if trigger matches any phrase (`{0}h exca`) - • ✉️ Response will be DMed (`{0}h exdm`) - • ❌ Trigger message will be deleted (`{0}h exad`) + • 🗯️ Triggered if trigger matches any word (`{0}h {0}exca`) + • ✉️ Response will be DMed (`{0}h {0}exdm`) + • ❌ Trigger will be deleted (`{0}h {0}exad`) ex: - 1 + - all params: - page: desc: "The number of pages to display in the list." @@ -421,45 +404,45 @@ exprshow: - 1 params: - id: - desc: "The expression ID to show." + desc: "The identifier for the entity whose response is being displayed." exprdelete: - desc: Deletes an expression by index. If ran in DM, it is bot owner only and deletes a global expression. Running this command in a server requires the Administrator permission and deletes a server expression. + desc: Deletes an expression on a specific index. If ran in DM, it is bot owner only and deletes a global expression. If ran in a server, it requires Administration privileges and removes server expression. ex: - 5 params: - id: - desc: "The ID of the expression to delete." + desc: "The identifier of the expression to be deleted." exprdeleteserver: - desc: Deletes an expression on a specific index on this server. This command is useful if you want to lower the permission requirement for managing expressions by using `{0}dpo`. + desc: Deletes an expression on a specific index on this server. ex: - 5c params: - id: - desc: "The ID of the expression to delete." + desc: "The identifier of the expression to be deleted." exprclear: desc: Deletes all expression on this server. ex: - '' params: - - { } + - {} fwclear: desc: Deletes all filtered words on this server. ex: - '' params: - - { } + - {} filterlist: desc: Lists invite and link filter channels and status. ex: - '' params: - - { } + - {} aliasesclear: desc: Deletes all aliases on this server. ex: - '' params: - - { } + - {} autoassignrole: desc: |- Toggles the role which will be assigned to every user who joins the server. @@ -472,7 +455,7 @@ autoassignrole: params: - role: desc: "The role assigned to new users, determining their permissions and access rights within the server." - - { } + - {} leave: desc: Makes Ellie leave the server. Either server name or server ID is required. ex: @@ -498,27 +481,27 @@ delmsgoncmd: - list params: - _: - desc: "The word 'list'" + desc: "The list of channels or servers where the automatic deletion is enabled, disabled, or inherited." - _: - desc: "The word 'server'" + desc: "The server where the command is being executed or monitored for chat flood prevention." - _: - desc: "The word 'channel'" + desc: "The channel where the automatic deletion of successful command messages should be toggled." s: - desc: "The state to set. One of 'enable', 'disable', or 'inherit'." + desc: "The state of whether automatic deletion is enabled or disabled for a specific channel." ch: - desc: "Channel in which to set" + desc: "The channel where the automatic deletion of successful command messages should be toggled for." - _: - desc: "The word 'channel'" + desc: "The channel where the automatic deletion of successful command messages should be toggled." s: - desc: "The state to set. One of 'enable', 'disable', or 'inherit'." + desc: "The state of whether automatic deletion is enabled or disabled for a specific channel." chId: - desc: "Optional channel id. If omitted, defaults to the current channel." + desc: "The ID of a channel where the automatic deletion should be toggled or inherited." restart: desc: Restarts the bot. Might not work. ex: - '' params: - - { } + - {} setrole: desc: Gives a role to a user. The role you specify has to be lower in the role hierarchy than your highest role. ex: @@ -574,7 +557,7 @@ deleterole: - Awesome Role params: - role: - desc: "The role being deleted, as identified by its id." + desc: "The role being deleted, as identified by its unique identifier." rolecolor: desc: Set a role's color using its hex value. Provide no color in order to see the hex value of the color of the specified role. The role you specify has to be lower in the role hierarchy than your highest role. ex: @@ -603,11 +586,11 @@ ban: - time: desc: "The duration of the temporary ban." userId: - desc: "The id of the user being banned." + desc: "The unique identifier of the user being banned." msg: desc: "The reason for the ban is provided in this message." - userId: - desc: "The id of the user being banned." + desc: "The unique identifier of the user being banned." msg: desc: "The reason for the ban is provided in this message." - user: @@ -625,7 +608,7 @@ softban: msg: desc: "The reason for the ban is described in this string." - userId: - desc: "The id of the user being banned and then unbanned." + desc: "The unique identifier for the user being banned and then unbanned." msg: desc: "The reason for the ban is described in this string." kick: @@ -774,7 +757,7 @@ prunecancel: ex: - '' params: - - { } + - {} die: desc: Shuts the bot down. ex: @@ -815,12 +798,12 @@ setbanner: params: - img: desc: "The URL of the image file to be displayed as the bot's banner." -setactivity: - desc: Sets the bots game status to a Custom, Playing, Listening, or Watching status. +setgame: + desc: Sets the bots game status to either Playing, Listening, or Watching. ex: - - Just chilling - - Playing with canaries - - Listening music + - Playing with snakes. + - Watching anime. + - Listening music. params: - type: desc: "The activity type determines whether the bot is engaged in a game, listening to audio, or watching a video." @@ -841,12 +824,7 @@ setservericon: - img: desc: "The URL of the image file to be displayed as the bot's banner." send: - desc: |- - Sends a message to a channel or user. - You can write "channel" (literally word 'channel') first followed by the channel id or channel mention, or - You can write "user" (literally word 'user') first followed by the user id or user mention. - After either one of those, specify the message to be sent. - This command can only be used by the Bot Owner. + desc: 'Sends a message to a channel or user. Channel or user can be ' ex: - channel 123123123132312 Stop spamming commands plz - user 1231231232132 I can see in the console what you're doing. @@ -865,12 +843,7 @@ savechat: - cnt: desc: "The number of messages to be saved." remind: - desc: |- - Sets a reminder which will be sent to you or to the targeted channel after certain amount of time (max 2 months). - First parameter is `me` / `here` / 'channelname' - Second parameter is time in a descending order (mo>w>d>h>m) example: 1w5d3h10m. - Third parameter is a (multiword) message. - Requires ManageMessages server permission if you're targeting a different channel. + desc: "Sends a message to you or a channel after certain amount of time (max 2 months). First parameter is `me`/`here`/'channelname'. Second parameter is time in a descending order (mo>w>d>h>m) example: 1w5d3h10m. Third parameter is a (multiword) message. Requires ManageMessages server permission if you're targeting a different channel." ex: - me 1d5h Do something - '#general 1m Start now!' @@ -914,7 +887,7 @@ serverinfo: params: - guildId: desc: "The ID of a server for which to retrieve information." - - { } + - {} channelinfo: desc: Shows info about the channel. If no channel is supplied, it defaults to current one. ex: @@ -969,7 +942,7 @@ stats: ex: - '' params: - - { } + - {} userid: desc: Shows user ID. ex: @@ -983,13 +956,13 @@ channelid: ex: - '' params: - - { } + - {} serverid: desc: Shows current server ID. ex: - '' params: - - { } + - {} roles: desc: List roles on this server or roles of a user if specified. Paginated, 20 roles per page. ex: @@ -1014,31 +987,31 @@ chnlfilterinv: ex: - '' params: - - { } + - {} srvrfilterinv: desc: Toggles automatic deletion of invites posted in the server. Does not affect users with the Administrator permission. ex: - '' params: - - { } + - {} chnlfilterlin: desc: Toggles automatic deletion of links posted in the channel. Does not negate the `{0}srvrfilterlin` enabled setting. Does not affect users with the Administrator permission. ex: - '' params: - - { } + - {} srvrfilterlin: desc: Toggles automatic deletion of links posted in the server. Does not affect users with the Administrator permission. ex: - '' params: - - { } + - {} chnlfilterwords: desc: Toggles automatic deletion of messages containing filtered words on the channel. Does not negate the `{0}srvrfilterwords` enabled setting. Does not affect users with the Administrator permission. ex: - '' params: - - { } + - {} filterword: desc: Adds or removes (if it exists) a word from the list of filtered words. Use`{0}sfw` or `{0}cfw` to toggle filtering. ex: @@ -1051,7 +1024,7 @@ srvrfilterwords: ex: - '' params: - - { } + - {} lstfilterwords: desc: Shows a list of filtered words. ex: @@ -1201,7 +1174,7 @@ userblacklist: - action: desc: "The type of operation to perform on the user, either adding or removing them from the blacklist." id: - desc: "The id of the user to be added, removed, or listed." + desc: "The unique identifier of the user to be added, removed, or listed." - action: desc: "The type of operation to perform on the user, either adding or removing them from the blacklist." usr: @@ -1221,7 +1194,7 @@ channelblacklist: - action: desc: "The type of operation to perform on the channel, either adding it to the blacklist or removing it from it." id: - desc: "The id of the channel being added, removed, or listed." + desc: "The unique identifier of the channel being added, removed, or listed." serverblacklist: desc: |- Either [add]s or [rem]oves a server, or servers specified by an ID from a blacklist. @@ -1237,7 +1210,7 @@ serverblacklist: - action: desc: "The type of operation to perform on the server(s). It can be either adding or removing them from the blacklist." id: - desc: "The id of the server being added, removed, or listed." + desc: "The unique identifier of the server being added, removed, or listed." - action: desc: "The type of operation to perform on the server(s). It can be either adding or removing them from the blacklist." guild: @@ -1294,7 +1267,7 @@ quoteshow: - 123 params: - quoteId: - desc: "The id of the quote being queried." + desc: "The unique identifier for the quote being queried." quotesearch: desc: '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' ex: @@ -1310,20 +1283,19 @@ quotesearch: textOrAuthor: desc: "The search term to find a matching quote." quoteid: - desc: -| - Displays the quote with the specified ID number. + desc: Displays the quote with the specified ID number. Quote ID numbers can be found by typing `{0}liqu [num]` where `[num]` is a number of a page which contains 15 quotes. ex: - 123456 params: - quoteId: - desc: "The id of the quote to be displayed." + desc: "The unique identifier for the quote to be displayed." quotedelete: desc: 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. ex: - 123456 params: - quoteId: - desc: "The id of the quote being deleted." + desc: "The unique identifier for the quote being deleted." quotedeleteauthor: desc: Deletes all quotes by the specified author. If the author is not you, then ManageMessage server permission is required. ex: @@ -1354,7 +1326,7 @@ playlistshuffle: ex: - '' params: - - { } + - {} flip: desc: Flips coin(s) - heads or tails, and shows an image. ex: @@ -1364,12 +1336,7 @@ flip: - count: desc: "The number of times the coin is flipped." betflip: - desc: |- - Bet on the coin flip. - The result can be heads or tails. - Guessing correctly rewards you with 1.95x of the currency you've bet (rounded up). - Multiplier can be changed by the bot owner. - You can specify 'all', 'half' or 'X%' instead of the amount to bet that part of your current balance. + desc: Bet to guess will the result be heads or tails. Guessing awards you 1.95x the currency you've bet (rounded up). Multiplier can be changed by the bot owner. ex: - 5 heads - 3 t @@ -1386,7 +1353,7 @@ roll: - 3d5 - 5dF params: - - { } + - {} - num: desc: "The number of sides on the dice being rolled." - arg: @@ -1430,7 +1397,7 @@ nunchi: ex: - '' params: - - { } + - {} connect4: desc: Creates or joins an existing connect4 game. 2 players are required for the game. Objective of the game is to get 4 of your pieces next to each other in a vertical, horizontal or diagonal line. You can specify a bet when you create a game and only users who bet the same amount will be able to join your game. ex: @@ -1515,64 +1482,50 @@ take: usrId: desc: "The ID of the user whose funds are being taken." 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. - You can specify 'all', 'half' or 'X%' instead of the amount to bet that part of your current balance. + desc: Bets a certain amount of currency and rolls a dice. Rolling over 66 yields x2 of your currency, over 90 - x4 and 100 x10. ex: - 5 params: - amount: desc: "The amount to be wagered on the roll of the dice." luckyladder: - desc: - Bets the specified amount of currency on the lucky ladder. - You can stop on one of many different multipliers. - The won amount is rounded down to the nearest whole number. - You can specify 'all', 'half' or 'X%' instead of the amount to bet that part of your current balance. + desc: Bets a certain amount of currency on the lucky ladder. You can stop on one of many different multipliers. Won amount is rounded down to the nearest whole number. ex: - 10 params: - amount: desc: "The total value of the bet being placed." leaderboard: - desc: |- - Displays the bot's currency leaderboard, or in other words, the richest users. - Specifying -c flag will show only users who are in this server. - Paginated with 10 users per page. + desc: Displays the bot's currency leaderboard. ex: - '' - - '-c' params: - params: - desc: "Optional -c flag" + desc: "The list of player names or IDs to display in the leaderboard." - page: - desc: "The page number to display." + desc: "The number of pages to display in the leaderboard." params: - desc: "Optional -c flag." + desc: "The list of player names or IDs to display in the leaderboard." trivia: - desc: |- - Starts a game of trivia. - First player to get to 10 points wins by default. - 30 seconds per question. + desc: Starts a game of trivia. You can add `nohint` to prevent hints. First player to get to 10 points wins by default. You can specify a different number. 30 seconds per question. ex: - '' - --timeout 5 -p -w 3 -q 10 params: - params: - desc: "Options. --timeout , --pokemon, --win --question " + desc: "The list of questions and answers for the trivia game." tl: desc: Shows a current trivia leaderboard. ex: - '' params: - - { } + - {} tq: desc: Quits current trivia after current question. ex: - '' params: - - { } + - {} typestart: desc: Starts a typing contest. ex: @@ -1585,7 +1538,7 @@ typestop: ex: - '' params: - - { } + - {} typeadd: desc: Adds a new article to the typing contest. ex: @@ -1616,7 +1569,7 @@ gencurrency: ex: - '' params: - - { } + - {} gencurlist: desc: Shows the list of server and channel ids where gc is enabled. Paginated with 9 per page. ex: @@ -1625,17 +1578,14 @@ gencurlist: - page: desc: "The current page number for pagination." choose: - desc: Chooses a thing from a list of things. Separate items with a semicolon ; + desc: Chooses a thing from a list of things ex: - Get up;Sleep;Sleep more params: - list: - desc: "The items separated by ;" + desc: "The type of items in the collection being searched." rps: - desc: |- - Play a game of Rocket-Paperclip-Scissors with Ellie. - You can bet on it. Winning awards you 1.95x of the bet. - You can specify 'all', 'half' or 'X%' instead of the amount to bet that part of your current balance. + desc: Play a game of Rocket-Paperclip-Scissors with Ellie. You can bet on it. Multiplier is the same as on betflip. ex: - r 100 - scissors @@ -1643,26 +1593,21 @@ rps: - pick: desc: "The user's chosen move in the game, such as rock, paper or scissors." amount: - desc: "Optional amount of currency to be wagered on the outcome of the game." + desc: "The stake to be wagered on the outcome of the game." next: desc: Goes to the next song in the queue. You have to be in the same voice channel as the bot ex: - '' params: - - { } + - {} play: - desc: |- - Queues up and plays a song or video based on a search query, song name, artist name or youtube link. - If no parameters are specified, it will skip the current song. - If you specify a song number, it will jump to that song. - If you specify a search query, acts as a `{0}q` command - **You must be in a voice channel**. + desc: If no parameters are specified, acts as `{0}next 1` command. If you specify a song number, it will jump to that song. If you specify a search query, acts as a `{0}q` command ex: - '' - 5 - Dream Of Venice params: - - { } + - {} - index: desc: "The index of the desired song or search result to navigate to." - query: @@ -1672,24 +1617,21 @@ stop: ex: - '' params: - - { } + - {} destroy: desc: Completely stops the music and unbinds the bot from the channel. (may cause weird behaviour) ex: - '' params: - - { } + - {} pause: desc: Pauses or Unpauses the song. ex: - '' params: - - { } + - {} queue: - desc: |- - Queues up and plays a song or video based on a search query, song name, artist name, search query or youtube link. - Bot will join your voice channel. - **You must be in a voice channel**. + desc: Queue a song using keywords or a link. Bot will join your voice channel. **You must be in a voice channel**. ex: - Dream Of Venice params: @@ -1715,7 +1657,7 @@ listqueue: - '' - 2 params: - - { } + - {} - page: desc: "The current page number for the song queue listing." nowplaying: @@ -1723,7 +1665,7 @@ nowplaying: ex: - '' params: - - { } + - {} volume: desc: Sets the music playback volume (0-100%). Persistent server setting. Default 100 ex: @@ -1764,7 +1706,7 @@ join: ex: - '' params: - - { } + - {} trackremove: desc: "Remove a song by its # in the queue, or 'all' (or provide no parameter) to remove all songs from the queue." ex: @@ -1814,14 +1756,14 @@ streamrole: desc: "The role of users being monitored for streamer status." addRole: desc: "The role to be added to users when they start streaming." - - { } + - {} load: desc: Loads a saved playlist using its ID. Use `{0}pls` to list all saved playlists and `{0}save` to save new ones. ex: - 5 params: - id: - desc: "The id of the playlist to be loaded." + desc: "The unique identifier of the playlist to be loaded." playlists: desc: Lists all playlists. Paginated, 20 per page. ex: @@ -1835,7 +1777,7 @@ playlistshow: - 1 params: - id: - desc: "The id of the playlist to retrieve songs from." + desc: "The unique identifier for the playlist to retrieve songs from." page: desc: "The current page number for the pagination." deleteplaylist: @@ -1850,7 +1792,7 @@ queueautoplay: ex: - '' params: - - { } + - {} streamadd: desc: Notifies this channel when the stream on the specified URL goes online or offline. Offline notifications will only show if you enable `{0}streamoff`. Maximum 10 per server. ex: @@ -1863,7 +1805,7 @@ streamsclear: ex: - '' params: - - { } + - {} streamremove: desc: Stops following the stream on the specified index. (use `{0}stl` to see indexes) ex: @@ -1883,13 +1825,13 @@ streamoffline: ex: - '' params: - - { } + - {} streamonlinedelete: desc: Toggles whether the bot will delete stream online message when the stream goes offline. ex: - '' params: - - { } + - {} streammessage: desc: Sets the message which will show when the stream on the specified index comes online. You can use %user% and %platform% placeholders. ex: @@ -1929,13 +1871,13 @@ convertlist: ex: - '' params: - - { } + - {} wowjoke: desc: Get one of penultimate WoW jokes. ex: - '' params: - - { } + - {} calculate: desc: Evaluate a mathematical expression. ex: @@ -1986,13 +1928,30 @@ pokemonability: params: - ability: desc: "The type of the Pokémon's special power or trait that can be used in battle." -weather: - desc: Shows current weather data for the specified city. +memelist: + desc: Shows a list of template keys (and their respective names) used for `{0}memegen`. ex: - - Auckland, NZ + - '' + params: + - page: + desc: "The number of pages in the list to be displayed." +memegen: + desc: Generates a meme from memelist with specified text. Separate multiple text values with semicolons. Provide no meme text to see an example meme with that template. + ex: + - biw gets iced coffee;in the winter + - ntot + params: + - meme: + desc: "The caption or punchline of the meme, which can be a single sentence or multiple sentences separated by semicolons." + memeText: + desc: "The user-provided text to be displayed on the generated meme." +weather: + desc: Shows weather data for a specified city. You can also specify a country after a comma. + ex: + - Moscow, RU params: - query: - desc: "The name of the place or city for which to show the weather data." + desc: "The location to retrieve weather information for." youtube: desc: Searches youtubes and shows the first result ex: @@ -2033,25 +1992,25 @@ randomcat: ex: - '' params: - - { } + - {} randomdog: desc: Shows a random dog image. ex: - '' params: - - { } + - {} randomfood: desc: Shows a random food image. ex: - '' params: - - { } + - {} randombird: desc: Shows a random bird image. ex: - '' params: - - { } + - {} image: desc: Pulls a random image using a search parameter. ex: @@ -2060,11 +2019,11 @@ image: - query: desc: "The search term used to retrieve the desired image." lmgtfy: - desc: Google something for a baka. + desc: Google something for an idiot. ex: - - How to eat a banana + - query params: - - smh: + - ffs: desc: "The search query to be entered into the search engine." google: desc: Get a Google search link for some terms. @@ -2088,35 +2047,35 @@ urbandict: - query: desc: "The term being searched for in the dictionary." catfact: - desc: Shows a random fact about cats. + desc: Shows a random catfact from ex: - '' params: - - { } + - {} yomama: - desc: Shows a random yomama joke. + desc: Shows a random joke from ex: - '' params: - - { } + - {} randjoke: desc: Shows a random joke. ex: - '' params: - - { } + - {} chucknorris: desc: Shows a random Chuck Norris joke. ex: - '' params: - - { } + - {} magicitem: - desc: Shows a random magic item with its description. + desc: Shows a random magic item from ex: - '' params: - - { } + - {} wiki: desc: Gives you back a wikipedia link ex: @@ -2155,37 +2114,35 @@ translangs: ex: - '' params: - - { } + - {} guide: desc: Sends a readme and a guide links to the channel. ex: - '' params: - - { } + - {} calcops: desc: Shows all available operations in the `{0}calc` command ex: - '' params: - - { } -quotesdeleteall: - desc: Deletes all quotes with the specified keyword. + - {} +delallquotes: + desc: Deletes all quotes on a specified keyword. ex: - kek params: - keyword: - desc: "The keyword/trigger of the quotes to be deleted." + desc: "The keyword to search for in the text." greetdmmsg: - desc: Sets a new join announcement message which will be sent to the user who joined. Type `%user.mention%` if you want to mention the new member. Using it with no message will show the current DM greet message. You can use embed json from instead of a regular text, if you want the message to be embedded. + desc: Sets a new join announcement message which will be sent to the user who joined. Type `%user.mention%` if you want to mention the new member. Using it with no message will show the current DM greet message. You can use embed json from instead of a regular text, if you want the message to be embedded. ex: - Welcome to the server, %user.mention% params: - text: desc: "The new join announcement message that will be sent to the user who joined." cash: - desc: |- - Check how much currency a person has. - If no argument is provided it will check your own balance. + desc: Check how much currency a person has. If no argument is provided it will check your own balance. ex: - '' - '@Someone' @@ -2214,7 +2171,7 @@ currencytransaction: - 3yvd params: - id: - desc: "The id of the transaction being queried." + desc: "The unique identifier for the transaction being queried." listperms: desc: Lists whole permission chain with their indexes. You can specify an optional page number if there are a lot of permissions. ex: @@ -2285,11 +2242,7 @@ emojiremove: - emotes: desc: "The list of emojis to be removed from the server." stickeradd: - desc: |- - Adds the sticker from your message to this server. - Send the sticker along with this command (in the same message). - Alternatively you can upload an image along with this command but you have to specify the name. - The image must be 300x300 in .png or .apng format and up to 512KB in size. + desc: Adds the sticker from your message to this server. Send the sticker along with this command (in the same message). ex: - '' - name "description" tag1 tag2 tagN @@ -2305,51 +2258,40 @@ deckshuffle: ex: - '' params: - - { } + - {} forwardmessages: desc: Toggles forwarding of non-command messages sent to bot's DM to the bot owners ex: - '' params: - - { } + - {} forwardtoall: desc: Toggles whether messages will be forwarded to all bot owners or only to the first one specified in the creds.yml file ex: - '' params: - - { } + - {} forwardtochannel: desc: Toggles forwarding of non-command messages sent to bot's DM to the current channel ex: - '' params: - - { } + - {} resetperms: desc: Resets the bot's permissions module on this server to the default value. ex: - '' params: - - { } + - {} antiraid: - desc: |- - Sets an anti-raid protection on the server. - - 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. - - Third parameter is punishment for those people. - Available punishments: Ban, Kick, Softban, Mute, VoiceMute, ChatMute, RemoveRoles, AddRole, Warn, TimeOut - You can specify an additional time argument to do a timed punishment for actions which support it (Ban, Mute, etc) up to 24h. - - Provide no parameters to disable. + desc: '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' ex: - 5 20 Kick - 7 9 Ban - 10 10 Ban 6h30m - '' params: - - { } + - {} - userThreshold: desc: "The number of users that must join the server within a specified time interval to trigger the anti-raid protection." seconds: @@ -2365,19 +2307,14 @@ antiraid: action: desc: "The punishment action specifies the consequence for users who trigger the anti-raid protection." antispam: - desc: |- - Applies a Punishment to people who repeat the same message X times in a row. - Available Punishments are: Ban, Kick, Softban, Mute, VoiceMute, ChatMute, RemoveRoles, AddRole, Warn, TimeOut - 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. - Provide no parameters to disable. + desc: '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' ex: - 3 Mute - 5 Ban - 5 Ban 3h30m - '' params: - - { } + - {} - messageCount: desc: "The maximum number of times a user can send the same message before being punished." action: @@ -2395,17 +2332,12 @@ antispam: action: desc: "The type of punishment to be applied to the offender." antialt: - desc: |- - Applies a punishment action to any user whose account is younger than the specified threshold. - Available Punishments are: Ban, Kick, Softban, Mute, VoiceMute, ChatMute, RemoveRoles, AddRole, Warn, TimeOut - 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. - Provide no parameters to disable. + desc: 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). ex: - 1h Ban - 3d Mute 1h params: - - { } + - {} - minAge: desc: "The minimum age of an account for which the punishment should be applied." action: @@ -2469,7 +2401,7 @@ adsarm: ex: - '' params: - - { } + - {} setstream: desc: Sets the bots stream. First parameter is the twitch link, second parameter is stream name. ex: @@ -2513,9 +2445,9 @@ autotranslang: ex: - en fr params: - - { } + - {} - fromLang: - desc: + desc: toLang: desc: "The destination language code, such as \"en\" for English or \"fr\" for French." autotranslate: @@ -2526,7 +2458,7 @@ autotranslate: params: - autoDelete: desc: "The option to automatically remove translated messages from the chat." -quotelist: +listquotes: desc: Lists all quotes on the server ordered alphabetically or by ID. 15 Per page. ex: - 3 @@ -2553,7 +2485,7 @@ typelist: params: - page: desc: "The current page number for the list of typing articles." -serverlist: +listservers: desc: Lists servers the bot is on with some basic info. 15 per page. ex: - 3 @@ -2561,14 +2493,11 @@ serverlist: - page: desc: "The number of pages to retrieve from the server list." cleverbot: - desc: |- - Toggles cleverbot/chatgpt session. - When enabled, the bot will reply to messages starting with bot mention in the server. - Expressions starting with %bot.mention% won't work if cleverbot/chatgpt is enabled. + desc: Toggles cleverbot/chatgpt session. When enabled, the bot will reply to messages starting with bot mention in the server. Expressions starting with %bot.mention% won't work if cleverbot/chatgpt is enabled. ex: - '' params: - - { } + - {} shorten: desc: Attempts to shorten an URL, if it fails, returns the input URL. ex: @@ -2598,7 +2527,7 @@ hangmanlist: ex: - '' params: - - { } + - {} hangman: desc: Starts a game of hangman in the channel. You can optionally select a category `{0}hangmanlist` to see a list of available categories. ex: @@ -2612,7 +2541,7 @@ hangmanstop: ex: - '' params: - - { } + - {} acrophobia: desc: Starts an Acrophobia game. ex: @@ -2626,7 +2555,7 @@ logevents: ex: - '' params: - - { } + - {} log: desc: Toggles logging event. Disables it if it is active anywhere on the server. Enables if it isn't active. Use `{0}logevents` to see a list of all events you can subscribe to. ex: @@ -2640,7 +2569,7 @@ queuefairplay: ex: - '' params: - - { } + - {} define: desc: Finds a definition of a word. ex: @@ -2648,6 +2577,13 @@ define: params: - word: desc: "The word being searched for." +activity: + desc: Checks for spammers. + ex: + - '' + params: + - page: + desc: "The number of pages to scan for spam." setstatus: desc: Sets the bot's status. (Online/Idle/Dnd/Invisible) ex: @@ -2684,17 +2620,15 @@ antilist: ex: - '' params: - - { } + - {} antispamignore: desc: Toggles whether antispam ignores current channel. Antispam must be enabled. ex: - '' params: - - { } + - {} eventstart: - desc: |- - Starts one of the events seen on public Ellie. - Events: `reaction`, `gamestatus` + desc: 'Starts one of the events seen on public ellie. Events: `reaction`, `gamestatus`' ex: - reaction - reaction -d 1 -a 50 --pot-size 1500 @@ -2702,32 +2636,20 @@ eventstart: - ev: desc: "The type of event being started." options: - desc: "The optional option flags for the event." -gamblestats: - desc: |- - Shows the total stats of several gambling features. - Updates once an hour. + desc: "The types of events that can be started." +betstats: + desc: Shows the total stats of several gambling features. Updates once an hour. ex: - '' params: - - { } -gamblestatsreset: - desc: |- - Resets the gamble stats. - ex: - - '' - params: - - { } + - {} slot: - desc: |- - Play Ellie slots by placing your bet. - You can specify 'all', 'half' or 'X%' instead of the amount to bet that part of your current balance. + desc: Play Ellie slots. 1 second cooldown per user. ex: - 5 - - 'all' params: - amount: - desc: "The amount of currency to bet." + desc: "The number of spins to perform in the game." affinity: desc: Sets your affinity towards someone you want to be claimed by. Setting affinity will reduce their `{0}claim` on you by 20%. Provide no parameters to clear your affinity. 30 minutes cooldown. ex: @@ -2745,18 +2667,12 @@ 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: - '' params: - - { } + - {} waifutransfer: desc: Transfer the ownership of one of your waifus to another user. You must pay 10% of your waifu's value unless that waifu has affinity towards you, in which case you must pay 60% fee. Transferred waifu's price will be reduced by the fee amount. ex: @@ -2771,21 +2687,15 @@ waifutransfer: newOwner: desc: "The user to whom ownership of the waifu is being transferred." waifugift: - desc: |- - Gift an item to a waifu user. - The waifu's value will be increased by the percentage of the gift's value. - You can optionally prefix the gift with a multiplier to gift the item that many times. - For example, 3xRose will give the waifu 3 roses, 10xBread will give the waifu 10 breads. Do not use plural forms. - Negative gifts will not show up in waifuinfo. - Provide no parameters to see a list of items that you can gift. + desc: -| Gift an item to someone. This will increase their waifu value by a percentage of the gift's value. Negative gifts will not show up in waifuinfo. Provide no parameters to see a list of items that you can gift. ex: - '' - Rose @Himesama params: - page: - desc: "The number of the page to display." - - items: - desc: "The name of an item to be gifted. With an optional multiplier prefix." + desc: "The number of pages to display when listing available gifting options." + - itemName: + desc: "The name of an item to be gifted, which is used to determine the percentage increase in waifu value." waifu: desc: "The user who is receiving the gift." waifulb: @@ -2817,18 +2727,27 @@ waifuinfo: desc: "The user being targeted, whose waifu information will be displayed." - targetId: desc: "The ID of the person whose waifu stats are being displayed." +mal: + desc: Shows basic info from a MyAnimeList profile. + ex: + - straysocks + params: + - name: + desc: "The username or identifier for the MyAnimeList account being queried." + - usr: + desc: "The user's guild membership information is used to fetch their anime list and other relevant data." setmusicchannel: desc: Sets the current channel as the default music output channel. This will output playing, finished, paused and removed songs to that channel instead of the channel where the first song was queued in. Persistent server setting. ex: - '' params: - - { } + - {} unsetmusicchannel: desc: Bot will output playing, finished, paused and removed songs to the channel where the first song was queued in. Persistent server setting. ex: - '' params: - - { } + - {} musicquality: desc: 'Gets or sets the default music player quality. Available settings: Highest, High, Medium, Low. Default is **Highest**. Provide no argument to see current setting.' ex: @@ -2836,7 +2755,7 @@ musicquality: - High - Low params: - - { } + - {} - preset: desc: "The selected preset determines the level of audio compression and processing applied to the music playback." stringsreload: @@ -2844,7 +2763,7 @@ stringsreload: ex: - '' params: - - { } + - {} shardstats: desc: |- Stats for shards. Paginated with 25 shards per page. @@ -2863,10 +2782,7 @@ restartshard: - shardId: desc: "The ID of the shard to be restarted or reconnected." tictactoe: - desc: |- - Starts a game of tic tac toe. - Another user must run the command in the same channel in order to accept the challenge. - Use numbers 1-9 to play. + desc: Starts a game of tic tac toe. Another user must run the command in the same channel in order to accept the challenge. Use numbers 1-9 to play. ex: - '' params: @@ -2885,7 +2801,7 @@ timezone: - '' - GMT Standard Time params: - - { } + - {} - id: desc: "The identifier for a specific timezone region." languagesetdefault: @@ -2894,7 +2810,7 @@ languagesetdefault: - en-US - default params: - - { } + - {} - name: desc: "The code page or character encoding for the target audience." languageset: @@ -2903,7 +2819,7 @@ languageset: - 'de-DE ' - default params: - - { } + - {} - name: desc: "The locale name for which the response language should be set." languageslist: @@ -2911,13 +2827,13 @@ languageslist: ex: - '' params: - - { } + - {} exprtoggleglobal: desc: Toggles whether global expressions are usable on this server. ex: - '' params: - - { } + - {} exprreact: desc: Sets or resets reactions (up to 3) which will be added to the response message of the Expression with the specified ID. Provide no emojis to reset. ex: @@ -2962,7 +2878,7 @@ exprsreload: ex: - '' params: - - { } + - {} exprsimport: desc: Upload the file or send the raw .yml data with this command to import all expressions from the specified string or file into the current server (or as global expressions in dm) ex: @@ -2975,7 +2891,7 @@ exprsexport: ex: - '' params: - - { } + - {} quotesimport: desc: 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. ex: @@ -2988,7 +2904,7 @@ quotesexport: ex: - '' params: - - { } + - {} aliaslist: desc: Shows the list of currently set aliases. Paginated. ex: @@ -3084,7 +3000,7 @@ startupcommandsclear: ex: - '' params: - - { } + - {} startupcommandslist: desc: Lists all startup commands in the order they will be executed in. ex: @@ -3102,7 +3018,7 @@ autocommandslist: unban: desc: Unbans a user with the provided user#discrim or id. ex: - - toastie_t0ast + - kwoth#1234 - 123123123 params: - user: @@ -3116,7 +3032,7 @@ banmessage: - '{{ "description": "%ban.user% you have been banned from %server.name% by %ban.mod%" }}' params: - message: - desc: "The custom message to be displayed when a user is banned." + desc: "The custom message to be displayed when a user is banned from the server, allowing for placeholders to be replaced with relevant information." banmessagetest: desc: If ban message is not disabled, bot will send you the message as if you were banned by yourself. Used for testing the ban message. ex: @@ -3134,7 +3050,7 @@ banmsgreset: ex: - '' params: - - { } + - {} banprune: desc: |- Sets how many days of messages will be deleted when a user is banned. @@ -3159,7 +3075,7 @@ warnexpire: - 3 - 6 --delete params: - - { } + - {} - days: desc: "The number of days after which expired warnings will be automatically cleared from the system." params: @@ -3178,19 +3094,12 @@ warnclear: desc: "The ID of the user whose warnings are being cleared." index: desc: "The index of the warning to be cleared, or 0 to clear all warnings." -warndelete: - desc: Deletes a warning from a user by its index. - ex: - - 3 - params: - - index: - desc: "The index of the warning to be deleted." warnpunishlist: desc: Lists punishments for warnings. ex: - '' params: - - { } + - {} warnpunish: desc: "Sets a punishment for a certain number of warnings. You can specify a time string after 'Ban' or *'Mute' punishments to make it a temporary mute/ban. Provide no punishment to remove. Available punishments: Ban, Kick, Softban, Mute, VoiceMute, ChatMute, AddRole, RemoveRoles" ex: @@ -3220,7 +3129,7 @@ ping: ex: - '' params: - - { } + - {} time: desc: Shows the current time and timezone in the specified location. ex: @@ -3237,38 +3146,27 @@ shop: - page: desc: "The number of the page to retrieve from the list of administrators' shops." shopadd: - desc: |- - Adds an item to the shop. - First you begin by specifying the type of the item you wish to add. - Available types are role, list and command. - If the item is a role, specify a role id or a role name. - In case you're selling a command, and you need user's name, id etc, you can use the following placeholders: - - `%you%` - Buyer mention - - `%you.id%` - Buyer's user ID - - `%you.username%` - Buyer's username - - `%you.name%` - Buyer's global name - - `%you.nick%` - Buyer's display name - 90% of currency from each purchase will be received by the user who added the item to the shop. This is configurable by the bot owner + desc: "- Available types are role, list and command.\n- If the item is a role, specify a role id or a role name.\n- If the item is a command, specify the full command, replacing the user with %user% (for a mention) or %user.id% for user id.\n90% of currency from each purchase will be received by the user who added the item to the shop. " ex: - role 1000 Rich - cmd 1000 .setrole %user% Rich params: - _: - desc: "This value has to be 'cmd'" + desc: "The command to be executed when an item is purchased." price: - desc: "The cost at which the command is available for purchase." + desc: "The cost at which the item is available for purchase." command: - desc: "The full command, replacing the buyer info (if required) with some of the special %you% placeholders." + desc: "The full command, replacing the user with %user% (for a mention) or %user.id% for user id. This allows users to specify custom" - _: - desc: "This value has to be 'list'" + desc: "The role that should be granted to users when they purchase this item." price: desc: "The cost at which the item is available for purchase." role: - desc: "The item (text) that is being sold." + desc: "The ID or name of a predefined role in the system, used to specify the type of item being added to the shop." - _: - desc: "This value has to be 'role'" + desc: "The list of items to be added to the shop." price: - desc: "The cost at which the role is available for purchase." + desc: "The cost at which the item is available for purchase." name: desc: "The name of the role, command, or list being added to the shop." shopremove: @@ -3336,7 +3234,7 @@ gamevoicechannel: ex: - '' params: - - { } + - {} shoplistadd: desc: Adds an item to the list of items for sale in the shop entry given the index. You usually want to run this command in the secret channel, so that the unique items are not leaked. ex: @@ -3356,7 +3254,7 @@ globalcommand: globalmodule: desc: Toggles whether a module can be used on any server. ex: - - 'Gambling' + - nsfw params: - module: desc: "The type of module or configuration information being toggled." @@ -3365,19 +3263,19 @@ globalpermlist: ex: - '' params: - - { } + - {} resetglobalperms: desc: Resets global permissions set by bot owner. ex: - '' params: - - { } + - {} prefix: desc: Sets this server's prefix for all bot commands. Provide no parameters to see the current server prefix. **Setting prefix requires Administrator server permission.** ex: - + params: - - { } + - {} - _: desc: "The default text that is prepended to all bot command names." newPrefix: @@ -3461,19 +3359,19 @@ experience: - '@someguy' params: - user: - desc: "Optional name, mention or ID of the user" + desc: "The ID or handle of a player whose XP statistics are being displayed." xptemplatereload: desc: Reloads the xp template file. Xp template file allows you to customize the position and color of elements on the `{0}xp` card. ex: - '' params: - - { } + - {} xpexclusionlist: desc: Shows the roles and channels excluded from the XP system on this server, as well as whether the whole server is excluded. ex: - '' params: - - { } + - {} xpexclude: desc: Exclude a channel, role or current server from the xp system. ex: @@ -3496,7 +3394,7 @@ xpnotify: - global dm - server channel params: - - { } + - {} - place: desc: "The location where notifications should be sent, such as a specific channel or DM." type: @@ -3513,7 +3411,7 @@ xprewsreset: ex: - '' params: - - { } + - {} xprolereward: desc: |- Add or remove a role from the user who reaches the specified level. @@ -3630,13 +3528,13 @@ clubleave: ex: - '' params: - - { } + - {} clubdisband: desc: Disbands the club you're the owner of. This action is irreversible. ex: - '' params: - - { } + - {} clubkick: desc: Kicks the user from the club. You must be the club owner. They will be able to apply again. ex: @@ -3716,8 +3614,8 @@ eightball: ytuploadnotif: desc: |- Subscribe to a youtube channel's upload rss feed. + Shortcut for `.feed https://www.youtube.com/feeds/videos.xml?channel_id=%3Cyoutube_channel_id` You can optionally specify a message which will be posted with an update. - This is just a shortcut for `.feed` with a url of the youtube channel's rss feed. ex: - https://www.youtube.com/channel/UCSJ4gkVC6NrvII8umztf0Ow - https://www.youtube.com/channel/UCSJ4gkVC6NrvII8umztf0Ow New video is posted @@ -3775,15 +3673,11 @@ expredit: - 123 I'm a magical girl params: - id: - desc: "The id of the expression being edited." + desc: "The unique identifier for the expression being edited." message: desc: "The text that will replace the original response in the expression's output." say: - desc: |- - Make the bot say something, or in other words, make the bot send the message. - You can optionally specify the channel where the bot will send the message. - If you omit the channel name, it will send the message in the current channel. - Supports [embeds](https://eb.elliebot.net/) + desc: Bot will send the message you typed in the specified channel. If you omit the channel name, it will send the message in the current channel. Supports embeds. ex: - hi - '#chat hi' @@ -3820,7 +3714,7 @@ deletewaifus: ex: - '' params: - - { } + - {} deletewaifu: desc: Deletes everything from WaifuUpdates, WaifuItem and WaifuInfo tables for the specified user. Also makes specified user's waifus free. ex: @@ -3835,19 +3729,19 @@ deletecurrency: ex: - '' params: - - { } + - {} deleteplaylists: desc: Deletes everything from MusicPlaylists. ex: - '' params: - - { } + - {} deletexp: desc: Deletes everything from UserXpStats, Clubs and sets users' TotalXP to 0. ex: - '' params: - - { } + - {} discordpermoverride: desc: Overrides required user permissions that the command has with the specified ones. You can only use server-level permissions. This action will make the bot ignore user permission requirements which command has by default. Provide no permissions to reset to default. ex: @@ -3870,13 +3764,34 @@ discordpermoverridereset: ex: - '' params: - - { } + - {} +rafflecur: + desc: Starts or joins a currency raffle with a specified amount. Users who join the raffle will lose the amount of currency specified and add it to the pot. After 30 seconds, random winner will be selected who will receive the whole pot. There is also a `mixed` mode in which the users will be able to join the game with any amount of currency, and have their chances be proportional to the amount they've bet. + ex: + - 20 + - mixed 15 + params: + - _: + desc: "The type of game mode to use, either \"fixed\" or \"mixed\"." + amount: + desc: "The minimum or maximum amount of currency that can be used for betting." + - amount: + desc: "The minimum or maximum amount of currency that can be used for betting." + mixed: + desc: "The parameter determines whether the raffle operates in \"fixed\" or \"proportional\" mode." +rip: + desc: Shows the inevitable fate of someone. + ex: + - '@Someone' + params: + - usr: + desc: "The user whose fate is being revealed." autodisconnect: desc: Toggles whether the bot should disconnect from the voice channel once it's done playing all of the songs and queue repeat option is set to `none`. ex: - '' params: - - { } + - {} timelyset: desc: Sets the 'timely' currency allowance amount for users. Second parameter is period in hours, default is 24 hours. ex: @@ -3888,20 +3803,17 @@ timelyset: period: desc: "The time period within which a user's timely currency allowance can be used." timely: - desc: |- - Use to claim your timely currency. - This is usually set by the bot owners to be daily, hourly or once every 12 hours. - Bot owner has to specify the amount and the period on how often you can claim your currency. + desc: Use to claim your 'timely' currency. Bot owner has to specify the amount and the period on how often you can claim your currency. ex: - '' params: - - { } + - {} timelyreset: desc: Resets all user timeouts on `{0}timely` command. ex: - '' params: - - { } + - {} crypto: desc: Shows basic stats about a cryptocurrency from coinmarketcap.com. You can use either a name or an abbreviation of the currency. ex: @@ -3936,12 +3848,52 @@ massban: - userStrings: desc: "The list of user IDs to ban, provided as a comma-separated string." masskill: - desc: Specify a new-line separated list of `userid reason`. You can use Username#discrim instead of UserId. Specified users will be banned from the current server, blacklisted from the bot, and have all of their currency taken away. + desc: Specify a new-line separated list of `userid reason`. You can use Username#discrim instead of UserId. Specified users will be banned from the current server, blacklisted from the bot, and have all of their flowers taken away. ex: - BadPerson#1234 Toxic person params: - people: desc: "The list of user IDs or usernames to ban from the server and blacklist from the bot." +pathofexile: + desc: Searches characters for a given Path of Exile account. May specify league name to filter results. + ex: + - '"Zizaran"' + params: + - usr: + desc: "The username or email address associated with the Path of Exile account being searched." + league: + desc: "The league in which the character is playing, allowing users to focus on a specific game mode or event." + page: + desc: "The number of pages to retrieve from the API." +pathofexileleagues: + desc: Returns a list of the main Path of Exile leagues. + ex: + - '' + params: + - {} +pathofexilecurrency: + desc: Returns the chaos equivalent of a given currency or exchange rate between two currencies. + ex: + - Standard "Mirror of Kalandra" + params: + - leagueName: + desc: "The name of the league in which the currency is used, such as \"Harbinger\" or \"Delve\"." + currencyName: + desc: "The type of currency being converted." + convertName: + desc: "The type of currency being converted from or to." +rollduel: + desc: Challenge someone to a roll duel by specifying the amount and the user you wish to challenge as the parameters. To accept the challenge, just specify the name of the user who challenged you, without the amount. + ex: + - 50 @Someone + - '@Challenger' + params: + - u: + desc: "The user being challenged or accepting the challenge." + - amount: + desc: "The stakes for the roll duel." + u: + desc: "The user being challenged or accepting the challenge." reroadd: desc: |- Specify a message id, emote and a role name to have the bot assign the specified role to the user who reacts to the specified message (in this channel) with the specified emoji. @@ -3983,7 +3935,7 @@ rerodeleteall: ex: - '' params: - - { } + - {} rerotransfer: desc: Transfers reaction roles from one message to another by specifying their ids. If the target message has reaction roles specified already, the reaction roles will be MERGED, not overwritten. ex: @@ -3994,35 +3946,30 @@ rerotransfer: toMessageId: desc: "The ID of the target message where the reaction roles should be transferred." blackjack: - desc: |- - Start or join a blackjack game by specifying the amount you're betting. - You must specify the amount you're betting. - Use `{0}hit`, `{0}stand` and `{0}double` commands to play. - Game is played with 4 decks. - Dealer hits on soft 17 and wins draws. + desc: Start or join a blackjack game. You must specify the amount you're betting. Use `{0}hit`, `{0}stand` and `{0}double` commands to play. Game is played with 4 decks. Dealer hits on soft 17 and wins draws. ex: - 50 params: - amount: - desc: "The amount you want to bet in the blackjack game." + desc: "The minimum bet required to participate in the game." hit: desc: In the blackjack game, ask the dealer for an extra card. ex: - '' params: - - { } + - {} stand: desc: Finish your turn in the blackjack game. ex: - '' params: - - { } + - {} double: desc: In the blackjack game, double your bet in order to receive exactly one more card, and your turn ends. ex: - '' params: - - { } + - {} xpreset: desc: Resets specified user's XP, or the XP of all users in the server. You can't reverse this action. ex: @@ -4033,7 +3980,7 @@ xpreset: desc: "The ID of a specific guild member whose XP is being reset." - userId: desc: "The ID of a specific player whose experience points are being reset." - - { } + - {} xpshop: desc: Access the xp shop (if enabled). You can purchase either xp card frames or backgrounds. You can optionally provide a page number ex: @@ -4041,7 +3988,7 @@ xpshop: - frames - bgs 3 params: - - { } + - {} - type: desc: "The type of item to be purchased, such as an XP card frame or background." page: @@ -4055,7 +4002,7 @@ xpshopbuy: - type: desc: "The type of item to purchase, such as a skill or a cosmetic." key: - desc: "The id of the item being purchased." + desc: "The unique identifier for the item being purchased." xpshopuse: desc: Use a previously purchased item from the xp shop by specifying the type and the key of the item. ex: @@ -4065,7 +4012,7 @@ xpshopuse: - type: desc: "The type of item to be used, such as an experience point or a skill upgrade." key: - desc: "The id of the item in the XP shop that you want to use." + desc: "The unique identifier for the item in the XP shop that you want to use." bible: desc: Shows bible verse. You need to supply book name and chapter:verse ex: @@ -4075,33 +4022,21 @@ bible: desc: "The name of the biblical book being referenced." chapterAndVerse: desc: "The reference to a specific passage in the Bible, such as 'Genesis 3:15'" -quran: - desc: |- - Shows the text of an ayah of the Quran, as well as the recitation by Alafasy. - Supply surah:ayah, or ayah number. For instance, 262 or 2:255 will both get you Ayat Al Kursi - ex: - - 2:255 - - 262 - params: - - ayah: - desc: "The number of the ayah in the Quran, for example 2:255." edit: - desc: |- - Edits bot's message, you have to specify message ID and new text. You can optionally specify target channel. - Supports [embeds](https://eb.elliebot.net/) + desc: Edits bot's message, you have to specify message ID and new text. You can optionally specify target channel. Supports embeds. ex: - 7479498384 Hi :^) - '#other-channel 771562360594628608 New message!' - '#other-channel 771562360594628608 {{"description":"hello"}}' params: - messageId: - desc: "The id of the message being edited." + desc: "The unique identifier of the message being edited." text: desc: "The new text content of the edited message." - channel: desc: "The target channel where the edited message will be sent or updated in." messageId: - desc: "The id of the message being edited." + desc: "The unique identifier of the message being edited." text: desc: "The new text content of the edited message." delete: @@ -4112,13 +4047,13 @@ delete: - 771562360594628608 5m params: - messageId: - desc: "The id of a specific message within a channel, used to target the deletion operation." + desc: "The unique identifier of a specific message within a channel, used to target the deletion operation." time: desc: "The duration after which the message should be automatically deleted." - channel: desc: "The channel where the message is located or should be searched for." messageId: - desc: "The id of a specific message within a channel, used to target the deletion operation." + desc: "The unique identifier of a specific message within a channel, used to target the deletion operation." time: desc: "The duration after which the message should be automatically deleted." roleid: @@ -4133,7 +4068,13 @@ agerestricttoggle: ex: - '' params: - - { } + - {} +economy: + desc: Breakdown of the current state of the bot's economy. Updates every 3 minutes. + ex: + - '' + params: + - {} purgeuser: desc: Purge user from the database completely. This includes currency, xp, clubs that user owns, waifu info ex: @@ -4162,7 +4103,7 @@ coordreload: ex: - '' params: - - { } + - {} showembed: desc: Prints the json equivalent of the embed of the message specified by its Id. ex: @@ -4180,12 +4121,12 @@ deleteemptyservers: ex: - '' params: - - { } + - {} marmaladeload: desc: |- Loads a marmalade with the specified name from the data/marmalades/ folder. Provide no name to see the list of loadable marmalades. - Read about the marmalade system [here](https://docs.elliebot.net/ellie/marmalade/creating-a-marmalade/) + Read about the marmalade system [here](https://docs.elliebot.net/ellie/) ex: - mycoolmarmalade - '' @@ -4196,7 +4137,7 @@ marmaladeunload: desc: |- Unloads the previously loaded marmalade. Provide no name to see the list of unloadable marmalades. - Read about the marmalade system [here](https://docs.elliebot.net/ellie/marmalade/creating-a-marmalade/) + Read about the marmalade system [here](https://docs.elliebot.net/ellie/) ex: - mycoolmarmalade - '' @@ -4205,9 +4146,9 @@ marmaladeunload: desc: "The name of a specific marmalade to be unloaded." marmaladeinfo: desc: |- - Shows information about the specified marmalade such as the author, name, description, list of canaries, number of commands etc. + Shows information about the specified marmalade such as the author, name, description, list of sneks, number of commands etc. Provide no name to see the basic information about all loaded marmalades. - Read about the marmalade system [here](https://docs.elliebot.net/ellie/marmalade/creating-a-marmalade/) + Read about the marmalade system [here](https://docs.elliebot.net/ellie/) ex: - mycoolmarmalade - '' @@ -4217,17 +4158,17 @@ marmaladeinfo: marmaladelist: desc: |- Lists all loaded and unloaded marmalades. - Read about the marmalade system [here](https://docs.elliebot.net/ellie/marmalade/creating-a-marmalade/) + Read about the marmalade system [here](https://docs.elliebot.net/ellie/) ex: - '' params: - - { } + - {} marmaladesearch: desc: Searches for marmalades online given the search term ex: - shrine params: - - { } + - {} bankdeposit: desc: Deposits the specified amount of currency into the bank for later use. ex: @@ -4243,16 +4184,11 @@ bankwithdraw: - amount: desc: "The amount of money to be withdrawn." bankbalance: - desc: |- - Shows how much currency is in your bank account. - This differs from your cash amount, as the cash amount is publicly available, but only you have access to your bank balance. - However, you have to withdraw it first in order to use it. - Bot Owner can also check another user's bank balance. + desc: Shows your current bank balance available for withdrawal. ex: - '' - - '@User' params: - - { } + - {} banktake: desc: Takes the specified amount of currency from a user's bank ex: @@ -4265,7 +4201,7 @@ banktake: - amount: desc: "The total value of funds being withdrawn." userId: - desc: "The id of the user whose account is being accessed." + desc: "The unique identifier for the user whose account is being accessed." bankaward: desc: Award the specified amount of currency to a user's bank ex: @@ -4280,13 +4216,11 @@ patron: ex: - '' params: - - { } + - {} - user: desc: "The ID or handle of the user whose patronage status is being checked." patronmessage: - desc: |- - Sends a message to all patrons of the specified tier and higher. - Supports [embeds](https://eb.elliebot.net/) + desc: Sends a message to all patrons of the specified tier and higher. Supports embeds. ex: - x hello params: @@ -4317,7 +4251,6 @@ betdraw: You can specify `r` or `b` for red or black, and `h` or `l` for high or low. You can specify only h/l or only r/b or both. Returns are high but **7 always loses**. - You can specify 'all', 'half' or 'X%' instead of the amount to bet that part of your current balance. ex: - 50 r - 200 b l @@ -4345,7 +4278,7 @@ bettest: - betflip 1000 - slot 2000 params: - - { } + - {} - target: desc: "The type of game or wager being tested." tests: @@ -4369,7 +4302,7 @@ autopublish: ex: - '' params: - - { } + - {} doas: desc: Execute the command as if you were the target user. Requires bot ownership and server administrator permission. ex: @@ -4392,7 +4325,7 @@ cacheusers: - '' - serverId params: - - { } + - {} - guild: desc: "The guild for which user data is being cached." stickyroles: @@ -4400,7 +4333,7 @@ stickyroles: ex: - '' params: - - { } + - {} giveawaystart: desc: Starts a giveaway. Specify the duration (between 1 minute and 30 days) followed by the prize. ex: @@ -4438,13 +4371,13 @@ giveawaylist: ex: - '' params: - - { } + - {} todolist: desc: Lists all todos. ex: - '' params: - - { } + - {} todoadd: desc: Adds a new todo. ex: @@ -4458,7 +4391,7 @@ todoedit: - abc This is an updated entry params: - todoId: - desc: "The id of the todo item being edited." + desc: "The unique identifier for the todo item being edited." newMessage: desc: "The text of a new task description or update to an existing one." todocomplete: @@ -4467,20 +4400,20 @@ todocomplete: - 4a params: - todoId: - desc: "The id of the todo item being marked as completed." + desc: "The unique identifier for the todo item being marked as completed." tododelete: desc: Deletes a todo with the specified ID. ex: - abc params: - todoId: - desc: "The id of the todo item being deleted." + desc: "The unique identifier for the todo item being deleted." todoclear: desc: Deletes all unarchived todos. ex: - '' params: - - { } + - {} todoarchiveadd: desc: Creates a new archive with the specified name using current todos. ex: @@ -4508,7 +4441,7 @@ todoshow: - 4a params: - todoId: - desc: "The id of the todo item being displayed." + desc: "The unique identifier for the todo item being displayed." todoarchivedelete: desc: Deletes the archived todo list with the specified ID. ex: @@ -4517,189 +4450,10 @@ todoarchivedelete: - todoId: desc: "The identifier for the archived todo item to be deleted." cleanupguilddata: - desc: |- + desc: |- Deletes data for all servers bot is no longer a member of from the database. This is a highly destructive and irreversible command. ex: - '' params: - - { } -prompt: - desc: |- - Ask the bot to do something for you. - This will fall back to the chatbot service in case of an error. - ex: - - What's the weather like today? - params: - - query: - desc: "The message to send to the bot." -honeypot: - desc: |- - Toggles honeypot on the current channel. - Anyone sending a message in this channel will be soft banned. (Banned and then unbanned) - This is useful for automatically getting rid of spam bots. - ex: - - '' - params: - - { } -coins: - desc: |- - Shows a list of 10 crypto currencies ordered by market cap. - Shows their price, change in the last24h, market cap and circulating and total supply. - Paginated with 10 per page. - ex: - - '' - - '2' - params: - - page: - desc: "Page number to show. Starts at 1." -afk: - desc: |- - Toggles AFK status for yourself with the specified message. - If you don't provide a message it default to a generic one. - Anyone @ mentioning you in any server will receive the afk message. - This will only work if the other user's message starts with the mention. - ex: - - '' - params: - - msg: - desc: "The message to send when someone pings you." -keep: - desc: |- - The current server, won't be deleted from Ellie's database during the purge. - ex: - - '' - params: - - { } -leaveunkeptservers: - desc: |- - Leaves all servers whose owners didn't run .keep - ex: - - '' - params: - - 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 + - {} \ 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..bbc021b 100644 --- a/src/EllieBot/data/strings/responses/responses.en-US.json +++ b/src/EllieBot/data/strings/responses/responses.en-US.json @@ -38,7 +38,6 @@ "prune_cancelled": "Pruning was cancelled.", "prune_not_found": "No active prune was found on this server.", "prune_progress": "Pruning... {0}/{1} messages deleted.", - "prune_already_running": "A prune is already running on this server.", "timeoutdm": "You have been timed out in {0} server.\nReason: {1}", "timedout_user": "User Timed Out", "remove_roles_pl": "have had their roles removed", @@ -195,7 +194,7 @@ "srvr_banner_too_large": "Specified image is too large! Maximum size is 8MB.", "srvr_banner_invalid_url": "Specified url is not valid. Make sure you're specifying a direct image url.", "set_channel_name": "New channel name set.", - "set_activity": "New activity set!", + "set_game": "New game set!", "set_stream": "New stream set!", "set_topic": "New channel topic set.", "shard_reconnecting": "Shard {0} reconnecting.", @@ -307,13 +306,13 @@ "waifus_none": "No waifus have been claimed yet.", "waifus_top_waifus": "Top Waifus", "waifu_affinity_already": "your affinity is already set to that waifu or you're trying to remove your affinity while not having one.", - "waifu_affinity_changed": "{0} changed their affinity from {1} to {2}.\n\n*This is morally questionable.*🤔", + "waifu_affinity_changed": "changed their affinity from {0} to {1}.\n\n*This is morally questionable.*🤔", "waifu_affinity_cooldown": "You must wait {0} hours and {1} minutes in order to change your affinity again.", "waifu_affinity_reset": "Your affinity is reset. You no longer have a person you like.", - "waifu_affinity_set": "{0} wants to be {1}'s waifu. Aww <3", - "waifu_claimed": "{0} claimed {1} as their waifu for {2}!", + "waifu_affinity_set": "wants to be {0}'s waifu. Aww <3", + "waifu_claimed": "claimed {0} as their waifu for {1}!", "waifu_divorced_like": "You have divorced a waifu who likes you. You heartless monster.\n{0} received {1} as a compensation.", - "waifu_egomaniac": "You can't set affinity to yourself, you egomaniac.", + "waifu_egomaniac": "you can't set affinity to yourself, you egomaniac.", "waifu_fulfilled": "🎉 Their love is fulfilled! 🎉\n{0}'s new value is {1}!", "waifu_isnt_cheap": "No waifu is that cheap. You must pay at least {0} to get a waifu, even if their actual value is lower.", "waifu_not_enough": "You must pay {0} or more to claim that waifu!", @@ -346,8 +345,8 @@ "submissions_closed": "Submissions closed", "animal_race_already_started": "Animal Race is already running.", "category": "Category", - "chatbot_disabled": "Disabled chatbot on this server.", - "chatbot_enabled": "Enabled chatbot on this server.", + "cleverbot_disabled": "Disabled cleverbot on this server.", + "cleverbot_enabled": "Enabled cleverbot on this server.", "curgen_disabled": "Currency generation has been disabled on this channel.", "curgen_enabled": "Currency generation has been enabled on this channel.", "curgen_pl": "{0} random {1} appeared!", @@ -620,9 +619,8 @@ "quote_deleted": "Quote #{0} deleted.", "quote_edited": "Quote Edited", "region": "Region", - "remind2": "I will remind {0} to {1} {2} ({3})", + "remind": "I will remind {0} to {1} in {2} `({3:d.M.yyyy.} at {4:HH:mm})`", "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.", @@ -703,7 +701,6 @@ "warn_count": "{0} current, {1} total", "warnlog_for": "Warnlog for {0}", "warnpl_none": "No punishments set.", - "warning_not_found": "Warning not found.", "warn_expire_set_delete": "Warnings will be deleted after {0} days.", "warn_expire_set_clear": "Warnings will be cleared after {0} days.", "warn_expire_reset": "Warnings will no longer expire.", @@ -714,7 +711,6 @@ "warn_punish_rem": "Having {0} warnings will no longer trigger a punishment.", "warn_punish_set": "I will apply {0} punishment to users with {1} warnings.", "warn_punish_set_timed": "I will apply {0} punishment for {2} to users with {1} warnings.", - "warning_deleted": "Warning {0} has been deleted.", "time_new": "Time", "timezone": "Timezone", "timezone_db_api_key": "You need to activate your TimezoneDB API key. You can do so by clicking on the link you've received in the email with your API key.", @@ -893,7 +889,6 @@ "club_kick_hierarchy": "Only club owner can kick club admins. Owner can't be kicked.", "club_renamed": "Club has been renamed to {0}", "club_name_taken": "A club with that name already exists.", - "rank": "Rank", "template_reloaded": "Xp template has been reloaded.", "expr_edited": "Expression Edited", "self_assign_are_exclusive": "You can only choose 1 role from each group.", @@ -978,7 +973,14 @@ "reset_user_confirm": "Are you sure that you want to reset specified user's XP on this server?", "reset_user": "User with id {0} has had their XP reset on this server.", "reset_server": "XP of all users on the server has been reset.", + "economy_state": "State of the economy", + "currency_owned": "Total currency owned by users", + "currency_one_percent": "% of currency owned by top 1%", + "currency_planted": "Currency currently planted", + "owned_waifus_total": "Total value of owned waifus", + "bot_currency": "Currency owned by the bot", "total": "Total", + "bank_accounts": "Bank Accounts", "no_invites": "No invites on this page.", "invite_deleted": "Invite {0} has been deleted.", "group_name_added": "Group #{0} now has a name: {1}", @@ -992,6 +994,7 @@ "module_description_help": "Get command help, descriptions and usage examples", "module_description_gambling": "Bet on dice rolls, blackjack, slots, coinflips and others", "module_description_games": "Play trivia, nunchi, hangman, connect4 and other games", + "module_description_nsfw": "NSFW commands.", "module_description_music": "Play music from youtube, local files and radio streams", "module_description_utility": "Manage custom quotes, repeating messages and check facts about the server", "module_description_administration": "Moderation, punish users, setup self assignable roles and greet messages", @@ -999,7 +1002,7 @@ "module_description_permissions": "Setup perms for commands, filter words and set up command cooldowns", "module_description_searches": "Search for jokes, images of animals, anime and manga", "module_description_xp": "Gain xp based on chat activity, check users' xp cards", - "module_description_marmalade": "**Bot Owner only.** Load, unload and handle dynamic modules. Read more [here](https://docs.elliebot.net/ellie/marmalade/creating-a-marmalade/)", + "module_description_marmalade": "**Bot Owner only.** Load, unload and handle dynamic modules. Read more [here](https://docs.elliebot.net/ellie/)", "module_description_patronage": "Commands related to supporting the bot", "module_description_missing": "Description is missing for this module.", "purge_user_confirm": "Are you sure that you want to purge {0} from the database?", @@ -1036,14 +1039,13 @@ "marmalade_already_loaded": "Marmalade {0} is already loaded", "marmalade_invalid_not_found": "Marmalade with that name wasn't found or the file was invalid", "bank_balance": "You have {0} in your bank account.", - "bank_balance_other": "User {0} has {1} in the bank.", "bank_deposited": "You deposited {0} to your bank account.", "bank_withdrew": "You withdrew {0} from your bank account.", "bank_withdraw_insuff": "You don't have sufficient {0} in your bank account.", "cmd_group_commands": "'{0}' command group", "limit_reached": "Feature limit of {0} reached.", "feature_limit_reached_you": "You've reached the limit of {0} for the {1} feature. You may be able to increase this limit by upgrading your patron tier.", - "feature_limit_reached_owner": "Feature limit reached. Server owner may upgrade patron level to increase the limit.", + "feature_limit_reached_owner": "Server owner has reached the limit of {0} for the {1} feature. Server owner may be able to upgrade this limit by upgrading patron tier.", "feature_limit_reached_either": "The limit of {0} for the {1} feature has been reached. Either you or the server owner may able to upgrade this limit by upgrading the patron tier.", "xp_shop_buy_required_tier": "Buying items from this shop requires Patron Tier {0} or higher.", "available_commands": "Available Commands", @@ -1065,7 +1067,8 @@ "xpshop_already_owned": "You already own this item.", "xpshop_item_not_found": "An item with that key doesn't exist.", "xpshop_website": "You can see the list of all Xp Shop items here: ", - "sticker_error": "You must either send a sticker along with this command, or upload a 300x300 .png or .apng image. Up to 512KB in size.", + "sticker_invalid_size": "Stickers must be exactly 300x300 pixels.", + "sticker_error": "You must either send a sticker along with this command, or upload a 300x300 .png or .apng image.", "sticker_missing_name": "Please specify a name for the sticker.", "thread_deleted": "Thread Deleted", "thread_created": "Thread Created", @@ -1098,25 +1101,5 @@ "todo_archived_list": "Archived Todo List", "search_results": "Search results", "queue_search_results": "Type the number of the search result to queue up that track.", - "overloads": "Overloads", - "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}" + "overloads": "Overloads" } 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