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

feat(Managers): ✨ Add GuildInviteManager #5889

Merged
merged 36 commits into from Jul 4, 2021

Conversation

DraftProducts
Copy link
Contributor

Please describe the changes this PR makes and why it should be merged:

The InviteManager was missing, this new Manager comes with some extra features

  • Invites generation from Guild based on the first accessible channel
  • Invite deletion outside of an Invite instance
  • Fetch a single invite with cache filling to avoid unnecessary future requests (force option is available)

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating
  • This PR changes the library's interface (methods or parameters added)

The InviteManager was missing, this new Manager comes with some extra features
- Invites generation from Guild based on the first accessible channel
- Invite deletion outside of an Invite instance
- Fetch a single invite with cache filling to avoid unnecessary future requests (force option is available)
src/errors/Messages.js Outdated Show resolved Hide resolved
typings/index.d.ts Outdated Show resolved Hide resolved
typings/index.d.ts Outdated Show resolved Hide resolved
Co-authored-by: iShibi <shubhamparihar391@gmail.com>
Copy link
Member

@vladfrangu vladfrangu left a comment

Choose a reason for hiding this comment

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

At this point, couldn't we get a GuildChannelInviteManager too? /s
Jokes aside, here are some things I'd like to bring up

src/errors/Messages.js Outdated Show resolved Hide resolved
src/managers/GuildInviteManager.js Outdated Show resolved Hide resolved
src/managers/GuildInviteManager.js Show resolved Hide resolved
src/managers/GuildInviteManager.js Outdated Show resolved Hide resolved
src/managers/GuildInviteManager.js Outdated Show resolved Hide resolved
DraftProducts and others added 2 commits June 20, 2021 18:03
Correction of docs and errors messages

Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
typings/index.d.ts Outdated Show resolved Hide resolved
DraftProducts and others added 2 commits June 20, 2021 18:19
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: iShibi <shubhamparihar391@gmail.com>
…with APIErrors

Co-authored-by: iShibi <shubhamparihar391@gmail.com>
Copy link
Contributor Author

@DraftProducts DraftProducts left a comment

Choose a reason for hiding this comment

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

I think everything is good if you don't have other suggestions for changes 👍

src/errors/Messages.js Outdated Show resolved Hide resolved
Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
src/managers/GuildInviteManager.js Outdated Show resolved Hide resolved
src/managers/GuildInviteManager.js Outdated Show resolved Hide resolved
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
src/managers/GuildInviteManager.js Outdated Show resolved Hide resolved
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
kyranet
kyranet previously requested changes Jul 3, 2021
Copy link
Member

@kyranet kyranet left a comment

Choose a reason for hiding this comment

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

Just one thing I noticed:

src/managers/GuildInviteManager.js Outdated Show resolved Hide resolved
Copy link
Contributor Author

@DraftProducts DraftProducts left a comment

Choose a reason for hiding this comment

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

I merged master to resolve conflicts with breaking changes of Guild#fetchInvites()

@iCrawl iCrawl dismissed stale reviews from kyranet and SpaceEEC July 3, 2021 20:01

Stale

src/structures/GuildChannel.js Outdated Show resolved Hide resolved
@iCrawl
Copy link
Member

iCrawl commented Jul 4, 2021

This needs a rebase.

Copy link
Member

@kyranet kyranet left a comment

Choose a reason for hiding this comment

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

Just the rebase, otherwise LGTM.

Copy link
Member

@iCrawl iCrawl left a comment

Choose a reason for hiding this comment

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

ID -> Id changes required.

src/managers/GuildInviteManager.js Outdated Show resolved Hide resolved
src/managers/GuildInviteManager.js Outdated Show resolved Hide resolved
src/managers/GuildInviteManager.js Outdated Show resolved Hide resolved
src/managers/GuildInviteManager.js Outdated Show resolved Hide resolved
src/managers/GuildInviteManager.js Outdated Show resolved Hide resolved
src/managers/GuildInviteManager.js Outdated Show resolved Hide resolved
@DraftProducts
Copy link
Contributor Author

Arf I was already working on it 👀

@DraftProducts DraftProducts requested a review from iCrawl July 4, 2021 19:11
@iCrawl iCrawl merged commit 9e08b02 into discordjs:master Jul 4, 2021
@DraftProducts DraftProducts deleted the feature-invite-manager branch July 4, 2021 22:26
@advaith1
Copy link
Contributor

advaith1 commented Jul 5, 2021

was this actually tested? it seems to not actually add the Guild#invites property, breaking all the places which now try to access it 😬

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants