The following changes were made by the replace_file_content tool to: /root/aadharbot/index.js. If relevant, proactively run terminal commands to execute this code for the USER. Don't ask for permission.
[diff_block_start]
@@ -1305,14 +1305,12 @@
let deductionLog = '';
if (access.isUnlimited) {
deductionLog = `š³ Plan: Unlimited š (No credits deducted)`;
- } else {
- if (freeUsedToday < 2) {
- const countAfter = await incrementDailyFreeNumSearches(userId);
- deductionLog = `š Free Search Used: ${countAfter}/2 Today`;
- } else {
- const newBal = await deductUserCredit(userId, 1);
- deductionLog = `š° Credits Charged: 1 Credit ${CREDIT_EMOJI}\nšŖ Remaining Balance: ${newBal} Credits ${CREDIT_EMOJI}`;
- }
+ } else if (access.hasFreeSearch) {
+ await markDailyFreeSearchUsed(userId);
+ deductionLog = `š Charged: 0 (Daily Free Search Used: 1/1)\nšŖ Credits Balance: ${access.credits} Credits ${CREDIT_EMOJI}`;
+ } else {
+ const newBal = await deductUserCredit(userId, 1);
+ deductionLog = `š° Credits Charged: 1 Credit ${CREDIT_EMOJI}\nšŖ Remaining Balance: ${newBal} Credits ${CREDIT_EMOJI}`;
}
// set cooldown
[diff_block_end]
Please note that the above snippet only shows the MODIFIED lines from the last change. It shows up to 3 lines of unchanged lines before and after the modified lines. The actual file contents may have many more lines not shown.