Fix changeStatus logical error2

This commit is contained in:
atorop
2024-08-29 08:48:20 +03:00
parent 33236b5a4d
commit 73271a6be8

View File

@@ -92,7 +92,7 @@ exports.refreshStatus = async (bot, messageData) => {
let ticketId = listTickets[i].id;
if(!listTickets[i] || !messageData.data.hasOwnProperty(ticketId)) continue;
let td = messageData.data[ticketId];
// try{
try{
if(td.status != listTickets[i].status){
let usersArray = await glpm.getUsers(ticketId);
let message = await htmlToText(listTickets[i].content);
@@ -130,9 +130,9 @@ exports.refreshStatus = async (bot, messageData) => {
}else if(td.hasOwnProperty('threadId') && (listTickets[i].status == 5 || listTickets[i].status == 6)){
await closeThread(bot, messageData, ticketId);
}
//}catch(e){
// fs.appendFileSync(dir + "/../logs/logs.json", JSON.stringify("refreshStatus function: " + e, null, 3));
//}
}catch(e){
fs.appendFileSync(dir + "/../logs/logs.json", JSON.stringify("refreshStatus function: " + e, null, 3));
}
}
fs.writeFileSync(dir + "/../data/messageData.json", JSON.stringify(messageData, null, 3));
}