mirror of
https://github.com/stjornleysi/telegram_glpi.git
synced 2025-11-29 08:33:11 +00:00
Fix changeStatus logical error2
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user