Utility Commands

This module contains generally useful, atomic commands that aren’t otherwise categorized into a dedicated module.

These commands might be safe for use by anyone, or locked behind in-Discord permissions.

NSFW Images Detection Tools

GiselleBot implements an (experimental) NSFW images detection system using TensorFlow.js as its base.

The detection system is based on Infinite Red’s NSFW JS library and GantMan’s Inception v3 Keras Model for NSFW detection to classify any image as a composition of 5 categories:

  • Drawings: Safe for work drawings (including anime).

  • Hentai: Hentai and pornographic drawings.

  • Neutral: Safe for work neutral images.

  • Porn: Pornographic images, sexual acts.

  • Sexy: Sexually explicit images, not pornography.

The module was furtherly converted into a back-end module and customized with a caching system to enhance its performance.

See also

This interesting article by Infinite Red explains the reasons behind the creation of the original NSFW JS client-side module.


This module, by no means, is supposed to reliably recognize all NSFW images. Its main purpose is quickly classifying provided images and supporting humans in better moderating a server.

The module itself will not store or expose any sexually explicit images. The output will not contain a direct link to the original image, and a censored (low resolution, blurred) version of the image will be locally cached and used to refer to the original image.

Here’s an example of an output of this command, and the corresponding censored image:

NSFW Images Detection Output Example NSFW Images Detection Censored Image Example

See also

For those of you with a background in image processing - yes, Lenna is actually flagged as NSFW with a confidence score of 81.9%!

If you don’t know what I’m talking about, refer to this Wikipedia page.


Command Syntax

!nsfwcheck (image URL, or image as a message attachment)

Command Description

Submits an image against the GantMan’s Inception v3 Keras Model for NSFW detection (as explained above) and returns a detailed output about the classification.


Command Syntax

!nsfwcache (cache ID)

Command Description

Recalls an image classification output by its cache ID (as given in the footer of the !nsfwcheck command.


!nsfwcache 5d6c4cd78e422b00137d14ce


Command Syntax

!nsfwthreshold [new threshold, or "-"]

Command Description

While the classification scores given to an image cannot be tuned, each server can choose its own NSFW threshold (the sum of NSFW-related scores over which an image is considered NSFW).

The new threshold is an integer within the range [0, 100], inclusive of 0 (treat all images as NSFW) and 100 (only treat an image as NSFW if the model recognize it as having no-SFW components - which is highly unlikely, hence basically meaning “treat no images as NSFW”).

Running the command with - as argument will reset the server threshold to the global, default threshold of 60%.

Running the command with no arguments will show the current value for the server.


!nsfwthreshold 80
!nsfwthreshold -

Permissions Needed

User: Manage Server

Other Tools


Command Syntax

!shorturl (long URL)

Command Description

Converts a long URL into a short URL using the proprietary gisl.eu shortening service.


URLs shortened using the gisl.eu service never expire, unless deleted by the person that created the short URL (feature not available yet). The original URLs are saved as encrypted strings within the redirection database. Any sensitive data contained in the URL (authentication keys, login info, etc.) will not be exposed in case of a breach.