Skip to content
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

Support specifying with_counts and with_expiration in RESTClient.fetch_invite #1330

Merged
merged 11 commits into from
Nov 6, 2022
Merged

Support specifying with_counts and with_expiration in RESTClient.fetch_invite #1330

merged 11 commits into from
Nov 6, 2022

Conversation

null-domain
Copy link
Contributor

@null-domain null-domain commented Oct 28, 2022

Summary

API docs mention that Get Invite (/invites/{invite.code}) has three parameters - with_counts, with_expiration, and guild_scheduled_event_id. The first two are hardcoded to true when the rest client's .fetch_invite() method is used (and makes no reference to the third).

I have changed the method to default these two parameters to true, while still allowing them to be changed to false (although I'm not sure why anyone would want them to be false). It does reduce the chance for confusion though, as it wasn't immediately clear that the function already returned these two values.

Checklist

  • I have run nox and all the pipelines have passed.
  • I have made unittests according to the code I have added/modified/deleted.

Related issues

None

@davfsa davfsa added the enhancement New feature or request label Oct 28, 2022
Copy link
Member

@davfsa davfsa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And missing tests :)

Ty for the pr tho!

changes/1330.doc.md Outdated Show resolved Hide resolved
@null-domain null-domain requested a review from davfsa October 29, 2022 12:02
@davfsa davfsa changed the title Make fetch_invite more closely match API docs upport specifying with_counts and with_expiration in RESTClient.fetch_invite Nov 5, 2022
@davfsa davfsa changed the title upport specifying with_counts and with_expiration in RESTClient.fetch_invite Support specifying with_counts and with_expiration in RESTClient.fetch_invite Nov 5, 2022
davfsa
davfsa previously approved these changes Nov 5, 2022
@davfsa davfsa enabled auto-merge (squash) November 5, 2022 23:04
hikari/api/rest.py Outdated Show resolved Hide resolved
Signed-off-by: davfsa <davfsa@gmail.com>
davfsa
davfsa previously approved these changes Nov 5, 2022
hikari/api/rest.py Outdated Show resolved Hide resolved
Signed-off-by: davfsa <davfsa@gmail.com>
@davfsa davfsa merged commit 167d796 into hikari-py:master Nov 6, 2022
@null-domain null-domain deleted the fetch-invite-params branch November 10, 2022 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants