diff --git a/src/structures/Integration.js b/src/structures/Integration.js index 49a0227af..0bd673133 100644 --- a/src/structures/Integration.js +++ b/src/structures/Integration.js @@ -58,11 +58,13 @@ class Integration extends Base { */ this.role = this.guild.roles.cache.get(data.role_id); - /** - * The user for this integration - * @type {User} - */ - this.user = this.client.users.add(data.user); + if (data.user) { + /** + * The user for this integration + * @type {?User} + */ + this.user = this.client.users.add(data.user); + } /** * The account integration information diff --git a/typings/index.d.ts b/typings/index.d.ts index 340b2043b..504682caa 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -890,7 +890,7 @@ declare module 'discord.js' { public syncedAt: number; public syncing: boolean; public type: string; - public user: User; + public user?: User; public delete(reason?: string): Promise; public edit(data: IntegrationEditData, reason?: string): Promise; public sync(): Promise;