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(GuildMember): add dmChannel getter #8281

Merged
merged 1 commit into from Jul 25, 2022

Conversation

ImRodry
Copy link
Contributor

@ImRodry ImRodry commented Jul 13, 2022

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

This PR adds the dmChannel getter to the GuildMember class, similar to the one on the User class. If there's the createDM and deleteDM methods it only makes sense to have this

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)

@vercel
Copy link

vercel bot commented Jul 13, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
discord-js ⬜️ Ignored (Inspect) Jul 20, 2022 at 9:05PM (UTC)

@@ -210,6 +210,15 @@ class GuildMember extends Base {
return this.user.id;
}

/**
* The DM between the client's user and this member
Copy link
Member

Choose a reason for hiding this comment

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

Might be worth mentioning that it only returns the channel if it is cached (I know the description is the same as the User class and the private method, but perhaps those should be updated too)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that's implicit when you make a property a getter and make it nullable, isn't it?

Copy link
Member

Choose a reason for hiding this comment

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

I don't know. One could assume it returns null if the channel does not exist at all

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm not sure, it's still a getter and all getters rely on cache (or almost all) so I don't think it's necessary. If a maintainer does I can change this and the other descriptions so I'll keep this open until one of them resolves it

@iCrawl iCrawl force-pushed the feat/guildmember-dmchannel branch from b2e9841 to c1ac5b2 Compare July 20, 2022 21:05
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.

Sure

@iCrawl iCrawl merged commit 4fc2c60 into discordjs:main Jul 25, 2022
@ImRodry ImRodry deleted the feat/guildmember-dmchannel branch August 9, 2022 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

6 participants