From 2df4f227a446a48330e941762374a262e138d2fd Mon Sep 17 00:00:00 2001 From: didinele Date: Sat, 17 Aug 2019 19:02:17 +0300 Subject: [PATCH] refactor: move Guild#defaultRole to RoleStore#everyone (#3347) * remove guild#defaultRole * add RoleStore#defaultRole * typings * fix trailing space * another one * Rename it to everyone --- src/stores/RoleStore.js | 9 +++++++++ src/structures/Guild.js | 9 --------- typings/index.d.ts | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/stores/RoleStore.js b/src/stores/RoleStore.js index db3e2c0be87f..649048be2f52 100644 --- a/src/stores/RoleStore.js +++ b/src/stores/RoleStore.js @@ -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} diff --git a/src/structures/Guild.js b/src/structures/Guild.js index 21be50d140c8..04aece2ff2f2 100644 --- a/src/structures/Guild.js +++ b/src/structures/Guild.js @@ -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} diff --git a/typings/index.d.ts b/typings/index.d.ts index 0d2422b63974..838eb2b3ee60 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -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; @@ -1795,6 +1794,7 @@ declare module 'discord.js' { export class RoleStore extends DataStore { constructor(guild: Guild, iterable?: Iterable); + public readonly everyone: Role | null; public readonly highest: Role; public create(options?: { data?: RoleData, reason?: string }): Promise;