Skip to content

Commit 5301ad7

Browse files
committed
refactor: revert now-unnecessary changes
1 parent d0451c2 commit 5301ad7

File tree

2 files changed

+10
-27
lines changed

2 files changed

+10
-27
lines changed

packages/discord.js/src/structures/ClientApplication.js

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -79,22 +79,6 @@ class ClientApplication extends Application {
7979
this.approximateGuildCount ??= null;
8080
}
8181

82-
if ('owner' in data) {
83-
this._owner = this.client.users._add(data.owner);
84-
} else {
85-
this._owner ??= null;
86-
}
87-
88-
if ('team' in data) {
89-
/**
90-
* The team that holds this application.
91-
* @type {?Team}
92-
*/
93-
this.team = new Team(this.client, data.team);
94-
} else {
95-
this.team ??= null;
96-
}
97-
9882
if ('guild_id' in data) {
9983
/**
10084
* The id of the guild associated with this application.
@@ -154,15 +138,16 @@ class ClientApplication extends Application {
154138
} else {
155139
this.roleConnectionsVerificationURL ??= null;
156140
}
157-
}
158141

159-
/**
160-
* The owner of this application.
161-
* @type {?(User|Team)}
162-
* @readonly
163-
*/
164-
get owner() {
165-
return this.team ?? this._owner;
142+
/**
143+
* The owner of this OAuth application
144+
* @type {?(User|Team)}
145+
*/
146+
this.owner = data.team
147+
? new Team(this.client, data.team)
148+
: data.owner
149+
? this.client.users._add(data.owner)
150+
: this.owner ?? null;
166151
}
167152

168153
/**

packages/discord.js/typings/index.d.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,8 +1010,6 @@ export class ClientApplication extends Application {
10101010
public botPublic: boolean | null;
10111011
public botRequireCodeGrant: boolean | null;
10121012
public commands: ApplicationCommandManager;
1013-
private _owner: User | null;
1014-
public team: Team | null;
10151013
public guildId: Snowflake | null;
10161014
public get guild(): Guild | null;
10171015
public cover: string | null;
@@ -1020,7 +1018,7 @@ export class ClientApplication extends Application {
10201018
public tags: string[];
10211019
public installParams: ClientApplicationInstallParams | null;
10221020
public customInstallURL: string | null;
1023-
public get owner(): User | Team | null;
1021+
public owner: User | Team | null;
10241022
public get partial(): boolean;
10251023
public roleConnectionsVerificationURL: string | null;
10261024
public rpcOrigins: string[];

0 commit comments

Comments
 (0)