feat(Application): application flags (#5147)

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
This commit is contained in:
Jan
2021-03-31 21:55:12 +02:00
committed by GitHub
parent dedf43288e
commit 06e9d86cb3
9 changed files with 147 additions and 53 deletions

View File

@@ -1,5 +1,6 @@
'use strict';
const ClientApplication = require('../../../structures/ClientApplication');
let ClientUser;
module.exports = (client, { d: data }, shard) => {
@@ -7,9 +8,8 @@ module.exports = (client, { d: data }, shard) => {
client.user._patch(data.user);
} else {
if (!ClientUser) ClientUser = require('../../../structures/ClientUser');
const clientUser = new ClientUser(client, data.user);
client.user = clientUser;
client.users.cache.set(clientUser.id, clientUser);
client.user = new ClientUser(client, data.user);
client.users.cache.set(client.user.id, client.user);
}
for (const guild of data.guilds) {
@@ -17,5 +17,11 @@ module.exports = (client, { d: data }, shard) => {
client.guilds.add(guild);
}
if (client.application) {
client.application._patch(data.application);
} else {
client.application = new ClientApplication(client, data.application);
}
shard.checkReady();
};