discord: allow only rating:g posts in SFW channels.

This commit is contained in:
evazion
2022-06-08 17:36:49 -05:00
parent 06f75c39a1
commit ae9495ec7c

View File

@@ -63,7 +63,7 @@ class DiscordSlashCommand
end
def is_censored?
(post.rating.in?(["q", "e"]) && !is_nsfw_channel?) || !post.visible?(User.anonymous) || censored_tags.any? { |tag| tag.in?(post.tag_array) }
(post.rating != 'g' && !is_nsfw_channel?) || !post.visible?(User.anonymous) || censored_tags.any? { |tag| tag.in?(post.tag_array) }
end
def is_nsfw_channel?