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:
Souji
2021-05-11 22:25:09 +02:00
committed by GitHub
parent ff2f7372f2
commit f831872125
6 changed files with 106 additions and 13 deletions

View File

@@ -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