-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add user to database immediately when purchasing premium #158
base: main
Are you sure you want to change the base?
Conversation
I believe I caught everywhere that this needed to be updated in code, but feel free to let me know if you think of any other places. My knowledge of rust is pretty rusty (ba-dum-tssss), so also let me know if there are any syntax issues. |
Thanks much, but I don't think I can merge this anytime soon... Migration is hard because cardinality of guilds won't give the correct premium level, and I'm not sure if I like this design because we can't quite assign premium roles manually anymore. Let's just keep this PR as is first until I can decide on something. |
I agree the cardinality isn't great, I just wanted to populate the database with initial data. I added I can add helper functions in the In |
Could also do it via a But maybe that's adding unneeded complexity. I know the users who had premium gifted are an issue but just because we implement this new system doesn't mean we need to remove the old one, just keep the old one as legacy until we're confident we have all of the users. |
0e5a511
to
529ada7
Compare
Summary
Adds the user to the database in the same webhook when a purchase is successfully completed.
Alters bot checks to use this new column
Adds migration files to add the new column, as well as completing a first pass of populating the
slots
column based on # of guilds with premiumAdditional context
These are written as upserts because it's possible that a person purchased premium, but never used the
=premiumassign
command, and therefore was never added to database.Premium 1
Premium 3
Premium 5