mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-20 13:33:30 +01:00
feat(Guild): add rulesChannel and publicUpdatesChannel (#3810)
* add rulesChannel* & publicUpdatesChannel* * update typings
This commit is contained in:
@@ -320,6 +320,20 @@ class Guild extends Base {
|
|||||||
this.available = !data.unavailable;
|
this.available = !data.unavailable;
|
||||||
this.features = data.features || this.features || [];
|
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.channels) {
|
if (data.channels) {
|
||||||
this.channels.cache.clear();
|
this.channels.cache.clear();
|
||||||
for (const rawChannel of data.channels) {
|
for (const rawChannel of data.channels) {
|
||||||
@@ -504,6 +518,26 @@ class Guild extends Base {
|
|||||||
return this.client.channels.cache.get(this.embedChannelID) || null;
|
return this.client.channels.cache.get(this.embedChannelID) || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.cache.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.cache.get(this.publicUpdatesChannelID) || null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The client user as a GuildMember of this guild
|
* The client user as a GuildMember of this guild
|
||||||
* @type {?GuildMember}
|
* @type {?GuildMember}
|
||||||
|
|||||||
4
typings/index.d.ts
vendored
4
typings/index.d.ts
vendored
@@ -710,8 +710,12 @@ declare module 'discord.js' {
|
|||||||
public premiumSubscriptionCount: number | null;
|
public premiumSubscriptionCount: number | null;
|
||||||
public premiumTier: PremiumTier;
|
public premiumTier: PremiumTier;
|
||||||
public presences: PresenceManager;
|
public presences: PresenceManager;
|
||||||
|
public readonly publicUpdatesChannel: TextChannel | null;
|
||||||
|
public publicUpdatesChannelID: Snowflake | null;
|
||||||
public region: string;
|
public region: string;
|
||||||
public roles: RoleManager;
|
public roles: RoleManager;
|
||||||
|
public readonly rulesChannel: TextChannel | null;
|
||||||
|
public rulesChannelID: Snowflake | null;
|
||||||
public readonly shard: WebSocketShard;
|
public readonly shard: WebSocketShard;
|
||||||
public shardID: number;
|
public shardID: number;
|
||||||
public splash: string | null;
|
public splash: string | null;
|
||||||
|
|||||||
Reference in New Issue
Block a user