Sure, a Slack bot could do that.
You just need to create a Slack app with a bot user and an event subscription to all messages via the Events API. The bot will then automatically receive all message that are posted to a channel, which the bot is a member of. He can then review each message and decide on an actions according to content (e.g. check the message content against a blacklist of words). I made a similar bot for my team that instantly deletes every message (using chat.delete
) in a specific channel, that is submitted by unauthorized user.
It is my understanding though that your bot will not be able to edit messages from users directly (that only works for your own messages). But you can e.g. delete the original message and repost it by the bot with corrections or the bot could delete the original message and then send a DM to the user who did the violation etc.
The same approach could be used to block unwanted images. Either based on the URL (assuming you have a url blacklist) or using an image recognition API to identify adult content (e.g. Google Cloud API, see here)