hermeslin/twitter-bot-i-suck

Refine code logic

Opened this issue · 0 comments

這段應該要修一下,這樣判斷的方式感覺有點蠢

subscribersSnap.forEach((subscriber) => {
const notMentionedUsers = async (subscriber) => {
const notMentionedUsersSnap = await db.doc(`mention_queue/${today}/users/${subscriber.id}`).get();
return {
exists: notMentionedUsersSnap.exists,
subscriber: {
id: subscriber.id,
data: subscriber.data()
},
};
};
filterResult.push(notMentionedUsers(subscriber));
});