Explorar o código

fix text raffles

Kylie Jo Swistak %!s(int64=5) %!d(string=hai) anos
pai
achega
99cdc4a2ae
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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!")