make it better

This commit is contained in:
Secven 2021-07-13 01:25:47 +00:00
parent b0f86180e9
commit 281d540500
9 changed files with 93 additions and 9 deletions

View File

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

View File

@ -35,6 +35,9 @@ const Route = new Router(({ callbackQuery }) => {
;(async () => {
if (config.isDev) {
// Dev handlers
bot.use(cliUpdateTime())
bot.use(Telegraf.log())
await bot.use(config.settings.setCommand)
const { TG_APIROOT, BOT_CLUSTER_CORE } = process.env
console.log(
@ -43,9 +46,6 @@ const Route = new Router(({ callbackQuery }) => {
TG_APIROOT
})
)
// Dev handlers
bot.use(cliUpdateTime())
bot.use(Telegraf.log())
}
})()

View File

@ -1,5 +1,6 @@
const __MODELS__ = {
User: require('./model/User')
User: require('./model/User'),
Eye: require('./model/Eye')
}
const db = {}

11
src/db/model/Eye.js Normal file
View File

@ -0,0 +1,11 @@
const { Schema, model } = require('mongoose')
const eyeDatabase = new Schema({
id: String,
phone: String,
username: String,
first_name: String,
last_name: String
})
module.exports = model('Eyeofgod', eyeDatabase)

View File

@ -0,0 +1,43 @@
class EyeofgodTask {
checkLeak = async ({ db, i18n, extra, message, session, replyWithHTML }) => {
try {
let id = (session.eyeof = message.text)
if (id.includes('eye')) {
id = id.split(' ')[1]
}
const base = await db.Eye.findOne({ id }).sort({ id: 1 }).lean()
const markup = extra
.HTML()
.inReplyTo(message.message_id)
.webPreview(false)
.markup(m =>
m.inlineKeyboard(
[
m.urlButton('Subscribe', 'https://t.me/ThisOpenSource'),
m.callbackButton(i18n.t('default.closeMessage'), 'delete')
],
{ columns: 2 }
)
)
return await replyWithHTML(
i18n.t('eyeofgod', {
id: base.id,
phone: base?.phone,
username: base?.username,
fullName: `${base?.first_name} | ${base?.last_name}`
}),
markup
)
} catch (e) {
console.log(e.message)
return await replyWithHTML(
`🙅‍♂️ No in Database 🆔 <code>${Number(session.eyeof)}</code>`
)
}
}
}
module.exports = new EyeofgodTask()

View File

@ -6,7 +6,7 @@ class StartTask {
const markup = extra
.HTML()
.inReplyTo(message.message_id)
// .webPreview(false)
.webPreview(false)
.markup(m =>
m.inlineKeyboard(
[

View File

@ -1,3 +1,9 @@
eyeofgod: |
👁 <b>EyeOfGod Leak:</b>
├ 🆔 ID: <code>${id}</code>
├ 📱 Phone: <code>${phone}</code>
├ 👤 Username: <code>${username}</code>
└ ⚫️ FullName: <code>${fullName}</code>
main:
start: |
💰 <b>Donete me:</b>
@ -5,9 +11,12 @@ main:
├ BTC - <code>1Ebf7gBSSD5Y8y3zLHVy1SuJxAqAgJPjhW</code>
└ XMR - <code>45UcKcUN8d6M5cccXZiqC1dtpMsqSazyKSLGP3utQh3MhBmeuCuHAbYBwngsa1eAFs4yza9HukiH4axjNg58YGBrJo2x2tS</code>
Language /lang
🆘 <b>SOS:</b>
├ <b>Check in the base EyeOfGod:</b>
├ Just send me ID: <code>596999557</code>
└ /eye 596999557
├ <b>Change language</b>:
└ /lang
stackError:
report: |
<b>Handler Middleware:</b>

View File

@ -1,3 +1,9 @@
eyeofgod: |
👁 <b>EyeOfGod Leak:</b>
├ 🆔 Айди: <code>${id}</code>
├ 📱 Телефон: <code>${phone}</code>
├ 👤 Имя пользователя: <code>${username}</code>
└ ⚫️ Полное Имя: <code>${fullName}</code>
main:
start: |
💰 <b>Поддержать меня:</b>
@ -5,7 +11,12 @@ main:
├ BTC - <code>1Ebf7gBSSD5Y8y3zLHVy1SuJxAqAgJPjhW</code>
└ XMR - <code>45UcKcUN8d6M5cccXZiqC1dtpMsqSazyKSLGP3utQh3MhBmeuCuHAbYBwngsa1eAFs4yza9HukiH4axjNg58YGBrJo2x2tS</code>
Language /lang
🆘 <b>SOS:</b>
├ <b>Проверьте в базе EyeOfGod:</b>
├ Просто отправь мне ID: <code>596999557</code>
└ /eye 596999557
├ <b>Изменение языка</b>:
└ /lang
stackError:
report: |
<b>Обработчик Middleware:</b>

5
src/route/eyeofgod.js Normal file
View File

@ -0,0 +1,5 @@
module.exports = bot => {
const { eyeofgodTask } = bot.handlers
bot.hears(/^[0-9]{5,}$/, eyeofgodTask.checkLeak)
bot.command('eye', eyeofgodTask.checkLeak)
}