Skip to content

Commit

Permalink
refactor: move Guild#defaultRole to RoleStore#everyone (discordjs#3347)
Browse files Browse the repository at this point in the history
* remove guild#defaultRole

* add RoleStore#defaultRole

* typings

* fix trailing space

* another one

* Rename it to everyone
  • Loading branch information
didinele authored and samsamson33 committed Feb 27, 2020
1 parent f913c26 commit 7d4ebb0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
9 changes: 9 additions & 0 deletions src/stores/RoleStore.js
Expand Up @@ -110,6 +110,15 @@ class RoleStore extends DataStore {
});
}

/**
* The `@everyone` role of the guild
* @type {?Role}
* @readonly
*/
get everyone() {
return this.get(this.guild.id) || null;
}

/**
* The role with the highest position in the store
* @type {Role}
Expand Down
9 changes: 0 additions & 9 deletions src/structures/Guild.js
Expand Up @@ -489,15 +489,6 @@ class Guild extends Base {
return this.client.channels.get(this.embedChannelID) || null;
}

/**
* The `@everyone` role of the guild
* @type {?Role}
* @readonly
*/
get defaultRole() {
return this.roles.get(this.id) || null;
}

/**
* The client user as a GuildMember of this guild
* @type {?GuildMember}
Expand Down
2 changes: 1 addition & 1 deletion typings/index.d.ts
Expand Up @@ -686,7 +686,6 @@ declare module 'discord.js' {
public readonly createdAt: Date;
public readonly createdTimestamp: number;
public defaultMessageNotifications: DefaultMessageNotifications | number;
public readonly defaultRole: Role | null;
public deleted: boolean;
public description: string | null;
public embedChannel: GuildChannel | null;
Expand Down Expand Up @@ -1795,6 +1794,7 @@ declare module 'discord.js' {

export class RoleStore extends DataStore<Snowflake, Role, typeof Role, RoleResolvable> {
constructor(guild: Guild, iterable?: Iterable<any>);
public readonly everyone: Role | null;
public readonly highest: Role;

public create(options?: { data?: RoleData, reason?: string }): Promise<Role>;
Expand Down

0 comments on commit 7d4ebb0

Please sign in to comment.