make it better

This commit is contained in:
Secven 2021-07-14 16:08:03 +00:00
parent a0aa6cb77f
commit 80fb883f81
3 changed files with 3 additions and 14 deletions

View File

@ -43,10 +43,6 @@ config.settings = {
{
command: 'joke',
description: 'IT GIfs or !joke'
},
{
command: 'eye',
description: 'Search leak Database'
}
])
return next()

View File

@ -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)

View File

@ -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)
}