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

Move Guild#defaultRole to RoleStore#everyone #3347

Merged
merged 6 commits into from Aug 17, 2019
Merged

Move Guild#defaultRole to RoleStore#everyone #3347

merged 6 commits into from Aug 17, 2019

Conversation

didinele
Copy link
Member

@didinele didinele commented Jun 16, 2019

Please describe the changes this PR makes and why it should be merged:
Moves Guild#defaultRole to RoleStore, which suits the use of stores far better.
Also renames it to everyone, as others have suggested.

Status

  • 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

Semantic versioning classification:

  • This PR changes the library's interface (methods or parameters added)
    • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)
  • This PR only includes non-code changes, like changes to documentation, README, etc.

@jpbberry
Copy link

My original idea btw.
Also I suggest it being RoleStore.everyone rather than .defaultRole

@tipakA
Copy link
Contributor

tipakA commented Jun 16, 2019

defaultRole leaves that tiny bit of space in case when Discord would out of the blue change naming of roles

@appellation
Copy link
Member

This is a case where it would be nice if default wasn't a reserved keyword. As it is, I don't see any way to reasonably avoid the naming redundancy here. 👍

@didinele
Copy link
Member Author

Absolutely, the question still stands, should we keep .defaultRole, or change it to .everyone.

I personally think defaultRole is the better option.

@vladfrangu
Copy link
Member

vladfrangu commented Jun 16, 2019

@appellation excuse my usage of notepad, but default doesn't seem to cause an issue in the class, neither with or without strict mode enabled (this is on node.js v12.3.1).

Surprisingly... None of the keywords seem to trigger an error in the code.. I am able to use get followed by true, false, null, class, function without an issue... Could this be an issue with older node.js versions?

EDIT: Tested on node.js 10.13.0 by @kyranet, result:

@appellation
Copy link
Member

I wasn't suggesting that we should avoid default because it doesn't work. I believe it is poor design to use keywords in identifiers even if the interpreter allows it.

@SpaceEEC
Copy link
Member

Is there any reason for it to be called defaultRole?
Skimming through Discord's documentation for guild yields two results for @everyone, and none for default.

Was it maybe only for consistency with the now "deceased" default channel?
If so, everyone might actually be a reasonable choice.

@didinele
Copy link
Member Author

Any more discussion on this? Should I change it into everyone like Space suggested?

@didinele
Copy link
Member Author

All said and done!

@didinele didinele changed the title Move Guild#defaultRole to RoleStore Move Guild#defaultRole to RoleStore#everyone Aug 13, 2019
@SpaceEEC SpaceEEC merged commit 2df4f22 into discordjs:master Aug 17, 2019
samsamson33 pushed a commit to samsamson33/discord.js that referenced this pull request Feb 27, 2020
* remove guild#defaultRole

* add RoleStore#defaultRole

* typings

* fix trailing space

* another one

* Rename it to everyone
samsamson33 added a commit to samsamson33/discord.js that referenced this pull request Feb 27, 2020
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

6 participants