Skip to content

Commit

Permalink
refactor: #4 leaderboard should just show 5 of them
Browse files Browse the repository at this point in the history
  • Loading branch information
geeksesi committed Apr 10, 2022
1 parent 9ee7311 commit 0de3a99
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions app/Helper/OutputHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ public static function level(User $_user)
public static function leader_board(string $_chat_id)
{
$keyboard = KeyboardMakerHepler::leader_board();
$users = User::get_top(10);
$users = User::get_top(5);

$message = "🏆 لیست برترین ها 🏆";
$message = "🏆 لیست برترین های امروز 🏆";
$message .= "\n\n";

foreach ($users as $key => $user) {
Expand All @@ -83,7 +83,7 @@ public static function leader_board(string $_chat_id)
} elseif ($key == 2) {
$message .= "🥉 ";
} else {
$message .= ($key + 1);
$message .= $key + 1;
}
$message .= ". " . $user->name;
$message .= "\n";
Expand Down Expand Up @@ -164,7 +164,6 @@ public static function profile(string $_chat_id, User $user)

if ($user->credit <= 10) {
$message .= "هیچیم سکه نداره 🤦🏻‍♂️";

} elseif ($user->credit <= $_ENV["DEFAULT_CREDIT"] / 2) {
$message .= "فقطم {$user->credit} سکه داره 🤷🏻‍♂️ ";
} else {
Expand Down

0 comments on commit 0de3a99

Please sign in to comment.