Selective Auto Publisher, or SAP, is a Discord bot for selectively publishing messages from announcement channels.
It is built for servers that need more control over which bot-generated messages should be published, based on allowed bots, allowed keywords, blocked keywords, channels, and channel-specific filters.
- Automatically publish matching messages
- Restrict publishing to specific source channels
- Restrict publishing to specific bot users
- Require allowed keywords
- Block messages with blocked keywords
- Add channel-specific filters
- Configure an audit channel
- Show current configuration
- PostgreSQL-backed configuration storage
- Ephemeral admin responses for configuration commands
SAP uses multiple slash commands.
/status
Shows current auto-publish settings.
/mode
Sets the publishing mode.
/bot-add
/bot-remove
/bot-list
Controls which bot user IDs are allowed.
/keyword-add
/keyword-remove
/keyword-list
Controls keywords that can allow a message to be published.
/blockedkeyword-add
/blockedkeyword-remove
/blockedkeyword-list
Controls keywords that block a message from being published.
/channel-filter-add
/channel-filter-remove
/channel-filter-list
Adds, removes, or lists filters for a specific channel.
Channel-specific filters can include:
allowed_bot
allowed_keyword
blocked_keyword
/channel-add
/channel-remove
/channel-list
Controls which channels SAP is allowed to process.
/audit-channel-set
/audit-channel-clear
/audit-channel-show
Configures or shows the audit channel used for publish decisions and configuration visibility.
- Node.js
- PostgreSQL database
- Discord bot application
- Discord server where slash commands can be registered
- Announcement channels where publishing/crossposting is relevant
SAP is configured through environment variables.
BOT_TOKEN=
CLIENT_ID=
GUILD_ID=
DEPLOY_GLOBAL_COMMANDS=
DATABASE_URL=
BOT_ID=sap
SUPPORT_MESSAGES_ENABLED=trueDEPLOY_GLOBAL_COMMANDS=true is only needed when deploying slash commands globally for public bot usage.
Optional support-message override:
SUPPORT_MESSAGE_CHANCE=SUPPORT_MESSAGE_CHANCE is intended for testing or temporary override only. Do not set it permanently unless you specifically want to override the bot default.
Install dependencies:
npm installDeploy slash commands to the configured development/test guild:
npm run deployDeploy slash commands globally for public bot usage:
DEPLOY_GLOBAL_COMMANDS=true npm run deployOn Windows PowerShell:
$env:DEPLOY_GLOBAL_COMMANDS="true"
npm run deploy
Remove-Item Env:\DEPLOY_GLOBAL_COMMANDSGuild deploy is useful for testing because commands update quickly. Global deploy is needed when the bot is installed in other servers.
Start the bot:
npm startSAP uses PostgreSQL.
The database connection is read from:
DATABASE_URL=SAP stores server configuration such as allowed bots, allowed channels, keywords, blocked keywords, channel-specific filters, publish mode, and audit channel configuration.
SAP needs the Discord permissions required to:
- read relevant announcement channels
- publish messages in announcement channels
- use slash commands
- send ephemeral command responses
- write to the configured audit channel, if one is set
SAP stores configuration needed to decide whether messages should be published.
This may include:
- Discord server ID
- channel IDs
- bot user IDs
- allowed keywords
- blocked keywords
- channel-specific filter values
- audit channel ID
- publish mode
SAP is not designed as a general-purpose message archive.
Selective Auto Publisher is built as an open source community tool.
If it helps your server, you can support further development by voting for the bot when voting pages are available, contributing feedback or issues on GitHub, or supporting the developer here:
https://buymeacoffee.com/andreasviken
- GitHub: https://github.com/briolist-fdl/selective-auto-publisher
- Support development: https://buymeacoffee.com/andreasviken
No license has been specified yet.