diff --git a/index.js b/index.js index 9c845fe..e7f6f20 100644 --- a/index.js +++ b/index.js @@ -639,7 +639,10 @@ async function updateDB(id) { const users = await User.find({uid: chat.users}) console.log({users}) for(let user of users) { - const chatMember = await bot.getChatMember(id, user.uid) + const chatMember = await bot.getChatMember(id, user.uid).catch(e => {return null}) + if(!chatMember) { + continue + } const u = chatMember.user user.name = u.first_name + (u.last_name? " " + u.last_name : "") user.username = u.username || null