Skip to main content

CLI moderation tool for bulk message deletion and media cleanup in public Matrix rooms.

Project description

Local Moderation for Matrix

CLI tool for bulk message deletion and media cleanup in Matrix rooms. Supports E2EE.

Installation

  • Python 3.11

Base Library:

pip install matrix-nio

Encrypted Room Support (Required for --e2ee): If you need to scan encrypted rooms, install the extra encryption dependencies:

pip install "matrix-nio[e2ee]"

Session

Once logged in, your session is saved. Just enter your User ID on the next run to auto-login without a password.

Usage

python localmoderation.py <room_id> [options]

Parameters

Parameter Description
--search Search for a single keyword.
--file Search using a wordlist file (one word per line).
--purge-media Delete media (images/videos) older than X days. Use 0 for all past media.
--e2ee Required for encrypted rooms.
--log-room Room ID to send deletion logs.
--days, --hours Time filter (Default: 1 hour).

Examples

1. Search in an encrypted room:

python localmoderation.py "!roomID:matrix.org" --search "test" --days 1 --e2ee

2. Scan with wordlist and log actions:

python localmoderation.py "!roomID:matrix.org" --file forbidden.txt --days 7 --log-room "!LogRoomID:matrix.org"

3. Delete media older than 90 days:

python localmoderation.py "!roomID:matrix.org" --purge-media 90

4. Delete ALL past media in an encrypted room:

python localmoderation.py "!roomID:matrix.org" --purge-media 0 --e2ee

Note

If messages aren't found, the room is likely encrypted. Add --e2ee to your command.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

localmoderationmatrix-1.0.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

localmoderationmatrix-1.0.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file localmoderationmatrix-1.0.0.tar.gz.

File metadata

  • Download URL: localmoderationmatrix-1.0.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for localmoderationmatrix-1.0.0.tar.gz
Algorithm Hash digest
SHA256 84a6ed8678d3130d15c6ef3df8f2697fb7062bbd6cace2cb064c5278e2b9351b
MD5 cc0e69f0ba9aee2508561bfa65eb7251
BLAKE2b-256 dcd77e8b7b78a05425611f1b3c6d7fe93363f987c83ebeb5812d0623fd4b1550

See more details on using hashes here.

File details

Details for the file localmoderationmatrix-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: localmoderationmatrix-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for localmoderationmatrix-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 75749ba4ad49895b687f82aa097cef53f40ae4e7f175c265478cfa426553249c
MD5 8a23ad73b99290e3926e7f8bba86a4c3
BLAKE2b-256 24083bd1f3890747184a6bcec541c530814c38a6316b3d7e14649f9fdd452bcb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page