Quellcode durchsuchen

bug fix emojis and catgory calls

Kylie Jo Swistak vor 5 Jahren
Ursprung
Commit
9b124e1d5a

+ 2 - 2
app/app_forms/character_app.rb

@@ -11,9 +11,9 @@ class CharacterApplication < ApplicationForm
         approve(event)
       elsif reactions[Emoji::N]&.count.to_i > maj
         deny(event)
-      elsif reactions[Emoji::Crayon]&.count.to_i > 1
+      elsif reactions[Emoji::CRAYON]&.count.to_i > 1
         edit(event)
-      elsif reactions[Emoji::Cross]&.count.to_i > 1
+      elsif reactions[Emoji::CROSS]&.count.to_i > 1
         remove(event)
       end
     rescue StandardError => e

+ 2 - 2
app/app_forms/image_app.rb

@@ -11,7 +11,7 @@ class ImageApplication < ApplicationForm
         approve(event)
       elsif reactions[Emoji::N].count.to_i > maj
         deny(event)
-      elsif reactions[Emoji::Cross]&.count.to_i > 1
+      elsif reactions[Emoji::CROSS]&.count.to_i > 1
         remove(event)
       end
     rescue StandardError => e
@@ -28,7 +28,7 @@ class ImageApplication < ApplicationForm
     character = Character.find(image.char_id)
 
     # Determine appropriate channel
-    channel = image.rating == 'NSFW' ? ENV['CHAR_NSFW_CH'] : ENV['CHAT_CH']
+    channel = image.category == 'NSFW' ? ENV['CHAR_NSFW_CH'] : ENV['CHAT_CH']
 
     reply = BotResponse.new(
       destination: channel,

+ 2 - 2
app/app_forms/item_app.rb

@@ -12,9 +12,9 @@ class ItemApplication < ApplicationForm
         approve(event)
       elsif reactions[Emoji::N]&.count.to_i > maj
         deny(event)
-      elsif reactions[Emoji::Crayon]&.count.to_i > 1
+      elsif reactions[Emoji::CRAYON]&.count.to_i > 1
         edit(event)
-      elsif reactions[Emoji::Cross]&.count.to_i > 1
+      elsif reactions[Emoji::CROSS]&.count.to_i > 1
         remove(event)
       end
     rescue StandardError => e

+ 2 - 2
app/app_forms/landmark_app.rb

@@ -12,9 +12,9 @@ class LandmarkApplication < ApplicationForm
         approve(event)
       elsif reactions[Emoji::N]&.count.to_i > maj
         deny(event)
-      elsif reactions[Emoji::Crayon]&.count.to_i > 1
+      elsif reactions[Emoji::CRAYON]&.count.to_i > 1
         edit(event)
-      elsif reactions[Emoji::Cross]&.count.to_i > 1
+      elsif reactions[Emoji::CROSS]&.count.to_i > 1
         remove(event)
       end
     rescue StandardError => e

+ 1 - 1
app/app_forms/reactivate_app.rb

@@ -14,7 +14,7 @@ class ReactivationApplication < ApplicationForm
         deny(event)
       elsif reactions[Emoji::CRAYON]&count.to_i > maj
         edit(event)
-      elsif reactions[Emoji::Cross]&.count.to_i > 1
+      elsif reactions[Emoji::CROSS]&.count.to_i > 1
         remove(event)
       end
     #rescue StandardError => e

+ 1 - 1
app/app_forms/team_app.rb

@@ -11,7 +11,7 @@ class TeamApplication < ApplicationForm
         approve(event)
       elsif reactions[Emoji::N]&.count.to_i > maj
         deny(event)
-      elsif reactions[Emoji::Cross]&.count.to_i > 1
+      elsif reactions[Emoji::CROSS]&.count.to_i > 1
         remove(event)
       end
     rescue StandardError => e

+ 3 - 3
app/commands/image.rb

@@ -90,13 +90,13 @@ class ImageCommand < BaseCommand
       [Character.where.not(active: 'Deleted').order('RANDOM()').first.name]
     when 'keyword'
       img = CharImage.where.not(keyword: 'Default').order('RANDOM()').first
-      [Character.find(img.char_id), img.keyword]
+      [Character.find(img.char_id).name, img.keyword]
     when 'delete'
       img = CharImage.where.not(keyword: 'Default').order('RANDOM()').first
-      [Character.find(img.char_id), img.keyword, 'delete']
+      [Character.find(img.char_id).name, img.keyword, 'delete']
     when 'update'
       img = CharImage.where.not(keyword: 'Default').order('RANDOM()').first
-      [Character.find(img.char_id), img.keyword, 'sfw', image_url]
+      [Character.find(img.char_id).name, img.keyword, 'sfw', image_url]
     when 'url'
       char = Character.where.not(active: 'Deleted').order('RANDOM()').first.name
       [char, kws.sample, 'sfw', image_url]