Auto commit: 2026-02-18T23:45:47.079Z
This commit is contained in:
parent
4197c9a786
commit
4af4672e9d
@ -103,6 +103,22 @@ if (!$stmt_lock->fetch()) {
|
||||
}
|
||||
$rewarded_users[$username] = $points_to_add;
|
||||
}
|
||||
|
||||
// Bot message to chat
|
||||
if (!empty($rewarded_users)) {
|
||||
$bot_msg = "🏆 ¡Atención comunidad! El Top 3 de interactores de esta semana ha sido premiado:\n\n";
|
||||
$medals = ["🥇", "🥈", "🥉"];
|
||||
$idx = 0;
|
||||
foreach ($rewarded_users as $user => $pts) {
|
||||
$bot_msg .= "{$medals[$idx]} $user: +$pts Fan Points\n";
|
||||
$idx++;
|
||||
}
|
||||
$bot_msg .= "\n¡Sigue participando en el chat para ganar el próximo lunes! 📻✨";
|
||||
|
||||
$db->prepare("INSERT INTO messages (username, ip_address, message, type) VALUES (?, ?, ?, ?)")
|
||||
->execute(['Lili Bot 🤖', '127.0.0.1', $bot_msg, 'text']);
|
||||
}
|
||||
|
||||
$db->prepare("INSERT INTO automation_logs (task_name, last_run) VALUES ('weekly_report_rewards', NOW()) ON DUPLICATE KEY UPDATE last_run = NOW()")->execute();
|
||||
} else {
|
||||
// If already rewarded today, we still want to show it in the email being generated
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user