add fallbacks
This commit is contained in:
@@ -129,6 +129,7 @@ class Emoji {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const guild of localuser.guilds) {
|
for (const guild of localuser.guilds) {
|
||||||
|
if (!guild.emojis) continue;
|
||||||
const emj = guild.emojis.find((_) => _.id === idOrString);
|
const emj = guild.emojis.find((_) => _.id === idOrString);
|
||||||
if (emj) {
|
if (emj) {
|
||||||
return new Emoji(emj, localuser);
|
return new Emoji(emj, localuser);
|
||||||
|
@@ -643,7 +643,7 @@ class Guild extends SnowFlake {
|
|||||||
update(json: extendedProperties) {
|
update(json: extendedProperties) {
|
||||||
this.large = json.large;
|
this.large = json.large;
|
||||||
this.member_count = json.member_count;
|
this.member_count = json.member_count;
|
||||||
this.emojis = json.emojis;
|
this.emojis = json.emojis || [];
|
||||||
this.headers = this.owner.headers;
|
this.headers = this.owner.headers;
|
||||||
this.properties.features = json.features;
|
this.properties.features = json.features;
|
||||||
if (this.properties.icon !== json.icon) {
|
if (this.properties.icon !== json.icon) {
|
||||||
@@ -669,7 +669,7 @@ class Guild extends SnowFlake {
|
|||||||
this.owner = owner;
|
this.owner = owner;
|
||||||
this.large = json.large;
|
this.large = json.large;
|
||||||
this.member_count = json.member_count;
|
this.member_count = json.member_count;
|
||||||
this.emojis = json.emojis;
|
this.emojis = json.emojis || [];
|
||||||
this.headers = this.owner.headers;
|
this.headers = this.owner.headers;
|
||||||
this.channels = [];
|
this.channels = [];
|
||||||
if (json.properties) {
|
if (json.properties) {
|
||||||
@@ -720,7 +720,7 @@ class Guild extends SnowFlake {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.prevchannel = this.localuser.channelids.get(this.perminfo.prevchannel);
|
this.prevchannel = this.localuser.channelids.get(this.perminfo.prevchannel);
|
||||||
this.stickers = json.stickers.map((_) => new Sticker(_, this));
|
this.stickers = json.stickers.map((_) => new Sticker(_, this)) || [];
|
||||||
}
|
}
|
||||||
get perminfo() {
|
get perminfo() {
|
||||||
return this.localuser.perminfo.guilds[this.id];
|
return this.localuser.perminfo.guilds[this.id];
|
||||||
|
Reference in New Issue
Block a user