docs: improve examples (#2200)

* docs: improve examples


another

* remove conflict

* some nuances

* backport
This commit is contained in:
Isabella
2018-01-03 18:14:36 -06:00
committed by Crawl
parent db5bdcd855
commit c79823002b
6 changed files with 50 additions and 16 deletions

View File

@@ -386,6 +386,16 @@ class GuildMember {
* @param {Collection<Snowflake, Role>|Role[]|Snowflake[]} roles The roles or role IDs to apply
* @param {string} [reason] Reason for applying the roles
* @returns {Promise<GuildMember>}
* @example
* // Set the member's roles to a single role
* guildMember.setRoles(['391156570408615936'])
* .then(console.log)
* .catch(console.error);
* @example
* // Remove all the roles from a member
* guildMember.setRoles([])
* .then(member => console.log(`Member roles is now of ${member.roles.size} size`))
* .catch(console.error);
*/
setRoles(roles, reason) {
return this.edit({ roles }, reason);
@@ -497,8 +507,10 @@ class GuildMember {
* @param {string} [options.reason] Reason for banning
* @returns {Promise<GuildMember>}
* @example
* // ban a guild member
* guildMember.ban(7);
* // Ban a guild member
* guildMember.ban(7)
* .then(console.log)
* .catch(console.error);
*/
ban(options) {
return this.guild.ban(this, options);