Legacy Notice: This extension is considered legacy and is scheduled for deprecation in the near future. It is no longer recommended for new integrations.Please note: Legacy extensions are no longer actively maintained and will not receive feature updates or enhancements.
Extension settings
- Login to CometChat and select your app.
- Go to the Extensions section and enable the Image Moderation extension.
- Open up the Settings and choose to Drop messages with NSFW images.
How does it work?
After analyzing, it classifies the image into four categories:- Explicit Nudity
- Suggestive Nudity
- Violence
- Visually Disturbing.
- JSON
confidence
that is less than 50 is likely to be a false-positive. So we recommend moderating only if confidence
is higher than 50.
If the image-moderation key is missing, it means that either the extension is not enabled or has timed out.
The
You can iterate over
unsafe
, confidence & category keys to the outside of attachments
are the result for the first attachment from the attachments
array. These have been retained for backward compatibility only.You can iterate over
attachments
array for better implementation.Implementation
You can then either show a warning or drop the image message.
message
object, you can fetch the metadata by calling the getMetadata()
method. Using this metadata, you can fetch information whether the image is safe or unsafe.
- JavaScript
- Java
- Swift
- Kotlin