mirror of
https://github.com/danbulant/discord.js
synced 2026-07-08 20:51:14 +00:00
Webpack build for branch master: 0c0ec72cb8
This commit is contained in:
parent
5cca12f908
commit
a95a233946
2 changed files with 9 additions and 6 deletions
|
|
@ -6347,6 +6347,7 @@ class Guild {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new role in the guild with given information
|
* 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 {Object} [options] Options
|
* @param {Object} [options] Options
|
||||||
* @param {RoleData} [options.data] The data to update the role with
|
* @param {RoleData} [options.data] The data to update the role with
|
||||||
* @param {string} [options.reason] Reason for creating this role
|
* @param {string} [options.reason] Reason for creating this role
|
||||||
|
|
@ -6372,12 +6373,14 @@ class Guild {
|
||||||
if (data.color) data.color = Util.resolveColor(data.color);
|
if (data.color) data.color = Util.resolveColor(data.color);
|
||||||
if (data.permissions) data.permissions = Permissions.resolve(data.permissions);
|
if (data.permissions) data.permissions = Permissions.resolve(data.permissions);
|
||||||
|
|
||||||
return this.client.api.guilds(this.id).roles.post({ data, reason }).then(role =>
|
return this.client.api.guilds(this.id).roles.post({ data, reason }).then(r => {
|
||||||
this.client.actions.GuildRoleCreate.handle({
|
const { role } = this.client.actions.GuildRoleCreate.handle({
|
||||||
guild_id: this.id,
|
guild_id: this.id,
|
||||||
role,
|
role: r,
|
||||||
}).role
|
});
|
||||||
);
|
if (data.position) return role.setPosition(data.position, reason);
|
||||||
|
return role;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
2
discord.master.min.js
vendored
2
discord.master.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue