From 7a0b7c76921c3fd3326eef3c064d451dce6000a9 Mon Sep 17 00:00:00 2001 From: rito528 Date: Tue, 28 Feb 2023 22:55:13 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20topFourRankingLore=E3=81=A7Option.get?= =?UTF-8?q?=E3=81=97=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unchama/seichiassist/menus/VoteMenu.scala | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main/scala/com/github/unchama/seichiassist/menus/VoteMenu.scala b/src/main/scala/com/github/unchama/seichiassist/menus/VoteMenu.scala index 1d0132aa17..cd74e0eaa5 100644 --- a/src/main/scala/com/github/unchama/seichiassist/menus/VoteMenu.scala +++ b/src/main/scala/com/github/unchama/seichiassist/menus/VoteMenu.scala @@ -382,14 +382,11 @@ object VoteMenu extends Menu { topFourRanking.lift(1), topFourRanking.lift(2), topFourRanking.lift(3) - ).flatMap { rankDataOpt => - if (rankDataOpt.nonEmpty) { - val rankData = rankDataOpt.get.get - List( - s"${GRAY}たくさんくれたニンゲン第${rankData.rank}位!", - s"${GRAY}なまえ:${rankData.playerName} りんご:${rankData.consumed.amount}個" - ) - } else Nil + ).flatMap(_.flatten).flatMap { rankData => + List( + s"${GRAY}たくさんくれたニンゲン第${rankData.rank}位!", + s"${GRAY}なまえ:${rankData.playerName} りんご:${rankData.consumed.amount}個" + ) } val statistics = List( s"${AQUA}ぜーんぶで${allEatenAppleAmount.amount}個もらえた!",