Skip to content

Releases: tcpipuk/matrix-nsfwbot

v0.2.1

30 Aug 14:03
4822034
Compare
Choose a tag to compare

nsfwbot Image Moderation Bot for Matrix v0.2.1

This is a minor release to add extra docstrings and error handling, to generally improve reliability and experience now this plugin has been announced in TWIM!

Future plans involve being able to optionally ban users, and also customising the exact percentage threshold to mark something as safe or not - we've found (very few) examples of safe images that scored just slightly over 50% and triggered the bot, whereas a threshold around 70-80% would have avoided this entirely.

If you would like to make any improvements yourself, please to raise a PR - I'd love to see this project become super reliable and useful for moderation!

Note: As per the previous releases, the nsfwdetection Python module unfortunately does not currently run on Alpine Linux, which is the base image for the official Maubot Docker container. I have built a Debian Bookworm variant of Maubot that is a drop-in replacement with the necessary modules already installed, but is larger and will be updated more slowly than the standard Alpine version. That said, if you do wish to use it, simply drop ghcr.io/tcpipuk/maubot:debian into your Docker/Kubernetes configuration.

v0.2.0

30 Aug 11:48
db95ab1
Compare
Choose a tag to compare

nsfwbot Image Moderation Bot for Matrix v0.2.0

Things have moved quite quickly and now the bot can redact messages and warn a nominated moderation room - each of these actions can be individually enabled, with most turned off by default so you can test the functionality before going live.

Note: It can only take actions it has permissions to do, so if the bot user doesn't have permissions to redact then the bot will have to skip that action.

Future plans involve being able to optionally ban users, and also customising the exact percentage threshold to mark something as safe or not - we've found (very few) examples of safe images that scored just slightly over 50% and triggered the bot, whereas a threshold around 70-80% would have avoided this entirely.

Note: As per the last release, the nsfwdetection Python module unfortunately does not currently run on Alpine Linux, which is the base image for the official Maubot Docker container. I have built a Debian Bookworm variant of Maubot that is a drop-in replacement with the necessary modules already installed, but is larger and will be updated more slowly than the standard Alpine version. That said, if you do wish to use it, simply drop ghcr.io/tcpipuk/maubot:debian into your Docker/Kubernetes configuration.

v0.1.0

26 Aug 21:00
f075696
Compare
Choose a tag to compare

nsfwbot Image Moderation Bot for Matrix v0.1.0

This is the initial release of nsfwbot, a Matrix bot plugin designed to detect NSFW (Not Safe For Work) content in images posted in Matrix chat rooms.

When an image is detected and analyzed, nsfwbot will reply to the message with something like:

mxc://matrix.org/abcd1234 in https://matrix.to/#/!roomid:matrix.org/$eventid?via=matrix.org appears NSFW with score 87.93%

If multiple images are detected in a text message:

- mxc://matrix.org/abcd1234 in https://matrix.to/#/!roomid:matrix.org/$eventid?via=matrix.org appears SFW with score 2.45%
- mxc://matrix.org/efgh5678 in https://matrix.to/#/!roomid:matrix.org/$eventid?via=matrix.org appears NSFW with score 94.82%

This plugin leverages the nsfwdetection model to analyse images and return a classification result, indicating whether the content is likely to be NSFW or SFW (Safe For Work).

The plugin currently only replies with a summary of the results, but future updates are planned to include moderation actions such as automatically redacting, or flagging unwanted images to a nominated moderation room.

Unfortunately, the nsfwdetection Python module does not currently run on Alpine Linux, which is the base image for the official Maubot Docker container, so I have built a Debian Bookworm variant of Maubot that is a drop-in replacement. It already has the necessary modules installed, the only real downside is that it's bigger than the standard Alpine version - simply drop ghcr.io/tcpipuk/maubot:debian into your Docker/Kubernetes configuration if you want to use it.

Currently it provides a config option to specify the "via" server list you want to use. Typically this would just contain the server the bot is running on, but you may wish to add more for reliability - these are the servers that anyone clicking the link (who is not currently in the room) will attempt to use to download the room from.