A direct message 'bouncing' service for limited group DMs.
This service is intended for communication for moderators of the Astronomy feed, but can be used by anyone to hack group DMs into Bluesky.
- Download the module with
git clone https://github.com/bluesky-astronomy/dm-bouncer.git
-
Ensure that you have uv installed to manage Python (see the development guide for help)
-
Set up the environment variables (see below)
-
Start the bot with:
uv run -m dm_bouncer
To run the DM bouncer, you'll need to set the following environment variables.
Mandatory:
DM_BOUNCER_HANDLE
- the handle of the account that will bounce DMs (without an @). Any DMs users send to this account will be sent to all other accounts in the DM bouncing group. Example:"moderationchat.astronomy.blue"
.DM_BOUNCER_PASSWORD
- an app password for the account. When creating the app password, make sure it has access to DMs (there's a checkbox.)
Mandatory in development:
DM_BOUNCER_ACCOUNTS
- a string with comma-separated DIDs of users to receive messages from and send messages to. At least two are required to do anything! You can look up the DID of an account with this tool. Example:"did:plc:jcoy7v3a2t4rcfdh6i4kza25,did:plc:ko747jc5ma4iarwwfwrlv2ct"
would bounce DMs between @emily.space and @moderation.astronomy.blue.
Mandatory in production:
ASTROFEED_PRODUCTION
- set to True to automatically DM all moderators of the astronomy feeds, in addition to the accounts specified inDM_BOUNCER_ACCOUNTS
.BLUESKY_DATABASE
- a connection string for a remote MySQL database (see the astrofeed-lib docs for more information.)
Optional:
DM_BOUNCER_CHECK_TIME
- how often to check for new messages (default: 60 seconds)DM_BOUNCER_MINIMUM_MOD_LEVEL
- minimum mod level in production to be included in the DM bouncing circle (default: 1, the lowest)