Created At: 2026-11-18T04:44:09Z
Completed At: 2026-11-18T04:44:09Z
Command exited with code 0.
Command output:
const { Markup } = require('telegraf');
const { CREDIT_EMOJI } = require('../core/fonts');
function registerBuyCreditCommand(bot, { sessions }) {
bot.command(['buycredit', 'buycredits', 'credits'], async (ctx) => {
const userId = ctx.from.id;
if (sessions) {
sessions[userId] = {
step: 'WAITING_FOR_BUY_AMOUNT',
planType: 'credits'
};
}
const buyMsg = `🪙 BUY SEARCH CREDITS 🪙\n` +
`━━━━━━━━━━━━━━━━━━━━━━━━━━\n` +
`💰 Rate: 1 Credit = ₹60 ${CREDIT_EMOJI}\n` +
`⚡ Rule: 1 Search = 1 Credit ${CREDIT_EMOJI}\n\n` +
`Neeche diye gaye package me se select karein ya chat me direct credits / amount type karein:\n` +
`━━━━━━━━━━━━━━━━━━━━━━━━━━\n` +
`💡 Payment complete hone par credits turant automatic add ho jayenge.`;
return ctx.reply(buyMsg, {
parse_mode: 'HTML',
...Markup.inlineKeyboard([
[
{ text: '1 Credit (₹60)', callback_data: 'BUY_CREDIT_PACK_1_60', style: 'primary' },
{ text: '5 Credits (₹300)', callback_data: 'BUY_CREDIT_PACK_5_300', style: 'primary' }
],
[
{ text: '10 Credits (₹600)', callback_data: 'BUY_CREDIT_PACK_10_600', style: 'primary' },
{ text: '20 Credits (₹1,200)', callback_data: 'BUY_CREDIT_PACK_20_1200', style: 'primary' }
],
[
{ text: '50 Credits (₹3,000)', callback_data: 'BUY_CREDIT_PACK_50_3000', style: 'primary' },
{ text: '100 Credits (₹6,000)', callback_data: 'BUY_CREDIT_PACK_100_6000', style: 'primary' }
],
[
{ text: '🔥 View Today\'s Offers', callback_data: 'SHOW_OFFERS_MENU', style: 'success' },
{ text: '💎 Buy Unlimited VIP Plan', callback_data: 'BUY_UNLIMITED_PLANS', style: 'primary' }
]
])
});
});
}
module.exports = { registerBuyCreditCommand };
const { Markup } = require('telegraf');
const fs = require('fs');
const path = require('path');
function registerBuySubscriptionCommand(bot) {
bot.command(['buysubscription', 'buysub', 'buyplan'], async (ctx) => {
let plans = [];
try {
const plansFile = path.join(process.cwd(), 'plans.json');
plans = JSON.parse(fs.readFileSync(plansFile, 'utf8'));
} catch (e) {
plans = [
{ type: 'daily', label: 'Daily', price: 399 },
{ type: 'weekly', label: 'Weekly', price: 1999 },
{ type: 'monthly', label: 'Monthly', price: 5999 },
{ type: 'yearly', label: 'Yearly', price: 34999 }
];
}
const buttons = [];
for (let i = 0; i < plans.length; i += 2) {
const row = [];
row.push({
text: `${plans[i].label.replace(/[^a-zA-Z0-9 ]/g, '').trim()} (₹${plans[i].price.toLocaleString('en-IN')})`,
callback_data: `BUY_PLAN_${plans[i].type}_${plans[i].price}`,
style: 'primary'
});
if (plans[i + 1]) {
row.push({
text: `${plans[i + 1].label.replace(/[^a-zA-Z0-9 ]/g, '').trim()} (₹${plans[i + 1].price.toLocaleString('en-IN')})`,
callback_data: `BUY_PLAN_${plans[i + 1].type}_${plans[i + 1].price}`,
style: 'primary'
});
}
buttons.push(row);
}
buttons.push([
{ text: '🔥 View Today\'s Offers', callback_data: 'SHOW_OFFERS_MENU', style: 'success' },
{ text: '🪙 Buy Credits Instead', callback_data: 'BUY_CUSTOM_CREDITS', style: 'primary' }
]);
const buyMsg = `💎 UNLIMITED VIP SEARCH SUBSCRIPTIONS 💎\n` +
`━━━━━━━━━━━━━━━━━━━━━━━━━━\n` +
`VIP Plan lene par aapko unlimited searches milengi bina kisi credit deduction ke!\n\n` +
`⚡ VIP Benefits:\n` +
`• Unlimited SMS Retrieval & PDF Downloads\n` +
`• Ultra-fast priority processing\n` +
`• Zero per-search cost\n` +
`━━━━━━━━━━━━━━━━━━━━━━━━━━\n` +
`👇 Neeche diye gaye plan me se select karein aur payment QR generate karein:`;
return ctx.reply(buyMsg, {
parse_mode: 'HTML',
...Markup.inlineKeyboard(buttons)
});
});
}
module.exports = { registerBuySubscriptionCommand };
function registerPingCommand(bot, deps = {}) {
bot.command(['ping', 'Ping'], async (ctx) => {
try {
const start = Date.now();
const msg = await ctx.reply("⚡ Pinging server...", { parse_mode: 'HTML' });
const latency = Date.now() - start;
const pingText = `⚡ PONG! ⚡\n` +
`━━━━━━━━━━━━━━━━━━━━━━━━━━\n` +
`Engine: Ultra-Fast v3.0\n` +
`Bot Latency: ${latency}ms\n` +
`Server Status: Online 🟢\n` +
`━━━━━━━━━━━━━━━━━━━━━━━━━━`;
return ctx.telegram.editMessageText(ctx.chat.id, msg.message_id, undefined, pingText, { parse_mode: 'HTML' }).catch(() => {
ctx.reply(pingText, { parse_mode: 'HTML' });
});
} catch (error) {
console.error("Ping command error:", error.message);
}
});
}
module.exports = { registerPingCommand };