Manage your Slack community by making read-only channels. Only admins can post to read-only channels, other users' messages to read-only channels get deleted and the user gets a friendly reminder from the bot.
- Create a new app: https://api.slack.com/slack-apps.
- Go to Bot Users in the navigation and click on the Add a Bot User. Enter e.g.
friendly-bot
and save. - Go to OAuth & Permissions in the navigation of the app. Under Scopes select the Send messages as user (
chat:write:user
) permission and click on Save Changes. - On the same page click on the Install App to Workspace button and authorize on the next screen.
- You are presented with access tokens. Send over two API tokens to the sysadmin. One should start with
xoxb-
and the other withxoxp-
. - Invite the bot to all the read-only channels.
- Create a server and SSH to it.
- Initialize the system
sudo apt update
sudo apt install -y python3-pip monit
pip3 install slackbot
sudo chown ubuntu /srv
cd /srv
git clone https://github.com/rokcarl/slack-read-only-bot.git
cd slack-read-only-bot
pip3 install -r requirements.txt
- Configure settings.
cp settings.yml.example settings.yml
vim settings.yml
cp monitrc ~/.monitrc
chmod 0700 ~/.monitrc
- Run monit that will run the bot.
monit