소스 검색

some chars don't have ratings

Kylie Jo Swistak 6 년 전
부모
커밋
a93e93652b
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      bot.rb

+ 1 - 1
bot.rb

@@ -990,7 +990,7 @@ bot.reaction_add do |event|
       char.id
     )if img_url
     color = CharacterController.type_color(char)
-    channel = char.rating.match(/nsfw/i) ? ENV['CHAR_NSFW_CH'] : ENV['CHAR_CH']
+    channel = char&.rating.match(/nsfw/i) ? ENV['CHAR_NSFW_CH'] : ENV['CHAR_CH']
 
     embed = character_embed(
       char: char,