mirror of
https://github.com/danbulant/discord.js
synced 2026-06-10 02:02:40 +00:00
fix(Integration): user might not be present (#4691)
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
parent
b7740d4859
commit
baffbdb541
2 changed files with 8 additions and 6 deletions
|
|
@ -58,11 +58,13 @@ class Integration extends Base {
|
||||||
*/
|
*/
|
||||||
this.role = this.guild.roles.cache.get(data.role_id);
|
this.role = this.guild.roles.cache.get(data.role_id);
|
||||||
|
|
||||||
/**
|
if (data.user) {
|
||||||
* The user for this integration
|
/**
|
||||||
* @type {User}
|
* The user for this integration
|
||||||
*/
|
* @type {?User}
|
||||||
this.user = this.client.users.add(data.user);
|
*/
|
||||||
|
this.user = this.client.users.add(data.user);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The account integration information
|
* The account integration information
|
||||||
|
|
|
||||||
2
typings/index.d.ts
vendored
2
typings/index.d.ts
vendored
|
|
@ -890,7 +890,7 @@ declare module 'discord.js' {
|
||||||
public syncedAt: number;
|
public syncedAt: number;
|
||||||
public syncing: boolean;
|
public syncing: boolean;
|
||||||
public type: string;
|
public type: string;
|
||||||
public user: User;
|
public user?: User;
|
||||||
public delete(reason?: string): Promise<Integration>;
|
public delete(reason?: string): Promise<Integration>;
|
||||||
public edit(data: IntegrationEditData, reason?: string): Promise<Integration>;
|
public edit(data: IntegrationEditData, reason?: string): Promise<Integration>;
|
||||||
public sync(): Promise<Integration>;
|
public sync(): Promise<Integration>;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue