aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2018-07-02 18:49:48 +0200
committeracdenisSK <[email protected]>2018-07-02 19:03:26 +0200
commitccd250649665b1726b0ca852b2375c113da6ed57 (patch)
tree1dda99996ac6095152b89763782fa40c8cc520de /src/utils
parentSimplify utils::is_nsfw (diff)
downloadserenity-ccd250649665b1726b0ca852b2375c113da6ed57.tar.xz
serenity-ccd250649665b1726b0ca852b2375c113da6ed57.zip
properly fix the is_nsfw check this time
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/utils/mod.rs b/src/utils/mod.rs
index fc95a86..544aef4 100644
--- a/src/utils/mod.rs
+++ b/src/utils/mod.rs
@@ -92,7 +92,7 @@ pub fn vecmap_to_json_map<K: PartialEq + ToString>(map: VecMap<K, Value>) -> Map
/// assert!(!utils::is_nsfw("nsfwstuff"));
/// ```
pub fn is_nsfw(name: &str) -> bool {
- name == "nsfw" || name.starts_with("nsfw-")
+ name == "nsfw" || name.chars().count() > 5 && name.starts_with("nsfw-")
}
/// Retrieves the "code" part of an invite out of a URL.