Skip to content

Commit

Permalink
Slot: 利益額が0のユーザーをランキングから除外する
Browse files Browse the repository at this point in the history
  • Loading branch information
2RiniaR committed Jan 1, 2025
1 parent 7de055e commit f156c00
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions Events/Slot/SlotRankingPresenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ protected override async Task MainAsync()

var selfUser = await app.FindOrCreateUserAsync(Message.Author.Id);
var users = await app.Users
.Where(x => x.MonthlySlotProfitPrice != 0)
.OrderByDescending(user => user.MonthlySlotProfitPrice)
.Take(MasterManager.SettingMaster.PurchaseInfoRankingViewUserCount)
.ToListAsync();
Expand Down
5 changes: 5 additions & 0 deletions Events/Slot/SlotUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ public static class SlotUtility
{
public static string CreateRankingView(IReadOnlyList<User> rankingUsers)
{
if (rankingUsers.Count == 0)
{
return "ランキングはまだありません";
}

var embedBuilder = new StringBuilder();
var order = 1;
foreach (var user in rankingUsers)
Expand Down

0 comments on commit f156c00

Please sign in to comment.