-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
Add monetization support #1803
Add monetization support #1803
Conversation
I added tests for all the things implemented in this PR afaict, not sure why codeclimate is still failing. Edit: Looks like the commit below completely broke CI, lol. |
This needs to be added to |
For create_test_entitlement I would prefer a guild and user kwarg, so something like this: await bot.rest.create_test_entitlement(
event.interaction.application_id,
sku="1",
guild="1",
)
await bot.rest.create_test_entitlement(
event.interaction.application_id,
sku="1",
user="1",
) Then raise an exception if they specify both. Or, "owner" kwarg that can be a user or guild, but if they specify just the snowflake ID, make it required to specify owner_type. In other words: await bot.rest.create_test_entitlement(
event.interaction.application_id,
sku="1",
owner="1",
owner_type=hikari.monetization.EntitlementOwnerType.GUILD
)
await bot.rest.create_test_entitlement(
event.interaction.application_id,
sku="1",
owner=await bot.rest.fetch_guild("1"),
) would be equivalent. Personally, I like the first one with separate user and guild args. |
I personally feel like that hikari should try to closely mirror the Discord API, wherever possible, so I'm against this idea, but if the maintainers feel otherwise, I'll adjust it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
9c13134
to
415bf61
Compare
Co-authored-by: davfsa <[email protected]> Signed-off-by: Hyper <[email protected]>
- Add missing import to init - Fix some deserialization bugs - Add missing `__all__` - Cleanup rest methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notes on stuff I need to check out/test
any progress on this |
As far as I am aware, it should just be the comments above. I'll ask around and check this out later today |
Added some comments in addition to what @davfsa already pointed out |
Everything sorted and should be good to merge! |
Summary
Add monetization support.
10
interaction.entitlements
propertyNotes/Questions
create_test_entitlement
take in a user/guild object instead of theEntitlementOwnerType
being the toggle?subscription_id
which is only partially documented but seems to be referenced so may be important? Unclear.Checklist
nox
and all the pipelines have passed.Related issues
Closes #1775