Correção de propriedade null

pull/21/head
adriano 2023-08-15 13:59:25 -03:00
parent 2138d70fa9
commit 22ad48e9be
2 changed files with 5 additions and 6 deletions

View File

@ -105,7 +105,6 @@ const isWeekend = async () => {
// obj.set = true;
// obj.msg = weekend.message;
}
return obj;
}
};

View File

@ -632,7 +632,7 @@ const handleMessage = async (msg: any, wbot: any): Promise<void> => {
// MESSAGE TO HOLIDAY
const holiday: any = await isHoliday();
if (holiday.set) {
if (holiday && holiday.set) {
if (msg.fromMe && holiday.msg == msg.body) {
console.log("HOLIDAY MESSAGE IGNORED");
return;
@ -645,7 +645,7 @@ const handleMessage = async (msg: any, wbot: any): Promise<void> => {
// MESSAGES TO SATURDAY OR SUNDAY
const weekend: any = await isWeekend();
if (weekend.set) {
if (weekend && weekend.set) {
if (msg.fromMe && weekend.msg == msg.body) {
console.log("WEEKEND MESSAGE IGNORED");
return;
@ -658,7 +658,7 @@ const handleMessage = async (msg: any, wbot: any): Promise<void> => {
// MESSAGE TO BUSINESS TIME
const businessTime = await isOutBusinessTime();
if (businessTime.set) {
if (businessTime && businessTime.set) {
if (msg.fromMe && businessTime.msg == msg.body) {
console.log("BUSINESS TIME MESSAGE IGNORED");
return;