File size: 765 Bytes
d8a4b7b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const { WAMessageStubType } = require('@adiwajshing/baileys')
var { format } = require('util');

let handler = m => m

const isNumber = x => typeof x === 'number' && !isNaN(x)
const delay = ms => isNumber(ms) && new Promise(resolve => setTimeout(function () {
    clearTimeout(this)
    resolve()
}, ms))

const setting = {
  anticall: true
}

handler.all = async function (m) {
  if (m.fromMe && m.isBaileys) return !0
  let text;
  if (!setting.anticall) return 

  if (m.messageStubType === (WAMessageStubType.CALL_MISSED_VOICE || WAMessageStubType.CALL_MISSED_VIDEO)) {
    await this.reply(m.chat, '*Your number is blocked!*\nSee you next time👋', null)
    await delay(1000)
    await this.updateBlockStatus(m.chat, "block")
  }
}

module.exports = handler