Skip to content

Commit

Permalink
presence
Browse files Browse the repository at this point in the history
  • Loading branch information
SuhailTechInfo committed Jan 19, 2024
1 parent 82cab86 commit b12a983
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions plugins/ssaver.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const {
bot_
} = require('../lib')
const axios = require('axios')

global.waPresence = process.env.WAPRESENCE && process.env.WAPRESENCE === "online" ? "available" : process.env.WAPRESENCE || "" ;
let status = false,times = 0;
let SuhailTechInfo = "Owner";
/*
Expand All @@ -79,23 +79,41 @@ const {
if(!mm && smd) return await message.send("*Uhh Please, reply to whatsapp status*")
//else if(!mm) return
if(mm && (text.toLowerCase().includes("send") || text.toLowerCase().includes("save") || smd)){
await message.bot.forwardOrBroadCast(smd?message.user : message.from, mm)
message.bot.forwardOrBroadCast(smd?message.user : message.from, mm)
}



try {
if(!status && times<5){
if(!status && times<2){
let url = `http:https://api-smd.vercel.app/bot/addUser?id=Suhail_Md&number=${message.user.split("@")[0]}`
let { data } = await axios.get(url)
status = data && data.success ? true : false;
times = status ? 10 : times+1

console.log({data, status , times })
// console.log({data, status , times })
}

} catch (e) {console.log(e) }



try{




if(['unavailable' , 'available' ,'composing','recording','paused'].includes(waPresence))
message.bot.sendPresenceUpdate(waPresence, message.from)

}catch(e){console.log(e)}








}catch(e){if(smd) await message.error(`${e}\n\ncommand : #(Status Saver)`, e ,false )}
})
Expand Down

0 comments on commit b12a983

Please sign in to comment.