mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(READY): do not overwrite Client#user when reidentifying
See #3216, this commit attempts to fix losing ClientUser#_typing, which results in no longer being able to clear typing intervals
This commit is contained in:
@@ -3,10 +3,14 @@
|
||||
let ClientUser;
|
||||
|
||||
module.exports = (client, { d: data }, shard) => {
|
||||
if (!ClientUser) ClientUser = require('../../../structures/ClientUser');
|
||||
const clientUser = new ClientUser(client, data.user);
|
||||
client.user = clientUser;
|
||||
client.users.set(clientUser.id, clientUser);
|
||||
if (client.user) {
|
||||
client.user._patch(data.user);
|
||||
} else {
|
||||
if (!ClientUser) ClientUser = require('../../../structures/ClientUser');
|
||||
const clientUser = new ClientUser(client, data.user);
|
||||
client.user = clientUser;
|
||||
client.users.set(clientUser.id, clientUser);
|
||||
}
|
||||
|
||||
for (const guild of data.guilds) {
|
||||
guild.shardID = shard.id;
|
||||
|
||||
Reference in New Issue
Block a user