mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
Handle unavailable guild, fix default getChannelLogs limit
This commit is contained in:
@@ -67,38 +67,32 @@ var Server = (function (_Equality) {
|
||||
|
||||
var self = this;
|
||||
|
||||
if (data.roles) {
|
||||
data.roles.forEach(function (dataRole) {
|
||||
_this.roles.add(new _Role2["default"](dataRole, _this, client));
|
||||
});
|
||||
}
|
||||
data.roles.forEach(function (dataRole) {
|
||||
_this.roles.add(new _Role2["default"](dataRole, _this, client));
|
||||
});
|
||||
|
||||
if (data.members) {
|
||||
data.members.forEach(function (dataUser) {
|
||||
_this.memberMap[dataUser.user.id] = {
|
||||
roles: dataUser.roles.map(function (pid) {
|
||||
return self.roles.get("id", pid);
|
||||
}),
|
||||
mute: dataUser.mute,
|
||||
deaf: dataUser.deaf,
|
||||
joinedAt: Date.parse(dataUser.joined_at)
|
||||
};
|
||||
var user = client.internal.users.add(new _User2["default"](dataUser.user, client));
|
||||
_this.members.add(user);
|
||||
});
|
||||
}
|
||||
data.members.forEach(function (dataUser) {
|
||||
_this.memberMap[dataUser.user.id] = {
|
||||
roles: dataUser.roles.map(function (pid) {
|
||||
return self.roles.get("id", pid);
|
||||
}),
|
||||
mute: dataUser.mute,
|
||||
deaf: dataUser.deaf,
|
||||
joinedAt: Date.parse(dataUser.joined_at)
|
||||
};
|
||||
var user = client.internal.users.add(new _User2["default"](dataUser.user, client));
|
||||
_this.members.add(user);
|
||||
});
|
||||
|
||||
if (data.channels) {
|
||||
data.channels.forEach(function (dataChannel) {
|
||||
if (dataChannel.type === "text") {
|
||||
var channel = client.internal.channels.add(new _TextChannel2["default"](dataChannel, client, _this));
|
||||
_this.channels.add(channel);
|
||||
} else {
|
||||
var channel = client.internal.channels.add(new _VoiceChannel2["default"](dataChannel, client, _this));
|
||||
_this.channels.add(channel);
|
||||
}
|
||||
});
|
||||
}
|
||||
data.channels.forEach(function (dataChannel) {
|
||||
if (dataChannel.type === "text") {
|
||||
var channel = client.internal.channels.add(new _TextChannel2["default"](dataChannel, client, _this));
|
||||
_this.channels.add(channel);
|
||||
} else {
|
||||
var channel = client.internal.channels.add(new _VoiceChannel2["default"](dataChannel, client, _this));
|
||||
_this.channels.add(channel);
|
||||
}
|
||||
});
|
||||
|
||||
if (data.presences) {
|
||||
for (var _iterator = data.presences, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
|
||||
|
||||
Reference in New Issue
Block a user