* Add reasons

* How could I forget

* Hopefully fix conflicts
This commit is contained in:
Pg Biel
2017-07-26 22:14:04 -03:00
committed by Crawl
parent 27196c2f9f
commit eef87e5d97
6 changed files with 78 additions and 50 deletions

View File

@@ -218,6 +218,7 @@ class Role {
/**
* Set a new name for the role.
* @param {string} name The new name of the role
* @param {string} [reason] Reason for changing the role's name
* @returns {Promise<Role>}
* @example
* // Set the name of the role
@@ -225,13 +226,14 @@ class Role {
* .then(r => console.log(`Edited name of role ${r}`))
* .catch(console.error);
*/
setName(name) {
return this.edit({ name });
setName(name, reason) {
return this.edit({ name }, reason);
}
/**
* Set a new color for the role.
* @param {ColorResolvable} color The color of the role
* @param {string} [reason] Reason for changing the role's color
* @returns {Promise<Role>}
* @example
* // Set the color of a role
@@ -239,13 +241,14 @@ class Role {
* .then(r => console.log(`Set color of role ${r}`))
* .catch(console.error);
*/
setColor(color) {
return this.edit({ color });
setColor(color, reason) {
return this.edit({ color }, reason);
}
/**
* Set whether or not the role should be hoisted.
* @param {boolean} hoist Whether or not to hoist the role
* @param {string} [reason] Reason for setting whether or not the role should be hoisted
* @returns {Promise<Role>}
* @example
* // Set the hoist of the role
@@ -253,8 +256,8 @@ class Role {
* .then(r => console.log(`Role hoisted: ${r.hoist}`))
* .catch(console.error);
*/
setHoist(hoist) {
return this.edit({ hoist });
setHoist(hoist, reason) {
return this.edit({ hoist }, reason);
}
/**
@@ -275,6 +278,7 @@ class Role {
/**
* Set the permissions of the role.
* @param {string[]} permissions The permissions of the role
* @param {string} [reason] Reason for changing the role's permissions
* @returns {Promise<Role>}
* @example
* // Set the permissions of the role
@@ -282,13 +286,14 @@ class Role {
* .then(r => console.log(`Role updated ${r}`))
* .catch(console.error);
*/
setPermissions(permissions) {
return this.edit({ permissions });
setPermissions(permissions, reason) {
return this.edit({ permissions }, reason);
}
/**
* Set whether this role is mentionable.
* @param {boolean} mentionable Whether this role should be mentionable
* @param {string} [reason] Reason for setting whether or not this role should be mentionable
* @returns {Promise<Role>}
* @example
* // Make the role mentionable
@@ -296,8 +301,8 @@ class Role {
* .then(r => console.log(`Role updated ${r}`))
* .catch(console.error);
*/
setMentionable(mentionable) {
return this.edit({ mentionable });
setMentionable(mentionable, reason) {
return this.edit({ mentionable }, reason);
}
/**