diff --git a/index.js b/index.js index 99db3470..484bf4a1 100644 --- a/index.js +++ b/index.js @@ -6595,11 +6595,7 @@ function isGoingToFast(api, event) { let input = eventB.normalize("NFKC"); commandCalls++; utils.logged("event_body " + event.threadID + " " + input); - if ( - !users.list.find((user) => event.senderID === user.id) || - // update old user data to newer ones - !!users.list.find((user) => event.senderID === user.id && user["name"] === undefined) - ) { + if (users.list.find((user) => event.senderID === user.id)) { api.getUserInfo(event.senderID, async (err, data1) => { if (err) return handleError({ stacktrace: err, cuid: api.getCurrentUserID(), e: event }); utils.logged("new_user " + event.threadID + " " + data1[event.senderID].name); @@ -6624,6 +6620,14 @@ function isGoingToFast(api, event) { }); }); } + if (!!users.list.find((user) => event.senderID === user.id && user["name"] === undefined)) { + api.getUserInfo(event.senderID, async (err, data1) => { + if (err) return handleError({ stacktrace: err, cuid: api.getCurrentUserID(), e: event }); + utils.logged("old_user " + event.threadID + " " + data1[event.senderID].name); + updateUserData(data1, event.senderID); + reactMessage(api, event, ":heart:"); + }); + } if (!users.bot.includes(event.senderID)) { if (isItBotOrNot(api, event)) { return true;