mirror of
https://github.com/danbulant/discord.js
synced 2026-07-09 05:00:48 +00:00
Webpack build for branch master: 0300601649
This commit is contained in:
parent
60232db361
commit
5924d54144
2 changed files with 14 additions and 12 deletions
|
|
@ -4013,7 +4013,7 @@ class Guild {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new role in the guild, and optionally updates it with the given information.
|
* Creates a new role in the guild with given information
|
||||||
* @param {RoleData} [data] The data to update the role with
|
* @param {RoleData} [data] The data to update the role with
|
||||||
* @returns {Promise<Role>}
|
* @returns {Promise<Role>}
|
||||||
* @example
|
* @example
|
||||||
|
|
@ -4023,14 +4023,15 @@ class Guild {
|
||||||
* .catch(console.error);
|
* .catch(console.error);
|
||||||
* @example
|
* @example
|
||||||
* // create a new role with data
|
* // create a new role with data
|
||||||
* guild.createRole({ name: 'Super Cool People' })
|
* guild.createRole({
|
||||||
* .then(role => console.log(`Created role ${role}`))
|
* name: 'Super Cool People',
|
||||||
* .catch(console.error)
|
* color: 'BLUE',
|
||||||
|
* })
|
||||||
|
* .then(role => console.log(`Created role ${role}`))
|
||||||
|
* .catch(console.error)
|
||||||
*/
|
*/
|
||||||
createRole(data) {
|
createRole(data) {
|
||||||
const create = this.client.rest.methods.createGuildRole(this);
|
return this.client.rest.methods.createGuildRole(this, data);
|
||||||
if (!data) return create;
|
|
||||||
return create.then(role => role.edit(data));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -22532,8 +22533,9 @@ class RESTMethods {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
createGuildRole(guild) {
|
createGuildRole(guild, data) {
|
||||||
return this.rest.makeRequest('post', Constants.Endpoints.guildRoles(guild.id), true).then(role =>
|
if (data.color) data.color = this.client.resolver.resolveColor(data.color);
|
||||||
|
return this.rest.makeRequest('post', Constants.Endpoints.guildRoles(guild.id), true, data).then(role =>
|
||||||
this.client.actions.GuildRoleCreate.handle({
|
this.client.actions.GuildRoleCreate.handle({
|
||||||
guild_id: guild.id,
|
guild_id: guild.id,
|
||||||
role,
|
role,
|
||||||
|
|
|
||||||
6
discord.master.min.js
vendored
6
discord.master.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue