make it better
This commit is contained in:
parent
a0aa6cb77f
commit
80fb883f81
|
@ -43,10 +43,6 @@ config.settings = {
|
|||
{
|
||||
command: 'joke',
|
||||
description: 'IT GIfs or !joke'
|
||||
},
|
||||
{
|
||||
command: 'eye',
|
||||
description: 'Search leak Database'
|
||||
}
|
||||
])
|
||||
return next()
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
class EyeofgodTask {
|
||||
checkLeak = async ({ db, i18n, extra, message, session, replyWithHTML }) => {
|
||||
let id = (session.eyeof = message.text.trim())
|
||||
try {
|
||||
id = id.split(' ')[1]
|
||||
if (id.includes('/eye') && /^[0-9]{5,}$/.test(id)) {
|
||||
id = id.split(' ')[1]
|
||||
}
|
||||
id = id.trim()
|
||||
const id = (session.eyeof = message.text.trim())
|
||||
const base = await db.Eye.findOne({ id }).sort({ id: 1 }).lean()
|
||||
|
||||
return await replyWithHTML(
|
||||
|
@ -33,7 +28,7 @@ class EyeofgodTask {
|
|||
} catch (e) {
|
||||
// console.log(e.message)
|
||||
return await replyWithHTML(
|
||||
`🙅♂️ No in Database 🆔 <code>${id}</code>`,
|
||||
'💮 <b>No in Database</b>',
|
||||
extra
|
||||
.HTML()
|
||||
.inReplyTo(message.message_id)
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
module.exports = bot => {
|
||||
const { eyeofgodTask } = bot.handlers
|
||||
|
||||
bot.hears(/^[0-9]{5,}$/, eyeofgodTask.checkLeak)
|
||||
bot.command('eye', eyeofgodTask.checkLeak)
|
||||
bot.hears(/^[0-9]{5,20}$/, eyeofgodTask.checkLeak)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue