Sfoglia il codice sorgente

some chars don't have ratings

Kylie Jo Swistak 6 anni fa
parent
commit
a93e93652b
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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,