add new unique property (#1659)

This commit is contained in:
Gus Caplan
2017-07-05 03:02:40 -05:00
committed by Amish Shah
parent 39a3e72894
commit 7f809395af

View File

@@ -283,12 +283,13 @@ class GuildChannel extends Channel {
* kicked after 24 hours if they have not yet received a role
* @param {number} [options.maxAge=86400] How long the invite should last (in seconds, 0 for forever)
* @param {number} [options.maxUses=0] Maximum number of uses
* @param {boolean} [options.unique=false] Create a unique invite, or use an existing one with similar settings
* @param {string} [options.reason] Reason for creating this
* @returns {Promise<Invite>}
*/
createInvite({ temporary = false, maxAge = 86400, maxUses = 0, reason } = {}) {
createInvite({ temporary = false, maxAge = 86400, maxUses = 0, unique, reason } = {}) {
return this.client.api.channels[this.id].invites.post({ data: {
temporary, max_age: maxAge, max_uses: maxUses,
temporary, max_age: maxAge, max_uses: maxUses, unique,
}, reason })
.then(invite => new Invite(this.client, invite));
}