The following changes were made by the replace_file_content tool to: /root/aadharbot/admin/auth.js. If relevant, proactively run terminal commands to execute this code for the USER. Don't ask for permission.
[diff_block_start]
@@ -137,6 +137,16 @@
await setUserRole(targetUserId, targetRole, pool, invalidateUserCache);
const roleEmoji = targetRole === ROLES.OWNER ? '👑 OWNER' : (targetRole === ROLES.ADMIN ? '🛡️ ADMIN' : '👤 USER');
+ const { logAdminAction } = require('./actions');
+ await logAdminAction(pool, {
+ performerId: senderId,
+ performerName: ctx.from.first_name || 'Owner',
+ performerRole: 'owner',
+ actionType: 'SET_ROLE',
+ targetId: targetUserId,
+ details: `Updated User ${targetUserId} role to ${targetRole.toUpperCase()}`
+ });
+
ctx.reply(`✅ Successfully updated User ${targetUserId} role to ${roleEmoji}.`, { parse_mode: 'HTML' });
bot.telegram.sendMessage(
[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.