Webpack build for branch master: 8d1bc30e40

This commit is contained in:
Travis CI 2017-02-21 20:09:52 +00:00
parent 7380e2fb9d
commit ceb5c8b6b9
2 changed files with 13 additions and 22 deletions

View file

@ -4097,20 +4097,15 @@ class Guild {
}
/**
* The data for a role
* @typedef {Object} AddGuildMemberOptions
* @property {string} accessToken An oauth2 access token granted with the guilds.join to the bot's application
* for the user you want to add to the guild
* @property {string} [nick] Value to set users nickname to
* @property {Collection<Snowflake, Role>|Role[]|string[]} [roles] The roles or role IDs to add
* @property {boolean} [mute] If the user is muted
* @property {boolean} [deaf] If the user is deafened
*/
/**
* Add a user to this guild using OAuth2
* @param {UserResolvable|string} user The user or ID of the user to add to guild
* @param {AddGuildMemberOptions} options Options object containing the access_token
* Adds a user to the guild using OAuth2. Requires the `CREATE_INSTANT_INVITE` permission.
* @param {UserResolvable} user User to add to the guild
* @param {Object} options Options for the addition
* @param {string} options.accessToken An OAuth2 access token for the user with the `guilds.join` scope granted to the
* bot's application
* @param {string} [options.nick] Nickname to give the member
* @param {Collection<Snowflake, Role>|Role[]|Snowflake[]} [options.roles] Roles to add to the member
* @param {boolean} [options.mute] Whether the member should be muted
* @param {boolean} [options.deaf] Whether the member should be deafened
* @returns {Promise<GuildMember>}
*/
addMember(user, options) {
@ -23172,17 +23167,13 @@ class RESTMethods {
}
putGuildMember(guild, user, options) {
options.access_token = options.accessToken;
if (options.roles) {
var roles = options.roles;
const roles = options.roles;
if (roles instanceof Collection || (roles instanceof Array && roles[0] instanceof Role)) {
options.roles = roles.map(role => role.id);
}
}
if (options.accessToken) {
options.access_token = options.accessToken;
} else {
return Promise.reject(new Error('OAuth2 access token was not specified.'));
}
return this.rest.makeRequest('put', Constants.Endpoints.guildMember(guild.id, user.id), true, options)
.then(data => this.client.actions.GuildMemberGet.handle(guild, data).member);
}

File diff suppressed because one or more lines are too long