Spaces:
Paused
Paused
File size: 1,230 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 |
const { setCmd, bot, getCmd, delCmd } = require('../lib/index')
bot(
{
pattern: 'setcmd ?(.*)',
desc: 'to set cmd',
type: 'misc',
},
async (message, match) => {
if (!message.reply_message || !message.reply_message.sticker)
return await message.send('*Reply to a sticker*')
if (!match) return await message.send('*Example : setcmd ping*')
const res = await setCmd(match, message.reply_message, message.id)
return await message.send(res < 1 ? '_Failed_' : '_Success_')
}
)
bot(
{
pattern: 'getcmd ?(.*)',
desc: 'to get cmd',
type: 'misc',
},
async (message, match) => {
const res = await getCmd(message.id)
if (!res.length) return await message.send('*Not set any cmds*')
return await message.send('```' + res.join('\n') + '```')
}
)
bot(
{
pattern: 'delcmd ?(.*)',
desc: 'to del cmd',
type: 'misc',
},
async (message, match) => {
if (!match && (!message.reply_message || !message.reply_message.sticker))
return await message.send('*Example :*\ndelcmd cmdName\nReply to a sticker')
const res = await delCmd(match || message.reply_message, message.id)
return await message.send(res < 1 ? '_Failed_' : '_Success_')
}
)
|