mirror of
https://github.com/discordjs/discord.js.git
synced 2024-08-20 17:54:43 +12:00
Add guild#createRole resolve permissions and RoleData optional (#1321)
* resolving permissions * make RoleData optional
This commit is contained in:
parent
f73e6a3e4d
commit
e08f2bad30
2 changed files with 2 additions and 1 deletions
|
@ -418,6 +418,7 @@ class RESTMethods {
|
|||
|
||||
createGuildRole(guild, data) {
|
||||
if (data.color) data.color = this.client.resolver.resolveColor(data.color);
|
||||
if (data.permissions) data.permissions = Permissions.resolve(data.permissions);
|
||||
return this.rest.makeRequest('post', Constants.Endpoints.guildRoles(guild.id), true, data).then(role =>
|
||||
this.client.actions.GuildRoleCreate.handle({
|
||||
guild_id: guild.id,
|
||||
|
|
|
@ -683,7 +683,7 @@ class Guild {
|
|||
* .then(role => console.log(`Created role ${role}`))
|
||||
* .catch(console.error)
|
||||
*/
|
||||
createRole(data) {
|
||||
createRole(data = {}) {
|
||||
return this.client.rest.methods.createGuildRole(this, data);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue