mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
feat(Guild): add rulesChannel and publicUpdatesChannel (#3810)
* add rulesChannel* & publicUpdatesChannel* * update typings
This commit is contained in:
@@ -275,6 +275,20 @@ class Guild {
|
||||
this.available = !data.unavailable;
|
||||
this.features = data.features || this.features || [];
|
||||
|
||||
/**
|
||||
* The ID of the rules channel for the guild
|
||||
* <info>This is only available on guilds with the `PUBLIC` feature</info>
|
||||
* @type {?Snowflake}
|
||||
*/
|
||||
this.rulesChannelID = data.rules_channel_id;
|
||||
|
||||
/**
|
||||
* The ID of the public updates channel for the guild
|
||||
* <info>This is only available on guilds with the `PUBLIC` feature</info>
|
||||
* @type {?Snowflake}
|
||||
*/
|
||||
this.publicUpdatesChannelID = data.public_updates_channel_id;
|
||||
|
||||
if (data.members) {
|
||||
this.members.clear();
|
||||
for (const guildUser of data.members) this._addMember(guildUser, false);
|
||||
@@ -558,6 +572,26 @@ class Guild {
|
||||
return this.roles.get(this.id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rules channel for this guild
|
||||
* <info>This is only available on guilds with the `PUBLIC` feature</info>
|
||||
* @type {?TextChannel}
|
||||
* @readonly
|
||||
*/
|
||||
get rulesChannel() {
|
||||
return this.client.channels.get(this.rulesChannelID) || null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Public updates channel for this guild
|
||||
* <info>This is only available on guilds with the `PUBLIC` feature</info>
|
||||
* @type {?TextChannel}
|
||||
* @readonly
|
||||
*/
|
||||
get publicUpdatesChannel() {
|
||||
return this.client.channels.get(this.publicUpdatesChannelID) || null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The client user as a GuildMember of this guild
|
||||
* @type {?GuildMember}
|
||||
|
||||
Reference in New Issue
Block a user