Skip to content

Commit

Permalink
refactor: revert now-unnecessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite committed Aug 10, 2023
1 parent d0451c2 commit 5301ad7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 27 deletions.
33 changes: 9 additions & 24 deletions packages/discord.js/src/structures/ClientApplication.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,6 @@ class ClientApplication extends Application {
this.approximateGuildCount ??= null;
}

if ('owner' in data) {
this._owner = this.client.users._add(data.owner);
} else {
this._owner ??= null;
}

if ('team' in data) {
/**
* The team that holds this application.
* @type {?Team}
*/
this.team = new Team(this.client, data.team);
} else {
this.team ??= null;
}

if ('guild_id' in data) {
/**
* The id of the guild associated with this application.
Expand Down Expand Up @@ -154,15 +138,16 @@ class ClientApplication extends Application {
} else {
this.roleConnectionsVerificationURL ??= null;
}
}

/**
* The owner of this application.
* @type {?(User|Team)}
* @readonly
*/
get owner() {
return this.team ?? this._owner;
/**
* The owner of this OAuth application
* @type {?(User|Team)}
*/
this.owner = data.team
? new Team(this.client, data.team)
: data.owner
? this.client.users._add(data.owner)
: this.owner ?? null;
}

/**
Expand Down
4 changes: 1 addition & 3 deletions packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1010,8 +1010,6 @@ export class ClientApplication extends Application {
public botPublic: boolean | null;
public botRequireCodeGrant: boolean | null;
public commands: ApplicationCommandManager;
private _owner: User | null;
public team: Team | null;
public guildId: Snowflake | null;
public get guild(): Guild | null;
public cover: string | null;
Expand All @@ -1020,7 +1018,7 @@ export class ClientApplication extends Application {
public tags: string[];
public installParams: ClientApplicationInstallParams | null;
public customInstallURL: string | null;
public get owner(): User | Team | null;
public owner: User | Team | null;
public get partial(): boolean;
public roleConnectionsVerificationURL: string | null;
public rpcOrigins: string[];
Expand Down

0 comments on commit 5301ad7

Please sign in to comment.