mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
fix(RoleStore): create method is supposed to take an options object
This commit is contained in:
@@ -20,8 +20,9 @@ class RoleStore extends DataStore {
|
||||
/**
|
||||
* Creates a new role in the guild with given information.
|
||||
* <warn>The position will silently reset to 1 if an invalid one is provided, or none.</warn>
|
||||
* @param {RoleData} [data] The data to update the role with
|
||||
* @param {string} [reason] Reason for creating this role
|
||||
* @param {Object} [options] Options
|
||||
* @param {RoleData} [options.data] The data to update the role with
|
||||
* @param {string} [options.reason] Reason for creating this role
|
||||
* @returns {Promise<Role>}
|
||||
* @example
|
||||
* // Create a new role
|
||||
@@ -31,15 +32,16 @@ class RoleStore extends DataStore {
|
||||
* @example
|
||||
* // Create a new role with data and a reason
|
||||
* guild.roles.create({
|
||||
* data: {
|
||||
* name: 'Super Cool People',
|
||||
* color: 'BLUE'
|
||||
* color: 'BLUE',
|
||||
* },
|
||||
* 'we needed a role for Super Cool People',
|
||||
* reason: 'we needed a role for Super Cool People',
|
||||
* })
|
||||
* .then(console.log)
|
||||
* .catch(console.error);
|
||||
*/
|
||||
create(data = {}, reason) {
|
||||
create({ data = {}, reason } = {}) {
|
||||
if (data.color) data.color = resolveColor(data.color);
|
||||
if (data.permissions) data.permissions = Permissions.resolve(data.permissions);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user