Skip to content

Latest commit

 

History

History
38 lines (33 loc) · 1.34 KB

README.md

File metadata and controls

38 lines (33 loc) · 1.34 KB

Slack read-only bot

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.

For Slack Admins

  1. Create a new app: https://api.slack.com/slack-apps.
  2. Go to Bot Users in the navigation and click on the Add a Bot User. Enter e.g. friendly-bot and save.
  3. 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.
  4. On the same page click on the Install App to Workspace button and authorize on the next screen.
  5. You are presented with access tokens. Send over two API tokens to the sysadmin. One should start with xoxb- and the other with xoxp-.
  6. Invite the bot to all the read-only channels.

For Sysadmin

  1. Create a server and SSH to it.
  2. 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
  1. Configure settings.
cp settings.yml.example settings.yml
vim settings.yml
cp monitrc ~/.monitrc
chmod 0700 ~/.monitrc
  1. Run monit that will run the bot.
monit