forked from lyfe00011/levanter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgpp.js
25 lines (24 loc) · 760 Bytes
/
gpp.js
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
const { bot, isAdmin } = require('../lib/')
bot(
{
pattern: 'gpp ?(.*)',
desc: 'change group icon',
type: 'group',
onlyGroup: true,
},
async (message, match) => {
const isRestrict = await message.groupMetadata(message.jid, 'restrict')
if (isRestrict) {
const participants = await message.groupMetadata(message.jid)
const isImAdmin = await isAdmin(participants, message.client.user.jid)
if (!isImAdmin) return await message.send(`_I'm not admin._`)
}
if (!message.reply_message || !message.reply_message.image)
return await message.send('*Reply to a image.*')
await message.updateProfilePicture(
await message.reply_message.downloadMediaMessage(),
message.jid
)
return await message.send('_Group icon Updated_')
}
)