dist/models/chat.js
/**
 * Returns chat, creates one if required
 * @param chatId Chat id of the chat
 * @returns requestedchat
 */
Returns chat, creates one if required
@param chatId Chat id of the chat
@returns requestedchat
Returns chat creates one if required @param chatId Chat id of the chat @returns requestedchat
async function findChat(chatId) {
    let chat = await ChatModel.findOne({ chatId });
    if (!chat) {
        chat = new ChatModel({ chatId });
        chat = await chat.save();
    }
    return chat;
}
async function findChat ( chatId ) { let chat = await ChatModel . findOne ( { chatId } ) ; if ( ! chat ) { chat = new ChatModel ( { chatId } ) ; chat = await chat . save ( ) ; } return chat ; }
Returns chat, creates one if required
 @param chatId Chat id of the chat
 @returns requestedchat
Returns chat creates one if required @param chatId Chat id of the chat @returns requestedchat