mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 09:33:32 +01:00
feat(GuildChannel): createInvite target options (#5514)
Co-authored-by: Antonio Román <kyradiscord@gmail.com> Co-authored-by: Advaith <advaithj1@gmail.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const Base = require('./Base');
|
||||
const IntegrationApplication = require('./IntegrationApplication');
|
||||
const { Endpoints } = require('../util/Constants');
|
||||
const Permissions = require('../util/Permissions');
|
||||
|
||||
@@ -71,22 +72,31 @@ class Invite extends Base {
|
||||
this.inviter = data.inviter ? this.client.users.add(data.inviter) : null;
|
||||
|
||||
/**
|
||||
* The target user for this invite
|
||||
* The user whose stream to display for this voice channel stream invite
|
||||
* @type {?User}
|
||||
*/
|
||||
this.targetUser = data.target_user ? this.client.users.add(data.target_user) : null;
|
||||
|
||||
/**
|
||||
* The type of the target user:
|
||||
* The embedded application to open for this voice channel embedded application invite
|
||||
* @type {?IntegrationApplication}
|
||||
*/
|
||||
this.targetApplication = data.target_application
|
||||
? new IntegrationApplication(this.client, data.target_application)
|
||||
: null;
|
||||
|
||||
/**
|
||||
* The type of the invite target:
|
||||
* * 1: STREAM
|
||||
* @typedef {number} TargetUser
|
||||
* * 2: EMBEDDED_APPLICATION
|
||||
* @typedef {number} TargetType
|
||||
*/
|
||||
|
||||
/**
|
||||
* The target user type
|
||||
* @type {?TargetUser}
|
||||
* The target type
|
||||
* @type {?TargetType}
|
||||
*/
|
||||
this.targetUserType = typeof data.target_user_type === 'number' ? data.target_user_type : null;
|
||||
this.targetType = typeof data.target_type === 'number' ? data.target_type : null;
|
||||
|
||||
/**
|
||||
* The channel the invite is for
|
||||
|
||||
Reference in New Issue
Block a user