Skip to main content

Tool to help mastodon server admins to conveniently reach certain parts of their user base with DMs.

Project description

mastomsg

A messanger for admins of mastodon servers allowing them to message groups of users.

You can install it via pip/pipx (requires Python-3.10+):

pipx install mastomsg

Then you have access to the command mastomsg.

mastomsg expects you to pass it a (potentially multi-line) text as its first argument. The text can contain placeholders for all user account properties you might want. To use the person's display name you can for example include {target.display_name} in your text. You should ideally include "@{target.username}" somewhere to create an actual mention. If your text doesn't include any mentions you will be asked if the system should automatically prepend it. Check out the Mastodon.py docs to see all possible values.

To select the target audience you can either use --everyone, --handles, --age or --lastactive. As expected --everyone targets all users on the server. With --handles you just add a list of local usernames separated by , to send the message to. With --ages you supply a time delta (in days or hours) to select all acounts created in that timeframe. With --lastactive you supply a similar time delta but target all people who have not posted anything in that time frame (to find inactive users). Note that for bigger instances the last commands can be quite slow.

Appending --pretend does all the API calls to select the recipients but does not send out the message. Only the list of selected accounts is printed out.

TODO:

  • load message from a text file or STDIN
  • add progress bar when sending more than 10 messages
  • Allow to customize type of message (currently only DM is supported)
  • add potential websocket receiver to trigger automatic sending of welcome messages

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

mastomsg-0.2.2.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

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

mastomsg-0.2.2-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file mastomsg-0.2.2.tar.gz.

File metadata

  • Download URL: mastomsg-0.2.2.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for mastomsg-0.2.2.tar.gz
Algorithm Hash digest
SHA256 c31d0b0ca4e05c851d7cd8b7ca48d419e55f8c827ef74d00de9ab27e3b1d9fa2
MD5 31c541e401ae9f553783994bffc29805
BLAKE2b-256 925a16e17b07f186383567e07ee6d0d0213d03ecf7bb92b0d1015849336dd30c

See more details on using hashes here.

File details

Details for the file mastomsg-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: mastomsg-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for mastomsg-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3e760359572da6d3de7dd087c70d25975dd054ae7537268e4aa59dd387698865
MD5 359da2881343f561208b8549bd32414a
BLAKE2b-256 820e455102ae56a289c1e30c7ee048746d295ae12f78267644ca1c56f91a591a

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