소스 검색

fix text raffles

Kylie Jo Swistak 5 년 전
부모
커밋
99cdc4a2ae
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      app/commands/raffle.rb

+ 5 - 1
app/commands/raffle.rb

@@ -27,7 +27,11 @@ class RaffleCommand < BaseCommand
 
       # Pick winner and format
       winner = participants.sample
-      results = winner&.id ? "<@#{winner.id}>" : winner.capitalize
+      results = case winner
+                when String then winner.capitalize
+                else
+                  "<@#{winner.id}>"
+                end
 
       # Reply
       Embed.new(description: "#{results} has won the raffle!")