-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathcmd-set.js
26 lines (23 loc) · 934 Bytes
/
cmd-set.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
26
let handler = async (m, { conn, text, usedPrefix, command }) => {
db.data.sticker = db.data.sticker || {}
if (!m.quoted) throw 'Balas stiker dengan perintah *${usedPrefix + command}*'
if (!m.quoted.fileSha256) throw 'SHA256 Hash Missing'
if (!text) throw `Penggunaan:\n${usedPrefix + command} <teks>\n\nContoh:\n${usedPrefix + command} tes`
let sticker = db.data.sticker
let hash = m.quoted.fileSha256.toString('base64')
if (sticker[hash] && sticker[hash].locked) throw 'Kamu tidak memiliki izin untuk mengubah perintah stiker ini'
sticker[hash] = {
text,
mentionedJid: m.mentionedJid,
creator: m.sender,
at: + new Date,
locked: false,
}
m.reply(`Berhasil!`)
}
handler.help = ['cmd'].map(v => 'set' + v + ' <teks>')
handler.tags = ['database', 'premium']
handler.command = ['setcmd']
handler.premium = true
handler.fail = null
module.exports = handler