mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
add new unique property (#1659)
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user