Selaa lähdekoodia

attempt to find adoptables without flag

Kylie Jo Swistak 5 vuotta sitten
vanhempi
commit
a02c467f26
2 muutettua tiedostoa jossa 5 lisäystä ja 4 poistoa
  1. 1 1
      app/responses/character.rb
  2. 4 3
      bot.rb

+ 1 - 1
app/responses/character.rb

@@ -276,7 +276,7 @@ def char_list_embed(chars, group, sort = nil)
         list["legend"].push("#{c.name}, #{c.species} -- last seen: #{c.location || "???"}")
       when /guild/i
         list["guild"].push("#{c.name}, #{c.species}")
-      when /adoptable/i
+      when nil
         list["adoptable"].push("#{c.name}, #{c.species} -- #{c.location || "???"}")
       end
     end

+ 4 - 3
bot.rb

@@ -1728,7 +1728,10 @@ bot.reaction_add do |event|
         regions = Region.all
         embed = char_list_embed(chars, 'npc', regions)
       when 3
-        chars = Character.where.not(special: nil).order(:name)
+        flags = Character.where.not(special: nil).order(:name)
+        adopts = Character.where(user_id: 'Public').order(:name)
+
+        chars = flags + adopts
         embed = char_list_embed(chars, 'special')
       end
 
@@ -1924,8 +1927,6 @@ end
 
 # This will trigger when any reaction is removed in discord
 bot.reaction_remove do |event|
-  binding.pry
-
 end
 
 # This will trigger when a member is updated