The command exited with code 0.
Output:
bot.command('num', async (ctx) => {
const text = ctx.message.text.trim();
const args = text.split(' ').slice(1);
const mobile = args[0] ? args[0].trim() : null;
if (mobile) {
if (!/^\d{10}$/.test(mobile)) {
return ctx.reply("❌ Invalid Mobile Number: Please enter a valid 10-digit mobile number.", { parse_mode: 'HTML' });
}
await handleNumLookup(ctx, mobile);
} else {
const userId = ctx.chat.id;
sessions[userId] = {
step: 'WAITING_FOR_NUM_MOBILE',
serviceType: 'NUMBER_TO_INFO',
reqId: crypto.randomUUID()
};
ctx.reply('📱 Please enter your 10-digit Mobile Number for Info Lookup:', { parse_mode: 'HTML' });
}
});
bot.command('numclear', async (ctx) => {
const text = ctx.message.text.trim();
const args = text.split(' ').slice(1);
const mobile = args[0] ? args[0].trim() : null;
if (!mobile || !/^\d{10}$/.test(mobile)) {
return ctx.reply("💡 Usage: /numclear <10-digit mobile number>", { parse_mode: 'HTML' });
}
try {
if (redisClient) {
await redisClient.del(`num_cache:${mobile}`);
}
ctx.reply(`✅ Cache cleared for: ${mobile}. Next search for this number will fetch fresh results from the API.`, { parse_mode: 'HTML' });