Spaces:
Paused
Paused
File size: 1,894 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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
const { bot, zushi, yami, ope, jidToNum } = require('../lib/')
bot(
{
pattern: 'zushi ?(.*)',
desc: 'allow set commands to be used by others in chat',
type: 'logia',
},
async (message, match) => {
if (!match)
return await message.send(
`> Example :\n- zushi ping, sticker\n\nwanna set all ? type list copy and paste the reply message\n- zushi copied_message`
)
const z = await zushi(match, message.jid, message.id)
if (!z) return await message.send(`*${match}* already set`)
await message.send(
`*allowed commands for @${message.isGroup ? message.jid : jidToNum(message.jid)}*\n${z
.map((a) => `- ${a}`)
.join('\n')}`,
{ contextInfo: { mentionedJid: [message.jid] } }
)
}
)
bot(
{
pattern: 'yami ?(.*)',
desc: 'shows the commands',
type: 'logia',
},
async (message, match) => {
const z = await yami(message.jid, message.id)
if (!z || !z.length) return await message.send(`not set any`)
await message.send(
`*allowed commands for @${message.isGroup ? message.jid : jidToNum(message.jid)}*\n${z
.map((a) => `- ${a}`)
.join('\n')}`,
{ contextInfo: { mentionedJid: [message.jid] } }
)
}
)
bot(
{
pattern: 'ope ?(.*)',
desc: 'delete or unset the command',
type: 'logia',
},
async (message, match) => {
if (!match) return await message.send('> Example :\n- ope ping, sticker\n- ope all')
const z = await ope(message.jid, match, message.id)
if (!z) return await message.send(`not set *${match}*`)
if (z === 'all') return await message.send(`_removed all allowed commands_`)
await message.send(
`*removed commands for @${message.isGroup ? message.jid : jidToNum(message.jid)}*\n${z
.map((a) => `- ${a}`)
.join('\n')}`,
{ contextInfo: { mentionedJid: [message.jid] } }
)
}
)
|