瀏覽代碼

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!")