-
Notifications
You must be signed in to change notification settings - Fork 66
/
_expired.js
18 lines (16 loc) · 1.17 KB
/
_expired.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
let handler = m => m
handler.before = async function (m) {
const fkontak = { key: {participant: `[email protected]`, ...(m.chat ? { remoteJid: `status@broadcast` } : {}) }, message: { 'contactMessage': { 'displayName': wm, 'vcard': `BEGIN:VCARD\nVERSION:3.0\nN:XL;${wm},;;;\nFN:${wm},\nitem1.TEL;waid=${m.sender.split('@')[0]}:${m.sender.split('@')[0]}\nitem1.X-ABLabell:Ponsel\nEND:VCARD`, 'jpegThumbnail': require('fs').readFileSync('./src/logo.jpg'), thumbnail: require('fs').readFileSync('./src/logo.jpg'),sendEphemeral: true}}}
if (m.isGroup && global.db.data.chats[m.chat].expired != 0) {
if (new Date() * 1 >= global.db.data.chats[m.chat].expired) {
this.reply(m.chat, `waktunya *${this.user.name}* untuk meninggalkan grup, mau bot ini stay di grup kamu? sewa ke nomor di bawah ini`, null).then(() => {
this.sendKontak(m.chat, kontak2, fkontak, { contexInfo: { forwardingScore: 99999, isForwarded: true } }).then(() => {
this.groupLeave(m.chat).then(() => {
global.db.data.chats[m.chat].expired = 0
})
})
})
}
}
}
module.exports = handler