mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix removal of Guild#afk/system channels and icon (#1863)
* fix removal of Guild#afk/system channels * guild#setIcon too * less ternary, many wow
This commit is contained in:
@@ -300,7 +300,7 @@ class Guild extends Base {
|
||||
* @readonly
|
||||
*/
|
||||
get afkChannel() {
|
||||
return this.client.channels.get(this.afkChannelID);
|
||||
return this.client.channels.get(this.afkChannelID) || null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -309,7 +309,7 @@ class Guild extends Base {
|
||||
* @readonly
|
||||
*/
|
||||
get systemChannel() {
|
||||
return this.client.channels.get(this.systemChannelID);
|
||||
return this.client.channels.get(this.systemChannelID) || null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -601,10 +601,14 @@ class Guild extends Base {
|
||||
if (data.name) _data.name = data.name;
|
||||
if (data.region) _data.region = data.region;
|
||||
if (typeof data.verificationLevel !== 'undefined') _data.verification_level = Number(data.verificationLevel);
|
||||
if (data.afkChannel) _data.afk_channel_id = this.client.resolver.resolveChannel(data.afkChannel).id;
|
||||
if (data.systemChannel) _data.system_channel_id = this.client.resolver.resolveChannel(data.systemChannel).id;
|
||||
if (typeof data.afkChannel !== 'undefined') {
|
||||
_data.afk_channel_id = this.client.resolver.resolveChannelID(data.afkChannel);
|
||||
}
|
||||
if (typeof data.systemChannel !== 'undefined') {
|
||||
_data.system_channel_id = this.client.resolver.resolveChannelID(data.systemChannel);
|
||||
}
|
||||
if (data.afkTimeout) _data.afk_timeout = Number(data.afkTimeout);
|
||||
if (data.icon) _data.icon = data.icon;
|
||||
if (typeof data.icon !== 'undefined') _data.icon = data.icon;
|
||||
if (data.owner) _data.owner_id = this.client.resolver.resolveUser(data.owner).id;
|
||||
if (data.splash) _data.splash = data.splash;
|
||||
if (typeof data.explicitContentFilter !== 'undefined') {
|
||||
|
||||
Reference in New Issue
Block a user