mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 03:53:29 +01:00
refactor: move Guild#defaultRole to RoleStore#everyone (#3347)
* remove guild#defaultRole * add RoleStore#defaultRole * typings * fix trailing space * another one * Rename it to everyone
This commit is contained in:
@@ -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
|
* The role with the highest position in the store
|
||||||
* @type {Role}
|
* @type {Role}
|
||||||
|
|||||||
@@ -489,15 +489,6 @@ class Guild extends Base {
|
|||||||
return this.client.channels.get(this.embedChannelID) || null;
|
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
|
* The client user as a GuildMember of this guild
|
||||||
* @type {?GuildMember}
|
* @type {?GuildMember}
|
||||||
|
|||||||
2
typings/index.d.ts
vendored
2
typings/index.d.ts
vendored
@@ -686,7 +686,6 @@ declare module 'discord.js' {
|
|||||||
public readonly createdAt: Date;
|
public readonly createdAt: Date;
|
||||||
public readonly createdTimestamp: number;
|
public readonly createdTimestamp: number;
|
||||||
public defaultMessageNotifications: DefaultMessageNotifications | number;
|
public defaultMessageNotifications: DefaultMessageNotifications | number;
|
||||||
public readonly defaultRole: Role | null;
|
|
||||||
public deleted: boolean;
|
public deleted: boolean;
|
||||||
public description: string | null;
|
public description: string | null;
|
||||||
public embedChannel: GuildChannel | null;
|
public embedChannel: GuildChannel | null;
|
||||||
@@ -1795,6 +1794,7 @@ declare module 'discord.js' {
|
|||||||
|
|
||||||
export class RoleStore extends DataStore<Snowflake, Role, typeof Role, RoleResolvable> {
|
export class RoleStore extends DataStore<Snowflake, Role, typeof Role, RoleResolvable> {
|
||||||
constructor(guild: Guild, iterable?: Iterable<any>);
|
constructor(guild: Guild, iterable?: Iterable<any>);
|
||||||
|
public readonly everyone: Role | null;
|
||||||
public readonly highest: Role;
|
public readonly highest: Role;
|
||||||
|
|
||||||
public create(options?: { data?: RoleData, reason?: string }): Promise<Role>;
|
public create(options?: { data?: RoleData, reason?: string }): Promise<Role>;
|
||||||
|
|||||||
Reference in New Issue
Block a user