File size: 743 Bytes
bb69f9b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
30
31
32
33
const {
  bot,
  setPdm,
  // genButtonMessage
} = require('../lib/')

bot(
  {
    pattern: 'pdm ?(.*)',
    desc: 'To manage promote demote alert',
    type: 'group',
    onlyGroup: true,
  },
  async (message, match) => {
    if (!match) return await message.send('*Promote demote message*\npdm on | off')
    // await message.send(
    // 	await genButtonMessage(
    // 		[
    // 			{ id: 'pdm on', text: 'ON' },
    // 			{ id: 'pdm off', text: 'OFF' },
    // 		],
    // 		'Promote Demote Message'
    // 	),
    // 	{},
    // 	'button'
    // )
    if (match == 'on' || match == 'off') {
      await setPdm(message.jid, match, message.id)
      await message.send(`_pdm ${match == 'on' ? 'Activated' : 'Deactivated'}_`)
    }
  }
)