aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorLakelezz <[email protected]>2018-10-20 23:42:29 +0200
committerGitHub <[email protected]>2018-10-20 23:42:29 +0200
commit75fb5c041511077e60e577e55039acc33d624569 (patch)
tree46635aab225f9ee51ff78921eaa1cbda84bee61e /src/utils
parentPrefix only Command (#416) (diff)
downloadserenity-75fb5c041511077e60e577e55039acc33d624569.tar.xz
serenity-75fb5c041511077e60e577e55039acc33d624569.zip
Fix NSFW Checks (#418)
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/mod.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/utils/mod.rs b/src/utils/mod.rs
index 2d1df4a..7cd60cf 100644
--- a/src/utils/mod.rs
+++ b/src/utils/mod.rs
@@ -91,6 +91,7 @@ pub fn vecmap_to_json_map<K: PartialEq + ToString>(map: VecMap<K, Value>) -> Map
///
/// assert!(!utils::is_nsfw("nsfwstuff"));
/// ```
+#[deprecated(since = "0.5.10", note = "Discord no longer turns a channel NSFW based on its name.")]
pub fn is_nsfw(name: &str) -> bool {
name == "nsfw" || name.chars().count() > 5 && name.starts_with("nsfw-")
}
@@ -566,6 +567,7 @@ mod test {
assert_eq!(parsed, ["a", "b c", "d", "e f", "g"]);
}
+ #[allow(deprecated)]
#[test]
fn test_is_nsfw() {
assert!(!is_nsfw("general"));