-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Doc fixes #1197
Doc fixes #1197
Conversation
If you could elaborate how this makes it better? |
src/structures/Guild.js
Outdated
@@ -573,7 +573,9 @@ class Guild { | |||
* be resolved, the user ID will be the result. | |||
* @example | |||
* // ban a user | |||
* guild.ban('123123123123'); | |||
* guild.ban(user) |
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.
'user' instead of '123123123'
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.
But you don't explain what "user" is at all.
At the same time you add a promise where you pass the user if it resolves and console log it, but guild.ban can be used without the user being on the server initially, so you would have no user to resolve.
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.
I agree, expansion on what user
is could be beneficial, but this is still an improvement on 123123123
.
As for bans being invoked before the user is in the guild, that's news to me. Do you know of a way to resolve a user outside of any guilds the bot is in?
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.
src/structures/Guild.js
Outdated
@@ -573,7 +573,9 @@ class Guild { | |||
* be resolved, the user ID will be the result. | |||
* @example | |||
* // ban a user | |||
* guild.ban('123123123123'); | |||
* guild.ban(user) | |||
* .then(user => console.log(`Banned ${user} from ${guild.name}`)) |
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.
.then() statement is also in line with other examples
src/structures/Guild.js
Outdated
* .then(user => console.log(`Unbanned ${user.username} from ${guild.name}`)) | ||
* .catch(reject); | ||
* .catch(console.error); |
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.
Use of 'console.error' is more in line with the rest of the examples
Aside from what Crawl pointed out I feel like this PR is too specific. If you'd like to help us out with the documentation, that's great, but your PRs should cover a more diverse set of code. For example, I'm sure some of the consistency changes you made in this PR could've been applied in other areas too... |
The change from |
* Improve ban/unban examples * Fix example comments * Replace nondescript 'user' parameter with 'some user ID' * Update Guild.js * Update Guild.js
* Improve ban/unban examples * Fix example comments * Replace nondescript 'user' parameter with 'some user ID' * Update Guild.js * Update Guild.js
Improve consistency in examples