Fix in getting chatMember

This commit is contained in:
Nefrace 2021-04-12 23:02:41 +03:00
parent 1d1e20703e
commit 9335a31582
1 changed files with 4 additions and 1 deletions

View File

@ -639,7 +639,10 @@ async function updateDB(id) {
const users = await User.find({uid: chat.users}) const users = await User.find({uid: chat.users})
console.log({users}) console.log({users})
for(let user of 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 const u = chatMember.user
user.name = u.first_name + (u.last_name? " " + u.last_name : "") user.name = u.first_name + (u.last_name? " " + u.last_name : "")
user.username = u.username || null user.username = u.username || null