Kaynağa Gözat

fix minor bugs

Kylie Jo Swistak 5 yıl önce
ebeveyn
işleme
24ecf77b0d
2 değiştirilmiş dosya ile 11 ekleme ve 3 silme
  1. 9 1
      app/commands/fable.rb
  2. 2 2
      app/models/carousels.rb

+ 9 - 1
app/commands/fable.rb

@@ -49,6 +49,14 @@ class FableCommand < BaseCommand
     end
   end
 
-  def self.example_command
+  def self.example_command(event=nil)
+    case ['', 'title', 'keyword'].sample
+    when ''
+      []
+    when 'title'
+      [Fable.order('RANDOM()').first.name]
+    when 'keyword'
+      [Fable.order('RANDOM()').first.keywords.sample]
+    end
   end
 end

+ 2 - 2
app/models/carousels.rb

@@ -22,8 +22,8 @@ class Carousel < ActiveRecord::Base
       # Member List
       GuildCarousel.update_embed(event, self)
     end
-  #rescue StandardError => e
-    #error_embed(e.message)
+  rescue StandardError => e
+    error_embed(e.message)
   end
 
   def close(event)