mirror of
https://github.com/danbulant/discord.js
synced 2026-06-08 01:01:30 +00: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:
parent
55447fd4da
commit
1bafa4b86b
1 changed files with 8 additions and 4 deletions
|
|
@ -3,10 +3,14 @@
|
||||||
let ClientUser;
|
let ClientUser;
|
||||||
|
|
||||||
module.exports = (client, { d: data }, shard) => {
|
module.exports = (client, { d: data }, shard) => {
|
||||||
if (!ClientUser) ClientUser = require('../../../structures/ClientUser');
|
if (client.user) {
|
||||||
const clientUser = new ClientUser(client, data.user);
|
client.user._patch(data.user);
|
||||||
client.user = clientUser;
|
} else {
|
||||||
client.users.set(clientUser.id, clientUser);
|
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) {
|
for (const guild of data.guilds) {
|
||||||
guild.shardID = shard.id;
|
guild.shardID = shard.id;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue