浏览代码

flag NSFW app Default images NSFW

Kylie Jo Swistak 5 年之前
父节点
当前提交
13568420f1
共有 3 个文件被更改,包括 5 次插入4 次删除
  1. 2 2
      app/controllers/image_controller.rb
  2. 1 1
      app/responses/character.rb
  3. 2 1
      bot.rb

+ 2 - 2
app/controllers/image_controller.rb

@@ -1,5 +1,5 @@
 class ImageController
-  def self.default_image(url, char_id)
+  def self.default_image(url, char_id, rating)
     img = CharImage.where(char_id: char_id).find_by(keyword: 'Default')
 
     case
@@ -10,7 +10,7 @@ class ImageController
       img = CharImage.create(
         char_id: char_id,
         url: url,
-        category: 'SFW',
+        category: rating,
         keyword: 'Default'
       )
     end

+ 1 - 1
app/responses/character.rb

@@ -401,7 +401,7 @@ def nsfw_char_embed(char:, user: nil, color:, event: nil)
     title: char.name,
     color: color,
     fields: [
-      { name: 'Wrong Channel!', value: "The requested information has contains NSFW content" }
+      { name: 'Wrong Channel!', value: "The requested information contains NSFW content" }
     ]
   )
 

+ 2 - 1
bot.rb

@@ -1187,7 +1187,8 @@ bot.reaction_add do |event|
     char = CharacterController.edit_character(app)
     img = ImageController.default_image(
       img_url,
-      char.id
+      char.id,
+      char.rating
     )if img_url
     color = CharacterController.type_color(char)
     channel = case char.rating